/* ==========================================================================
   ST Manager · Sistema de Servicio Técnico
   Hoja de estilos única (sin dependencias externas, apta para uso offline/VPN)
   ========================================================================== */

:root {
  --navy-950: #060b14;
  --navy-900: #0b1220;
  --navy-800: #131c2f;
  --navy-700: #1c2740;
  --brand-50: #eff6ff;
  --brand-100: #dbeafe;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;
  --teal-400: #2dd4bf;
  --teal-500: #14b8a6;
  --teal-600: #0d9488;

  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;

  --green-50: #ecfdf5;
  --green-600: #059669;
  --amber-50: #fffbeb;
  --amber-600: #d97706;
  --red-50: #fef2f2;
  --red-600: #dc2626;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 30px -12px rgba(15, 23, 42, 0.25);
  --shadow-lg: 0 30px 60px -20px rgba(15, 23, 42, 0.35);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body, #root { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }

::selection { background: var(--brand-100); }

/* ------------------------------- estructura ------------------------------- */

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 14px 14px;
  background: radial-gradient(1200px 500px at 0% 0%, #16233c 0%, var(--navy-900) 45%, var(--navy-950) 100%);
  color: #cbd5e1;
  overflow-y: auto;
  z-index: 30;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--teal-500), var(--brand-600));
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 16px;
  box-shadow: 0 6px 18px -6px rgba(20, 184, 166, 0.8);
}
.brand-name { color: #fff; font-weight: 700; font-size: 15px; line-height: 1.15; }
.brand-sub { color: #7c8ba5; font-size: 11.5px; letter-spacing: 0.04em; text-transform: uppercase; }

.nav-group { margin-top: 12px; }
.nav-group-title {
  padding: 0 10px 6px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
  font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  color: #c3ccdb;
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-item:hover { background: rgba(148, 163, 184, 0.12); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(37, 99, 235, 0.35), rgba(20, 184, 166, 0.16)); color: #fff; box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.35); }
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: 0.9; }
.nav-badge {
  margin-left: auto; background: rgba(239, 68, 68, 0.9); color: #fff;
  border-radius: 999px; font-size: 10.5px; padding: 1px 7px; font-weight: 700;
}
.sidebar-footer { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(148, 163, 184, 0.16); font-size: 11.5px; color: #64748b; }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  height: 62px; padding: 0 24px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { font-weight: 650; font-size: 15px; }
.topbar-spacer { flex: 1; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--text-2);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); }

.content { padding: 22px 26px 70px; width: 100%; max-width: 1560px; margin: 0 auto; }
.page-header { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-header .title-block { flex: 1; min-width: 240px; }
.page-header h1 { font-size: 22px; }
.page-sub { color: var(--muted); margin-top: 3px; font-size: 13px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* --------------------------------- tarjetas -------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.card-pad { padding: 18px; }
.card-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.card-header h2, .card-header h3 { font-size: 14.5px; }
.card-header .sub { color: var(--muted); font-size: 12px; }
.card-body { padding: 18px; }
.card-footer { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow-xs); position: relative; overflow: hidden; }
.kpi::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: linear-gradient(180deg, var(--brand-500), var(--teal-500)); opacity: 0.9; }
.kpi-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 650; }
.kpi-value { font-size: 24px; font-weight: 720; letter-spacing: -0.02em; margin-top: 6px; }
.kpi-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi-hint.positive { color: var(--green-600); }
.kpi-hint.negative { color: var(--red-600); }

/* --------------------------------- botones -------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border-radius: 9px; border: 1px solid transparent;
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand-600); color: #fff; box-shadow: 0 1px 2px rgba(37, 99, 235, 0.4); }
.btn-primary:hover:not(:disabled) { background: var(--brand-700); }
.btn-accent { background: var(--teal-600); color: #fff; }
.btn-accent:hover:not(:disabled) { background: #0f766e; }
.btn-secondary { background: #fff; border-color: var(--border-strong); color: var(--text-2); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); }
.btn-danger { background: var(--red-50); color: var(--red-600); border-color: #fecaca; }
.btn-danger:hover:not(:disabled) { background: #fee2e2; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.btn-icon:hover { background: var(--surface-3); color: var(--text); }

/* ---------------------------------- forms --------------------------------- */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .label { font-size: 12.5px; font-weight: 620; color: var(--text-2); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.field .error-text { font-size: 11.5px; color: var(--red-600); }
.req { color: var(--red-600); }

.input, .select, .textarea {
  width: 100%;
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}
.input:disabled, .select:disabled { background: var(--surface-3); color: var(--muted); }
.textarea { min-height: 84px; resize: vertical; }
.input.sm { min-height: 30px; padding: 5px 8px; font-size: 12.5px; }
.input-group { display: flex; gap: 8px; align-items: center; }
.input-group .input { flex: 1; }

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

.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--brand-600); }

.search-box { position: relative; display: flex; align-items: center; }
.search-box svg { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--muted-2); pointer-events: none; }
.search-box .input { padding-left: 34px; }

/* --------------------------------- badges --------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; line-height: 1.7;
  white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-slate { background: #f1f5f9; color: #475569; }
.badge-sky { background: #e0f2fe; color: #0369a1; }
.badge-violet { background: #ede9fe; color: #6d28d9; }
.badge-amber { background: #fef3c7; color: #b45309; }
.badge-teal { background: #ccfbf1; color: #0f766e; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-emerald { background: #d1fae5; color: #047857; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-rose { background: #ffe4e6; color: #be123c; }
.badge-gray { background: #f3f4f6; color: #4b5563; }
.badge-fuchsia { background: #fae8ff; color: #a21caf; }
.badge-neutral { background: var(--surface-3); color: var(--muted); }

/* --------------------------------- tablas --------------------------------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th {
  text-align: left; padding: 10px 14px;
  font-size: 10.8px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 700;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fafbfe; }
.table tbody tr.clickable { cursor: pointer; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .strong { font-weight: 620; }
.table .muted { color: var(--muted); }
.table-compact td { padding: 7px 10px; }
.table-compact th { padding: 8px 10px; }

.row-actions { display: flex; gap: 4px; justify-content: flex-end; }

.empty {
  padding: 42px 20px; text-align: center; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.empty svg { width: 34px; height: 34px; color: var(--muted-2); }
.empty strong { color: var(--text-2); font-size: 14px; }

.pagination { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.pagination .spacer { flex: 1; }

/* -------------------------------- filtros --------------------------------- */

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.toolbar .search-box { min-width: 240px; flex: 1; max-width: 420px; }
.toolbar .select { width: auto; min-width: 150px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 16px; }
.chip {
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: #fff; font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer;
}
.chip:hover { background: var(--surface-2); }
.chip.active { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }

/* ---------------------------------- tabs ---------------------------------- */

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab {
  padding: 10px 14px; font-size: 13.5px; font-weight: 620; color: var(--muted);
  border: none; background: transparent; cursor: pointer; border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand-700); border-bottom-color: var(--brand-600); }
.tab .count { margin-left: 5px; background: var(--surface-3); border-radius: 999px; padding: 1px 7px; font-size: 11px; }

/* --------------------------------- modal ---------------------------------- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  display: grid; place-items: center;
  padding: 20px;
  animation: fadeIn 0.12s ease;
}
.modal {
  width: min(680px, 100%); max-height: min(88vh, 900px);
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: pop 0.14s ease;
}
.modal.wide { width: min(980px, 100%); }
.modal.slim { width: min(460px, 100%); }
.modal-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 15.5px; flex: 1; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.drawer-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.35); z-index: 55; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 56;
  width: min(440px, 100%); background: #fff; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
}
.drawer-header { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.drawer-body { padding: 18px; overflow-y: auto; flex: 1; }
.drawer-footer { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.99); } to { opacity: 1; transform: none; } }

/* --------------------------------- toasts --------------------------------- */

.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 36px)); }
.toast {
  background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--brand-600);
  border-radius: 10px; padding: 11px 14px; box-shadow: var(--shadow-md);
  font-size: 13px; color: var(--text-2); animation: pop 0.15s ease;
}
.toast.success { border-left-color: var(--green-600); }
.toast.error { border-left-color: var(--red-600); }
.toast.info { border-left-color: var(--brand-600); }
.toast .toast-title { font-weight: 650; color: var(--text); margin-bottom: 2px; }

/* -------------------------------- timeline -------------------------------- */

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 22px; border-left: 2px solid var(--border); margin-left: 6px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ''; position: absolute; left: -6px; top: 2px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand-500); box-shadow: 0 0 0 3px #fff;
}
.timeline .when { font-size: 11.5px; color: var(--muted); }
.timeline .what { font-weight: 620; font-size: 13px; margin-top: 1px; }
.timeline .note { font-size: 12.5px; color: var(--muted); }

/* --------------------------------- varias --------------------------------- */

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-sidebar { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.strong { font-weight: 650; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 26px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-weight: 700; font-size: 12.5px; color: var(--text-2); flex: none; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-3); font-size: 12px; color: var(--text-2); }
.money { font-variant-numeric: tabular-nums; }
.money-lg { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.text-right { text-align: right; }
.link-quiet { color: inherit; text-decoration: none; }
.link-quiet:hover { text-decoration: none; color: var(--brand-700); }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--brand-600); animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-panel { padding: 40px; display: grid; place-items: center; }
.alert { padding: 11px 14px; border-radius: 10px; font-size: 13px; border: 1px solid; }
.alert-error { background: var(--red-50); border-color: #fecaca; color: #991b1b; }
.alert-warn { background: var(--amber-50); border-color: #fde68a; color: #92400e; }
.alert-info { background: var(--brand-50); border-color: var(--brand-100); color: #1e40af; }
.alert-success { background: var(--green-50); border-color: #a7f3d0; color: #065f46; }

/* --------------------------------- login ---------------------------------- */

.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
  background: var(--navy-950);
}
.auth-art {
  position: relative; padding: 48px;
  background: radial-gradient(900px 600px at 20% 10%, #1e3a8a 0%, transparent 60%),
              radial-gradient(700px 500px at 80% 80%, #0f766e 0%, transparent 60%),
              var(--navy-950);
  color: #e2e8f0; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-art h1 { font-size: 34px; line-height: 1.15; letter-spacing: -0.02em; max-width: 460px; }
.auth-art p { color: #94a3b8; max-width: 420px; margin-top: 14px; }
.auth-features { display: grid; gap: 10px; margin-top: 28px; }
.auth-feature { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: #cbd5e1; }
.auth-feature svg { width: 18px; height: 18px; color: var(--teal-400); flex: none; margin-top: 1px; }
.auth-panel { background: #fff; display: grid; place-items: center; padding: 32px; }
.auth-box { width: min(380px, 100%); }
.auth-box h2 { font-size: 24px; margin-bottom: 6px; }
.auth-box .sub { color: var(--muted); margin-bottom: 24px; }
.login-error { margin-bottom: 14px; }

/* ------------------------------- dashboard -------------------------------- */

.chart-card { padding: 16px 18px; }
.chart-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.chart-head h3 { font-size: 14px; }
.chart-head .legend { margin-left: auto; display: flex; gap: 12px; font-size: 11.5px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 8px; height: 8px; border-radius: 3px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; height: 100%; }
.bar { background: linear-gradient(180deg, var(--brand-500), var(--brand-600)); border-radius: 4px 4px 2px 2px; min-height: 2px; }
.bar.alt { background: linear-gradient(180deg, var(--teal-400), var(--teal-600)); }
.bar-label { font-size: 9.5px; color: var(--muted-2); text-align: center; white-space: nowrap; }

/* --------------------------------- kanban --------------------------------- */

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.board-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 160px; }
.board-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.board-card { background: #fff; border: 1px solid var(--border); border-radius: 9px; padding: 9px 10px; margin-bottom: 8px; box-shadow: var(--shadow-xs); cursor: pointer; }
.board-card:hover { border-color: var(--brand-500); }
.board-card .num { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.board-card .title { font-size: 12.5px; font-weight: 620; margin-top: 2px; }

/* ------------------------------ seguimiento ------------------------------- */

.track-page { min-height: 100vh; background: var(--bg); padding: 30px 16px 60px; }
.track-wrap { max-width: 720px; margin: 0 auto; }
.track-hero { background: radial-gradient(700px 300px at 20% 0%, #1e3a8a, var(--navy-950)); color: #fff; border-radius: var(--radius-lg); padding: 26px; margin-bottom: 16px; }
.track-hero h1 { font-size: 22px; }
.track-steps { display: flex; gap: 4px; margin-top: 18px; }
.track-step { flex: 1; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); }
.track-step.done { background: var(--teal-400); }
.track-step.current { background: var(--brand-500); box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35); }

/* ------------------------------ responsive -------------------------------- */

@media (max-width: 1080px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-104%); transition: transform 0.18s ease; width: 264px; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); z-index: 29; }
  .content { padding: 16px 14px 60px; }
  .topbar { padding: 0 14px; }
  .grid-2, .grid-3, .grid-sidebar { grid-template-columns: minmax(0, 1fr); }
  .form-grid, .form-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: auto; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
}

@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-value { font-size: 19px; }
  .page-header h1 { font-size: 19px; }
  .toolbar { padding: 10px; }
  .table th, .table td { padding: 9px 10px; }
}

@media print {
  .sidebar, .topbar, .page-actions, .no-print, .toolbar { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #cbd5e1; break-inside: avoid; }
}

/* --------------------------- comprobante A4 (2 copias) --------------------- */

.print-page {
  min-height: 100vh;
  background: #e8edf6;
  padding: 18px 12px 42px;
}
.print-toolbar {
  max-width: 210mm;
  margin: 0 auto 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.a4-sheet {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  background: #fff;
  color: #0f172a;
  padding: 6mm 8mm;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px -24px rgba(15, 23, 42, 0.4);
}
.receipt-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  font-size: 8.4pt;
  line-height: 1.32;
  break-inside: avoid;
}
.receipt-head {
  display: flex;
  justify-content: space-between;
  gap: 6mm;
  border-bottom: 1.2pt solid #0b1220;
  padding-bottom: 1.5mm;
}
.receipt-brand { font-size: 11pt; font-weight: 800; letter-spacing: -0.01em; }
.receipt-muted { font-size: 7.1pt; color: #475569; line-height: 1.35; }
.receipt-copy-tag {
  font-size: 6.4pt;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 800;
  color: #0f766e;
}
.receipt-title { text-align: right; }
.receipt-number { font-size: 11pt; font-weight: 800; font-family: var(--mono); }
.receipt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8mm 5mm;
  margin-top: 1.5mm;
}
.receipt-field { display: flex; gap: 2mm; margin: 0; font-size: 7.8pt; }
.receipt-field dt { color: #64748b; min-width: 17mm; margin: 0; }
.receipt-field dd { margin: 0; font-weight: 600; }
.receipt-block {
  border: 0.6pt solid #cbd5e1;
  border-radius: 1.2mm;
  padding: 1mm 2mm;
  margin-top: 1.4mm;
  font-size: 7.7pt;
}
.receipt-block-title {
  font-size: 6.2pt;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  font-weight: 800;
}
.receipt-table { width: 100%; border-collapse: collapse; margin-top: 1.6mm; font-size: 7.5pt; }
.receipt-table th {
  text-align: left;
  border-bottom: 0.8pt solid #0b1220;
  padding: 0.7mm 1mm;
  font-size: 6.1pt;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}
.receipt-table td { border-bottom: 0.4pt solid #e2e8f0; padding: 0.7mm 1mm; }
.receipt-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.receipt-totals {
  display: flex;
  justify-content: flex-end;
  gap: 5mm;
  margin-top: 1.2mm;
  font-size: 7.6pt;
}
.receipt-total-strong { font-size: 9.2pt; font-weight: 800; }
.receipt-terms {
  margin-top: 1.4mm;
  font-size: 6.2pt;
  color: #334155;
  line-height: 1.38;
  text-align: justify;
}
.receipt-terms strong { color: #0f172a; }
.receipt-signs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10mm;
  margin-top: auto;
  padding-top: 5mm;
}
.receipt-sign {
  border-top: 0.8pt solid #334155;
  padding-top: 1mm;
  font-size: 6.6pt;
  color: #475569;
  text-align: center;
  line-height: 1.6;
}
.cut-line { position: relative; border-top: 1px dashed #94a3b8; height: 0; margin: 2.5mm 0; }
.cut-line span {
  position: absolute;
  right: 0;
  top: -2.3mm;
  background: #fff;
  padding: 0 2mm;
  font-size: 6.2pt;
  color: #94a3b8;
  letter-spacing: 0.08em;
}

@media print {
  @page { size: A4 portrait; margin: 0; }
  .print-page { background: #fff; padding: 0; min-height: auto; }
  .a4-sheet { box-shadow: none; width: auto; min-height: auto; padding: 5mm 7mm; }
  .receipt-copy { break-inside: avoid; }
}

@media (max-width: 820px) {
  .print-page { padding: 10px 6px 30px; overflow-x: auto; }
}

