/* ═══════════════════════════════════════════════════════════════
   BusesTAC Sistema — Design System v2.0
   Dirección: Dark Luxury + Systematic Dashboard
   Tipografía: Plus Jakarta Sans (display) + DM Sans (body)
   Skill: ui-ux-pro-max
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* ─── RESET ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0; padding: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* ════════════════════════════════════════
   MODO OSCURO — Cyber Navy Elevated
════════════════════════════════════════ */
[data-theme="dark"] {
  --bg:         hsl(228, 72%, 5%);
  --surface:    hsl(228, 60%, 8%);
  --surface2:   hsl(228, 52%, 12%);
  --text:       hsl(228, 22%, 91%);
  --sub:        hsl(228, 18%, 50%);
  --border:     hsl(228, 42%, 15%);
  --input:      hsl(228, 60%, 8%);
  --tab:        hsla(228, 72%, 5%, 0.94);
  --modal-bg:   hsla(228, 65%, 6%, 0.97);

  --accent:       hsl(217, 96%, 62%);
  --accent2:      hsl(256, 88%, 68%);
  --accent-glow:  hsla(217, 96%, 62%, 0.20);
  --danger:       hsl(347, 96%, 62%);
  --success:      hsl(152, 80%, 48%);
  --warning:      hsl(38,  96%, 56%);
  --gold:         hsl(44,  95%, 58%);

  --grad:         linear-gradient(135deg, hsl(217,96%,62%) 0%, hsl(256,88%,68%) 100%);
  --grad-bar:     linear-gradient(180deg, hsl(256,88%,68%) 0%, hsl(217,96%,62%) 100%);
  --grad-bar-dim: linear-gradient(180deg, hsla(256,88%,68%,.28) 0%, hsla(217,96%,62%,.28) 100%);
  --card-glow:    0 2px 16px hsla(217,96%,62%,.06), 0 1px 4px hsla(0,0%,0%,.3);

  color-scheme: dark;
}

/* ════════════════════════════════════════
   MODO CLARO — iOS Clean
════════════════════════════════════════ */
[data-theme="light"] {
  --bg:         hsl(228, 28%, 97%);
  --surface:    hsl(0, 0%, 100%);
  --surface2:   hsl(228, 18%, 94%);
  --text:       hsl(228, 28%, 10%);
  --sub:        hsl(228, 14%, 42%);
  --border:     hsl(228, 20%, 88%);
  --input:      hsl(0, 0%, 100%);
  --tab:        hsla(0, 0%, 100%, 0.90);
  --modal-bg:   hsla(0, 0%, 100%, 0.97);

  --accent:       hsl(217, 90%, 52%);
  --accent2:      hsl(256, 75%, 58%);
  --accent-glow:  hsla(217, 90%, 52%, 0.15);
  --danger:       hsl(0,   78%, 53%);
  --success:      hsl(145, 72%, 40%);
  --warning:      hsl(38,  92%, 50%);
  --gold:         hsl(42,  90%, 48%);

  --grad:         linear-gradient(135deg, hsl(217,90%,52%) 0%, hsl(256,75%,58%) 100%);
  --grad-bar:     linear-gradient(180deg, hsl(256,75%,58%) 0%, hsl(217,90%,52%) 100%);
  --grad-bar-dim: linear-gradient(180deg, hsla(256,75%,58%,.18) 0%, hsla(217,90%,52%,.18) 100%);
  --card-glow:    0 1px 8px hsla(228,28%,20%,.06);

  color-scheme: light;
}

/* ─── TOKENS DE DISEÑO ─── */
:root {
  --font-display: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-body:    'DM Sans', -apple-system, sans-serif;

  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --fast:  140ms;
  --mid:   260ms;
  --slow:  400ms;

  --r-sm:   8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-2xl: 24px;
}

/* ════════════════════════════════════════
   BASE
════════════════════════════════════════ */
html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior-y: none;
}

body {
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: background .3s, color .3s;
}

/* ════════════════════════════════════════
   LOGIN SCREEN
════════════════════════════════════════ */
#login-container {
  width: 100%;
  max-width: 340px;
  padding: 0 20px;
  outline: none;
  opacity: 1;
  transition: opacity .5s;
}

#login-container h2 {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.6px;
  margin: 8px 0 4px;
  text-align: center;
}

.login-sub {
  font-size: 14px;
  color: var(--sub);
  text-align: center;
  margin-bottom: 32px;
  font-weight: 400;
}

/* ════════════════════════════════════════
   APP CONTAINER
════════════════════════════════════════ */
#app-container {
  display: none;
  opacity: 0;
  flex-direction: column;
  width: 100%;
  max-width: 600px;
  height: 100%;
  padding: 0 18px 90px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  transition: opacity .5s;
  scrollbar-width: none;
}
#app-container::-webkit-scrollbar { display: none; }

/* ─── HEADER ─── */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 0 18px;
  flex-shrink: 0;
}

.header h3 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.1;
}

.user-badge {
  font-size: 11px;
  color: var(--sub);
  text-align: right;
  line-height: 1.5;
  font-weight: 500;
}

/* ─── VIEWS ─── */
.view { display: none; }
.view.active {
  display: block;
  animation: fadeUp .38s var(--ease-out);
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════
   FORMS
════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--card-glow);
  transition: border-color var(--fast) var(--ease-out);
}
[data-theme="dark"] .card:hover { border-color: hsla(217,96%,62%,.22); }

.card-header {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}
.form-group label {
  font-size: 10.5px;
  color: var(--sub);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 7px;
  margin-left: 1px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

input, select, textarea {
  background: var(--input);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 13px 15px;
  font-size: 15px;
  font-family: var(--font-body);
  outline: none;
  width: 100%;
  transition: border-color var(--fast) var(--ease-out),
              box-shadow var(--fast) var(--ease-out);
}
input[type="file"] { padding: 10px; font-size: 13px; }
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
input:read-only { opacity: .55; }

/* ════════════════════════════════════════
   BUTTONS
════════════════════════════════════════ */
.btn {
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: var(--r-lg);
  font-size: 15px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.1px;
  cursor: pointer;
  transition: transform var(--fast) var(--ease-out),
              opacity var(--fast),
              box-shadow var(--fast) var(--ease-out);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
}
.btn:active { transform: scale(.97); opacity: .85; }

.btn-blue {
  background: var(--grad, var(--accent));
  color: #fff;
  box-shadow: 0 4px 18px hsla(217,96%,62%,.32);
}
.btn-blue:hover { box-shadow: 0 6px 24px hsla(217,96%,62%,.42); }

[data-theme="light"] .btn-blue {
  background: var(--accent);
  box-shadow: 0 4px 14px hsla(217,90%,52%,.28);
}

.btn-green {
  background: var(--success);
  color: #fff;
  box-shadow: 0 4px 14px hsla(152,80%,48%,.28);
}
.btn-red {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid var(--danger);
}
.btn-wa {
  background: hsl(144, 72%, 40%);
  color: #fff;
  box-shadow: 0 4px 14px hsla(144,72%,40%,.28);
}
.btn-orange {
  background: var(--warning);
  color: hsl(228, 60%, 8%);
  box-shadow: 0 4px 14px hsla(38,96%,56%,.28);
}
.btn-cerrar {
  background: transparent;
  color: var(--accent);
  border: none;
  font-size: 15px;
  font-weight: 700;
  width: 100%;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  cursor: pointer;
  margin-top: 4px;
  font-family: var(--font-display);
  min-height: 48px;
}

/* ════════════════════════════════════════
   TAB BAR (Bottom Nav / Side Nav)
════════════════════════════════════════ */
.tab-bar {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: auto;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  background: var(--tab);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-top: 1px solid hsla(228, 42%, 50%, 0.12);
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  padding-top: 10px;
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 4px 0;
  transition: transform var(--fast) var(--ease-out), opacity var(--fast);
}
.tab-btn:active { transform: scale(.88); opacity: .7; }

.tab-icon {
  width: 24px;
  height: 24px;
  opacity: 0.45;
  color: var(--text);
  transition: opacity var(--mid) var(--ease-out), color var(--mid) var(--ease-out);
  flex-shrink: 0;
}
.tab-btn.active .tab-icon {
  opacity: 1;
  color: var(--accent);
}

.tab-text {
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--sub);
  opacity: .7;
  transition: color var(--mid) var(--ease-out), opacity var(--mid);
}
.tab-btn.active .tab-text {
  color: var(--accent);
  opacity: 1;
}

/* ════════════════════════════════════════
   MODALS
════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: hsla(228, 60%, 3%, .55);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity .3s;
}

.modal-content {
  background: var(--modal-bg);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid hsla(228, 60%, 80%, .10);
  padding: 26px 22px;
  border-radius: var(--r-xl);
  text-align: center;
  width: 300px;
  max-width: 92vw;
  box-shadow: 0 28px 70px hsla(0,0%,0%,.45);
  transform: scale(.92);
  transition: transform .3s var(--ease-out);
}

.modal-sheet-wrap {
  position: fixed;
  inset: 0;
  background: hsla(228, 60%, 3%, .55);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity .3s;
}

.modal-sheet {
  background: var(--modal-bg);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 95dvh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .38s var(--ease-out);
  border-top: 1px solid hsla(228, 60%, 80%, .10);
}

.sheet-grip {
  width: 36px;
  height: 4px;
  background: var(--sub);
  opacity: 0.4;
  border-radius: 2px;
  margin: 10px auto;
  flex-shrink: 0;
  cursor: grab;
}
.sheet-grip:active { cursor: grabbing; }

.sheet-header {
  padding: 10px 18px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sheet-header h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.sheet-body {
  padding: 20px 18px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-bottom: max(30px, env(safe-area-inset-bottom));
}

.btn-x {
  background: var(--surface2);
  border: 1px solid var(--border);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  color: var(--sub);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--fast), color var(--fast);
  flex-shrink: 0;
}
.btn-x:hover { background: var(--border); color: var(--text); }

/* ════════════════════════════════════════
   DASHBOARD CARDS
════════════════════════════════════════ */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 16px;
  cursor: pointer;
  box-shadow: var(--card-glow);
  transition: border-color var(--fast) var(--ease-out),
              transform var(--fast) var(--ease-out),
              box-shadow var(--fast) var(--ease-out);
}
[data-theme="dark"] .dash-card:hover {
  border-color: hsla(217,96%,62%,.30);
  box-shadow: 0 4px 24px hsla(217,96%,62%,.10);
  transform: translateY(-1px);
}
.dash-card.full { grid-column: span 2; }

.dash-label {
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--sub);
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

.dash-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

/* ════════════════════════════════════════
   COTIZACIÓN CARDS
════════════════════════════════════════ */
.coti-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 15px;
  margin-bottom: 10px;
  cursor: pointer;
  box-shadow: var(--card-glow);
  transition: border-color var(--fast), transform var(--fast) var(--ease-out);
}
[data-theme="dark"] .coti-card:hover {
  border-color: hsla(217,96%,62%,.25);
  transform: translateY(-1px);
}

.badge {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: var(--r-sm);
  letter-spacing: 0.5px;
}
.badge-PENDIENTE { background: hsla(38,96%,56%,.12); color: var(--warning); }
.badge-VENTA     { background: hsla(152,80%,48%,.12); color: var(--success); }
.badge-ANULADO   { background: hsla(347,96%,62%,.12); color: var(--danger); }

/* ════════════════════════════════════════
   AUTOCOMPLETE
════════════════════════════════════════ */
.ac-wrap { position: relative; }
.ac-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 16px 48px hsla(0,0%,0%,.45);
  display: none;
}
[data-theme="dark"] .ac-list {
  box-shadow: 0 16px 48px hsla(0,0%,0%,.7),
              0 0 0 1px hsla(217,96%,62%,.12);
}
.ac-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  transition: background var(--fast);
}
.ac-item:hover { background: var(--surface2); }
.ac-item:last-child { border-bottom: none; }

/* ════════════════════════════════════════
   SPINNER
════════════════════════════════════════ */
.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid hsla(228, 60%, 80%, .12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ════════════════════════════════════════
   APP LOADER
════════════════════════════════════════ */
#app-loader {
  display: none;
  position: fixed;
  inset: 0;
  background: hsla(228, 72%, 5%, .75);
  justify-content: center;
  align-items: center;
  z-index: 9000;
  opacity: 0;
  transition: opacity .3s;
  flex-direction: column;
  gap: 20px;
}

/* ════════════════════════════════════════
   NET BAR (progress indicator)
════════════════════════════════════════ */
#net-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2.5px;
  background: var(--grad);
  z-index: 99999;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform .3s var(--ease-out), opacity .3s;
  opacity: 0;
  pointer-events: none;
}
#net-bar.active { opacity: 1; }
#net-bar.fill   { transform: scaleX(.82); }
#net-bar.done   { transform: scaleX(1); transition: transform .15s; }

/* ════════════════════════════════════════
   SESSION TOAST
════════════════════════════════════════ */
#sesion-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(28px);
  background: var(--danger);
  color: #fff;
  padding: 12px 22px;
  border-radius: var(--r-lg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  z-index: 99998;
  opacity: 0;
  transition: opacity .3s, transform .3s var(--ease-out);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 8px 28px hsla(347,96%,62%,.38);
}
#sesion-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ════════════════════════════════════════
   NOTIFICATION BANNER
════════════════════════════════════════ */
#notif-banner {
  position: fixed;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 400px;
  background: var(--modal-bg);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid hsla(228, 60%, 80%, .10);
  border-radius: var(--r-xl);
  padding: 14px 16px;
  box-shadow: 0 12px 40px hsla(0,0%,0%,.38);
  z-index: 9500;
  transition: top .5s var(--ease-out);
  display: flex;
  align-items: center;
  gap: 13px;
  cursor: pointer;
}
#notif-banner.show { top: 20px; }

.notif-icon {
  width: 42px;
  height: 42px;
  background: var(--accent);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}
.notif-body  { flex: 1; }
.notif-app   { font-size: 10px; color: var(--sub); font-weight: 700; display: flex; justify-content: space-between; margin-bottom: 2px; }
.notif-title { font-family: var(--font-display); font-size: 14px; font-weight: 700; margin-bottom: 1px; }
.notif-sub   { font-size: 12px; color: var(--sub); }

/* ════════════════════════════════════════
   MINI CALENDAR
════════════════════════════════════════ */
.cal-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.cal-mes {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.cal-dow {
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--sub);
  text-align: center;
  padding: 4px 0;
  letter-spacing: 0.3px;
}
.cal-day {
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  transition: background var(--fast), border-color var(--fast);
}
.cal-day.hoy {
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  border-color: var(--accent);
  box-shadow: 0 2px 10px var(--accent-glow);
}
.cal-day.tiene-servicio .cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
  position: absolute;
  bottom: 3px;
}
.cal-day.vacio {
  opacity: 0;
  pointer-events: none;
  border-color: transparent;
}
.cal-pill {
  font-size: 9.5px;
  font-weight: 700;
  border-radius: 3px;
  padding: 2px 4px;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  display: block;
  cursor: pointer;
}
.cal-pill-single { background: hsla(152,80%,48%,.18); color: var(--success); border-left: 2px solid var(--success); }
.cal-pill-span   { background: hsla(217,96%,62%,.18); color: var(--accent);  border-left: 2px solid var(--accent); }

/* ════════════════════════════════════════
   VENCIMIENTO LABELS
════════════════════════════════════════ */
.venc-label, .cxp-fecha-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
  margin-top: 3px;
  letter-spacing: 0.3px;
}
.venc-ok,      .cxp-vence-ok     { background: hsla(152,80%,48%,.12); color: var(--success); }
.venc-pronto,  .cxp-vence-pronto { background: hsla(38,96%,56%,.12);  color: var(--warning); }
.venc-vencido, .cxp-vence-hoy    { background: hsla(347,96%,62%,.12); color: var(--danger); }

/* ════════════════════════════════════════
   RESPONSIVE — TABLET/PC
════════════════════════════════════════ */
@media (min-width: 700px) {
  #login-container    { max-width: 400px; }
  #login-container h2 { font-size: 42px; }
  #app-container      { max-width: 820px; padding: 0 28px 100px; }
  .header h3          { font-size: 30px; }
  input, select, textarea { font-size: 16px; }
  .btn  { font-size: 16px; }
  .modal-sheet { max-width: 800px; }
  .modal-content { width: 380px; }
}

@media (min-width: 1024px) {
  body { align-items: stretch; justify-content: flex-start; }
  #login-container { align-self: center; margin: auto; }

  #app-container {
    max-width: 100%;
    width: 100%;
    padding: 0 0 0 72px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: hidden;
  }

  .header {
    padding: 20px 3% 16px 3%;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
  }

  /* Dashboard: panel izquierdo + calendario */
  #vista-dashboard.active {
    display: grid !important;
    grid-template-columns: clamp(420px, 36vw, 560px) 1fr;
    flex: 1;
    overflow: hidden;
    padding: 0;
    gap: 0;
  }
  #dash-col-left {
    overflow-y: auto;
    padding: 24px 24px 24px 28px;
    scrollbar-width: none;
    border-right: 1px solid var(--border);
  }
  #dash-col-left::-webkit-scrollbar { display: none; }
  #dash-col-right {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    scrollbar-width: none;
  }
  #dash-col-right::-webkit-scrollbar { display: none; }

  .mini-cal {
    display: flex;
    flex-direction: column;
    margin: 0 !important;
    border-radius: 0;
    padding: 16px 20px 20px;
  }
  .mini-cal > .cal-nav { flex-shrink: 0; margin-bottom: 10px; }
  .mini-cal .cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 100px;
    gap: 3px;
  }
  .cal-day {
    aspect-ratio: auto !important;
    height: 100px;
    min-height: unset;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 6px 8px;
    overflow: hidden;
  }

  #vista-cotizar.active,
  #vista-gastos.active,
  #vista-ajustes.active {
    padding: 28px 3%;
    overflow-y: auto;
    flex: 1;
    width: 100%;
  }

  /* Sidebar nav */
  .tab-bar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 72px !important;
    max-width: 72px !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px 0 28px;
    gap: 6px;
    border-top: none;
    border-right: 1px solid var(--border);
    border-top: none;
    transform: none !important;
  }
  .tab-btn {
    min-width: unset;
    width: 52px;
    padding: 12px 0;
    border-radius: var(--r-lg);
    gap: 3px;
    flex: none;
    transition: background var(--fast), transform var(--fast) var(--ease-out);
  }
  .tab-btn.active { background: var(--accent-glow); }
  .tab-text { font-size: 8.5px; }
  .modal-sheet { max-width: 700px; }
}

@media (min-width: 1400px) {
  #vista-dashboard.active { grid-template-columns: 520px 1fr; }
  .mini-cal { padding: 20px 28px 24px; }
  .mini-cal .cal-grid { grid-auto-rows: 120px; }
  .cal-day { height: 120px; font-size: 13px; padding: 7px 10px; }
  .cal-pill { font-size: 10px; }
}

/* ════════════════════════════════════════
   MICRO-INTERACTIONS & UTILITIES
════════════════════════════════════════ */

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* Text utilities */
.text-accent   { color: var(--accent); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }
.text-warning  { color: var(--warning); }
.text-sub      { color: var(--sub); }
.font-display  { font-family: var(--font-display); }
.font-mono     { font-family: 'JetBrains Mono', 'Fira Code', monospace; }

/* Shimmer loading skeleton */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface2) 25%,
    var(--border) 50%,
    var(--surface2) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: var(--r-md);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--sub);
}
.empty-state svg { opacity: .35; margin-bottom: 12px; }
.empty-state p   { font-size: 14px; line-height: 1.6; }


/* ── Calendario móvil — celdas compactas ── */
@media (max-width: 1023px) {
  #vista-dashboard.active { display: block !important; }
  #dash-col-right { display: block; overflow: visible; height: auto; }
  .mini-cal { height: auto !important; }
  .cal-grid { grid-auto-rows: unset !important; }
  .cal-day {
    aspect-ratio: 1 !important;
    height: auto !important;
    min-height: unset !important;
    max-height: 72px;
    overflow: hidden;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 4px 4px;
  }
  .cal-pill { font-size: 8px; padding: 1px 3px; margin-top: 2px; }
  .cal-dot { bottom: 2px; }
}
