/* ──────────────────────────────────────────────────────────
   ETL Hostinger – Modern UI
────────────────────────────────────────────────────────── */
:root {
  --bg:           #edf1f7;
  --surface:      #ffffff;
  --surface-soft: #f7fafd;
  --text:         #0e1726;
  --muted:        #60748c;
  --line:         #dce5f0;
  --primary:      #0f766e;
  --primary-lt:   #ccfbf1;
  --primary-dark: #0a5954;
  --danger:       #dc2626;
  --success:      #15803d;
  --warning:      #b45309;
  --sidebar:      #0b1d32;
  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 3px rgba(14,23,38,.05);
  --shadow:    0 2px 12px rgba(14,23,38,.08);
  --shadow-lg: 0 8px 32px rgba(14,23,38,.13);
  --transition: .18s ease;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14.5px;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
input, select, button, textarea { font: inherit; }

/* ── Shell ─────────────────────────────────────────────── */
.app-shell { min-height: 100vh; }
.app-shell-auth {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  min-height: 100vh;
}
.app-shell-guest { display: block; }

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
  background: var(--sidebar);
  color: #fff;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px; }
.login-brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px; }
.brand small, .login-brand small { display: block; color: #7a9cc0; font-size: 11.5px; margin-top: 1px; }
.brand strong { font-size: 13px; letter-spacing: -0.01em; white-space: nowrap; }
.brand-robot-wrap {
  position: relative;
  width: 68px;
  height: 54px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 0 0 34px 34px;
}
.brand-robot-wrap::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 20px;
  background: linear-gradient(to bottom, transparent, #0b1d32);
}
.brand-logo {
  width: 68px;
  height: auto;
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  mix-blend-mode: screen;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(15,118,110,.45);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 26px;
  flex: 1;
}

.nav a {
  display: flex;
  align-items: center;
  padding: 9.5px 12px;
  border-radius: var(--radius-sm);
  color: #94b3cc;
  font-weight: 500;
  font-size: 13.5px;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  border-left: 3px solid transparent;
}
.nav a:hover {
  background: rgba(255,255,255,.07);
  color: #dcedf8;
  border-left-color: rgba(20,184,166,.35);
}
.nav a.is-active {
  background: rgba(15,118,110,.22);
  color: #4df8e8;
  border-left-color: #14b8a6;
  font-weight: 600;
}

.nav-section {
  padding: 18px 12px 6px;
  color: #4a6478;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* ── Main ──────────────────────────────────────────────── */
.main { min-width: 0; }
.main-auth  { min-height: 100vh; display: flex; flex-direction: column; }
.main-guest { min-height: 100vh; display: flex; flex-direction: column; }

/* ── Topbar ────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  height: 68px;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-guest { padding-inline: clamp(24px, 5vw, 52px); }
.topbar h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
}
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-user { display: grid; gap: 1px; text-align: right; line-height: 1.3; }
.topbar-user strong { font-size: 13.5px; font-weight: 600; }
.topbar-user span { color: var(--muted); font-size: 12px; }

.topbar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #14b8a6, #0f766e);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(15,118,110,.3);
}

/* ── Content ───────────────────────────────────────────── */
.content { padding: 22px 26px; }
.content-auth { width: min(1720px, 100%); margin: 0 auto; }
.content-guest { padding: clamp(28px, 5vw, 54px); flex: 1; display: flex; }
.content-guest > * { width: 100%; }
.content-guest > .panel { width: min(560px, 100%); margin: auto; }

/* ── Cards & Panels ────────────────────────────────────── */
.panel, .card, .login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel { padding: 20px 22px; margin-bottom: 16px; }
.compact-panel { margin-bottom: 0; }
.panel h2 { margin: 0 0 6px; font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.panel > p { color: var(--muted); line-height: 1.6; margin: 0 0 12px; font-size: 13.5px; }
.section-heading {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 12px;
}
.section-heading h2 { margin: 0; }

/* ── Metric cards ──────────────────────────────────────── */
.grid { display: grid; gap: 14px; }
.cards-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.analytics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.card.metric-card {
  padding: 20px 22px;
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.card.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-lt), var(--primary));
  border-radius: var(--radius) var(--radius) 0 0;
}
.card.metric-card:nth-child(2)::before { background: linear-gradient(90deg, #bfdbfe, #3b82f6); }
.card.metric-card:nth-child(3)::before { background: linear-gradient(90deg, #d1fae5, #10b981); }
.card.metric-card:nth-child(4)::before { background: linear-gradient(90deg, #fef3c7, #f59e0b); }
.card.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.metric-card p { margin: 0 0 6px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.metric-card strong { display: block; font-size: 27px; font-weight: 700; margin-bottom: 5px; letter-spacing: -0.03em; }
.metric-card span { color: var(--muted); font-size: 12px; }

/* ── Empty state ───────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}
.empty-state-icon { font-size: 40px; line-height: 1; opacity: .5; }
.empty-state p { margin: 0; font-size: 14px; line-height: 1.6; }
.empty-state p strong { color: var(--primary); }

/* ── Buttons ───────────────────────────────────────────── */
.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
}
.button:active { transform: scale(0.97); }
.button-primary {
  background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(15,118,110,.28);
}
.button-primary:hover {
  background: linear-gradient(135deg, #0d9488 0%, #0a5954 100%);
  box-shadow: 0 4px 16px rgba(15,118,110,.38);
}
.button-secondary {
  background: #f1f5f9;
  color: var(--text);
  border: 1px solid var(--line);
}
.button-secondary:hover { background: #e2e8f0; }
.button-odoo {
  background: linear-gradient(135deg, #714b67 0%, #4c2a4e 100%);
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(113,75,103,.25);
}
.button-odoo:hover { opacity: .88; box-shadow: 0 4px 14px rgba(113,75,103,.38); }
.button-resync {
  background: linear-gradient(135deg, #0f766e 0%, #0a5954 100%);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(15,118,110,.25);
  gap: 6px;
}
.button-resync:hover { opacity: .88; box-shadow: 0 4px 14px rgba(15,118,110,.35); }
.button-full { width: 100%; justify-content: center; }

/* ── Forms ─────────────────────────────────────────────── */
.input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  background: #fff;
  font-size: 14px;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,118,110,.12);
}
label { display: grid; gap: 5px; font-weight: 600; font-size: 13px; }
.filter-grid, .settings-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}
.filter-actions, .inline-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack-form { display: grid; gap: 12px; }
.check-row { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check-row-diag {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1.5px solid #dce5f0;
  background: #f4f7fb;
  color: #506176;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .18s, background .18s, color .18s;
}
.check-row-diag:hover { border-color: #f59e0b; background: #fffbeb; color: #92400e; }
.check-row-diag.is-active { border-color: #f59e0b; background: #fef3c7; color: #92400e; font-weight: 600; }
.check-row-diag input { accent-color: #d97706; }

/* ── Subnav ────────────────────────────────────────────── */
.subnav { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.subnav a {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  transition: all var(--transition);
}
.subnav a:hover {
  border-color: rgba(15,118,110,.4);
  color: var(--primary-dark);
  background: var(--primary-lt);
  transform: translateY(-1px);
}

/* ── Flash messages ────────────────────────────────────── */
.flash-stack { padding: 14px 26px 0; }
.flash-stack-auth { width: min(1720px, 100%); margin: 0 auto; }
.flash-stack-guest { width: min(1180px, 100%); margin: 0 auto; padding-inline: clamp(24px, 5vw, 52px); }
.flash {
  position: relative;
  padding: 14px 18px 14px 22px;
  border-radius: 18px;
  margin-bottom: 10px;
  border: 1px solid;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
.flash::before,
.login-alert::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.32;
}
.flash-success { background: #f3fbf6; color: #166534; border-color: #ccead5; }
.flash-danger  { background: #fff4f4; color: #b42318; border-color: #f7c7c7; }
.flash-warning { background: #fff9ed; color: #b45309; border-color: #f8ddb0; }

/* SweetAlert */
.etl-swal-popup {
  border-radius: 22px;
  padding: 1.4rem;
}
.etl-swal-popup .swal2-title {
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 800;
}
.etl-swal-popup .swal2-html-container {
  color: var(--muted);
  line-height: 1.55;
}
.etl-swal-loading .swal2-loader {
  border-color: #0f766e transparent #0f766e transparent;
}
.etl-swal-toast {
  border-radius: 16px;
  box-shadow: 0 14px 28px rgba(14,23,38,.12);
}
.etl-swal-toast .swal2-title {
  font-size: 13.5px;
  font-weight: 700;
}

/* ── Tables ────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 2px solid var(--line); }
th {
  padding: 9px 10px 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-align: left;
  white-space: nowrap;
}
td { padding: 10px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; font-size: 13.5px; }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: #f7fafc; }
tbody tr:last-child td { border-bottom: none; }

/* ── Badges ────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; min-height: 22px; padding: 2px 9px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600; text-transform: capitalize;
  background: #f1f5f9; color: var(--muted);
}
.badge-verde    { background: #f0fdf4; color: var(--success); }
.badge-amarillo { background: #fffbeb; color: var(--warning); }
.badge-naranja  { background: #fff7ed; color: #c2410c; }
.badge-rojo     { background: #fef2f2; color: var(--danger); }
.badge-gris     { background: #f8fafc; color: #475467; }
.badge-azul     { background: #eff6ff; color: #1d4ed8; }

/* ── Data list ─────────────────────────────────────────── */
.data-list { display: grid; gap: 0; }
.data-list div {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.data-list div:last-child { border-bottom: none; }
.data-list dt { color: var(--muted); font-size: 13px; }
.data-list dd { margin: 0; font-weight: 700; font-size: 13.5px; }

/* ── Chart containers ──────────────────────────────────── */
.chart-wrap {
  position: relative;
  width: 100%;
  margin-top: 14px;
}
.chart-wrap-sm { height: 180px; }
.chart-wrap-md { height: 250px; }
.chart-wrap-lg { height: 300px; }
.chart-wrap canvas { display: block; }

/* ── Detail two-column layout ──────────────────────────── */
.detail-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 8px;
}
.detail-section-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}
@media (max-width: 860px) {
  .detail-cols { grid-template-columns: 1fr; }
}

/* ── Subnav active state ────────────────────────────────── */
.subnav a.is-active {
  background: var(--primary-lt);
  color: var(--primary-dark);
  border-color: rgba(15,118,110,.3);
}

/* ── Currency toggle ───────────────────────────────────── */
.currency-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  padding: 2px;
  gap: 2px;
}
.ct-btn {
  border: none;
  background: transparent;
  padding: 5px 13px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  border-radius: 999px;
  transition: all var(--transition);
  letter-spacing: 0.04em;
  text-align: center;
}
.ct-btn:hover { color: var(--text); }
.ct-btn.ct-active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(15,118,110,.28);
}

/* ── Payment summary bar ───────────────────────────────── */
.payment-summary-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.ps-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.ps-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); cursor: pointer; }
.ps-card--active { outline: 2px solid currentColor; outline-offset: -2px; opacity: 1; }
.ps-card--ps-pagado.ps-card--active    { outline-color: var(--success); background: #f0fdf4; }
.ps-card--ps-parcial.ps-card--active   { outline-color: var(--warning); background: #fffbeb; }
.ps-card--ps-pendiente.ps-card--active { outline-color: var(--danger);  background: #fef2f2; }
.ps-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 800;
  flex-shrink: 0;
}
.ps-card--ps-pagado   { border-left: 3px solid var(--success); }
.ps-card--ps-parcial  { border-left: 3px solid var(--warning); }
.ps-card--ps-pendiente{ border-left: 3px solid var(--danger); }
.ps-card--ps-pagado   .ps-icon { background: #f0fdf4; color: var(--success); }
.ps-card--ps-parcial  .ps-icon { background: #fffbeb; color: var(--warning); }
.ps-card--ps-pendiente .ps-icon{ background: #fef2f2; color: var(--danger); }
.ps-body { display: flex; flex-direction: column; gap: 2px; }
.ps-label { font-size: 13px; font-weight: 700; }
.ps-count { font-size: 12px; color: var(--muted); }
.ps-amount { font-size: 17px; font-weight: 700; margin-top: 4px; }
.ps-debt { font-size: 12px; color: var(--danger); }

@media (max-width: 768px) {
  .payment-summary-bar { grid-template-columns: 1fr; }
}

/* ── Login (full-screen) ───────────────────────────────── */
body.page-guest {
  background: linear-gradient(145deg, #0d2d6e 0%, #1546a0 45%, #0d3d8a 100%);
  background-attachment: fixed;
}
body.page-guest .topbar-guest,
body.page-guest .flash-stack-guest { display: none; }
body.page-guest .content-guest {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-center {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: #fff;
  border-radius: 22px;
  padding: 42px 40px 38px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,.28);
  text-align: center;
}
.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.login-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1546a0 0%, #0d2d6e 100%);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 18px rgba(13,45,110,.35);
}
.login-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: #0e1726;
  letter-spacing: -0.02em;
}
.login-subtitle {
  margin: 0;
  color: #60748c;
  font-size: 13.5px;
  line-height: 1.5;
}
.login-divider {
  border: none;
  border-top: 2px solid #1546a0;
  width: 36px;
  margin: 16px auto 20px;
  border-radius: 99px;
}
.login-alert {
  position: relative;
  text-align: left;
  padding: 12px 14px 12px 20px;
  border-radius: 14px;
  font-size: 13.5px;
  margin-bottom: 16px;
  line-height: 1.5;
  border: 1px solid;
}
.login-alert-warning { background: #fff9ed; color: #92400e; border-color: #f8ddb0; }
.login-alert-error,
.login-alert-danger  { background: #fff4f4; color: #991b1b; border-color: #f7c7c7; }
.login-alert-success { background: #f3fbf6; color: #14532d; border-color: #ccead5; }
.login-form { display: grid; gap: 14px; margin-top: 4px; }
.login-field {
  position: relative;
  display: flex;
  align-items: center;
}
.login-field-icon {
  position: absolute;
  left: 14px;
  font-size: 14px;
  color: #8aa0bc;
  pointer-events: none;
  line-height: 1;
}
.login-input {
  width: 100%;
  padding: 13px 44px 13px 40px;
  border-radius: 10px;
  border: 1.5px solid #dce5f0;
  background: #f4f7fb;
  font-size: 14px;
  color: #0e1726;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.login-input::placeholder { color: #a0b0c4; }
.login-input:focus {
  border-color: #1546a0;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(21,70,160,.12);
}
.login-eye {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: #8aa0bc;
  font-size: 15px;
  line-height: 1;
  padding: 0 4px;
  transition: color .15s;
}
.login-eye:hover { color: #1546a0; }
.login-btn {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #1a56c4 0%, #0d2d6e 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(13,45,110,.30);
  transition: opacity .18s, transform .15s, box-shadow .18s;
}
.login-btn:hover {
  opacity: .92;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(13,45,110,.38);
}
.login-btn:active { transform: translateY(0); opacity: 1; }

/* ── Sales status ──────────────────────────────────────── */
.status-page { display: grid; gap: 14px; margin-bottom: 16px; }
.status-hero {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr); gap: 18px; align-items: center;
  background: radial-gradient(circle at top left, rgba(15,118,110,.08), transparent 34%), linear-gradient(180deg, #fff 0%, #f7fafd 100%);
}
.status-hero-kicker { margin: 0 0 6px; color: var(--primary); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.status-hero-copy h2 { margin-bottom: 6px; }
.status-hero-copy p:last-child { margin: 0; }
.status-hero-actions { display: grid; justify-items: end; gap: 12px; }
.status-filters-panel { background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(248,251,255,.98) 100%); }
.status-filters-header { margin-bottom: 14px; }
.status-filters-header p { margin: 0; }
.status-filter-form { display: grid; gap: 14px; }
.status-filter-grid-top {
  display: grid; gap: 12px;
  grid-template-columns: minmax(200px,1.4fr) minmax(180px,1fr) minmax(180px,1fr) repeat(2, minmax(140px,.9fr)) repeat(3, minmax(100px,.65fr));
  align-items: end;
}
.status-chip-sections { display: grid; gap: 12px; }
.status-chip-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.status-filter-footer { display: grid; grid-template-columns: minmax(260px,1fr) auto; gap: 14px; align-items: end; }
.status-filter-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }

/* ── Filter chips ──────────────────────────────────────── */
.filter-chip-group {
  display: grid; gap: 8px; min-width: 240px; padding: 12px 14px 14px;
  border: 1px solid rgba(15,118,110,.08); border-radius: var(--radius);
  background: radial-gradient(circle at top left, rgba(15,118,110,.06), transparent 42%), linear-gradient(180deg, #fff 0%, #f8fbff 100%);
}
.filter-chip-group-wide { width: 100%; }
.filter-chip-label { color: var(--text); font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.filter-chip-list { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.9); color: #506176; cursor: pointer;
  font-weight: 600; font-size: 13px;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.filter-chip:hover { transform: translateY(-1px); border-color: rgba(15,118,110,.35); background: #f0fdf9; box-shadow: 0 8px 16px rgba(15,118,110,.10); }
.filter-chip input {
  appearance: none; width: 16px; height: 16px; margin: 0;
  border: 1.5px solid #b8c6d8; border-radius: 5px; background: #fff;
  display: inline-grid; place-items: center;
}
.filter-chip input::after { content: ""; width: 7px; height: 7px; border-radius: 2px; background: #fff; transform: scale(0); transition: transform .14s ease; }
.filter-chip input:checked { border-color: var(--primary); background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%); box-shadow: 0 4px 10px rgba(15,118,110,.22); }
.filter-chip input:checked::after { transform: scale(1); }
.filter-chip.is-selected { border-color: rgba(15,118,110,.30); background: linear-gradient(180deg, #f0fdf9 0%, #e6f9f3 100%); color: var(--primary-dark); box-shadow: 0 10px 22px rgba(15,118,110,.12); }

/* ── Invoice / payment detail ─────────────────────────── */
.payment-list { display: flex; flex-direction: column; gap: 4px; }
.payment-row {
  display: flex; gap: 10px; align-items: center;
  padding: 4px 8px; border-radius: 6px;
  background: #f0fdf9; font-size: 13px;
}
.payment-date { color: var(--primary-dark); font-weight: 600; white-space: nowrap; }
.payment-amount { color: var(--text); }
.invoices-table td { vertical-align: top; padding-top: 10px; padding-bottom: 10px; }

/* ── Table totals ──────────────────────────────────────── */
.table-total-row td {
  border-top: 2px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.table-total-row td:last-child { color: var(--primary); }

/* ── Integration result ────────────────────────────────── */
.integration-result { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.integration-result.ok    { background: #f0fdf4; color: var(--success); }
.integration-result.error { background: #fef2f2; color: var(--danger); }
.link-strong { color: var(--primary); font-weight: 700; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1100px) {
  .cards-grid, .analytics-grid,
  .status-hero, .status-chip-row,
  .status-filter-footer, .status-filter-grid-top { grid-template-columns: 1fr; }
  .status-hero-actions { justify-items: stretch; }
  .status-filter-actions { justify-content: flex-start; }
  .login-card { max-width: 100%; }
}
.sidebar-mobile-actions { display: none; }

/* ── Hamburger button (hidden on desktop) ───────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform .22s ease, opacity .22s ease, width .22s ease;
}
.hamburger span:nth-child(1) { width: 22px; }
.hamburger span:nth-child(2) { width: 16px; }
.hamburger span:nth-child(3) { width: 22px; }
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); width: 22px; }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); width: 22px; }

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

@media (max-width: 960px) {
  .app-shell-auth {
    display: block;
  }
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: 240px;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform .26s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 24px rgba(0,0,0,.3);
    overflow-y: auto;
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar { display: flex; flex-direction: column; }
  .main-auth { width: 100%; }
  .hamburger { display: flex; }
  .login-card { padding: 30px 22px; }
  .sidebar-mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 14px;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,.1);
  }
  .sidebar-mobile-actions .currency-toggle {
    width: 100%;
    background: rgba(255,255,255,.12);
    border-radius: 20px;
    padding: 3px;
    border: 1px solid rgba(255,255,255,.2);
  }
  .sidebar-mobile-actions .ct-btn {
    color: rgba(255,255,255,.75);
    font-size: 12px;
    flex: 1;
    padding: 5px 0;
  }
  .sidebar-mobile-actions .ct-btn.ct-active {
    background: var(--primary);
    color: #fff;
  }
  .sidebar-mobile-actions .button-secondary {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    color: rgba(255,255,255,.75);
    font-size: 13px;
  }
  .sidebar-mobile-actions .button-secondary:hover {
    background: rgba(255,255,255,.15);
    color: #fff;
  }
}
@media (max-width: 640px) {
  .topbar { height: 54px; padding: 0 14px; gap: 8px; }
  .topbar h1 { font-size: 16px; }
  .topbar .eyebrow { display: none; }
  .topbar-actions > *:not(.topbar-avatar) { display: none; }
  .topbar-avatar { display: flex; }
  .content { padding: 14px 12px; }
  .panel { padding: 14px 14px; }
  .analytics-grid, .cards-grid { grid-template-columns: 1fr; }
  .chart-wrap-lg { height: 220px; }
  .chart-wrap-md { height: 200px; }
  .content { padding: 14px 16px; }
  .data-list div { grid-template-columns: 1fr; }
  .content-guest { padding: 20px; }
  .login-card { padding: 26px 18px; }
}

/* Simple login override */
body.page-guest {
  background: linear-gradient(135deg, #0b4b96 0%, #83add7 100%);
  background-attachment: fixed;
}
body.page-guest::before,
body.page-guest::after {
  display: none;
}
body.page-guest .content-guest {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-shell {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: 100%;
  max-width: 370px;
  padding: 42px 28px 30px;
  background: #ffffff;
  border: none;
  border-radius: 28px;
  box-shadow: 0 18px 42px rgba(14, 23, 38, .16);
  text-align: center;
  display: block;
}
.login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.login-logo-image {
  display: block;
  width: min(220px, 78%);
  height: auto;
  object-fit: contain;
}
.login-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0e2f62;
}
.login-subtitle {
  margin: 0;
  color: #7a8ea8;
  font-size: 13px;
  line-height: 1.55;
}
.login-divider {
  width: 44px;
  margin: 14px auto 22px;
  border: none;
  border-top: 3px solid #2b6ec7;
  border-radius: 999px;
}
.login-alert {
  position: relative;
  text-align: left;
  padding: 12px 14px 12px 20px;
  border-radius: 14px;
  font-size: 13.5px;
  margin-bottom: 16px;
  line-height: 1.5;
  border: 1px solid;
}
.login-form {
  display: grid;
  gap: 14px;
}
.login-field {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 46px;
  border: 1px solid #d1def0;
  border-radius: 999px;
  background: #edf3fb;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.login-field:focus-within {
  border-color: #2b6ec7;
  background: #f7fbff;
  box-shadow: 0 0 0 3px rgba(43, 110, 199, .12);
}
.login-field-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: #2b6ec7;
  pointer-events: none;
}
.login-field-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.login-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: #173154;
  font-size: 14px;
  padding: 12px 54px 12px 42px;
}
.login-input::placeholder {
  color: #8fa5c0;
}
.login-eye {
  position: absolute;
  right: 14px;
  border: none;
  background: transparent;
  color: #7f95b0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.login-btn {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 15px 18px;
  background: linear-gradient(135deg, #0d3f7a 0%, #2d7bd5 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(13, 63, 122, .18);
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}
.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(13, 63, 122, .22);
  opacity: .96;
}
.login-btn:active {
  transform: translateY(0);
}
@media (max-width: 640px) {
  body.page-guest .content-guest {
    padding: 16px;
  }
  .login-card {
    max-width: 100%;
    padding: 36px 22px 26px;
    border-radius: 24px;
  }
  .login-logo-image {
    width: min(190px, 72%);
  }
}
