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

:root {
  --paper: #F8FAFC;
  --card: #FFFFFF;
  --card-glass: rgba(255, 255, 255, 0.96);
  --ink: #0F172A;
  --ink2: #334155;
  --ink3: #64748B;
  --ink4: #94A3B8;
  --line: #E2E8F0;
  --line2: #F1F5F9;
  
  --petrol: #0284C7;
  --petrol-dark: #0369A1;
  --petrol-soft: #F0F9FF;
  --petrol-border: #BAE6FD;
  
  --teal: #0D9488;
  --teal-dark: #0F766E;
  --teal-soft: #F0FDF4;
  --teal-border: #BBF7D0;
  
  --emerald: #10B981;
  --emerald-soft: #ECFDF5;
  
  --warn: #EA580C;
  --warn-soft: #FFF7ED;
  --warn-line: #FED7AA;
  
  --indigo: #6366F1;
  --indigo-soft: #EEF2FF;
  --indigo-border: #C7D2FE;
  
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1680px;
  margin: 0 auto;
  padding: 24px 24px 80px;
}

/* ==================== MASTHEAD ==================== */
.mast {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.mast-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mast-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0284C7, #0D9488);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3);
}
.mast h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.mast .sub {
  color: var(--ink3);
  font-size: 12px;
  margin-top: 2px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.stamp {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--petrol-dark);
  background: var(--petrol-soft);
  border: 1px solid var(--petrol-border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  white-space: nowrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 20px;
  font-weight: 600;
  font-family: var(--mono);
}
.badge.live { background: #DCFCE7; color: #15803D; border: 1px solid #86EFAC; }
.badge.mock { background: #FEF3C7; color: #B45309; border: 1px solid #FDE68A; }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.85); } }

/* ==================== NAVIGATION TABS ==================== */
.nav-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.nav-tab {
  background: var(--card);
  border: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink2);
  padding: 9px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.nav-tab:hover {
  background: var(--line2);
  color: var(--ink);
  border-color: var(--ink4);
}
.nav-tab.active {
  background: var(--petrol);
  color: #fff;
  border-color: var(--petrol);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

/* ==================== PANELS & CARDS ==================== */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
}
.panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: #FAFAFA;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--petrol-dark);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.panel-bd { padding: 18px 20px; }

/* ==================== CONTROLS & FILTER BAR ==================== */
.ctrl-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.ctrl-row + .ctrl-row {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.lbl {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink3);
  font-weight: 700;
  min-width: 90px;
}
.req {
  font-size: 11px;
  color: var(--ink3);
  font-style: italic;
}

/* Segmented Buttons */
.seg {
  display: inline-flex;
  background: var(--line2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
  flex-wrap: wrap;
}
.seg button {
  background: transparent;
  border: none;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink2);
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.seg button:hover { color: var(--ink); background: rgba(255,255,255,0.6); }
.seg button.sel {
  background: #fff;
  color: var(--petrol);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* Date Inputs */
.date-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  transition: border-color 0.15s ease;
}
.date-input-wrap:focus-within {
  border-color: var(--petrol);
  box-shadow: 0 0 0 2px var(--petrol-soft);
}
.date-input-wrap .k {
  color: var(--ink3);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
}
.date-input {
  border: none;
  background: transparent;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  outline: none;
  cursor: pointer;
}

/* Dropdowns */
.dd { position: relative; }
.dd-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}
.dd-btn:hover { border-color: var(--petrol); }
.dd-btn .k { color: var(--ink3); font-family: var(--mono); font-size: 10px; text-transform: uppercase; font-weight: 700; }
.dd-btn .v { font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-btn .caret { color: var(--ink3); font-size: 9px; }
.dd-btn.part { border-color: var(--petrol-border); background: var(--petrol-soft); color: var(--petrol-dark); }
.dd-btn.none { border-color: var(--warn-line); background: var(--warn-soft); color: var(--warn); }

.dd-pop {
  position: absolute;
  z-index: 100;
  top: calc(100% + 6px);
  left: 0;
  min-width: 260px;
  max-width: 380px;
  max-height: 320px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  padding: 8px;
  display: none;
}
.dd.open .dd-pop { display: block; animation: dropDown 0.15s ease; }
@keyframes dropDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.dd-tools {
  display: flex;
  gap: 6px;
  padding: 4px 6px 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
  position: sticky;
  top: -8px;
  background: #fff;
  z-index: 2;
}
.dd-list { display: flex; flex-direction: column; gap: 2px; }
.opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  user-select: none;
}
.opt:hover { background: var(--line2); }
.opt input { margin: 0; cursor: pointer; accent-color: var(--petrol); }

/* Chips */
.chip {
  background: var(--line2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink2);
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--petrol); color: var(--ink); }
.chip.on {
  background: var(--petrol-soft);
  border-color: var(--petrol-border);
  color: var(--petrol-dark);
  font-weight: 700;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn.primary { background: var(--petrol); color: #fff; }
.btn.primary:hover { background: var(--petrol-dark); box-shadow: var(--shadow-sm); }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink2); }
.btn.ghost:hover { background: var(--line2); color: var(--ink); border-color: var(--ink4); }
.mini {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink2);
  cursor: pointer;
}
.mini:hover { background: var(--line2); color: var(--ink); }

/* ==================== MATURITY STRIP ==================== */
.mat { display: flex; flex-direction: column; gap: 10px; }
.strip { display: flex; flex-direction: column; gap: 6px; }
.strip-grid {
  display: grid;
  grid-template-columns: repeat(31, 1fr);
  gap: 3px;
  background: var(--line2);
  padding: 6px;
  border-radius: var(--radius-sm);
}
.cell {
  height: 24px;
  border-radius: 3px;
  transition: transform 0.1s ease;
  cursor: help;
}
.cell:hover { transform: scaleY(1.15); }
.cell.inc { background: var(--teal); border: 1px solid var(--teal-dark); }
.cell.exc { background: var(--warn); border: 1px solid #9A3412; opacity: 0.85; }
.strip-ax {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink3);
  padding: 0 4px;
}
.legend {
  display: flex;
  gap: 16px;
  font-size: 11.5px;
  color: var(--ink2);
  margin-top: 4px;
  flex-wrap: wrap;
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.note {
  font-size: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  border: 1px solid var(--warn-line);
  color: #9A3412;
}
.note.clear {
  background: var(--teal-soft);
  border-color: var(--teal-border);
  color: var(--teal-dark);
}

/* ==================== KPI TILES ==================== */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--petrol-border);
}
.kpi::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--petrol), var(--teal));
}
.kpi .k {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.kpi .v {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.kpi .d {
  font-size: 11px;
  color: var(--ink4);
  margin-top: 4px;
  line-height: 1.3;
}
.kpi.skeleton {
  background: linear-gradient(90deg, #F8FAFC 25%, #EDF2F7 50%, #F8FAFC 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-color: #E2E8F0;
}
.kpi.skeleton .k { color: #94A3B8; }
.kpi.skeleton .v { color: #CBD5E1; }
.kpi.skeleton .d { color: #94A3B8; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.tbl-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--petrol-dark);
}
.spinner-icon {
  width: 20px;
  height: 20px;
  border: 3px solid var(--petrol-soft);
  border-top-color: var(--petrol);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==================== DATA TABLE ==================== */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 16px;
  background: #FAFAFA;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.table-search {
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  min-width: 240px;
  outline: none;
}
.table-search:focus { border-color: var(--petrol); }

.tbl-wrap {
  max-height: 600px;
  overflow: auto;
  border-top: 1px solid var(--line);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}
th {
  position: sticky;
  top: 0;
  background: #F8FAFC;
  color: var(--ink2);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
  z-index: 10;
  cursor: pointer;
  user-select: none;
}
th:hover { background: #F1F5F9; color: var(--petrol); }
th .sort-icon { font-size: 10px; margin-left: 4px; color: var(--ink4); }
th.sorted .sort-icon { color: var(--petrol); }

td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line2);
  white-space: nowrap;
}
tbody tr:hover td { background: #F8FAFC; }
td.num { text-align: right; font-family: var(--mono); font-weight: 500; }
td.dim { font-weight: 600; color: var(--ink); }

/* Sticky first column */
th.stick, td.stick {
  position: sticky;
  left: 0;
  background: inherit;
  z-index: 5;
  box-shadow: 2px 0 5px rgba(0,0,0,0.03);
}
th.stick { z-index: 15; background: #F8FAFC; }

tfoot tr td {
  position: sticky;
  bottom: 0;
  background: #F1F5F9;
  font-weight: 700;
  border-top: 2px solid var(--line);
  z-index: 10;
}
tfoot tr td.stick { background: #E2E8F0; z-index: 15; }

/* Table Pagination */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: #FAFAFA;
  font-size: 12px;
  color: var(--ink2);
  flex-wrap: wrap;
  gap: 10px;
}

/* ==================== CHARTS & FUNNELS ==================== */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 20px;
}
.chart-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.chart-box h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

/* ==================== CRM FOLLOW-UP TABLE ==================== */
.followup-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.search-input {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12px;
  min-width: 260px;
  outline: none;
}
.search-input:focus { border-color: var(--petrol); }
.copy-btn {
  background: var(--line2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 10px;
  font-family: var(--mono);
  cursor: pointer;
  margin-left: 6px;
}
.copy-btn:hover { background: var(--petrol-soft); color: var(--petrol); }

.status-select {
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  background: #fff;
  cursor: pointer;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.15s ease;
}
.modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 90%;
  max-width: 520px;
  padding: 24px;
}
.modal-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-hd h3 { margin: 0; font-size: 16px; }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--ink3); }

/* ==================== SQL QUERY STUDIO ==================== */
.query-studio-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
}
@media (max-width: 1024px) {
  .query-studio-layout { grid-template-columns: 1fr; }
}
.query-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 600px;
  overflow-y: auto;
}
.query-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
}
.query-item:hover { border-color: var(--petrol); background: var(--petrol-soft); }
.query-item.active { border-color: var(--petrol); background: var(--petrol-soft); font-weight: 600; }
.query-item .q-title { font-size: 12.5px; color: var(--ink); }
.query-item .q-meta { font-size: 10.5px; color: var(--ink3); font-family: var(--mono); margin-top: 2px; }

.sql-editor {
  width: 100%;
  min-height: 220px;
  font-family: var(--mono);
  font-size: 12px;
  background: #0F172A;
  color: #E2E8F0;
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid #334155;
  resize: vertical;
  outline: none;
  line-height: 1.4;
}
.sql-editor:focus { border-color: var(--petrol); }

.query-params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 14px 0;
  background: var(--line2);
  padding: 14px;
  border-radius: var(--radius-sm);
}
.param-field { display: flex; flex-direction: column; gap: 4px; }
.param-field label { font-family: var(--mono); font-size: 10.5px; font-weight: 700; color: var(--ink3); }
.param-field input, .param-field select {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
}

/* ==================== USER PROFILE & LOGOUT ==================== */
.user-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.user-avatar {
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--petrol-soft);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(15, 118, 110, 0.2);
}
.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.user-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}
.user-role {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--petrol);
  font-weight: 600;
}
.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink2);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  margin-left: 4px;
}
.btn-logout:hover {
  background: #FEE2E2;
  border-color: #FCA5A5;
  color: #DC2626;
}

/* ==================== GLASSMORHPIC LOGIN OVERLAY ==================== */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.login-overlay.active {
  opacity: 1;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.15);
  padding: 36px 32px;
  position: relative;
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.login-overlay.active .login-card {
  transform: translateY(0) scale(1);
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0F766E, #3B82F6, #10B981);
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}
.login-brand-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--petrol-soft);
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 118, 110, 0.2);
}
.login-header h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.login-subtitle {
  font-size: 12.5px;
  color: var(--ink3);
}

.login-error-alert {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #B91C1C;
  font-size: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  line-height: 1.4;
  animation: shake 0.35s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink2);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 12px;
  color: var(--ink3);
  pointer-events: none;
}
.login-input {
  width: 100%;
  padding: 10px 38px 10px 38px;
  font-size: 13.5px;
  font-family: var(--sans);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  background: #F8FAFC;
  color: var(--ink);
  transition: all 0.15s ease;
}
.login-input:focus {
  background: #FFFFFF;
  border-color: var(--petrol);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.btn-toggle-pw {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--ink3);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-toggle-pw:hover {
  color: var(--ink);
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.remember-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink2);
  cursor: pointer;
}
.security-badge {
  font-size: 10.5px;
  font-family: var(--mono);
  color: var(--petrol);
  font-weight: 600;
}

.btn-login-submit {
  width: 100%;
  padding: 11px 16px;
  background: var(--petrol);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
  margin-top: 8px;
  box-shadow: 0 2px 4px rgba(15, 118, 110, 0.25);
}
.btn-login-submit:hover:not(:disabled) {
  background: #0D655E;
  box-shadow: 0 4px 8px rgba(15, 118, 110, 0.35);
}
.btn-login-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.spinner-inline {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink3);
  font-family: var(--mono);
}

