/* =============================================
   TOKENS GLOBALES
   ============================================= */
:root {
  /* Brand — iguales en ambos temas */
  --red:    oklch(46% 0.26 27);
  --red-2:  oklch(33% 0.22 27);
  --blue:   oklch(52% 0.22 265);
  --blue-2: oklch(46% 0.22 265);
  --green:  oklch(70% 0.18 165);
  --gold:   oklch(74% 0.17 75);
  --cyan:   oklch(72% 0.17 210);

  /* Espaciado */
  --space-1: 4px;  --space-2: 8px;   --space-3: 12px;
  --space-4: 16px; --space-5: 20px;  --space-6: 24px;
  --space-8: 32px;

  /* Forma */
  --radius:    12px;
  --radius-sm: 8px;
  --radius-xs: 5px;
}

/* =============================================
   TEMA OSCURO (por defecto)
   ============================================= */
:root,
[data-theme="dark"] {
  --bg:        oklch(10% 0.025 255);
  --bg-2:      oklch(13% 0.028 255);
  --sidebar:   oklch(8% 0.022 255);
  --panel:     oklch(13% 0.028 255 / 94%);
  --border:    oklch(100% 0 0 / 8%);
  --border-lg: oklch(100% 0 0 / 13%);
  --ink:       oklch(92% 0.02 255);
  --text:      oklch(92% 0.02 255);
  --muted:     oklch(74% 0.04 255 / 82%);
  --soft:      oklch(68% 0.05 255);
  --shadow:    0 1px 3px oklch(0% 0 0 / 30%), 0 8px 32px oklch(0% 0 0 / 35%);
  --shadow-sm: 0 1px 2px oklch(0% 0 0 / 25%), 0 2px 6px oklch(0% 0 0 / 20%);
  --shadow-lg: 0 4px 6px oklch(0% 0 0 / 20%), 0 24px 60px oklch(0% 0 0 / 45%);

  /* Inputs en oscuro */
  --input-bg:     oklch(100% 0 0 / 6%);
  --input-border: oklch(100% 0 0 / 16%);
  --input-text:   oklch(92% 0.02 255);
  --input-focus:  oklch(100% 0 0 / 8%);

  /* Tablas en oscuro */
  --table-head-bg:     oklch(100% 0 0 / 5%);
  --table-head-text:   oklch(70% 0.03 255 / 65%);
  --table-row-border:  oklch(100% 0 0 / 8%);
  --table-hover:       oklch(100% 0 0 / 4%);
  --table-td:          oklch(92% 0.02 255);
  --table-wrap-bg:     oklch(13% 0.028 255);
  --table-wrap-border: oklch(100% 0 0 / 13%);

  /* Alertas en oscuro */
  --alert-success-bg:     oklch(25% 0.08 165);
  --alert-success-color:  oklch(85% 0.12 165);
  --alert-success-border: oklch(35% 0.12 165);
  --alert-danger-bg:      oklch(22% 0.08 15);
  --alert-danger-color:   oklch(80% 0.15 15);
  --alert-danger-border:  oklch(32% 0.12 15);
  --alert-warning-bg:     oklch(25% 0.08 75);
  --alert-warning-color:  oklch(85% 0.12 75);
  --alert-warning-border: oklch(35% 0.1 75);
}

/* =============================================
   TEMA CLARO
   ============================================= */
[data-theme="light"] {
  --bg:        oklch(97% 0.008 255);
  --bg-2:      oklch(93% 0.012 255);
  --sidebar:   oklch(100% 0.004 255);
  --panel:     oklch(100% 0.004 255 / 92%);
  --border:    oklch(0% 0 0 / 7%);
  --border-lg: oklch(0% 0 0 / 12%);
  --ink:       oklch(18% 0.03 255);
  --text:      oklch(18% 0.03 255);
  --muted:     oklch(35% 0.04 255 / 92%);
  --soft:      oklch(38% 0.05 255);
  --shadow:    0 1px 3px oklch(0% 0 0 / 8%), 0 8px 24px oklch(0% 0 0 / 12%);
  --shadow-sm: 0 1px 2px oklch(0% 0 0 / 5%), 0 2px 6px oklch(0% 0 0 / 8%);
  --shadow-lg: 0 4px 6px oklch(0% 0 0 / 8%), 0 24px 60px oklch(0% 0 0 / 18%);

  /* Inputs en claro */
  --input-bg:     oklch(100% 0 0);
  --input-border: oklch(0% 0 0 / 15%);
  --input-text:   oklch(18% 0.03 255);
  --input-focus:  oklch(52% 0.22 265 / 12%);

  /* Tablas en claro */
  --table-head-bg:     oklch(95% 0.01 255);
  --table-head-text:   oklch(45% 0.04 255);
  --table-row-border:  oklch(0% 0 0 / 6%);
  --table-hover:       oklch(95% 0.01 255);
  --table-td:          oklch(18% 0.03 255);
  --table-wrap-bg:     oklch(100% 0.004 255);
  --table-wrap-border: oklch(0% 0 0 / 10%);

  /* Alertas en claro */
  --alert-success-bg:     #ecfdf5;
  --alert-success-color:  #065f46;
  --alert-success-border: #a7f3d0;
  --alert-danger-bg:      #fef2f2;
  --alert-danger-color:   #991b1b;
  --alert-danger-border:  #fecaca;
  --alert-warning-bg:     #fffbeb;
  --alert-warning-color:  #92400e;
  --alert-warning-border: #fde68a;
}

/* =============================================
   TRANSICIÓN DE TEMA
   ============================================= */
html {
  transition: background-color 220ms ease, color 220ms ease;
}

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

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 15% 0%, oklch(50% 0.22 15 / 10%) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 100%, oklch(52% 0.22 265 / 7%) 0%, transparent 55%);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

[data-theme="light"] body {
  background-image:
    radial-gradient(ellipse at 15% 0%, oklch(50% 0.22 15 / 5%) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 100%, oklch(52% 0.22 265 / 4%) 0%, transparent 55%);
}

a {
  color: oklch(72% 0.18 265);
  font-weight: 600;
  text-decoration: none;
}

[data-theme="light"] a {
  color: var(--blue);
}

img { max-width: 100%; }

label {
  display: block;
  margin: 0 0 6px;
  color: var(--soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* =============================================
   INPUTS
   ============================================= */
input, select, textarea {
  width: 100%;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--input-text);
  font: inherit;
  font-size: 14px;
  padding: 10px 13px;
  outline: none;
  transition: border-color 150ms, box-shadow 150ms, background 150ms;
}

textarea { min-height: 96px; resize: vertical; }

input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--input-focus);
}

input:disabled, select:disabled, textarea:disabled {
  opacity: 0.6;
  cursor: default;
}

[data-theme="light"] input:disabled,
[data-theme="light"] select:disabled,
[data-theme="light"] textarea:disabled {
  background: oklch(0% 0 0 / 3%);
  color: var(--muted);
}

/* =============================================
   TABLAS
   ============================================= */
table { width: 100%; min-width: 800px; border-collapse: collapse; }

th {
  background: var(--table-head-bg);
  color: var(--table-head-text);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 11px 18px;
  border-bottom: 1px solid var(--table-row-border);
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--table-row-border);
  color: var(--table-td);
  font-size: 14px;
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--table-hover); }

code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  background: oklch(100% 0 0 / 8%);
  color: var(--muted);
  border-radius: 4px;
  padding: 2px 6px;
}

[data-theme="light"] code {
  background: oklch(0% 0 0 / 6%);
  color: oklch(40% 0.05 255);
}

/* =============================================
   APP SHELL
   ============================================= */

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

/* =============================================
   SIDEBAR
   ============================================= */

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

[data-theme="light"] .sidebar {
  border-right-color: var(--border-lg);
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 20px 16px 18px;
  border-bottom: 1px solid var(--border);
  color: #fff;
  text-align: center;
  flex-shrink: 0;
}

[data-theme="light"] .brand-lockup {
  border-bottom-color: var(--border-lg);
}

.brand-lockup img {
  width: 96px;
  height: 56px;
  object-fit: contain;
}

.brand-lockup span {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

[data-theme="light"] .brand-lockup span {
  color: oklch(18% 0.03 255);
}

.brand-lockup small {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 10px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-list::-webkit-scrollbar { width: 4px; }
.nav-list::-webkit-scrollbar-track { background: transparent; }
.nav-list::-webkit-scrollbar-thumb { background: oklch(100% 0 0 / 12%); border-radius: 4px; }
[data-theme="light"] .nav-list::-webkit-scrollbar-thumb { background: oklch(0% 0 0 / 10%); }

.nav-list a {
  display: flex;
  align-items: center;
  height: 50px;
  border-radius: var(--radius-sm);
  color: oklch(85% 0.06 255 / 85%);
  padding: 0 14px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: transparent;
  border: none;
  transition: background 130ms, color 130ms;
  gap: 10px;
  position: relative;
  white-space: nowrap;
}

.nav-list a:hover {
  color: oklch(92% 0.02 255 / 90%);
  background: oklch(100% 0 0 / 6%);
}

.nav-list a.active {
  color: #fff;
  background: oklch(50% 0.22 15 / 16%);
  font-weight: 600;
}

[data-theme="light"] .nav-list a {
  color: oklch(22% 0.05 255 / 88%);
}

[data-theme="light"] .nav-list a:hover {
  color: oklch(18% 0.03 255);
  background: oklch(0% 0 0 / 5%);
}

[data-theme="light"] .nav-list a.active {
  color: oklch(18% 0.03 255);
  background: oklch(50% 0.22 15 / 10%);
}

.nav-list a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--red);
}

.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 0 5px;
}

.nav-list a.active .nav-badge {
  background: oklch(100% 0 0 / 22%);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 130ms;
}

.nav-icon svg { width: 17px; height: 17px; }

.nav-list a:hover .nav-icon,
.nav-list a.active .nav-icon {
  opacity: 1;
}

.sidebar-bottom {
  flex-shrink: 0;
  padding: 10px 10px 14px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  gap: 10px;
  align-items: center;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: oklch(100% 0 0 / 4%);
  border: 1px solid var(--border);
}

.sidebar-user strong, .sidebar-user small { display: block; }
.sidebar-user strong { font-size: 13px; font-weight: 600; color: #fff; }
.sidebar-user small { color: var(--muted); font-size: 11px; margin-top: 1px; }

[data-theme="light"] .sidebar-user { background: oklch(0% 0 0 / 4%); border-color: var(--border-lg); }
[data-theme="light"] .sidebar-user strong { color: oklch(18% 0.03 255); }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  font-weight: 700;
  font-size: 12px;
  overflow: hidden;
}

.avatar.large {
  width: 64px;
  height: 64px;
  font-size: 22px;
  border-radius: var(--radius);
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* =============================================
   MAIN PANEL
   ============================================= */

.main-panel {
  min-width: 0;
  padding: 0 36px 88px;
}

/* =============================================
   GREETING BAR
   ============================================= */

.greeting-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

.greeting-bar .greeting-text { font-size: 13px; }
.greeting-bar strong { color: var(--gold); font-weight: 700; }
[data-theme="light"] .greeting-bar { color: oklch(25% 0.04 255); }
[data-theme="light"] .greeting-bar strong { color: oklch(40% 0.18 75); }

/* =============================================
   PAGE TITLE
   ============================================= */

.page-title-area { margin-bottom: 30px; }

.page-title-area h1 {
  margin: 0;
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--text);
}

/* =============================================
   EYEBROW
   ============================================= */

.eyebrow {
  margin: 0 0 6px;
  color: oklch(72% 0.17 210);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

[data-theme="light"] .eyebrow { color: oklch(36% 0.18 210); }

/* =============================================
   TOOLBAR / ACTIONS
   ============================================= */

.top-toolbar, .quick-actions, .row-actions, .form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* =============================================
   BUTTONS
   ============================================= */

.date-chip, .icon-btn, .btn {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.date-chip {
  color: var(--muted);
  background: oklch(100% 0 0 / 6%);
  border-color: var(--border);
  cursor: default;
}

[data-theme="light"] .date-chip {
  background: oklch(0% 0 0 / 4%);
  border-color: var(--border-lg);
}

.btn-sm { min-height: 28px; padding: 0 10px; font-size: 12px; border-radius: 5px; }

.btn, .icon-btn {
  transition: transform 130ms ease, opacity 130ms ease, box-shadow 130ms ease;
}

.btn:hover, .icon-btn:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

/* color: #fff con alta especificidad — gana sobre [data-theme] a { color: blue } */
a.btn-primary,
button.btn-primary,
.btn-primary {
  color: #fff !important;
  background: linear-gradient(135deg, var(--red), oklch(42% 0.24 22));
  box-shadow: 0 3px 12px oklch(46% 0.26 27 / 28%), 0 1px 2px oklch(0% 0 0 / 20%);
}

a.btn-primary:hover,
button.btn-primary:hover,
.btn-primary:hover {
  color: #fff !important;
  opacity: 1;
  background: linear-gradient(135deg, oklch(42% 0.26 27), oklch(38% 0.24 22));
  box-shadow: 0 6px 20px oklch(46% 0.26 27 / 38%), 0 1px 4px oklch(0% 0 0 / 25%);
}

a.btn-light,
button.btn-light,
.btn-light {
  color: oklch(14% 0.03 255);
  background: oklch(100% 0 0);
  border-color: oklch(0% 0 0 / 14%);
}

a.btn-light:hover,
button.btn-light:hover,
.btn-light:hover {
  color: oklch(8% 0.02 255);
  opacity: 1;
  background: oklch(96% 0.01 255);
}

.btn-ghost, .icon-btn {
  color: var(--muted);
  background: oklch(100% 0 0 / 6%);
  border-color: var(--border);
}

.btn-ghost:hover, .icon-btn:hover {
  color: var(--text);
  background: oklch(100% 0 0 / 10%);
  opacity: 1;
}

[data-theme="light"] .btn-ghost,
[data-theme="light"] .icon-btn {
  background: oklch(0% 0 0 / 4%);
  border-color: var(--border-lg);
}

[data-theme="light"] .btn-ghost:hover,
[data-theme="light"] .icon-btn:hover {
  background: oklch(0% 0 0 / 8%);
}

/* Focus-visible: accesibilidad teclado */
.btn:focus-visible,
.icon-btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  opacity: 1;
}

.nav-list a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}

[data-theme="light"] .btn:focus-visible,
[data-theme="light"] .icon-btn:focus-visible {
  outline-color: var(--blue-2);
}

.icon-btn { position: relative; }

.icon-btn em {
  position: absolute;
  top: -7px; right: -7px;
  min-width: 18px; height: 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--red);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  box-shadow: 0 0 0 2px var(--bg);
}

.icon-btn.light {
  color: var(--ink);
  background: oklch(100% 0 0);
  border-color: oklch(0% 0 0 / 14%);
}

/* =============================================
   ALERTS
   ============================================= */

.alert {
  margin: 0 0 16px;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
}

.alert-success { color: var(--alert-success-color); background: var(--alert-success-bg); border-color: var(--alert-success-border); }
.alert-danger  { color: var(--alert-danger-color);  background: var(--alert-danger-bg);  border-color: var(--alert-danger-border); }
.alert-warning { color: var(--alert-warning-color); background: var(--alert-warning-bg); border-color: var(--alert-warning-border); }

/* =============================================
   METRIC GRID
   ============================================= */

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card,
.panel,
.chat-panel,
.chat-inbox,
.profile-hero,
.client-hero,
.command-bar {
  border: 1px solid var(--border-lg);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.metric-card { padding: 22px 24px; }

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 10px;
}

.metric-card strong {
  display: block;
  color: var(--text);
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
}

.metric-card.attention {
  background: linear-gradient(135deg, oklch(50% 0.22 15 / 18%), oklch(74% 0.17 75 / 7%));
  border-color: oklch(50% 0.22 15 / 28%);
}

/* =============================================
   CONTENT GRID
   ============================================= */

.content-grid { display: grid; gap: 16px; margin-bottom: 16px; }

.two-col { grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr); }

/* =============================================
   PANELS
   ============================================= */

.panel, .chat-panel, .chat-inbox, .command-bar { padding: 24px; }

.panel.narrow { max-width: 860px; }

.panel h2, .chat-panel h2 {
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.panel p { color: var(--muted); line-height: 1.65; }

.panel-head, .chat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

/* =============================================
   TABLE
   ============================================= */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--table-wrap-border);
  border-radius: var(--radius-sm);
  background: var(--table-wrap-bg);
}

.compact-table table { min-width: 460px; }

/* =============================================
   FORMS
   ============================================= */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.full, .form-actions { grid-column: 1 / -1; }

.check-stack { display: grid; align-content: center; gap: 10px; }

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.check-row input { width: auto; }

/* =============================================
   INLINE FILTERS
   ============================================= */

.inline-filters {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-filters input, .inline-filters select {
  flex: 1 1 200px;
  max-width: 320px;
}

/* =============================================
   FEATURE PANELS
   ============================================= */

.feature-panel {
  background:
    radial-gradient(circle at 88% 0%, oklch(50% 0.22 15 / 20%), transparent 38%),
    linear-gradient(135deg, oklch(52% 0.22 265 / 16%), oklch(10% 0.025 255 / 96%));
}

[data-theme="light"] .feature-panel {
  background:
    radial-gradient(circle at 88% 0%, oklch(50% 0.22 15 / 10%), transparent 38%),
    linear-gradient(135deg, oklch(52% 0.22 265 / 8%), oklch(96% 0.01 255 / 95%));
  color: var(--text);
}

.feature-panel h2 { font-size: clamp(20px, 2.5vw, 32px); }

.accent-panel { background: linear-gradient(135deg, var(--red), var(--blue-2)); }
.accent-panel strong { display: block; margin-top: 10px; color: #fff; font-size: 30px; }

/* =============================================
   STATUS PILLS
   ============================================= */

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #065f46;
  background: #d1fae5;
}

.status-pill.active, .status-pill.completed, .status-pill.confirmed { color: #065f46; background: #d1fae5; }
.status-pill.invited, .status-pill.pending   { color: #92400e; background: #fef3c7; }
.status-pill.cancelled, .status-pill.suspended, .status-pill.voided, .status-pill.refunded { color: #991b1b; background: #fee2e2; }
.status-pill.archived { color: #374151; background: #f3f4f6; }

/* =============================================
   MISC
   ============================================= */

.link-button {
  border: 0;
  padding: 0;
  color: oklch(72% 0.18 265);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}

.inline-form { display: inline; }

/* =============================================
   PROGRESS BARS
   ============================================= */

.progress-block { display: grid; gap: 8px; margin-bottom: 18px; }

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: oklch(90% 0.04 255 / 90%);
  font-size: 13px;
  font-weight: 600;
}

[data-theme="light"] .progress-label { color: var(--muted); }

.progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: oklch(100% 0 0 / 10%);
}

[data-theme="light"] .progress-track { background: oklch(0% 0 0 / 8%); }

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--gold));
  transition: width 700ms cubic-bezier(.4,0,.2,1);
}

.progress-track.travel span { background: linear-gradient(90deg, var(--blue), var(--cyan)); }

/* =============================================
   CIRCULAR RINGS
   ============================================= */

.progress-ring {
  position: relative;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: conic-gradient(
    var(--green) calc(var(--ring-pct,0) * 1%),
    oklch(100% 0 0 / 8%) 0%
  );
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

[data-theme="light"] .progress-ring {
  background: conic-gradient(
    var(--green) calc(var(--ring-pct,0) * 1%),
    oklch(0% 0 0 / 10%) 0%
  );
}

.progress-ring::after {
  content: '';
  position: absolute;
  width: 74px; height: 74px;
  border-radius: 50%;
  background: var(--bg-2);
}

.progress-ring > span {
  position: relative; z-index: 1;
  color: var(--text); font-weight: 800; font-size: 18px;
  text-align: center; line-height: 1.1;
}

.progress-ring > small {
  position: relative; z-index: 1;
  color: var(--soft); font-size: 9px; font-weight: 700;
  text-transform: uppercase; text-align: center;
  margin-top: 2px; letter-spacing: 0.05em;
}

/* =============================================
   PHASE HEADERS
   ============================================= */

.phase-header {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--border-lg);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(18px);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.phase-header-left { display: flex; gap: 16px; align-items: flex-start; }

.phase-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.phase-icon.red { background: linear-gradient(135deg, var(--red), var(--red-2)); }
.phase-icon.gold { background: linear-gradient(135deg, var(--gold), oklch(60% 0.14 75)); color: var(--ink); }

.phase-header-meta h2 { margin: 0 0 4px; color: var(--text); font-size: 20px; font-weight: 700; }
.phase-header-meta p { margin: 0; color: var(--muted); font-size: 13px; }

.phase-summary-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  background: oklch(100% 0 0 / 4%);
  min-width: 180px;
}

.phase-summary-card p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.phase-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
}

.phase-summary-row span { color: var(--muted); }
.phase-summary-row strong { color: var(--text); }

/* =============================================
   STEP ROWS
   ============================================= */

.step-section {
  border: 1px solid var(--border-lg);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(18px);
  margin-bottom: 12px;
  overflow: hidden;
}

.step-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.step-section-head h3 { margin: 0; color: var(--text); font-size: 14px; font-weight: 700; }
.step-count { color: var(--muted); font-size: 12px; font-weight: 600; }
.step-count.done { color: var(--green); }

.step-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--table-row-border);
  background: var(--table-wrap-bg);
  color: var(--table-td);
  transition: background 110ms;
}

.step-row:last-child { border-bottom: none; }
.step-row:hover { background: var(--table-hover); }

.step-icon {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.step-icon.blue  { background: var(--blue); }
.step-icon.red   { background: var(--red); }
.step-icon.green { background: var(--green); color: var(--ink); }
.step-icon.gold  { background: var(--gold); color: var(--ink); }
.step-icon.cyan  { background: var(--cyan); color: var(--ink); }
.step-icon.dark  { background: oklch(28% 0.04 255); }

.step-content { flex: 1; min-width: 0; }
.step-content strong { display: block; font-size: 13px; font-weight: 600; }
.step-content small { display: block; color: var(--table-head-text); font-size: 12px; margin-top: 2px; }
.step-date { color: var(--muted); font-size: 11px; white-space: nowrap; flex-shrink: 0; }

/* =============================================
   CALLOUT / ACCESS BOX
   ============================================= */

.callout, .access-box {
  border-radius: var(--radius-sm);
  background: oklch(100% 0 0 / 5%);
  border: 1px solid var(--border-lg);
  padding: 14px 16px;
}

/* =============================================
   HERO SECTIONS
   ============================================= */

.profile-hero, .client-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding: 22px 24px;
}

.profile-hero { justify-content: flex-start; }

.client-hero {
  background:
    radial-gradient(circle at 75% -15%, oklch(50% 0.22 15 / 32%), transparent 42%),
    linear-gradient(135deg, oklch(52% 0.22 265 / 26%), oklch(8% 0.022 255 / 96%));
}

.hero-balance {
  min-width: 200px;
  border-radius: var(--radius-sm);
  background: oklch(100% 0 0 / 9%);
  padding: 14px 18px;
  text-align: right;
}

.hero-balance span, .hero-balance strong { display: block; }
.hero-balance strong { margin-top: 4px; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }

/* =============================================
   BOTTOM STATS BAR
   ============================================= */

.bottom-stats-bar {
  position: fixed;
  left: 260px; right: 0; bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 11px 36px;
  background: oklch(9% 0.025 255 / 98%);
  border-top: 1px solid oklch(100% 0 0 / 12%);
  backdrop-filter: blur(20px);
  box-shadow: 0 -2px 20px oklch(0% 0 0 / 40%);
}

.stats-ring-group { display: flex; align-items: center; gap: 12px; }

.mini-ring {
  position: relative;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: conic-gradient(
    var(--green) calc(var(--ring-pct,0) * 1%),
    oklch(100% 0 0 / 8%) 0%
  );
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.mini-ring::after {
  content: '';
  position: absolute;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg);
}

.mini-ring span { position: relative; z-index: 1; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: -0.02em; }

.mini-ring-label { display: grid; gap: 2px; }
.mini-ring-label strong { display: block; color: oklch(94% 0.02 255); font-size: 12px; font-weight: 700; }
.mini-ring-label small { display: block; color: oklch(76% 0.03 255 / 80%); font-size: 11px; }

.stats-divider { width: 1px; height: 28px; background: oklch(100% 0 0 / 10%); flex-shrink: 0; }

.bottom-stats-bar .motivational {
  margin-left: auto;
  text-align: right;
  font-size: 11.5px;
  font-style: italic;
  color: oklch(72% 0.04 255 / 75%);
}

.bottom-stats-bar .motivational strong {
  display: block;
  color: oklch(80% 0.18 75);
  font-style: normal;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* =============================================
   CHAT - FULL PAGE
   ============================================= */

.chat-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  min-height: 640px;
}

.chat-layout.single { grid-template-columns: minmax(0, 900px); }

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;
}

.thread-list {
  display: grid;
  gap: 6px;
  max-height: 540px;
  overflow-y: auto;
}

.thread-list.compact { max-height: none; gap: 4px; }

.thread-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border-lg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  background: oklch(100% 0 0 / 4%);
  transition: background 130ms, border-color 130ms;
}

.thread-row.active, .thread-row:hover {
  background: oklch(50% 0.22 15 / 14%);
  border-color: oklch(50% 0.22 15 / 28%);
}

.thread-row strong, .thread-row small { display: block; }
.thread-row small { color: var(--muted); font-weight: 500; font-size: 12px; margin-top: 2px; }

.thread-row em, .floating-thread-tabs em {
  min-width: 20px; height: 20px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: var(--red);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.message-list, .floating-messages {
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 8px 4px 16px;
}

.message {
  width: min(76%, 660px);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.message small {
  display: block;
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  margin-bottom: 4px;
}

.message p { margin: 0; color: inherit; font-size: 14px; line-height: 1.5; }
.message.incoming { color: var(--ink); background: oklch(93% 0.02 255); }
.message.outgoing {
  justify-self: end;
  color: #fff;
  background: linear-gradient(135deg, var(--blue-2), var(--red-2));
}
.message.outgoing small { color: oklch(100% 0 0 / 60%); }

.chat-form, .floating-chat-form {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.chat-form textarea, .floating-chat-form textarea {
  min-height: 52px;
  max-height: 130px;
}

/* =============================================
   FLOATING CHAT WIDGET
   ============================================= */

.floating-chat {
  position: fixed;
  right: 24px; bottom: 24px;
  z-index: 80;
  width: min(420px, calc(100vw - 28px));
  max-height: min(700px, calc(100vh - 40px));
  display: none;
  grid-template-rows: auto auto minmax(160px,1fr) auto auto;
  border: 1px solid oklch(100% 0 0 / 14%);
  border-radius: 14px;
  background: oklch(8% 0.022 255 / 98%);
  box-shadow: 0 24px 80px oklch(0% 0 0 / 55%);
  padding: 16px;
}

.floating-chat.is-open { display: grid; }

.floating-chat-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.floating-chat-head h2 { margin: 0; color: var(--text); font-size: 18px; font-weight: 700; }

.floating-thread-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.floating-thread-tabs a {
  white-space: nowrap;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: oklch(100% 0 0 / 5%);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
}

.floating-thread-tabs a.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.floating-chat-link { margin-top: 10px; text-align: center; font-size: 12px; }

/* =============================================
   ACCESS LINK BOX
   ============================================= */

.access-link-box {
  border: 1px solid oklch(52% 0.22 265 / 35%);
  border-radius: var(--radius-sm);
  background: oklch(52% 0.22 265 / 8%);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.access-link-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: oklch(72% 0.18 265);
  margin: 0 0 8px;
}

.access-link-row {
  display: flex;
  gap: 8px;
}

.access-link-row input {
  flex: 1;
  font-size: 12px;
  background: oklch(100% 0 0 / 6%);
  border-color: oklch(100% 0 0 / 15%);
  color: var(--text);
  cursor: text;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* =============================================
   COLLAPSIBLE EDIT PANELS
   ============================================= */

.edit-panel { overflow: hidden; padding: 0; }

.edit-panel-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.edit-panel-trigger::-webkit-details-marker { display: none; }

.edit-panel-trigger h2 { color: var(--text); font-size: 20px; font-weight: 700; margin: 0; }

.edit-panel-trigger:hover { background: oklch(100% 0 0 / 3%); }

.chevron {
  width: 20px;
  height: 20px;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 220ms ease;
}

details[open] .chevron { transform: rotate(180deg); }

details[open] .edit-panel-trigger {
  border-bottom: 1px solid var(--border);
}

.edit-panel-body { padding: 24px; }

/* =============================================
   EMPTY STATES
   ============================================= */

.empty, .empty-state { color: var(--muted); font-size: 13px; padding: 10px 0; }

/* =============================================
   AUTH PAGES
   ============================================= */

.auth-page { background: var(--bg); }
.auth-page .app-shell { display: block; }
.auth-page .main-panel { max-width: none; padding: 0; }

.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.55fr);
}

.auth-visual {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(28px, 7vw, 72px);
  background:
    radial-gradient(circle at 66% 6%, oklch(50% 0.22 15 / 38%), transparent 24%),
    url("../img/oficial-logo.png") center 18% / min(440px, 70vw) no-repeat,
    linear-gradient(135deg, oklch(10% 0.025 255), oklch(13% 0.028 255));
}

.auth-visual img { width: 130px; margin-bottom: auto; }

.auth-visual p { max-width: 600px; color: var(--muted); font-size: 17px; line-height: 1.65; }

.auth-visual h1 {
  max-width: 800px;
  font-size: clamp(40px, 7vw, 80px);
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.auth-card {
  align-self: center;
  width: min(420px, calc(100% - 32px));
  margin: 28px auto;
  border: 1px solid var(--border-lg);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}

[data-theme="light"] .auth-card {
  background: #ffffff;
  border-color: oklch(0% 0 0 / 18%);
  color: oklch(18% 0.03 255);
  box-shadow: 0 2px 8px oklch(0% 0 0 / 10%), 0 24px 60px oklch(0% 0 0 / 14%);
}

.auth-card h2 {
  color: var(--text);
  margin-bottom: 24px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

[data-theme="light"] .auth-card h2 {
  color: oklch(18% 0.03 255);
}

.auth-card .eyebrow { color: var(--blue); }
.auth-card label { margin-top: 16px; color: var(--table-head-text); }
.auth-card .btn { width: 100%; margin-top: 20px; min-height: 44px; font-size: 15px; }

.fine-print { margin: 14px 0 0; color: var(--muted); font-size: 13px; }

/* =============================================
   INVOICE
   ============================================= */

.invoice-screen { color: var(--ink); background: oklch(94% 0.012 255); padding: 24px; }

.invoice-document {
  position: relative;
  overflow: hidden;
  max-width: 940px;
  margin: 0 auto;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 4px 28px oklch(0% 0 0 / 10%);
  padding: 44px;
}

.watermark-logo {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 60%;
  max-width: 540px;
  opacity: 0.065;
  transform: translate(-50%, -50%) rotate(-18deg);
  pointer-events: none;
}

.invoice-top {
  position: relative; z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 2px solid #111827;
}

.invoice-top img { width: 110px; height: 68px; object-fit: contain; object-position: left center; }
.invoice-top h1 { margin: 8px 0 0; color: #111827; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.invoice-top p, .invoice-numbers span, .invoice-footer { color: #64748b; }

.invoice-numbers { display: grid; align-content: start; gap: 5px; text-align: right; }
.invoice-numbers strong { color: var(--red); font-size: 22px; font-weight: 800; }

.invoice-grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.invoice-grid article, .invoice-note {
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 16px;
}

.invoice-grid h2, .invoice-note h2 {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
}

.invoice-grid p, .invoice-note p { margin: 4px 0; font-size: 14px; }

.invoice-table, .invoice-summary, .invoice-note, .invoice-footer {
  position: relative; z-index: 1;
}

.invoice-table table { min-width: 0; }
.right { text-align: right; }

.invoice-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.invoice-summary div { border-radius: var(--radius-sm); padding: 14px 16px; background: #f8fafc; }
.invoice-summary span, .invoice-summary strong { display: block; }
.invoice-summary span { color: #64748b; font-weight: 600; font-size: 12px; }
.invoice-summary strong { color: #111827; margin-top: 6px; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }

.invoice-footer { margin-top: 30px; font-size: 13px; }
.invoice-footer div { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 44px; }
.invoice-footer span { border-top: 1px solid #cbd5e1; padding-top: 8px; text-align: center; font-weight: 600; }

.invoice-actions {
  max-width: 940px;
  margin: 16px auto 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* =============================================
   THEME TOGGLE
   ============================================= */
.theme-toggle .theme-icon-dark { display: flex !important; align-items: center; }
.theme-toggle .theme-icon-light { display: none !important; }

[data-theme="light"] .theme-toggle .theme-icon-dark { display: none !important; }
[data-theme="light"] .theme-toggle .theme-icon-light { display: flex !important; align-items: center; }

/* =============================================
   LANG TOGGLE
   ============================================= */
.lang-toggle { gap: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; padding: 0 10px; }
.lang-toggle .lang-es,
.lang-toggle .lang-en { line-height: 1; }
/* En ES (default): mostrar ES activo, EN tenue */
.lang-toggle .lang-es { color: var(--text); }
.lang-toggle .lang-en { color: var(--muted); font-weight: 500; }
/* Separador entre los dos */
.lang-toggle .lang-es::after { content: '/'; color: var(--muted); margin: 0 2px; font-weight: 400; }

/* En EN: invertir */
[data-lang="en"] .lang-toggle .lang-es { color: var(--muted); font-weight: 500; }
[data-lang="en"] .lang-toggle .lang-en { color: var(--text); font-weight: 700; }

/* Etiquetas bilingues de navegacion y UI */
.l-en { display: none; }
[data-lang="en"] .l-es { display: none; }
[data-lang="en"] .l-en { display: inline; }

/* =============================================
   PROFILE CONTACTS ROW
   ============================================= */
.profile-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 6px;
}
.profile-contacts span {
  font-size: 13px;
  color: var(--muted);
}
.profile-contacts span::before {
  content: '';
}

/* =============================================
   PROFILE CARD
   ============================================= */
.profile-card-wrap { margin-bottom: 16px; }

.profile-card { padding: 0; overflow: hidden; }

.profile-card-head {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.profile-card-identity { flex: 1; min-width: 0; }
.profile-card-identity h2 { font-size: 22px; font-weight: 800; margin: 4px 0 0; }
.profile-card-actions {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-shrink: 0;
}

.profile-card-body {
  padding: 0 24px 20px;
  border-bottom: 1px solid var(--border);
}

.profile-card-gauge {
  padding: 4px 24px 20px;
}

/* =============================================
   TRAVEL PROFILE CARD
   ============================================= */
.profile-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 20px;
  margin-top: 16px;
}
.profile-info-item { display: flex; flex-direction: column; gap: 2px; }
.profile-info-item span { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.profile-info-item strong { font-size: 14px; font-weight: 600; color: var(--text); }
.profile-info-item.full { grid-column: 1 / -1; }

.profile-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 20px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* =============================================
   FUEL GAUGE (barra de combustible de pagos)
   ============================================= */
.fuel-gauge-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 0 8px;
}
.fuel-gauge-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.fuel-gauge-label span { font-size: 12px; color: var(--muted); }
.fuel-gauge-label strong { font-size: 22px; font-weight: 800; color: var(--text); }
.fuel-gauge-label small { font-size: 12px; color: var(--muted); }

.fuel-gauge-track {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}
.fuel-gauge-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), oklch(72% 0.17 210));
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
  min-width: 4px;
}
.fuel-gauge-fill.warning { background: linear-gradient(90deg, oklch(74% 0.17 75), oklch(68% 0.2 50)); }
.fuel-gauge-fill.danger  { background: linear-gradient(90deg, var(--red), oklch(55% 0.22 15)); }

.fuel-gauge-ticks {
  display: flex;
  justify-content: space-between;
  padding: 4px 2px 0;
}
.fuel-gauge-ticks span { font-size: 10px; color: var(--muted); }

.payment-history-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.payment-bar-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: center;
  gap: 10px;
}
.payment-bar-row span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.payment-bar-row strong { font-size: 12px; font-weight: 600; color: var(--text); text-align: right; white-space: nowrap; }
.payment-bar-bg { background: var(--input-bg); border-radius: 999px; height: 6px; overflow: hidden; }
.payment-bar-bg .payment-bar-fill { height: 100%; border-radius: 999px; background: var(--green); }

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 1120px) {
  .app-shell, .two-col, .auth-wrap, .chat-layout, .chat-layout.single {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 10px 12px;
  }

  .sidebar .nav-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0;
    overflow: visible;
    margin-top: 8px;
    gap: 4px;
  }

  .sidebar .nav-list a { flex: 0 0 auto; height: 36px; }
  .sidebar .nav-list a.active::before { display: none; }

  .sidebar-bottom {
    padding: 6px 0;
    border-top: none;
    border-left: 1px solid var(--border);
    margin-left: auto;
    padding-left: 10px;
  }

  .bottom-stats-bar { left: 0; }

  .metric-grid { grid-template-columns: repeat(2, 1fr); }

  .auth-visual { display: none; }
}

@media (max-width: 768px) {
  .main-panel { padding: 0 16px 72px; }

  .greeting-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 0;
    margin-bottom: 18px;
  }

  .top-toolbar { flex-wrap: wrap; gap: 6px; }

  /* Touch targets: mínimo 44px en móvil */
  .date-chip, .icon-btn, .btn { min-height: 44px; }

  .page-title-area h1 { font-size: clamp(24px, 6vw, 36px); }

  .sidebar .brand-lockup { display: none; }

  .metric-grid { grid-template-columns: 1fr; }
}

@media print {
  body { background: #fff; color: #000; }
  .sidebar, .invoice-actions, .bottom-stats-bar,
  .greeting-bar, .page-title-area, .command-bar { display: none !important; }
  .app-shell { display: block; }
  .main-panel { padding: 0; }
  .invoice-screen { background: none; padding: 0; }
  .invoice-document { box-shadow: none; }
}
