/* ============================================================
   ClaimTrack CRM — Professional UI  v2
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:       #2563EB;
  --blue-lt:    #EFF6FF;
  --blue-bd:    #BFDBFE;
  --blue-dk:    #1D4ED8;
  --blue-glow:  rgba(37,99,235,.18);
  --green:      #059669;
  --green-lt:   #ECFDF5;
  --green-bd:   #6EE7B7;
  --red:        #DC2626;
  --red-lt:     #FEF2F2;
  --red-bd:     #FCA5A5;
  --amber:      #D97706;
  --amber-lt:   #FFFBEB;
  --amber-bd:   #FCD34D;
  --purple:     #7C3AED;
  --purple-lt:  #F5F3FF;
  --gray:       #64748B;
  --slate:      #334155;
  --border:     #E2E8F0;
  --card:       #FFFFFF;
  --bg:         #F1F5F9;
  --text:       #0F172A;
  --sidebar-w:  256px;
  --topbar-h:   64px;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow-xs:  0 1px 2px rgba(0,0,0,.06);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:     0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.05);
  --shadow-lg:  0 10px 25px -3px rgba(0,0,0,.1), 0 4px 10px -2px rgba(0,0,0,.05);
  --shadow-xl:  0 20px 40px -5px rgba(0,0,0,.15), 0 8px 16px -4px rgba(0,0,0,.08);
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ════════════════════════════════════════
   LAYOUT
════════════════════════════════════════ */
.app-wrapper { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #0F172A 0%, #1E293B 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(0,0,0,.15);
}

.sidebar-logo {
  padding: 20px 18px 18px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.15);
}
.sidebar-logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--blue) 0%, #60A5FA 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37,99,235,.4);
}
.sidebar-logo-icon svg,
.sidebar-logo-icon i { width: 20px; height: 20px; color: #fff; font-size: 18px; }
.sidebar-logo-text { font-size: 15px; font-weight: 700; color: #F8FAFC; letter-spacing: -.3px; }
.sidebar-logo-sub  { font-size: 10px; color: #64748B; margin-top: 1px; font-weight: 500; letter-spacing: .5px; text-transform: uppercase; }

.sidebar-nav { flex: 1; padding: 14px 0 8px; }
.nav-section-label {
  font-size: 10px; font-weight: 600; color: #475569;
  letter-spacing: 1.2px; text-transform: uppercase;
  padding: 12px 18px 5px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  color: #94A3B8;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.18s ease;
  user-select: none;
  margin: 1px 8px;
  border-radius: 8px;
  border-left: none;
}
.nav-item i { font-size: 16px; flex-shrink: 0; width: 20px; text-align: center; }
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #E2E8F0; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(37,99,235,.25) 0%, rgba(37,99,235,.08) 100%);
  color: #93C5FD;
  font-weight: 600;
  border-left: 3px solid var(--blue);
  border-radius: 0 8px 8px 0;
  margin-left: 0;
  padding-left: 15px;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.1);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
  padding: 8px 4px;
}
.sidebar-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue) 0%, #60A5FA 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37,99,235,.35);
}
.sidebar-user-name { font-size: 13px; font-weight: 600; color: #E2E8F0; }
.sidebar-user-role {
  font-size: 10px; color: #64748B; font-weight: 500;
  letter-spacing: .4px; text-transform: uppercase;
}
.sidebar-logout {
  display: flex; align-items: center; gap: 8px;
  color: #64748B; font-size: 12px; font-weight: 500; cursor: pointer;
  padding: 8px 10px; border-radius: 8px;
  transition: all .15s;
}
.sidebar-logout i { font-size: 14px; }
.sidebar-logout:hover { background: rgba(239,68,68,.12); color: #FCA5A5; }

/* ── Main Area ── */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}
.topbar-title {
  font-size: 18px; font-weight: 700; color: var(--text);
  letter-spacing: -.3px;
}
.topbar-right { display: flex; gap: 10px; align-items: center; }

/* ── Page Content ── */
.page-content { flex: 1; overflow-y: auto; padding: 26px 28px; }
.page { display: none; }
.page.active { display: block; }

/* ════════════════════════════════════════
   CARDS
════════════════════════════════════════ */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  margin-bottom: 20px;
  transition: box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.card-title {
  font-size: 14px; font-weight: 700; color: var(--slate);
  display: flex; align-items: center; gap: 8px;
}
.card-title i { color: var(--blue); font-size: 16px; }

/* ── Stat Cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform .18s, box-shadow .18s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: inherit;
}
.stat-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}
.stat-val { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 5px; letter-spacing: -.5px; }
.stat-lbl { font-size: 12px; color: var(--gray); font-weight: 500; }
.stat-sub { font-size: 11px; margin-top: 5px; font-weight: 600; display: flex; align-items: center; gap: 4px; }

/* ════════════════════════════════════════
   BUTTONS
════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: none; border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -.1px;
}
.btn i { font-size: 15px; line-height: 1; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--blue) 0%, #3B82F6 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--blue-dk) 0%, var(--blue) 100%);
  box-shadow: 0 4px 12px rgba(37,99,235,.4);
  transform: translateY(-1px);
}
.btn-success {
  background: linear-gradient(135deg, var(--green) 0%, #34D399 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(5,150,105,.3);
}
.btn-success:hover { box-shadow: 0 4px 12px rgba(5,150,105,.4); transform: translateY(-1px); }
.btn-danger {
  background: var(--red-lt); color: var(--red);
  border: 1px solid var(--red-bd);
}
.btn-danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn-secondary {
  background: var(--card); color: var(--slate);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--bg); border-color: #CBD5E1; }
.btn-warning {
  background: var(--amber-lt); color: var(--amber);
  border: 1px solid var(--amber-bd);
}
.btn-warning:hover { background: var(--amber); color: #fff; }
.btn-info {
  background: var(--purple-lt); color: var(--purple);
  border: 1px solid #DDD6FE;
}
.btn-info:hover { background: var(--purple); color: #fff; }

.btn-sm  { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn-sm i { font-size: 13px; }
.btn-block { width: 100%; }
.btn-icon  { padding: 8px 10px; }

/* ════════════════════════════════════════
   FORM FIELDS
════════════════════════════════════════ */
.field { margin-bottom: 16px; }
.field label {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--gray);
  letter-spacing: 0.6px; text-transform: uppercase;
  margin-bottom: 6px;
}
.field label i { font-size: 12px; }
.field input, .field select, .field textarea {
  width: 100%;
  background: #FAFAFA;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
  background: #fff;
}
.field input:disabled { background: var(--bg); color: #94A3B8; cursor: not-allowed; }
.field input[readonly] { background: #F8FAFC; color: #64748B; cursor: default; border-color: #E2E8F0; border-style: dashed; }
.field input[readonly]:focus { border-color: #CBD5E1; box-shadow: none; }
.field-readonly-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 9px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  background: #E2E8F0; color: #64748B;
  border-radius: 4px; padding: 2px 7px; margin-left: 6px;
}
.field textarea { resize: vertical; min-height: 85px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-hint { font-size: 11px; color: #94A3B8; margin-top: 4px; }
.req { color: var(--red); margin-left: 1px; }

/* ════════════════════════════════════════
   TABLE
════════════════════════════════════════ */
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
table { width: 100%; border-collapse: collapse; }
thead { background: linear-gradient(90deg, #F8FAFC 0%, #F1F5F9 100%); }
th {
  text-align: left; font-size: 11px; font-weight: 700; color: var(--slate);
  letter-spacing: 0.6px; text-transform: uppercase;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
th i { color: var(--gray); font-size: 13px; margin-right: 4px; }
td {
  padding: 13px 16px;
  border-bottom: 1px solid #F1F5F9;
  font-size: 13px; color: var(--text);
  vertical-align: middle;
}
tr:hover td { background: #F8FAFC; }
tr:last-child td { border-bottom: none; }

/* ── Badge / Tag ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
  white-space: nowrap;
}
.badge i { font-size: 10px; }
.tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 5px;
  font-size: 10px; font-weight: 600; border: 1px solid;
}

/* ════════════════════════════════════════
   PIPELINE BOARD
════════════════════════════════════════ */
.pipe-scroll { padding-bottom: 8px; }
.pipe-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  align-items: flex-start;
}
.pcol {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.pcol-hdr {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.pcol-title { font-size: 12px; font-weight: 700; }
.pcol-cnt {
  background: #F1F5F9; border-radius: 20px;
  padding: 2px 9px; font-size: 11px; font-weight: 700; color: var(--gray);
  min-width: 26px; text-align: center;
}
.pcard {
  background: #FAFAFA;
  border-radius: 10px; padding: 11px 12px; margin-bottom: 8px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-xs);
}
.pcard:hover { border-color: var(--blue-bd); box-shadow: 0 4px 12px rgba(37,99,235,.12); background: #fff; }
.pcard-name  { font-weight: 700; font-size: 13px; color: var(--text); margin-bottom: 2px; }
.pcard-hosp  { color: var(--gray); font-size: 11px; margin-bottom: 2px; display: flex; align-items: center; gap: 3px; }
.pcard-cid   { color: #94A3B8; font-size: 10px; font-family: monospace; letter-spacing: .5px; }
.pcard-amt   { color: var(--green); font-size: 12px; font-family: monospace; font-weight: 700; margin-top: 6px; display: flex; align-items: center; gap: 3px; }
.pcard-foot  { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }

/* ── Filter Bar ── */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.fchip {
  background: var(--card); border: 1.5px solid var(--border); border-radius: 20px;
  padding: 5px 15px; font-size: 12px; font-weight: 600; color: var(--gray);
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.fchip:hover { border-color: var(--blue-bd); color: var(--blue); background: var(--blue-lt); }
.fchip.on { background: var(--blue); color: #fff; border-color: var(--blue); box-shadow: 0 2px 8px rgba(37,99,235,.3); }

/* ── Search ── */
.search-wrap { position: relative; margin-bottom: 14px; }
.search-wrap input {
  width: 100%; background: var(--card); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px 10px 40px;
  font-size: 14px; outline: none; font-family: inherit; color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-wrap input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.08); background: #fff; }
.search-wrap input::placeholder { color: #94A3B8; }
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: #94A3B8; font-size: 16px;
}

/* ════════════════════════════════════════
   SLIDE PANELS
════════════════════════════════════════ */
.slide-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(540px, 100vw);
  background: var(--card);
  box-shadow: -8px 0 40px rgba(0,0,0,.14);
  z-index: 400;
  display: flex; flex-direction: column;
  transform: translateX(102%);
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
}
.slide-panel.open { transform: translateX(0); }
.panel-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.4);
  backdrop-filter: blur(2px);
  z-index: 399; display: none;
}
.panel-overlay.show { display: block; }
.panel-hdr {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 20px; height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}
.panel-hdr-title { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -.2px; }
.panel-body { flex: 1; overflow-y: auto; background: var(--bg); padding: 20px; }

/* ════════════════════════════════════════
   MODAL
════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(4px);
  z-index: 600; display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: var(--card);
  border-radius: 18px;
  padding: 28px 26px;
  width: 100%; max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalIn .22s cubic-bezier(.4,0,.2,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--blue-lt);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: var(--blue);
  margin: 0 auto 16px;
}
.modal-title { font-weight: 700; font-size: 17px; margin-bottom: 5px; text-align: center; }
.modal-sub   { color: var(--gray); font-size: 13px; margin-bottom: 20px; text-align: center; }

/* ── Note Item ── */
.note-item {
  background: #FAFAFA;
  border-radius: 10px; padding: 13px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  transition: box-shadow .15s;
}
.note-item:hover { box-shadow: var(--shadow-sm); }
.note-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; align-items: center; }
.note-text { font-size: 13px; line-height: 1.65; color: var(--slate); white-space: pre-wrap; }

/* ── Info Box ── */
.ibox {
  background: #FAFAFA; border-radius: 10px; padding: 11px 13px;
  border: 1px solid var(--border);
  transition: box-shadow .15s;
}
.ibox:hover { box-shadow: var(--shadow-sm); }
.ibox .lbl {
  font-size: 10px; font-weight: 700; color: #94A3B8;
  letter-spacing: .7px; text-transform: uppercase; margin-bottom: 4px;
  display: flex; align-items: center; gap: 4px;
}
.ibox .lbl i { font-size: 11px; }
.ibox .val { font-size: 13px; font-weight: 600; color: var(--text); word-break: break-word; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 12px; }

/* ── Toast ── */
#toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(0);
  background: #1E293B; color: #fff;
  padding: 12px 22px; border-radius: 50px;
  font-weight: 600; font-size: 13px;
  z-index: 9999; display: none;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  animation: toastIn .25s ease;
  display: flex; align-items: center; gap: 8px;
}
#toast { display: none; }
#toast.success { background: linear-gradient(135deg, #059669, #10B981); }
#toast.error   { background: linear-gradient(135deg, #DC2626, #EF4444); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Misc ── */
.empty {
  text-align: center; color: #94A3B8; padding: 60px 20px;
  font-size: 14px; font-weight: 500;
}
.empty i { display: block; font-size: 40px; margin-bottom: 12px; opacity: .4; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.prio-pill {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 10px; font-weight: 700; border: 1px solid;
}
.progress-bar { background: #E2E8F0; border-radius: 6px; height: 9px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 6px; transition: width .6s cubic-bezier(.4,0,.2,1); }

/* ── Star Rating ── */
.stars { display: flex; gap: 3px; }
.star  { font-size: 28px; cursor: pointer; color: #E2E8F0; transition: color .1s, transform .1s; }
.star:hover { transform: scale(1.15); }
.star.on { color: var(--amber); }

/* ── Bar Chart ── */
.bar-row   { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.bar-label { width: 140px; font-size: 12px; color: var(--gray); flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.bar-track { flex: 1; background: #F1F5F9; border-radius: 4px; height: 9px; overflow: hidden; }
.bar-fill  { height: 100%; border-radius: 4px; transition: width .6s cubic-bezier(.4,0,.2,1); }
.bar-val   { width: 55px; font-size: 11px; color: var(--gray); text-align: right; flex-shrink: 0; font-weight: 600; }

/* ── Section header utility ── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.section-title {
  font-size: 16px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.section-title i { color: var(--blue); }

/* ════════════════════════════════════════
   LOGIN PAGE
════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 50%, #2563EB 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.login-card {
  background: rgba(255,255,255,.98);
  border-radius: 20px;
  padding: 40px 36px;
  width: 100%; max-width: 420px;
  box-shadow: 0 32px 80px rgba(0,0,0,.35);
  position: relative;
  z-index: 1;
}
.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.login-logo-icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--blue) 0%, #60A5FA 100%);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(37,99,235,.35);
}
.login-logo-icon i { font-size: 26px; color: #fff; }
.login-logo-icon svg { width: 28px; height: 28px; color: #fff; }
.login-title { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.4px; }
.login-sub   { font-size: 12px; color: var(--gray); margin-top: 2px; font-weight: 500; }
.login-err {
  background: var(--red-lt); border: 1.5px solid var(--red-bd);
  border-radius: var(--radius-sm); padding: 11px 14px;
  color: var(--red); font-size: 13px; font-weight: 500;
  margin-bottom: 16px; display: none;
  display: flex; align-items: center; gap: 8px;
}
.login-err { display: none; }
.login-divider {
  text-align: center; position: relative; margin: 20px 0 16px;
  color: var(--gray); font-size: 12px; font-weight: 500;
}
.login-divider::before {
  content: ''; position: absolute; top: 50%; left: 0; right: 0;
  height: 1px; background: var(--border);
}
.login-divider span { background: #fff; padding: 0 12px; position: relative; }

/* ── Spinner ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .7s linear infinite; display: inline-block; }

/* ── Icon Action Buttons with Tooltip ── */
.btn-icon-action {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  border: none; cursor: pointer;
  font-size: 15px;
  transition: all .18s ease;
  flex-shrink: 0;
}
.btn-icon-action::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%; transform: translateX(-50%);
  background: #1E293B; color: #fff;
  font-size: 11px; font-weight: 600;
  padding: 4px 9px; border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s ease, transform .15s ease;
  transform: translateX(-50%) translateY(4px);
  z-index: 100;
  font-family: 'Inter', sans-serif;
  letter-spacing: .2px;
  box-shadow: 0 4px 10px rgba(0,0,0,.2);
}
.btn-icon-action::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%; transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1E293B;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s ease;
  z-index: 100;
}
.btn-icon-action:hover::after,
.btn-icon-action:hover::before { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed; z-index: 200; height: 100vh;
    transform: translateX(-100%); transition: transform 0.25s;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.5);
    z-index: 199; display: none;
  }
  .sidebar-overlay.show { display: block; }
  .page-content { padding: 16px; }
  .field-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 16px; }
}
