/* ============================================================
   KroInvoice — Premium Design System
   Clean & Minimal | White + Blue Accent
   NO @import — fonts loaded via <link> in HTML
============================================================ */

/* ── Variables ─────────────────────────────────────────── */
:root {
  /* Brand blue (from logo) */
  --blue:       #1a6bff;
  --blue-dk:    #1252cc;
  --blue-lt:    #4d8fff;
  --blue-bg:    #eef3ff;
  --blue-mid:   #dbeafe;

  /* Neutral palette */
  --white:      #ffffff;
  --bg:         #f8f9fc;
  --bg-alt:     #f1f4f9;
  --border:     #e4e8f0;
  --border-lt:  #eef0f6;

  /* Text */
  --text-1:     #0d1117;
  --text-2:     #374151;
  --text-3:     #6b7280;
  --text-4:     #9ca3af;

  /* Semantic */
  --green:      #16a34a; --green-bg: #f0fdf4; --green-bd: #86efac;
  --amber:      #d97706; --amber-bg: #fffbeb; --amber-bd: #fcd34d;
  --red:        #dc2626; --red-bg:   #fef2f2; --red-bd:   #fca5a5;
  --violet:     #7c3aed; --violet-bg:#f5f3ff;

  /* Dark sidebar */
  --sidebar-bg: #0a0f1e;
  --sidebar-bd: rgba(255,255,255,.06);

  /* Layout */
  --sidebar-w:  256px;
  --topbar-h:   60px;
  --radius:     10px;
  --radius-lg:  16px;
  --radius-xl:  22px;
  --radius-pill:9999px;

  /* Fonts */
  --font-head:  'Plus Jakarta Sans', 'Segoe UI', -apple-system, system-ui, sans-serif;
  --font-body:  'Inter', 'Segoe UI', -apple-system, system-ui, sans-serif;
  --font-mono:  'JetBrains Mono', 'SF Mono', ui-monospace, monospace;

  /* Shadow */
  --shadow-xs:  0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.07), 0 1px 6px rgba(0,0,0,.04);
  --shadow-md:  0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg:  0 8px 28px rgba(0,0,0,.10), 0 3px 8px rgba(0,0,0,.04);
  --shadow-xl:  0 20px 60px rgba(0,0,0,.13), 0 6px 16px rgba(0,0,0,.06);
  --shadow-blue:0 4px 18px rgba(26,107,255,.25);
  --shadow-blue-lg:0 8px 28px rgba(26,107,255,.32);

  --ease: cubic-bezier(.4,0,.2,1);
  --t:    all .18s cubic-bezier(.4,0,.2,1);
  --tf:   all .12s cubic-bezier(.4,0,.2,1);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-1);
  letter-spacing: -.3px;
}

a   { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul  { list-style: none; }
button, input, select, textarea { font-family: var(--font-body); font-size: inherit; }

/* ============================================================
   APP LAYOUT
============================================================ */
.app-layout   { display: flex; min-height: 100vh; }
.main-content { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; background: var(--bg); transition: margin-left .3s var(--ease); }
.page-content { padding: 28px 32px; flex: 1; }

/* ============================================================
   SIDEBAR
============================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  position: fixed; top: 0; left: 0; height: 100vh;
  z-index: 100;
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: transform .3s var(--ease);
  border-right: 1px solid rgba(255,255,255,.04);
}

/* Logo */
.sidebar-logo { padding: 18px 16px 14px; border-bottom: 1px solid var(--sidebar-bd); flex-shrink: 0; }
.sb-logo-link { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.sb-logo-img  { height: 32px; width: auto; object-fit: contain; flex-shrink: 0; }
.sb-logo-text { font-family: var(--font-head); font-size: 1rem; font-weight: 800; color: #fff; letter-spacing: -.2px; }
.sb-logo-sub  { font-size: .58rem; color: rgba(255,255,255,.28); letter-spacing: .4px; text-transform: uppercase; margin-top: 1px; display: block; }

/* Nav */
.sidebar-nav { flex: 1; padding: 10px 10px; overflow-y: auto; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.nav-section-lbl { font-size: .6rem; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: rgba(255,255,255,.18); padding: 14px 10px 5px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius);
  color: rgba(255,255,255,.5); font-size: .875rem; font-weight: 500;
  transition: var(--tf); margin-bottom: 1px; cursor: pointer;
  text-decoration: none; white-space: nowrap;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.9); }
.nav-item.active { background: rgba(26,107,255,.2); color: #fff; font-weight: 600; border-left: 2px solid var(--blue-lt); padding-left: 10px; }
.nav-item .ni    { font-size: .95rem; width: 20px; text-align: center; flex-shrink: 0; }

/* Footer */
.sidebar-footer { padding: 10px 10px 14px; border-top: 1px solid var(--sidebar-bd); flex-shrink: 0; }
.sb-user        { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius); cursor: pointer; transition: var(--tf); }
.sb-user:hover  { background: rgba(255,255,255,.07); }
.sb-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg,var(--blue-dk),var(--blue-lt)); display: flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 800; color: #fff; flex-shrink: 0; }
.sb-name   { font-size: .82rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.sb-plan   { font-size: .66rem; color: rgba(255,255,255,.28); line-height: 1.2; margin-top: 1px; }

/* Mobile hamburger */
.hamburger { display: none; flex-direction: column; gap: 4px; background: none; border: none; padding: 8px; cursor: pointer; border-radius: var(--radius); }
.hamburger:hover { background: var(--border-lt); }
.hamburger span  { display: block; width: 20px; height: 2px; background: var(--text-3); border-radius: 2px; transition: var(--t); }

#sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 99; backdrop-filter: blur(2px); }
#sidebar-overlay.active { display: block; }

/* ============================================================
   TOPBAR
============================================================ */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 90;
  box-shadow: var(--shadow-xs);
}

.tb-left  { display: flex; align-items: center; gap: 14px; }
.tb-right { display: flex; align-items: center; gap: 8px; }
.tb-title { font-family: var(--font-head); font-size: 1rem; font-weight: 700; color: var(--text-1); }

.tb-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg,var(--blue-dk),var(--blue-lt));
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 800; color: #fff;
  cursor: pointer; position: relative;
  transition: var(--tf); box-shadow: var(--shadow-blue);
}
.tb-avatar:hover { transform: scale(1.06); }

.tb-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
  min-width: 205px; z-index: 200;
  opacity: 0; visibility: hidden;
  transform: translateY(-6px) scale(.97);
  transition: all .16s var(--ease); overflow: hidden;
}
.tb-avatar.open .tb-dropdown { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

.dd-item { display: flex; align-items: center; gap: 9px; padding: 10px 15px; font-size: .875rem; color: var(--text-2); cursor: pointer; transition: var(--tf); }
.dd-item:hover { background: var(--bg); color: var(--text-1); }
.dd-item.red  { color: var(--red); }
.dd-item.red:hover { background: var(--red-bg); }
.dd-divider   { border-top: 1px solid var(--border-lt); margin: 3px 0; }
.dd-user-info { padding: 12px 15px 10px; border-bottom: 1px solid var(--border-lt); background: var(--bg); }
.dd-user-name  { font-weight: 700; font-size: .875rem; color: var(--text-1); }
.dd-user-email { font-size: .76rem; color: var(--text-4); margin-top: 2px; }

/* ============================================================
   AUTH LAYOUT
============================================================ */
.auth-layout { min-height: 100vh; display: flex; background: var(--bg); }

.auth-left {
  width: 44%; flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column; justify-content: center;
  padding: 60px 52px; position: relative; overflow: hidden;
}
.auth-left::before { content: ''; position: absolute; width: 360px; height: 360px; border-radius: 50%; background: rgba(26,107,255,.09); top: -120px; right: -100px; }
.auth-left::after  { content: ''; position: absolute; width: 260px; height: 260px; border-radius: 50%; background: rgba(26,107,255,.06); bottom: -60px; left: -60px; }
.auth-left-inner   { position: relative; z-index: 1; }

.auth-right { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 52px; background: var(--white); }
.auth-form-box { width: 100%; max-width: 400px; }

.auth-brand     { display: flex; align-items: center; margin-bottom: 40px; }
.auth-brand-img { height: 38px; width: auto; }

.auth-tagline { font-family: var(--font-head); font-size: 2.2rem; font-weight: 800; color: #fff; line-height: 1.2; margin-bottom: 14px; letter-spacing: -.3px; }
.auth-tagline em { color: var(--blue-lt); font-style: normal; }
.auth-desc    { font-size: .94rem; color: rgba(255,255,255,.55); line-height: 1.75; margin-bottom: 34px; }

.auth-features    { display: flex; flex-direction: column; gap: 12px; }
.auth-features li { display: flex; align-items: center; gap: 11px; font-size: .875rem; color: rgba(255,255,255,.68); }
.auth-features li .tick { width: 20px; height: 20px; border-radius: 50%; background: rgba(26,107,255,.2); border: 1px solid rgba(77,143,255,.35); display: flex; align-items: center; justify-content: center; font-size: .7rem; color: var(--blue-lt); flex-shrink: 0; }

.auth-heading  { font-family: var(--font-head); font-size: 1.65rem; font-weight: 800; color: var(--text-1); margin-bottom: 6px; letter-spacing: -.3px; }
.auth-subtext  { font-size: .9rem; color: var(--text-3); margin-bottom: 26px; }
.auth-subtext a { color: var(--blue); font-weight: 600; }
.auth-subtext a:hover { text-decoration: underline; }

/* ============================================================
   BUTTONS
============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; font-family: var(--font-head); font-weight: 600;
  border: none; border-radius: var(--radius);
  cursor: pointer; transition: var(--tf);
  white-space: nowrap; text-decoration: none; line-height: 1;
}
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.btn-xs  { font-size: .75rem; padding: 5px 10px; border-radius: 6px; }
.btn-sm  { font-size: .8rem;  padding: 7px 14px; }
.btn-md  { font-size: .875rem; padding: 10px 20px; }
.btn-lg  { font-size: .95rem;  padding: 12px 24px; border-radius: var(--radius-lg); }
.btn-xl  { font-size: 1rem;    padding: 14px 32px; border-radius: var(--radius-lg); }
.btn-full { width: 100%; }

.btn-primary { background: var(--blue); color: #fff; box-shadow: var(--shadow-blue); }
.btn-primary:hover { background: var(--blue-dk); box-shadow: var(--shadow-blue-lg); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary { background: var(--white); color: var(--text-2); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: var(--bg); border-color: var(--text-4); color: var(--text-1); }

.btn-outline { background: transparent; color: var(--blue); border: 1.5px solid var(--blue); }
.btn-outline:hover { background: var(--blue-bg); }

.btn-ghost { background: transparent; color: var(--text-3); border: 1.5px solid transparent; }
.btn-ghost:hover { background: var(--bg); color: var(--text-1); border-color: var(--border); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; transform: translateY(-1px); }

.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #15803d; }

.btn-dark { background: var(--text-1); color: #fff; }
.btn-dark:hover { background: #1f2937; transform: translateY(-1px); }

.btn-white { background: #fff; color: var(--blue-dk); font-weight: 700; border: 1.5px solid rgba(255,255,255,.3); }
.btn-white:hover { background: rgba(255,255,255,.9); }

.btn .spin { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .65s linear infinite; flex-shrink: 0; }

/* ============================================================
   FORMS
============================================================ */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 18px; }

.form-label { font-size: .8rem; font-weight: 600; color: var(--text-2); letter-spacing: .1px; }
.form-label.req::after { content: ' *'; color: var(--red); }

.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: .9rem; color: var(--text-1); background: var(--white);
  outline: none; transition: var(--tf); -webkit-appearance: none;
}
.form-input:hover, .form-select:hover { border-color: var(--text-4); }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,107,255,.1); background: var(--white); }
.form-input.err, .form-select.err, .form-textarea.err { border-color: var(--red); background: var(--red-bg); }
.form-input::placeholder { color: var(--text-4); font-size: .875rem; }
.form-textarea { resize: vertical; min-height: 86px; line-height: 1.55; }
.form-select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%239ca3af'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; background-size: 15px; padding-right: 34px; }

.input-wrap { position: relative; }
.input-wrap .form-input { padding-right: 40px; }
.input-icon-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-4); font-size: .88rem; padding: 3px; border-radius: 5px; transition: var(--tf); line-height: 1; }
.input-icon-btn:hover { color: var(--text-2); background: var(--bg); }

.form-err  { font-size: .77rem; color: var(--red); font-weight: 500; }
.form-hint { font-size: .77rem; color: var(--text-4); }

.pw-bars { display: flex; gap: 4px; margin-top: 6px; }
.pw-bar  { flex: 1; height: 3px; border-radius: 2px; background: var(--border); transition: background .25s; }
.pw-bar.weak   { background: var(--red); }
.pw-bar.medium { background: var(--amber); }
.pw-bar.strong { background: var(--green); }
.pw-lbl { font-size: .74rem; font-weight: 600; margin-top: 4px; }

.chk-group { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.chk-group input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--blue); flex-shrink: 0; margin-top: 2px; cursor: pointer; }
.chk-lbl { font-size: .875rem; color: var(--text-3); cursor: pointer; line-height: 1.5; }
.chk-lbl a { color: var(--blue); font-weight: 600; }

/* ============================================================
   CARDS
============================================================ */
.card { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); overflow: hidden; }
.card-hd  { padding: 16px 20px 0; display: flex; align-items: center; justify-content: space-between; }
.card-title { font-family: var(--font-head); font-size: .9rem; font-weight: 700; color: var(--text-1); }
.card-bd  { padding: 16px 20px; }
.card-ft  { padding: 12px 20px; border-top: 1px solid var(--border-lt); background: var(--bg); }

/* Stat cards */
.stat-card { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-sm); transition: var(--t); }
.stat-card:hover { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,107,255,.07), var(--shadow-md); transform: translateY(-2px); }

.stat-icon { width: 42px; height: 42px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.si-blue   { background: var(--blue-bg); }
.si-green  { background: var(--green-bg); }
.si-orange { background: #fff7ed; }
.si-purple { background: var(--violet-bg); }
.si-red    { background: var(--red-bg); }
.si-teal   { background: #f0fdfa; }

.stat-val { font-family: var(--font-head); font-size: 1.7rem; font-weight: 800; color: var(--text-1); line-height: 1; letter-spacing: -.4px; }
.stat-lbl { font-size: .82rem; color: var(--text-3); font-weight: 500; }
.stat-sub { font-size: .75rem; color: var(--text-4); }

/* ============================================================
   TABLES
============================================================ */
.tbl-wrap  { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); overflow: hidden; }
.tbl-hd    { padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-lt); flex-wrap: wrap; gap: 10px; }
.tbl-title { font-family: var(--font-head); font-size: .92rem; font-weight: 700; color: var(--text-1); }

.data-tbl { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-tbl thead th { padding: 9px 16px; text-align: left; font-size: .68rem; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-4); background: var(--bg); border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-tbl tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border-lt); color: var(--text-2); vertical-align: middle; }
.data-tbl tbody tr:last-child td { border-bottom: none; }
.data-tbl tbody tr { transition: background .1s; }
.data-tbl tbody tr:hover { background: #fafbff; }
.tbl-actions { display: flex; gap: 5px; align-items: center; }

/* ============================================================
   BADGES
============================================================ */
.badge { display: inline-flex; align-items: center; font-size: .68rem; font-weight: 700; padding: 3px 9px; border-radius: var(--radius-pill); letter-spacing: .3px; text-transform: uppercase; white-space: nowrap; line-height: 1.4; }

.st-draft     { background: var(--bg-alt);   color: var(--text-3); }
.st-sent      { background: var(--blue-bg);  color: var(--blue-dk); }
.st-paid      { background: var(--green-bg); color: var(--green); }
.st-overdue   { background: var(--red-bg);   color: var(--red); }
.st-cancelled { background: var(--bg-alt);   color: var(--text-4); }

.pl-free     { background: var(--bg-alt);    color: var(--text-3); }
.pl-starter  { background: var(--blue-bg);   color: var(--blue-dk); }
.pl-pro      { background: var(--green-bg);  color: var(--green); }
.pl-business { background: var(--violet-bg); color: var(--violet); }

.badge-blue   { background: var(--blue-bg);   color: var(--blue-dk); }
.badge-green  { background: var(--green-bg);  color: var(--green); }
.badge-yellow { background: var(--amber-bg);  color: var(--amber); }
.badge-red    { background: var(--red-bg);    color: var(--red); }
.badge-gray   { background: var(--bg-alt);    color: var(--text-3); }
.badge-purple { background: var(--violet-bg); color: var(--violet); }
.badge-orange { background: #fff7ed;          color: #c2410c; }

/* ============================================================
   PROGRESS
============================================================ */
.prog-wrap { display: flex; flex-direction: column; gap: 7px; }
.prog-hd   { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--text-3); font-weight: 500; }
.prog-hd strong { color: var(--text-1); }
.prog-track { width: 100%; height: 7px; background: var(--border-lt); border-radius: var(--radius-pill); overflow: hidden; }
.prog-fill  { height: 100%; border-radius: var(--radius-pill); background: var(--blue); transition: width .5s var(--ease); }
.prog-fill.warn   { background: var(--amber); }
.prog-fill.danger { background: var(--red); }

/* ============================================================
   TOASTS
============================================================ */
#toast-container { position: fixed; bottom: 24px; right: 20px; z-index: 400; display: flex; flex-direction: column-reverse; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--text-1); color: #fff; padding: 12px 15px; border-radius: var(--radius); box-shadow: var(--shadow-xl); font-size: .875rem; font-weight: 500; min-width: 270px; max-width: 360px; opacity: 0; transform: translateX(16px); transition: all .26s var(--ease); pointer-events: all; }
.toast.show { opacity: 1; transform: translateX(0); }
.toast.success { border-left: 4px solid var(--green); }
.toast.error   { border-left: 4px solid var(--red); }
.toast.warning { border-left: 4px solid var(--amber); }
.toast.info    { border-left: 4px solid var(--blue); }
.toast-x { margin-left: auto; background: none; border: none; color: rgba(255,255,255,.38); cursor: pointer; font-size: .85rem; padding: 2px 4px; border-radius: 4px; transition: var(--tf); }
.toast-x:hover { color: #fff; }

/* ============================================================
   MODAL
============================================================ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); backdrop-filter: blur(4px); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; visibility: hidden; transition: opacity .2s var(--ease), visibility .2s; }
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal { background: var(--white); border-radius: var(--radius-xl); width: 100%; max-width: 500px; box-shadow: var(--shadow-xl); transform: scale(.95) translateY(10px); transition: transform .22s var(--ease); overflow: hidden; }
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-hd { padding: 18px 22px 14px; border-bottom: 1px solid var(--border-lt); display: flex; align-items: center; justify-content: space-between; background: var(--bg); }
.modal-title { font-family: var(--font-head); font-size: .97rem; font-weight: 700; color: var(--text-1); }
.modal-x { width: 28px; height: 28px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--white); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-3); font-size: .82rem; transition: var(--tf); }
.modal-x:hover { background: var(--bg-alt); color: var(--text-1); }
.modal-bd { padding: 20px 22px; max-height: 66vh; overflow-y: auto; }
.modal-ft { padding: 12px 22px 18px; border-top: 1px solid var(--border-lt); display: flex; gap: 8px; justify-content: flex-end; background: var(--bg); }

/* ============================================================
   ALERTS
============================================================ */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius); font-size: .875rem; margin-bottom: 16px; border-width: 1px; border-style: solid; line-height: 1.55; }
.alert-info    { background: var(--blue-bg);  border-color: var(--blue-mid);  color: #1e40af; }
.alert-success { background: var(--green-bg); border-color: var(--green-bd);  color: #14532d; }
.alert-warning { background: var(--amber-bg); border-color: var(--amber-bd);  color: #78350f; }
.alert-error   { background: var(--red-bg);   border-color: var(--red-bd);    color: #7f1d1d; }
.alert-icon    { font-size: .95rem; flex-shrink: 0; margin-top: 1px; }

.usage-banner { display: flex; align-items: center; gap: 14px; padding: 13px 17px; border-radius: var(--radius-lg); border: 1.5px solid var(--blue); background: var(--blue-bg); margin-bottom: 24px; flex-wrap: wrap; }
.usage-banner.warn   { border-color: var(--amber); background: var(--amber-bg); }
.usage-banner.danger { border-color: var(--red);   background: var(--red-bg);   }

/* ============================================================
   UTILITIES
============================================================ */
.sec-hd    { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.sec-title { font-family: var(--font-head); font-size: 1.02rem; font-weight: 700; color: var(--text-1); }
.sec-sub   { font-size: .82rem; color: var(--text-3); margin-top: 2px; }

.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
.g4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; }

.divider     { border: none; border-top: 1px solid var(--border); margin: 22px 0; }
.divider-txt { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-4); font-size: .82rem; }
.divider-txt::before, .divider-txt::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.search-wrap { position: relative; }
.search-wrap .si { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-4); font-size: .88rem; pointer-events: none; }
.search-wrap .form-input { padding-left: 34px; }

.filter-tabs { display: flex; gap: 2px; background: var(--bg-alt); border-radius: var(--radius); padding: 3px; flex-wrap: wrap; }
.ftab { padding: 6px 13px; border-radius: 7px; font-size: .8rem; font-weight: 600; color: var(--text-3); cursor: pointer; transition: var(--tf); border: none; background: none; }
.ftab:hover { color: var(--text-1); }
.ftab.active { background: var(--white); color: var(--blue); box-shadow: var(--shadow-xs); }

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 52px 24px; text-align: center; }
.empty-icon  { font-size: 2.6rem; margin-bottom: 14px; opacity: .35; }
.empty-title { font-family: var(--font-head); font-size: .97rem; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.empty-text  { font-size: .875rem; color: var(--text-4); max-width: 280px; line-height: 1.65; margin-bottom: 18px; }

.skeleton { background: linear-gradient(90deg, var(--bg) 25%, var(--border-lt) 50%, var(--bg) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius); }

.page-loader { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; gap: 14px; background: var(--bg); }
.page-loader .spinner { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; }
.page-loader p { color: var(--text-4); font-size: .875rem; }

/* ============================================================
   ANIMATIONS
============================================================ */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes shimmer { 0%{background-position:200% 0;} 100%{background-position:-200% 0;} }
@keyframes fadeUp  { from{opacity:0;transform:translateY(16px);} to{opacity:1;transform:translateY(0);} }
@keyframes fadeIn  { from{opacity:0;} to{opacity:1;} }
@keyframes float   { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-6px);} }
@keyframes bounce  { 0%,100%{transform:translateY(0);} 50%{transform:translateY(5px);} }

.fade-up { animation: fadeUp .36s var(--ease) both; }
.fade-in { animation: fadeIn .28s var(--ease) both; }
.stagger > *:nth-child(1){animation-delay:.04s;}
.stagger > *:nth-child(2){animation-delay:.09s;}
.stagger > *:nth-child(3){animation-delay:.14s;}
.stagger > *:nth-child(4){animation-delay:.18s;}
.stagger > *:nth-child(5){animation-delay:.22s;}

/* ============================================================
   PUBLIC — NAVBAR
============================================================ */
.pub-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 0 48px; height: 68px;
  display: flex; align-items: center; justify-content: space-between;
  transition: var(--t);
}
.pub-nav.scrolled { background: rgba(255,255,255,.97); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.pub-nav.scrolled .pub-links a { color: var(--text-3); }
.pub-nav.scrolled .pub-links a:hover { color: var(--text-1); }

.nav-logo { display: flex; align-items: center; }
.nav-logo-img { height: 36px; width: auto; }

.pub-links { display: flex; align-items: center; gap: 30px; }
.pub-links a { color: rgba(255,255,255,.7); font-size: .875rem; font-weight: 500; transition: var(--tf); }
.pub-links a:hover { color: #fff; }
.pub-nav-actions { display: flex; align-items: center; gap: 9px; }

/* ============================================================
   PUBLIC — HERO
============================================================ */
.hero {
  min-height: 100vh;
  background: linear-gradient(140deg, #08122b 0%, #0d1f4e 45%, #112560 100%);
  display: flex; align-items: center;
  padding: 108px 48px 80px;
  position: relative; overflow: hidden;
}

.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 55% 65% at 12% 55%, rgba(26,107,255,.16) 0%, transparent 55%),
              radial-gradient(ellipse 45% 45% at 88% 12%, rgba(77,143,255,.1) 0%, transparent 50%);
}

.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, rgba(255,255,255,.032) 1px, transparent 1px);
  background-size: 38px 38px;
}

.hero-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; max-width: 1200px; margin: 0 auto; position: relative; z-index: 1; width: 100%; }

.hero-eyebrow { display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.75); font-size: .76rem; font-weight: 600; padding: 5px 13px; border-radius: var(--radius-pill); margin-bottom: 20px; letter-spacing: .2px; }
.hero-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--blue-lt); animation: float 2s ease-in-out infinite; }

.hero-title { font-family: var(--font-head); font-size: clamp(2rem,3.8vw,3rem); font-weight: 800; color: #fff; line-height: 1.14; margin-bottom: 18px; letter-spacing: -.5px; }
.hero-title .hl { color: var(--blue-lt); }

.hero-sub { font-size: 1rem; color: rgba(255,255,255,.6); line-height: 1.76; margin-bottom: 32px; max-width: 460px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-proof { display: flex; align-items: center; gap: 10px; margin-top: 32px; }
.hero-proof-avatars { display: flex; }
.hero-proof-avatars span { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; color: #fff; margin-left: -8px; }
.hero-proof-avatars span:first-child { margin-left: 0; }
.hero-proof-text { font-size: .8rem; color: rgba(255,255,255,.5); }
.hero-proof-text strong { color: rgba(255,255,255,.8); }

/* Invoice card in hero */
.hero-card {
  background: var(--white); border-radius: 18px;
  box-shadow: 0 28px 72px rgba(0,0,0,.38), 0 0 0 1px rgba(255,255,255,.06);
  overflow: hidden;
  transform: perspective(900px) rotateY(-6deg) rotateX(2deg);
  transition: transform .5s var(--ease);
}
.hero-card:hover { transform: perspective(900px) rotateY(-2deg) rotateX(1deg); }

.hc-header { background: linear-gradient(110deg,#08122b,#0e3272); padding: 16px 20px; }
.hc-co     { font-family: var(--font-head); font-size: .9rem; font-weight: 800; color: #fff; }
.hc-gstin  { font-size: .65rem; color: rgba(255,255,255,.42); margin-top: 2px; }
.hc-badge  { display: inline-block; margin-top: 7px; background: rgba(255,255,255,.1); color: rgba(255,255,255,.7); font-size: .58rem; font-weight: 700; letter-spacing: 1px; padding: 3px 8px; border-radius: 20px; text-transform: uppercase; }

.hc-body { padding: 14px 18px; }
.hc-to   { font-size: .7rem; color: var(--text-4); margin-bottom: 3px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.hc-client { font-weight: 700; font-size: .88rem; color: var(--text-1); }
.hc-addr   { font-size: .72rem; color: var(--text-3); margin-top: 1px; }

.hc-table { width: 100%; border-collapse: collapse; font-size: .73rem; margin: 10px 0 6px; }
.hc-table th { background: var(--bg); padding: 4px 6px; text-align: left; color: var(--text-4); font-weight: 700; font-size: .6rem; text-transform: uppercase; letter-spacing: .5px; }
.hc-table td { padding: 5px 6px; border-bottom: 1px solid var(--border-lt); color: var(--text-2); }
.hc-table td:last-child { text-align: right; font-weight: 600; color: var(--text-1); }
.hc-table tr:last-child td { border: none; }
.hc-sub { text-align: right; font-size: .7rem; color: var(--text-3); padding: 3px 0; }

.hc-total { background: #08122b; padding: 10px 18px; display: flex; justify-content: space-between; align-items: center; }
.hc-total-lbl { font-size: .75rem; color: rgba(255,255,255,.55); font-weight: 600; }
.hc-total-amt { font-family: var(--font-head); font-size: 1rem; font-weight: 800; color: #fff; }

/* ============================================================
   PUBLIC — SECTIONS
============================================================ */
.pub-sec { padding: 88px 48px; }
.pub-sec.bg-light { background: var(--bg); }
.pub-sec.bg-dark  { background: var(--sidebar-bg); }
.pub-sec-inner    { max-width: 1200px; margin: 0 auto; }

.section-label { display: inline-flex; align-items: center; gap: 7px; font-size: .7rem; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--blue); margin-bottom: 10px; }
.section-label span { display: inline-block; width: 16px; height: 2px; background: var(--blue); border-radius: 1px; }
.section-label.light { color: #93c5fd; }
.section-label.light span { background: #93c5fd; }

.section-title { font-family: var(--font-head); font-size: clamp(1.75rem,2.8vw,2.3rem); font-weight: 800; color: var(--text-1); line-height: 1.2; margin-bottom: 12px; letter-spacing: -.3px; }
.section-title.white { color: #fff; }
.section-desc  { font-size: .97rem; color: var(--text-3); max-width: 500px; line-height: 1.75; }
.section-desc.white { color: rgba(255,255,255,.55); }

/* Feature grid */
.feat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin-top: 52px; }
.feat-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 26px 22px; transition: var(--t); position: relative; overflow: hidden; }
.feat-card::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
.feat-card:hover { border-color: var(--blue); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.feat-card:hover::after { transform: scaleX(1); }
.feat-ico  { width: 46px; height: 46px; background: var(--blue-bg); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; margin-bottom: 16px; }
.feat-name { font-family: var(--font-head); font-size: .95rem; font-weight: 700; color: var(--text-1); margin-bottom: 7px; }
.feat-desc { font-size: .875rem; color: var(--text-3); line-height: 1.68; }

/* Steps */
.steps-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; margin-top: 50px; position: relative; }
.steps-grid::before { content: ''; position: absolute; top: 22px; left: calc(16.67% + 12px); right: calc(16.67% + 12px); height: 1px; background: repeating-linear-gradient(90deg, var(--border) 0, var(--border) 6px, transparent 6px, transparent 12px); }
.step-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 26px 22px; text-align: center; transition: var(--t); }
.step-card:hover { border-color: var(--blue); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.step-num  { width: 44px; height: 44px; border-radius: 50%; background: var(--blue); color: #fff; font-family: var(--font-head); font-size: 1rem; font-weight: 800; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; box-shadow: var(--shadow-blue); }
.step-title { font-family: var(--font-head); font-size: .95rem; font-weight: 700; color: var(--text-1); margin-bottom: 7px; }
.step-desc  { font-size: .875rem; color: var(--text-3); line-height: 1.65; }

/* Pricing grid */
.price-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; margin-top: 52px; }
.price-card { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius-xl); padding: 26px 20px; display: flex; flex-direction: column; transition: var(--t); position: relative; }
.price-card:hover { border-color: var(--blue); box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.price-card.popular { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(26,107,255,.08), var(--shadow-md); }
.pop-lbl { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--blue); color: #fff; font-size: .67rem; font-weight: 700; padding: 4px 13px; border-radius: var(--radius-pill); white-space: nowrap; box-shadow: var(--shadow-blue); }
.price-name  { font-family: var(--font-head); font-size: .88rem; font-weight: 700; color: var(--text-3); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .4px; font-size: .75rem; }
.price-amt   { font-family: var(--font-head); font-size: 2rem; font-weight: 800; color: var(--text-1); line-height: 1; margin-bottom: 4px; letter-spacing: -1px; }
.price-amt sub { font-size: .88rem; font-weight: 500; color: var(--text-4); letter-spacing: 0; }
.price-period{ font-size: .8rem; color: var(--text-3); margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border-lt); }
.price-feats { list-style: none; flex: 1; margin-bottom: 22px; }
.price-feats li { display: flex; align-items: flex-start; gap: 9px; font-size: .865rem; color: var(--text-3); padding: 5px 0; }
.price-feats .ck { color: var(--green); flex-shrink: 0; margin-top: 1px; font-weight: 700; font-size: .9rem; }
.price-feats .cx { color: var(--border); flex-shrink: 0; margin-top: 1px; font-size: .9rem; }

/* FAQ */
.faq-list { max-width: 700px; margin: 50px auto 0; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 8px; overflow: hidden; transition: border-color .18s; }
.faq-item.open { border-color: var(--blue); }
.faq-q { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 17px 20px; background: var(--white); border: none; cursor: pointer; font-family: var(--font-head); font-size: .92rem; font-weight: 600; color: var(--text-1); text-align: left; gap: 14px; transition: var(--tf); }
.faq-q:hover { background: var(--bg); }
.faq-chevron { flex-shrink: 0; color: var(--text-4); font-size: .9rem; transition: transform .26s; }
.faq-item.open .faq-chevron { transform: rotate(180deg); color: var(--blue); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease, padding .3s; font-size: .9rem; color: var(--text-3); line-height: 1.74; background: var(--bg); padding: 0 20px; }
.faq-item.open .faq-a { max-height: 200px; padding: 14px 20px 18px; }

/* Testimonials */
.testi-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 24px 22px; transition: var(--t); }
.testi-card:hover { border-color: var(--blue); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.testi-stars  { color: #f59e0b; font-size: .95rem; margin-bottom: 13px; letter-spacing: 2px; }
.testi-text   { font-size: .9rem; color: var(--text-3); line-height: 1.72; margin-bottom: 16px; font-style: italic; }
.testi-author { display: flex; align-items: center; gap: 10px; }
.testi-av     { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .86rem; font-weight: 800; color: #fff; flex-shrink: 0; }
.testi-name   { font-weight: 700; font-size: .875rem; color: var(--text-1); }
.testi-role   { font-size: .77rem; color: var(--text-4); margin-top: 1px; }

/* CTA */
.cta-section { background: var(--text-1); padding: 80px 48px; text-align: center; position: relative; overflow: hidden; }
.cta-section::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 80% 80% at 50% 120%, rgba(26,107,255,.18) 0%, transparent 60%); }
.cta-section h2  { font-family: var(--font-head); font-size: clamp(1.8rem,3vw,2.4rem); font-weight: 800; color: #fff; margin-bottom: 12px; position: relative; letter-spacing: -.3px; }
.cta-section p   { color: rgba(255,255,255,.6); font-size: .97rem; margin-bottom: 34px; position: relative; }
.cta-section .cta-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; position: relative; }

/* Footer */
.site-footer  { background: var(--sidebar-bg); padding: 60px 48px 28px; }
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-grid  { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 44px; }
.footer-logo  { display: flex; align-items: center; margin-bottom: 14px; }
.footer-logo img { height: 32px; }
.footer-tag   { font-size: .875rem; line-height: 1.7; color: rgba(255,255,255,.38); max-width: 250px; margin-bottom: 16px; }
.footer-contact { font-size: .82rem; color: rgba(255,255,255,.3); line-height: 1.85; }
.footer-hd    { font-family: var(--font-head); font-size: .7rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: rgba(255,255,255,.6); margin-bottom: 14px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: .875rem; color: rgba(255,255,255,.38); transition: var(--tf); }
.footer-links a:hover { color: rgba(255,255,255,.8); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.06); padding-top: 22px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-copy   { font-size: .78rem; color: rgba(255,255,255,.22); }
.footer-links-row { display: flex; gap: 20px; }
.footer-links-row a { font-size: .78rem; color: rgba(255,255,255,.3); transition: var(--tf); }
.footer-links-row a:hover { color: rgba(255,255,255,.7); }

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width:1100px) {
  .price-grid { grid-template-columns: repeat(2,1fr); }
  .feat-grid  { grid-template-columns: repeat(2,1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .steps-grid::before { display: none; }
}

@media (max-width:900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 44px; }
  .hero-card  { max-width: 460px; margin: 0 auto; transform: none; }
  .hero-card:hover { transform: none; }
  .steps-grid { grid-template-columns: 1fr; }
}

@media (max-width:768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .hamburger { display: flex; }
  .topbar { padding: 0 16px; }
  .page-content { padding: 16px; }
  .pub-nav  { padding: 0 20px; }
  .pub-links { display: none; }
  .hero     { padding: 96px 22px 60px; }
  .pub-sec  { padding: 60px 22px; }
  .cta-section { padding: 56px 22px; }
  .site-footer  { padding: 50px 22px 24px; }
  .g2,.g3,.g4 { grid-template-columns: 1fr; }
  .feat-grid,.price-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .auth-left { display: none; }
  .auth-right { padding: 32px 20px; background: var(--bg); }
}

@media (max-width:480px) {
  .hero-actions { flex-direction: column; }
  .btn-xl { padding: 13px 24px; font-size: .95rem; }
  .stat-val { font-size: 1.55rem; }
}
