/* ============================================================
   CSP SERVICES — PORTAL STYLESHEET v2.1
   Centro Servizi Padova | Branch Management System
   Theme: Dark Navy + Electric Blue + Gold — Futuristic
   ============================================================ */

/* ── TOKENS ── */
:root {
  /* Blues — brand primary */
  --b900: #030d1a;
  --b800: #061525;
  --b700: #0a1f38;
  --b600: #0d2d52;
  --b500: #1153a0;
  --b400: #1a6fd4;
  --b300: #2e8bf0;
  --b200: #7ab8f5;
  --b100: #d0e8fc;
  --b50:  #eef6ff;

  /* Gold accents */
  --gold:  #c49a2a;
  --gold2: #f0c040;
  --gold3: #fde68a;
  --goldbg:#fdf6e3;

  /* Status */
  --red:   #dc2626;
  --redbg: #fef2f2;
  --warn:  #d97706;
  --warnbg:#fffbeb;
  --green: #16a34a;
  --greenbg:#f0fdf4;
  --purple:#7c3aed;
  --purplebg:#faf5ff;

  /* Neutrals */
  --ink:   #0f172a;
  --ink2:  #1e293b;
  --slate: #64748b;
  --muted: #94a3b8;
  --border:#e2e8f0;
  --cream: #f8fafc;
  --white: #ffffff;

  /* Sidebar */
  --sidebar-w: 260px;
  --topbar-h:  60px;

  /* Shape */
  --radius:    14px;
  --radius-sm: 9px;
  --radius-xs: 6px;

  /* Shadows */
  --shadow:  0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
  --shadow2: 0 8px 32px rgba(0,0,0,.12);
  --shadow3: 0 20px 60px rgba(0,0,0,.18);
  --shadow-blue: 0 4px 20px rgba(26,111,212,.25);

  /* Typography */
  --font-body: 'Outfit', system-ui, sans-serif;
  --font-head: 'Space Grotesk', system-ui, sans-serif;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  background: var(--cream);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--b400); text-decoration: none; }
a:hover { color: var(--b300); }
img { max-width: 100%; }

/* ════════════════════════════════════════
   LOGIN PAGE
   ════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background: var(--white);
}

.login-left-panel {
  flex: 1;
  background: linear-gradient(160deg, #6b8fa0 0%, #8fb0be 55%, #9ec0cc 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 52px;
  position: relative;
  overflow: hidden;
}
.login-left-panel::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  opacity: 0.25;
  background-image:
    linear-gradient(135deg, transparent 44%, rgba(255,255,255,.9) 44%, rgba(255,255,255,.9) 46%, transparent 46%),
    linear-gradient(45deg,  transparent 54%, rgba(255,255,255,.9) 54%, rgba(255,255,255,.9) 56%, transparent 56%),
    linear-gradient(135deg, transparent 69%, rgba(255,255,255,.9) 69%, rgba(255,255,255,.9) 71%, transparent 71%),
    linear-gradient(45deg,  transparent 29%, rgba(255,255,255,.9) 29%, rgba(255,255,255,.9) 31%, transparent 31%);
  background-size: 160px 160px, 200px 200px, 280px 280px, 240px 240px;
}
.login-left-panel::after {
  content: '';
  position: absolute;
  bottom: -80px; right: -80px;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(26,111,212,.18) 0%, transparent 70%);
  pointer-events: none;
}

.lp-brand {
  display: flex; align-items: center; gap: 14px;
  position: relative; z-index: 1;
}
.lp-logo-box {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, var(--b300), var(--b400));
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(26,111,212,.4);
}
.lp-brand-name { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: #fff; }
.lp-brand-sub   { font-size: 11px; color: rgba(255,255,255,.45); letter-spacing: .8px; text-transform: uppercase; margin-top: 2px; }

.lp-content { position: relative; z-index: 1; }
.lp-headline {
  font-family: var(--font-head);
  font-size: 44px; font-weight: 700;
  color: #fff; line-height: 1.1;
  margin-bottom: 18px;
  letter-spacing: -.5px;
}
.lp-headline span {
  background: linear-gradient(90deg, var(--b300), var(--gold2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.lp-subline { font-size: 15px; color: rgba(255,255,255,.6); line-height: 1.75; max-width: 380px; margin-bottom: 36px; }

.lp-pills { display: flex; flex-wrap: wrap; gap: 9px; }
.lp-pill {
  padding: 7px 16px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.8); letter-spacing: .2px;
  backdrop-filter: blur(4px);
  transition: background .2s, border-color .2s;
}
.lp-pill:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.28); }
.lp-pill.gold { background: rgba(240,192,64,.12); border-color: rgba(240,192,64,.3); color: var(--gold2); }

.lp-footer { font-size: 11px; color: rgba(255,255,255,.25); position: relative; z-index: 1; }

/* right form panel */
.login-right-panel {
  width: 440px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 48px 44px;
  background: var(--white);
  position: relative;
}
.login-right-panel::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--b400), var(--b300), var(--gold2));
}
.login-box { width: 100%; }
.login-box h2 {
  font-family: var(--font-head);
  font-size: 26px; font-weight: 700; color: var(--ink);
  margin-bottom: 6px; letter-spacing: -.3px;
}
.login-box .login-tagline { font-size: 14px; color: var(--slate); margin-bottom: 32px; }

/* ── FORM ELEMENTS ── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--slate); letter-spacing: .5px; text-transform: uppercase; margin-bottom: 7px;
}
.form-group input,
.form-group select,
.form-group textarea,
form input[type="text"],
form input[type="password"],
form input[type="date"],
form input[type="email"],
form select {
  width: 100%; padding: 12px 15px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--ink); outline: none;
  font-family: var(--font-body);
  background: #fafbfc;
  transition: border-color .2s, box-shadow .2s, background .2s;
  appearance: none;
}
.form-group input:focus,
form input[type="text"]:focus,
form input[type="password"]:focus,
form input[type="date"]:focus,
form select:focus {
  border-color: var(--b400); box-shadow: 0 0 0 3px rgba(26,111,212,.12);
  background: var(--white);
}

/* ── BUTTONS ── */
.btn, button[type="submit"], button {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 22px; border: none; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .2s; white-space: nowrap;
  text-decoration: none;
}
.btn-primary, button[type="submit"] {
  background: linear-gradient(135deg, var(--b500), var(--b400));
  color: var(--white);
  box-shadow: var(--shadow-blue);
}
.btn-primary:hover, button[type="submit"]:hover {
  background: linear-gradient(135deg, var(--b400), var(--b300));
  box-shadow: 0 6px 24px rgba(26,111,212,.38);
  color: var(--white);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--white); border: 1.5px solid var(--border); color: var(--ink2);
}
.btn-secondary:hover { border-color: var(--b400); color: var(--b500); transform: translateY(-1px); }
.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover { background: #b91c1c; color: var(--white); }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold2)); color: var(--ink); }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }

.login-btn-main {
  width: 100%; padding: 14px; font-size: 15px;
  background: linear-gradient(135deg, var(--b500), var(--b400));
  color: var(--white); border: none; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-weight: 700; cursor: pointer;
  box-shadow: var(--shadow-blue);
  transition: all .2s; letter-spacing: .2px;
}
.login-btn-main:hover {
  background: linear-gradient(135deg, var(--b400), var(--b300));
  box-shadow: 0 6px 28px rgba(26,111,212,.42);
  transform: translateY(-1px);
}

/* ── ALERTS ── */
.alert { border-radius: var(--radius-sm); padding: 12px 16px; font-size: 13px; font-weight: 500; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 9px; }
.alert-error   { background: var(--redbg);   border: 1px solid #fecaca; color: var(--red); }
.alert-success { background: var(--greenbg); border: 1px solid #bbf7d0; color: var(--green); }
.alert-warn    { background: var(--warnbg);  border: 1px solid #fde68a; color: var(--warn); }
.alert-info    { background: var(--b50);     border: 1px solid var(--b200); color: var(--b500); }
.error { color: var(--red); font-size: 13px; }

/* ════════════════════════════════════════
   SIDEBAR v5 — CSP Office steel-blue theme
   Wall: #8fb0be (steel blue-grey from office)
   ════════════════════════════════════════ */
/* Core office palette */
:root {
  --wall:      #8fb0be;   /* main wall steel-blue */
  --wall-dark: #6d8f9e;   /* darker shade */
  --wall-mid:  #7da0ae;   /* mid tone */
  --wall-light:#b8ccd4;   /* lighter, closer to ceiling */
  --wall-pale: #dce8ec;   /* very light tint */
  --wall-line: rgba(255,255,255,0.55); /* white geometric lines */
}

.sidebar {
  position: fixed; left: 0; top: var(--topbar-h); bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(175deg, var(--wall-light) 0%, var(--wall) 45%, var(--wall-dark) 100%);
  z-index: 100;
  display: flex; flex-direction: column;
  box-shadow: 3px 0 20px rgba(80,120,140,.25);
  overflow-y: auto; overflow-x: hidden;
  border-right: 1px solid var(--wall-mid);
}

/* Subtle geometric line pattern — matches office wall */
.sidebar::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  border-radius: inherit;
  opacity: 0.18;
  background-image:
    linear-gradient(135deg, transparent 45%, rgba(255,255,255,.8) 45%, rgba(255,255,255,.8) 46%, transparent 46%),
    linear-gradient(45deg,  transparent 55%, rgba(255,255,255,.8) 55%, rgba(255,255,255,.8) 56%, transparent 56%),
    linear-gradient(135deg, transparent 70%, rgba(255,255,255,.8) 70%, rgba(255,255,255,.8) 71%, transparent 71%);
  background-size: 120px 120px, 160px 160px, 200px 200px;
}

.sidebar > * { position: relative; z-index: 1; }
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.3); border-radius: 3px; }

/* ── Brand ── */
.sb-top {
  padding: 18px 18px 15px;
  border-bottom: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(4px);
}
.sb-brand { display: flex; align-items: center; justify-content: center; }
.sb-brand-logo-img { width: 155px; height: auto; object-fit: contain; flex-shrink: 0; }
.sb-brand-icon {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  background: rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.sb-brand-name { font-family: var(--font-head); font-size: 15px; font-weight: 800; color: #fff; }
.sb-brand-sub  { font-size: 9px; color: rgba(255,255,255,.7); letter-spacing: .8px; text-transform: uppercase; }

/* ── User card ── */
.sb-user-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px;
  background: rgba(0,0,0,.12);
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.sb-user-avatar {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 15px; font-weight: 800; color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.sb-user-info { flex: 1; min-width: 0; }
.sb-user-name {
  font-size: 14px; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px;
}
.sb-user-role {
  display: inline-block; font-size: 9px; font-weight: 700;
  letter-spacing: .4px; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; margin-bottom: 4px;
}
.sb-user-branch { font-size: 11px; color: rgba(255,255,255,.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-logout {
  width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0; margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.6); transition: background .15s, color .15s; text-decoration: none;
}
.sb-user-logout:hover { background: rgba(220,38,38,.3); color: #fff; }

/* ── Nav ── */
.sb-nav { padding: 10px 0 16px; flex: 1; }

.sb-section {
  font-size: 10px; color: rgba(255,255,255,.6);
  letter-spacing: 1px; text-transform: uppercase; font-weight: 800;
  padding: 16px 18px 6px;
}
.sb-divider { height: 1px; background: rgba(255,255,255,.18); margin: 5px 14px; }

/* ── Nav links ── */
.sb-link {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 16px; margin: 2px 8px; border-radius: 10px;
  color: rgba(255,255,255,.9);
  font-size: 14px; font-weight: 600; text-decoration: none;
  transition: background .12s, color .12s;
}
.sb-link:hover { background: rgba(255,255,255,.18); color: #fff; }

.sb-active {
  background: rgba(255,255,255,.92) !important;
  color: var(--wall-dark) !important;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
.sb-link-icon  { font-size: 18px; width: 26px; text-align: center; flex-shrink: 0; }
.sb-link-label { font-size: 14px; font-weight: 600; flex: 1; }

.sb-badge {
  background: #e53e3e; color: #fff; border-radius: 999px;
  font-size: 10px; font-weight: 800; padding: 2px 7px; min-width: 18px; text-align: center;
}

/* ── Footer ── */
.sb-footer-ver {
  font-size: 10px; color: rgba(255,255,255,.45); text-align: center;
  padding: 10px 16px 16px; border-top: 1px solid rgba(255,255,255,.15);
}

/* ════════════════════════════════════════
   TOPBAR — full width, above sidebar
   ════════════════════════════════════════ */
.topbar {
  position: fixed; left: 0; right: 0; top: 0;
  height: var(--topbar-h);
  background: rgba(255,255,255,.97); backdrop-filter: blur(10px);
  border-bottom: 1px solid #dde5ea;
  z-index: 110;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px 0 14px;
  box-shadow: 0 1px 0 var(--border), 0 4px 12px rgba(0,0,0,.04);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.tb-brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.tb-brand-logo { height: 34px; width: auto; object-fit: contain; }
.tb-brand-name { font-family: var(--font-head); font-size: 15px; font-weight: 800; color: var(--ink); letter-spacing: -.3px; }
.breadcrumb { font-size: 13px; color: var(--slate); font-weight: 500; }
.breadcrumb a { color: var(--slate); }
.breadcrumb a:hover { color: var(--b400); }
.breadcrumb span { margin: 0 6px; color: var(--muted); }
.page-heading { font-family: var(--font-head); font-size: 19px; font-weight: 700; color: var(--ink); }

.topbar-right { display: flex; align-items: center; gap: 8px; }
.tb-date { font-size: 12px; color: var(--slate); font-weight: 500; }
.tb-btn {
  width: 36px; height: 36px; border-radius: 9px;
  border: 1.5px solid var(--border); background: var(--white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 15px; position: relative; transition: border-color .15s;
}
.tb-btn:hover { border-color: var(--b400); }
.tb-dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); border: 2px solid var(--cream); }
.tb-avatar {
  width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(135deg, var(--b500), var(--b400));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px; color: #fff; cursor: pointer;
  flex-shrink: 0;
}

/* User chip in topbar */
.tb-user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 10px 4px 4px;
  border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--cream); max-width: 220px;
}
.tb-user-meta { min-width: 0; }
.tb-user-name { font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-user-sub  { font-size: 10px; color: var(--slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Logout button in topbar */
.tb-logout-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 12px; border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--white); color: var(--slate); font-size: 12px; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: all .15s; white-space: nowrap;
}
.tb-logout-btn:hover { border-color: var(--red); color: var(--red); background: var(--redbg); }
.tb-logout-btn svg { flex-shrink: 0; }

/* ── Notification bell ── */
.tb-notif-wrap { position: relative; }
.tb-notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff;
  border-radius: 999px; font-size: 9px; font-weight: 800;
  min-width: 16px; height: 16px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; line-height: 1; pointer-events: none;
}

/* ── Notification dropdown ── */
.notif-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 360px; max-height: 480px;
  background: #fff; border: 1.5px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow3);
  overflow: hidden; z-index: 200;
  display: flex; flex-direction: column;
}
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notif-title { font-size: 13px; font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: 7px; }
.notif-cnt {
  background: var(--red); color: #fff;
  border-radius: 999px; font-size: 10px; font-weight: 800;
  padding: 1px 7px; min-width: 18px; text-align: center;
}
.notif-mark-all {
  font-size: 11px; color: var(--b400); font-weight: 600;
  background: none; border: none; cursor: pointer; padding: 0;
  font-family: var(--font-body);
}
.notif-mark-all:hover { color: var(--b300); text-decoration: underline; }
.notif-list { overflow-y: auto; flex: 1; }
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--b50);
  transition: background .12s;
}
.notif-item:hover { background: var(--b50); }
.notif-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--b400);
  flex-shrink: 0; margin-top: 5px;
}
.notif-body { flex: 1; min-width: 0; }
.notif-msg { font-size: 12px; color: var(--ink); line-height: 1.45; font-weight: 500; }
.notif-sub { font-size: 11px; color: var(--slate); margin-top: 3px; }
.notif-ago { font-size: 10px; color: var(--muted); white-space: nowrap; flex-shrink: 0; margin-top: 2px; }
.notif-empty { padding: 32px 16px; text-align: center; font-size: 13px; color: var(--slate); }
.notif-loading { padding: 20px 16px; text-align: center; font-size: 12px; color: var(--slate); }
.notif-item-unread { background: var(--b50); }
.notif-item-unread .notif-msg { font-weight: 700; }
.notif-action-badge {
  display: inline-block; margin-top: 4px;
  font-size: 10px; font-weight: 600; color: #b45309;
  background: #fef3c7; border: 1px solid #fcd34d;
  border-radius: 4px; padding: 1px 6px;
}

/* ════════════════════════════════════════
   MAIN CONTENT AREA
   ════════════════════════════════════════ */
.main {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  min-height: 100vh;
}
.main-inner { padding: 28px; }

/* ════════════════════════════════════════
   DASHBOARD COMPONENTS
   ════════════════════════════════════════ */

/* Welcome banner */
.welcome-banner {
  background:
    radial-gradient(ellipse at 0% 100%, rgba(26,111,212,.4) 0%, transparent 60%),
    linear-gradient(135deg, var(--b900) 0%, var(--b700) 100%);
  border-radius: var(--radius); padding: 28px 32px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  margin-bottom: 24px; position: relative; overflow: hidden;
  border: 1px solid rgba(255,255,255,.06);
}
.welcome-banner::after {
  content: '';
  position: absolute; right: -30px; top: -30px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(46,139,240,.15) 0%, transparent 70%);
  pointer-events: none;
}
.wb-text h2 { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: #fff; letter-spacing: -.2px; }
.wb-text p  { font-size: 13px; color: rgba(255,255,255,.55); margin-top: 4px; }
.wb-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.wb-btn {
  padding: 9px 20px; border-radius: 9px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: none; font-family: var(--font-body);
  transition: all .2s; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.wb-btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold2)); color: var(--ink); }
.wb-btn-outline {
  background: rgba(255,255,255,.1); color: #fff;
  border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(4px);
}
.wb-btn:hover { opacity: .88; transform: translateY(-1px); }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 20px 18px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow2); }
.stat-accent-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: var(--radius) 0 0 var(--radius); }
.green  .stat-accent-bar { background: linear-gradient(180deg, #16a34a, #22c55e); }
.gold   .stat-accent-bar { background: linear-gradient(180deg, var(--gold), var(--gold2)); }
.blue   .stat-accent-bar { background: linear-gradient(180deg, var(--b500), var(--b300)); }
.red    .stat-accent-bar { background: linear-gradient(180deg, #dc2626, #ef4444); }
.purple .stat-accent-bar { background: linear-gradient(180deg, #7c3aed, #a78bfa); }
.stat-icon { font-size: 22px; margin-bottom: 10px; }
.stat-val  { font-family: var(--font-head); font-size: 30px; font-weight: 700; color: var(--ink); line-height: 1; letter-spacing: -.5px; }
.stat-lbl  { font-size: 12px; color: var(--slate); margin-top: 4px; font-weight: 500; }
.stat-change { font-size: 11px; margin-top: 10px; font-weight: 600; }
.change-up   { color: var(--green); }
.change-down { color: var(--red); }
.change-warn { color: var(--warn); }

/* Grid layouts */
.grid-2  { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.grid-13 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; margin-bottom: 24px; }
@media (max-width: 900px) { .grid-2, .grid-13 { grid-template-columns: 1fr; } }

/* Card */
.card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.card-title  { font-family: var(--font-head); font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: -.2px; }
.card-action { font-size: 12px; color: var(--b400); cursor: pointer; font-weight: 600; text-decoration: none; }
.card-action:hover { color: var(--b300); }

/* ════════════════════════════════════════
   TABLE
   ════════════════════════════════════════ */
.table-wrapper, .table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
.table, .data-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.table th, .data-table th {
  font-size: 10px; letter-spacing: .6px; text-transform: uppercase;
  color: var(--slate); padding: 11px 16px; text-align: left;
  border-bottom: 2px solid var(--border); font-weight: 700; white-space: nowrap;
  background: #f8fafc;
}
.table td, .data-table td {
  padding: 13px 16px; border-bottom: 1px solid #f1f5f9; color: var(--ink2);
  vertical-align: middle;
}
.table tr:last-child td, .data-table tr:last-child td { border-bottom: none; }
.table tr:hover td, .data-table tr:hover td { background: var(--b50); }
.table .actions { display: flex; gap: 6px; align-items: center; }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 11px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: .2px; white-space: nowrap;
}
.badge-green  { background: var(--greenbg); color: var(--green); }
.badge-gold   { background: var(--goldbg);  color: #92611a; }
.badge-red    { background: var(--redbg);   color: var(--red); }
.badge-blue   { background: var(--b50);     color: var(--b500); }
.badge-purple { background: var(--purplebg);color: var(--purple); }
.badge-grey   { background: #f1f5f9;        color: var(--slate); }

/* ── ACTIVITY LIST ── */
.activity-list { display: flex; flex-direction: column; gap: 14px; }
.activity-item { display: flex; align-items: flex-start; gap: 12px; }
.activity-icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.ai-green  { background: var(--greenbg); }
.ai-gold   { background: var(--goldbg); }
.ai-blue   { background: var(--b50); }
.ai-red    { background: var(--redbg); }
.activity-body .act-title { font-size: 13px; font-weight: 500; color: var(--ink); }
.activity-body .act-meta  { font-size: 11px; color: var(--slate); margin-top: 2px; }

/* ════════════════════════════════════════
   FORMS (inner pages)
   ════════════════════════════════════════ */
.form-container {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
  box-shadow: var(--shadow); max-width: 860px;
}
.form-container h2 {
  font-family: var(--font-head); font-size: 22px; font-weight: 700;
  color: var(--ink); margin-bottom: 6px; letter-spacing: -.3px;
}
.form-container .form-subtitle { font-size: 13px; color: var(--slate); margin-bottom: 28px; }
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px;
}
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid label, .form-group label {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--slate); letter-spacing: .5px; text-transform: uppercase; margin-bottom: 7px;
}
.form-grid label input,
.form-grid label select { display: block; width: 100%; }
.form-divider { grid-column: 1/-1; border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.form-section-title {
  grid-column: 1/-1; font-family: var(--font-head); font-size: 15px; font-weight: 700;
  color: var(--ink); padding-bottom: 6px;
  border-bottom: 2px solid var(--b100);
}

.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding-top: 8px; }
.back-link { font-size: 13px; color: var(--slate); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.back-link:hover { color: var(--b400); }

/* Profile summary */
.profile-summary {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.profile-hero-inner {
  display: flex; align-items: center; gap: 18px;
  margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border);
}
.profile-avatar-lg {
  width: 72px; height: 72px; border-radius: 18px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--b500), var(--b300));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 26px; font-weight: 700; color: #fff;
  box-shadow: 0 4px 16px rgba(26,111,212,.3);
}
.profile-name { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -.3px; }
.profile-role-badge {
  display: inline-block; margin-top: 6px; padding: 3px 12px; border-radius: 999px;
  background: var(--b50); color: var(--b500); font-size: 11px; font-weight: 700;
}
.profile-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px;
}
.profile-field {
  background: var(--cream); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
  transition: border-color .2s;
}
.profile-field:hover { border-color: var(--b200); }
.profile-field .pf-label { font-size: 10px; color: var(--slate); letter-spacing: .5px; text-transform: uppercase; font-weight: 700; margin-bottom: 4px; }
.profile-field .pf-val   { font-size: 13px; font-weight: 600; color: var(--ink); }

.edit-btn {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 20px;
  padding: 10px 22px; background: linear-gradient(135deg, var(--b500), var(--b400));
  color: var(--white); border-radius: var(--radius-sm); font-weight: 600; font-size: 14px;
  transition: all .2s; box-shadow: var(--shadow-blue);
}
.edit-btn:hover { opacity: .9; color: var(--white); transform: translateY(-1px); }

/* Admin controls */
.admin-controls, .employee-controls {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.admin-controls h3, .employee-controls h3 {
  font-family: var(--font-head); font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 14px;
}
.control-links { display: flex; gap: 12px; flex-wrap: wrap; }
.control-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--radius-sm);
  background: var(--b50); border: 1.5px solid var(--b100);
  color: var(--b500); font-weight: 600; font-size: 14px;
  transition: all .2s;
}
.control-link:hover { background: var(--b100); border-color: var(--b400); color: var(--b600); transform: translateY(-1px); }

/* ════════════════════════════════════════
   MANAGE USERS / CLIENTS FILTERS
   ════════════════════════════════════════ */
.filter-bar {
  display: flex; gap: 8px; flex-wrap: nowrap; align-items: center;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 20px;
  box-shadow: var(--shadow); margin-bottom: 20px;
  overflow-x: auto;
}
/* Text inputs (and search-box wrapper) expand to fill remaining space */
.filter-bar input[type="text"] {
  flex: 1; min-width: 160px;
  padding: 9px 13px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; color: var(--ink);
  background: #fafbfc; outline: none;
  font-family: var(--font-body); transition: border-color .2s;
}
/* Selects: fixed 160px, never stretch */
.filter-bar select {
  width: 160px; flex-shrink: 0;
  padding: 9px 13px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; color: var(--ink);
  background: #fafbfc; outline: none;
  font-family: var(--font-body); transition: border-color .2s;
}
.filter-bar input[type="text"]:focus, .filter-bar select:focus {
  border-color: var(--b400); box-shadow: 0 0 0 3px rgba(26,111,212,.1);
}
/* Buttons: fixed size, no stretch */
.filter-bar button, .filter-bar a.btn {
  flex-shrink: 0;
  padding: 9px 18px; font-size: 13px;
}

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 0 14px; flex: 1; min-width: 200px;
}
.search-box input { border: none; background: none; outline: none; padding: 10px 0; width: 100%; font-size: 13px; font-family: var(--font-body); }
.search-icon { color: var(--slate); font-size: 15px; }

/* inline table inputs (manage_users) */
.table input[type="text"],
.table select {
  padding: 7px 11px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: 12px; background: #fafbfc;
  font-family: var(--font-body); outline: none; min-width: 100px;
  transition: border-color .2s;
}
.table input[type="text"]:focus,
.table select:focus { border-color: var(--b400); background: #fff; }

.save-btn {
  padding: 6px 12px; background: var(--b50);
  border: 1.5px solid var(--b100); border-radius: 8px;
  color: var(--b500); font-size: 13px; cursor: pointer;
  transition: all .15s;
}
.save-btn:hover { background: var(--b100); border-color: var(--b400); }

/* ════════════════════════════════════════
   REGISTER PAGES
   ════════════════════════════════════════ */
.register-page-standalone {
  min-height: 100vh; background: var(--cream);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
}
.register-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 20px; padding: 40px; width: 100%; max-width: 760px;
  box-shadow: var(--shadow3);
}
.register-card-header {
  text-align: center; margin-bottom: 32px;
}
.register-card-header img { max-height: 64px; margin-bottom: 14px; }
.register-card-header h2 { font-family: var(--font-head); font-size: 26px; font-weight: 700; color: var(--ink); }
.register-card-header p { font-size: 14px; color: var(--slate); margin-top: 5px; }

/* ════════════════════════════════════════
   UPLOAD PAGE
   ════════════════════════════════════════ */
.files-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.files-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--b50);
  border: 1px solid var(--b100); border-radius: var(--radius-sm);
  transition: background .15s;
}
.files-list li:hover { background: var(--b100); }
.files-list a { font-size: 13px; font-weight: 500; color: var(--b500); }
.files-list a:hover { color: var(--b400); }

/* ════════════════════════════════════════
   PAGE HEADER
   ════════════════════════════════════════ */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px; flex-wrap: wrap; gap: 12px;
}
.page-header h1 { font-family: var(--font-head); font-size: 24px; font-weight: 700; color: var(--ink); letter-spacing: -.3px; }
.page-header p  { font-size: 13px; color: var(--slate); margin-top: 3px; }

/* ════════════════════════════════════════
   MOBILE MENU TOGGLE
   ════════════════════════════════════════ */
#menuToggle {
  display: none;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--b800); border: none;
  color: #fff; font-size: 20px; cursor: pointer;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ════════════════════════════════════════
   RESPONSIVE — MOBILE FIRST
   ════════════════════════════════════════ */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  #menuToggle { display: flex; }

  .sidebar {
    width: 260px;
    transform: translateX(-260px);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    box-shadow: none;
    top: var(--topbar-h);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,.5);
  }

  .topbar { padding: 0 12px; }
  .tb-user-chip .tb-user-meta { display: none; }
  .tb-brand-name { display: none; }
  .tb-logout-btn span { display: none; }
  .tb-logout-btn { padding: 0; width: 36px; height: 36px; justify-content: center; }
  .main   { margin-left: 0; }
  .main-inner { padding: 16px; }
  .notif-dropdown { width: 300px; right: -60px; }

  .login-left-panel { display: none; }
  .login-right-panel { width: 100%; padding: 32px 24px; }
  .login-right-panel::before { display: none; }

  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-card  { padding: 12px 10px 10px; }
  .stat-icon  { font-size: 16px; margin-bottom: 5px; }
  .stat-val   { font-size: 20px; }
  .stat-lbl   { font-size: 10px; }
  .stat-change { display: none; }

  .welcome-banner { padding: 14px 16px; flex-direction: column; gap: 10px; }
  .wb-text h2 { font-size: 16px; }
  .wb-text p  { display: none; }
  .wb-btn { padding: 7px 12px; font-size: 12px; }
  .lp-headline { font-size: 32px; }

  .form-container { padding: 20px; }
  .form-grid { grid-template-columns: 1fr; }

  .filter-bar { flex-direction: column; align-items: stretch; flex-wrap: wrap; overflow-x: visible; }
  .filter-bar input[type="text"] { min-width: unset; width: 100%; }
  .filter-bar select { width: 100%; }
  .filter-bar button, .filter-bar a.btn { width: 100%; justify-content: center; }
  .search-box { min-width: unset; }

  .table-wrapper, .table-wrap { margin: 0 -16px; border-radius: 0; }

  .page-header { gap: 8px; }
  .page-header h1 { font-size: 20px; }

  .card { padding: 16px; }
  .register-card { padding: 24px 20px; }
}

@media (max-width: 480px) {
  .wb-actions { flex-direction: column; }
  .wb-btn { width: 100%; justify-content: center; }
}

/* Overlay when sidebar open on mobile */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 99;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

/* ════════════════════════════════════════
   UTILITIES
   ════════════════════════════════════════ */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-muted { color: var(--slate); }
.text-sm { font-size: 12px; }
.font-head { font-family: var(--font-head); }
.flex { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.w-full { width: 100%; }
.message { border-radius: var(--radius-sm); padding: 12px 16px; font-size: 13px; font-weight: 500; margin-bottom: 16px; }
.message.success { background: var(--greenbg); border: 1px solid #bbf7d0; color: var(--green); }
.message.error   { background: var(--redbg);   border: 1px solid #fecaca; color: var(--red); }

/* ── Legacy --g* aliases kept for backward compatibility ── */
:root {
  --g900: var(--b900); --g800: var(--b800); --g700: var(--b500);
  --g600: var(--b400); --g500: var(--b300); --g200: var(--b200);
  --g100: var(--b100); --g50:  var(--b50);
  --blue: var(--b400); --bluebg: var(--b50);
}
