/* ── Variables ───────────────────────────────────────────────── */
:root {
  --sidebar-width: 240px;
  --sidebar-bg: #1a1f2e;
  --sidebar-text: #a9b4c7;
  --sidebar-active: #3b82f6;
  --topbar-height: 60px;
}

/* ── Global ──────────────────────────────────────────────────── */
* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: #1e293b;
}

.x-small { font-size: 0.7rem; }
.fw-mono  { font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; }
.cursor-pointer { cursor: pointer; }
.w-40 { width: 40%; }

/* ── Login ───────────────────────────────────────────────────── */
.login-body {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #06b6d4 100%);
  min-height: 100vh;
}

.login-card {
  border-radius: 16px;
}

.login-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #3b82f6, #1e3a8a);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

/* ── Admin Layout ────────────────────────────────────────────── */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: #f1f5f9;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  transition: transform 0.25s ease;
  overflow-y: auto;
}

.sidebar-brand {
  color: #fff;
  font-size: 1.05rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar .nav-link {
  color: var(--sidebar-text);
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  margin-bottom: 2px;
  transition: all 0.15s;
  font-size: 0.875rem;
}

.sidebar .nav-link:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}

.sidebar .nav-link.active {
  background: var(--sidebar-active);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59,130,246,0.4);
}

.sidebar-footer {
  color: var(--sidebar-text);
}

.avatar-circle {
  width: 34px;
  height: 34px;
  background: var(--sidebar-active);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.avatar-circle-lg {
  width: 80px;
  height: 80px;
  background: #3b82f6;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 2rem;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  height: var(--topbar-height);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* ── Cards & Components ──────────────────────────────────────── */
.card {
  border-radius: 12px;
}

.card-header {
  border-radius: 12px 12px 0 0 !important;
}

.stat-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  flex-shrink: 0;
}

/* ── Tables ──────────────────────────────────────────────────── */
.table > :not(caption) > * > * {
  padding: 0.65rem 0.75rem;
  vertical-align: middle;
}

.table tbody tr:hover { background-color: rgba(59,130,246,0.04); }

/* ── Invoice Card (Client) ───────────────────────────────────── */
.invoice-card {
  transition: transform 0.15s, box-shadow 0.15s;
}
.invoice-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important;
}
.invoice-card.border-danger { border: 1px solid #fee2e2 !important; }

/* ── Timeline ────────────────────────────────────────────────── */
.timeline-dot {
  margin-top: 4px;
  flex-shrink: 0;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-xs {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
}

/* ── Responsive Sidebar ──────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.show {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
}

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Bootstrap overrides ─────────────────────────────────────── */
.badge { font-weight: 500; letter-spacing: 0.02em; }
.btn { border-radius: 8px; font-weight: 500; }
.form-control, .form-select, .input-group-text {
  border-radius: 8px;
  border-color: #e2e8f0;
}
.form-control:focus, .form-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.input-group .form-control { border-radius: 0; }
.input-group > :first-child { border-radius: 8px 0 0 8px !important; }
.input-group > :last-child  { border-radius: 0 8px 8px 0 !important; }

.alert { border-radius: 10px; border: none; }
.alert-success { background: #f0fdf4; color: #166534; }
.alert-danger  { background: #fef2f2; color: #991b1b; }
.alert-info    { background: #eff6ff; color: #1e40af; }

pre { border-radius: 8px; }
