/* ═══════════════════════════════════════════════════════════════════════════
   DigiRG Agency CMS — Professional White Theme
   Enterprise Grade · Government-Level Design
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  /* Brand */
  --brand:       #1a3a5c;
  --brand-dark:  #0f2540;
  --brand-light: #2563eb;
  --brand-pale:  #eff6ff;
  --accent:      #f59e0b;
  --accent-light:#fef3c7;

  /* UI */
  --bg:          #f8fafc;
  --bg2:         #f1f5f9;
  --white:       #ffffff;
  --surface:     #ffffff;
  --surface2:    #f8fafc;
  --border:      #e2e8f0;
  --border2:     #cbd5e1;

  /* Text */
  --text:        #0f172a;
  --text2:       #334155;
  --text3:       #64748b;
  --text4:       #94a3b8;

  /* Status */
  --success:     #16a34a;
  --success-bg:  #dcfce7;
  --warning:     #d97706;
  --warning-bg:  #fef9c3;
  --danger:      #dc2626;
  --danger-bg:   #fee2e2;
  --info:        #2563eb;
  --info-bg:     #dbeafe;

  /* Spacing */
  --sidebar-w:   260px;
  --topbar-h:    64px;
  --radius:      10px;
  --radius-sm:   6px;
  --radius-lg:   16px;
  --radius-xl:   24px;

  /* Shadows */
  --shadow-xs:   0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow:      0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-md:   0 10px 15px rgba(0,0,0,0.07), 0 4px 6px rgba(0,0,0,0.05);
  --shadow-lg:   0 20px 25px rgba(0,0,0,0.08), 0 8px 10px rgba(0,0,0,0.04);

  /* Type */
  --sans:   'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:   'IBM Plex Mono', 'Courier New', monospace;
  --ease:   cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--brand-light); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--brand); }
img { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ── Typography ─────────────────────────────────────────────────────────────── */
h1 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; color: var(--text); line-height: 1.2; }
h2 { font-size: 1.5rem; font-weight: 700; color: var(--text); line-height: 1.3; }
h3 { font-size: 1.15rem; font-weight: 700; color: var(--text); }
h4 { font-size: 1rem; font-weight: 600; color: var(--text); }
p  { color: var(--text3); line-height: 1.65; }

/* ══ ADMIN LAYOUT ═══════════════════════════════════════════════════════════ */

.admin-layout { display: flex; min-height: 100vh; }

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--brand);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform 0.3s var(--ease);
  overflow: hidden;
}

.sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon {
  width: 40px; height: 40px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 14px; color: var(--brand-dark);
  flex-shrink: 0;
  letter-spacing: 1px;
}
.logo-text .name  { font-size: 16px; font-weight: 800; color: #fff; letter-spacing: 0.5px; }
.logo-text .tag   { font-size: 9px; color: rgba(255,255,255,0.5); letter-spacing: 1.5px; text-transform: uppercase; }

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.sidebar-nav::-webkit-scrollbar { width: 0; }

.nav-section { margin-bottom: 4px; }
.nav-section-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 12px 12px 4px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.65);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: all 0.15s var(--ease);
  cursor: pointer;
  white-space: nowrap;
}
.nav-link svg { flex-shrink: 0; opacity: 0.7; }
.nav-link:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-link:hover svg { opacity: 1; }
.nav-link.active { background: rgba(255,255,255,0.15); color: #fff; font-weight: 600; }
.nav-link.active svg { opacity: 1; }
.nav-link .count {
  margin-left: auto;
  background: var(--accent);
  color: var(--brand-dark);
  font-size: 10px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 20px;
}

.sidebar-bottom {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.08);
}
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--brand-dark);
  font-weight: 800; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-info .uname { font-size: 13px; font-weight: 600; color: #fff; }
.user-info .urole { font-size: 10px; color: rgba(255,255,255,0.45); text-transform: uppercase; letter-spacing: 0.5px; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 199; }

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

/* ── Topbar ──────────────────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-xs);
}
.topbar-left  { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.menu-toggle  { display: none; background: none; border: none; cursor: pointer; color: var(--text2); padding: 6px; border-radius: var(--radius-sm); }
.menu-toggle:hover { background: var(--bg2); }
.breadcrumb   { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text3); }
.breadcrumb a { color: var(--text3); } .breadcrumb a:hover { color: var(--brand); }
.breadcrumb .sep { color: var(--text4); }
.breadcrumb .current { color: var(--text2); font-weight: 600; }

/* ── Page Content ────────────────────────────────────────────────────────────── */
.page-content { padding: 28px 28px; flex: 1; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-header-left h1 { margin-bottom: 2px; }

/* ── Cards ───────────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title  { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text3); }
.card-body   { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface2); border-radius: 0 0 var(--radius) var(--radius); }

/* ── Stat Cards ──────────────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--brand-light);
}
.stat-card.green::after { background: var(--success); }
.stat-card.amber::after { background: var(--warning); }
.stat-card.red::after   { background: var(--danger); }
.stat-card.blue::after  { background: var(--brand-light); }

.stat-icon-wrap {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  font-size: 20px;
}
.stat-icon-wrap.blue  { background: var(--info-bg); }
.stat-icon-wrap.green { background: var(--success-bg); }
.stat-icon-wrap.amber { background: var(--warning-bg); }
.stat-icon-wrap.red   { background: var(--danger-bg); }
.stat-label { font-size: 12px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-sub   { font-size: 12px; color: var(--text4); margin-top: 6px; }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--sans); font-size: 13.5px; font-weight: 600;
  cursor: pointer; border: none;
  transition: all 0.15s var(--ease);
  text-decoration: none; white-space: nowrap; line-height: 1.4;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn svg { flex-shrink: 0; }
.btn-primary   { background: var(--brand); color: #fff; }
.btn-primary:hover   { background: var(--brand-dark); box-shadow: 0 4px 12px rgba(26,58,92,0.3); }
.btn-accent    { background: var(--accent); color: var(--brand-dark); }
.btn-accent:hover    { background: #e58e00; }
.btn-success   { background: var(--success); color: #fff; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover    { background: #b91c1c; }
.btn-outline   { background: transparent; border: 1px solid var(--border2); color: var(--text2); }
.btn-outline:hover   { border-color: var(--brand-light); color: var(--brand-light); background: var(--brand-pale); }
.btn-ghost     { background: transparent; color: var(--text3); padding: 8px 12px; }
.btn-ghost:hover     { background: var(--bg2); color: var(--text); }
.btn-sm  { padding: 6px 14px; font-size: 12.5px; }
.btn-lg  { padding: 12px 24px; font-size: 15px; }
.btn-xl  { padding: 14px 32px; font-size: 16px; border-radius: var(--radius); }
.btn-full { width: 100%; justify-content: center; }

/* ── Forms ───────────────────────────────────────────────────────────────────── */
.form-group   { margin-bottom: 18px; }
.form-label   { display: block; font-size: 12.5px; font-weight: 600; color: var(--text2); margin-bottom: 7px; }
.form-label .req { color: var(--danger); }
.form-control {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  line-height: 1.5;
}
.form-control:focus { border-color: var(--brand-light); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.form-control::placeholder { color: var(--text4); }
.form-control.error { border-color: var(--danger); }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint { font-size: 11.5px; color: var(--text4); margin-top: 5px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* ── Tables ──────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text3);
  background: var(--surface2);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.data-table tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
.data-table tbody tr:hover { background: var(--brand-pale); }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table td { padding: 13px 16px; color: var(--text2); vertical-align: middle; }
.data-table td strong { color: var(--text); font-weight: 600; }
.mono-text { font-family: var(--mono); font-size: 12px; color: var(--text3); }

/* ── Badges ──────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-success { background: var(--success-bg); color: #14532d; }
.badge-warn    { background: var(--warning-bg); color: #78350f; }
.badge-danger  { background: var(--danger-bg);  color: #7f1d1d; }
.badge-info    { background: var(--info-bg);    color: #1e3a8a; }
.badge-muted   { background: var(--bg2);        color: var(--text3); }

/* ── Alerts ──────────────────────────────────────────────────────────────────── */
.alert {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 18px;
  border-width: 1px; border-style: solid;
}
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-bg); border-color: #86efac; color: #14532d; }
.alert-error   { background: var(--danger-bg);  border-color: #fca5a5; color: #7f1d1d; }
.alert-warn    { background: var(--warning-bg); border-color: #fde68a; color: #78350f; }
.alert-info    { background: var(--info-bg);    border-color: #93c5fd; color: #1e3a8a; }

/* ── Login Page ──────────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}
.login-left {
  flex: 1;
  background: var(--brand);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  position: relative;
  overflow: hidden;
}
.login-left::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  top: -100px; right: -100px;
}
.login-left::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
  bottom: -80px; left: -80px;
}
.login-brand { text-align: center; position: relative; z-index: 1; }
.login-brand .mark { font-size: 44px; font-weight: 900; color: #fff; letter-spacing: 3px; }
.login-brand .mark span { color: var(--accent); }
.login-brand .tagline { font-size: 13px; color: rgba(255,255,255,0.5); letter-spacing: 2px; text-transform: uppercase; margin-top: 6px; }
.login-features { margin-top: 48px; position: relative; z-index: 1; }
.login-feature { display: flex; align-items: center; gap: 14px; color: rgba(255,255,255,0.75); font-size: 14px; margin-bottom: 18px; }
.login-feature svg { flex-shrink: 0; opacity: 0.6; }

.login-right {
  width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--white);
}
.login-form-wrap { width: 100%; max-width: 380px; }
.login-form-wrap h2 { margin-bottom: 4px; }
.login-form-wrap .subtitle { color: var(--text3); font-size: 14px; margin-bottom: 32px; }

/* ── Client Portal ───────────────────────────────────────────────────────────── */
.portal-page { background: var(--bg); min-height: 100vh; }
.portal-header {
  background: var(--white);
  border-bottom: 3px solid var(--brand);
  padding: 0 24px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 100;
}
.portal-logo  { font-size: 20px; font-weight: 900; color: var(--brand); letter-spacing: 2px; }
.portal-logo span { color: var(--accent); }
.portal-nav   { display: flex; gap: 4px; }
.portal-nav a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600;
  color: var(--text3);
  transition: all 0.15s;
}
.portal-nav a:hover, .portal-nav a.active { background: var(--brand-pale); color: var(--brand); }

.portal-body { max-width: 900px; margin: 0 auto; padding: 28px 20px; }
.portal-sidebar-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; }

/* ── Agreement Sign Page ─────────────────────────────────────────────────────── */
.sign-page { background: var(--bg); min-height: 100vh; }
.sign-header {
  background: var(--white);
  border-bottom: 3px solid var(--brand);
  padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow-sm);
}
.sign-progress { background: var(--bg2); border-radius: 4px; height: 6px; margin: 0 -24px; overflow: hidden; }
.sign-progress-bar { height: 100%; background: linear-gradient(90deg, var(--brand-light), var(--success)); transition: width 0.4s; }
.sign-body { max-width: 680px; margin: 0 auto; padding: 24px 16px 60px; }
.sign-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 18px; overflow: hidden; }
.sign-card-head {
  background: var(--brand);
  color: #fff; padding: 16px 20px;
}
.sign-card-head h3 { color: #fff; font-size: 14px; letter-spacing: 0.5px; }
.sign-card-head p  { color: rgba(255,255,255,0.6); font-size: 12px; margin-top: 2px; }
.sign-card-body { padding: 20px; }

/* ── Detail Grid ─────────────────────────────────────────────────────────────── */
.detail-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.info-item { padding: 4px 0; }
.info-item .lbl { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text4); margin-bottom: 3px; }
.info-item .val { font-size: 14px; font-weight: 600; color: var(--text); }
.info-item .val.big { font-size: 22px; font-weight: 800; color: var(--brand); }
.info-item .val.mono { font-family: var(--mono); font-size: 12px; }

/* ── Signature ───────────────────────────────────────────────────────────────── */
.sig-tab-row { display: flex; gap: 4px; margin-bottom: 12px; }
.sig-tab {
  flex: 1; padding: 9px; border-radius: var(--radius-sm);
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text3); font-size: 13px; font-weight: 600;
  cursor: pointer; text-align: center; transition: all 0.15s;
}
.sig-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.sig-canvas-wrap {
  position: relative;
  background: #fff;
  border: 2px solid var(--border2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: crosshair;
}
.sig-canvas-wrap:focus-within { border-color: var(--brand-light); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
#signatureCanvas { display: block; width: 100%; touch-action: none; }
.sig-placeholder {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  color: var(--text4); font-size: 13px;
  pointer-events: none; text-align: center;
}
.sig-placeholder svg { display: block; margin: 0 auto 6px; opacity: 0.4; }

/* ── Location Block ──────────────────────────────────────────────────────────── */
.loc-block {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.loc-row   { display: flex; align-items: center; gap: 10px; }
.loc-dot   { width: 10px; height: 10px; border-radius: 50%; background: var(--text4); flex-shrink: 0; transition: background 0.3s; }
.loc-dot.loading { background: var(--warning); animation: blink 1s ease-in-out infinite; }
.loc-dot.ok      { background: var(--success); }
.loc-dot.fail    { background: var(--danger); }
.loc-text  { font-size: 13.5px; color: var(--text2); }
.loc-addr  { font-size: 12px; color: var(--text4); margin-top: 6px; padding-left: 20px; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ── OTP Input ───────────────────────────────────────────────────────────────── */
.otp-inputs { display: flex; gap: 10px; justify-content: center; margin: 20px 0; }
.otp-input {
  width: 52px; height: 58px;
  text-align: center; font-size: 24px; font-weight: 800;
  border: 2px solid var(--border2); border-radius: var(--radius-sm);
  color: var(--brand); background: var(--white);
  outline: none; font-family: var(--mono);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.otp-input:focus { border-color: var(--brand-light); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.otp-input.filled { border-color: var(--brand); background: var(--brand-pale); }

/* ── Misc ────────────────────────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.flex { display: flex; } .items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-sm { font-size: 12.5px; } .text-xs { font-size: 11.5px; }
.text-muted { color: var(--text3); } .text-danger { color: var(--danger); }
.font-bold { font-weight: 700; } .font-mono { font-family: var(--mono); }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 28px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }
.hidden { display: none !important; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.65s linear infinite; }
.spinner-dark { border-color: rgba(0,0,0,0.15); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 56px 20px; }
.empty-icon  { font-size: 44px; margin-bottom: 14px; opacity: 0.5; }
.copy-badge  { background: var(--bg2); border: 1px solid var(--border); border-radius: 4px; padding: 2px 8px; font-family: var(--mono); font-size: 11.5px; color: var(--text3); cursor: pointer; transition: all 0.15s; }
.copy-badge:hover { border-color: var(--brand-light); color: var(--brand-light); }
.success-screen { text-align: center; padding: 40px 20px; }
.success-check { width: 72px; height: 72px; background: var(--success-bg); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-size: 32px; }

/* ── Invoice Items Builder ───────────────────────────────────────────────────── */
.items-builder { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.items-head { display: grid; grid-template-columns: 1fr 80px 110px 110px 36px; gap: 0; background: var(--bg2); border-bottom: 1px solid var(--border); }
.items-head span { padding: 9px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text3); }
.item-row { display: grid; grid-template-columns: 1fr 80px 110px 110px 36px; border-bottom: 1px solid var(--border); }
.item-row:last-child { border-bottom: none; }
.item-row input { border: none; border-right: 1px solid var(--border); padding: 10px 12px; font-size: 13px; color: var(--text); outline: none; background: var(--white); width: 100%; }
.item-row input:focus { background: var(--brand-pale); }
.item-row input:last-of-type { border-right: none; }
.item-row .del-btn { display: flex; align-items: center; justify-content: center; background: none; border: none; cursor: pointer; color: var(--text4); transition: color 0.15s; }
.item-row .del-btn:hover { color: var(--danger); }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main-wrap { margin-left: 0; }
  .menu-toggle { display: flex; }
  .login-left { display: none; }
  .login-right { width: 100%; }
  .portal-sidebar-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr; }
  .form-grid-2, .form-grid-3, .grid-2, .grid-3, .grid-4, .detail-2col { grid-template-columns: 1fr; }
  .page-content { padding: 18px 16px; }
  .otp-inputs { gap: 7px; }
  .otp-input { width: 44px; height: 50px; font-size: 20px; }
}
