/* StayOS · Tema SaaS hotelero (claro) — reemplaza el tema oscuro previo. */
:root {
  --bg: #f2f4f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e4e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --primary-soft: #eff4ff;
  --success: #16a34a;
  --success-soft: #e8f7ee;
  --warning: #d97706;
  --warning-soft: #fdf3e0;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --info: #0284c7;
  --info-soft: #e5f4fb;
  --purple: #7c3aed;
  --purple-soft: #f1eafd;
  --radius: 11px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
  --sidebar-w: 236px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "SFMono-Regular", "Consolas", "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d3dbe8; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b9c4d6; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Layout ---------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  z-index: 60;
  transition: width .2s ease, transform .2s ease;
}
.sidebar.collapsed { width: 68px; }

.side-brand { display: flex; align-items: center; gap: 11px; padding: 16px 18px; border-bottom: 1px solid var(--border); min-height: 62px; }
.logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--primary); color: #fff;
  display: grid; place-items: center; flex: none;
  box-shadow: 0 4px 10px rgba(37, 99, 235, .28);
}
.logo svg { width: 18px; height: 18px; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -.2px; white-space: nowrap; }
.brand-sub { font-size: 10px; color: var(--muted); display: block; white-space: nowrap; }

.side-nav { flex: 1; overflow-y: auto; padding: 8px 10px 14px; }
.nav-section { font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted-2); padding: 14px 10px 6px; font-weight: 700; white-space: nowrap; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 8px;
  color: var(--text-2); text-decoration: none;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background .12s, color .12s;
  border: none; background: none; width: 100%; text-align: left;
  white-space: nowrap;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-icon { width: 18px; height: 18px; flex: none; }
.side-foot { padding: 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }

.sidebar.collapsed .brand-name, .sidebar.collapsed .brand-sub,
.sidebar.collapsed .nav-label, .sidebar.collapsed .nav-section { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 9px; }
.sidebar.collapsed .side-foot { padding: 10px 0; align-items: center; }
.sidebar.collapsed .side-foot .nav-item { justify-content: center; }
.sidebar.collapsed .side-brand { justify-content: center; padding: 16px 0; }

.main { flex: 1; margin-left: var(--sidebar-w); transition: margin-left .2s ease; min-width: 0; }
.main.collapsed { margin-left: 68px; }

/* ---------- Header ---------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  height: 62px; display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px;
  border: 1px solid transparent; background: none;
  color: var(--text-2); display: grid; place-items: center; cursor: pointer;
  position: relative;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 19px; height: 19px; }

.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.bc-root { color: var(--muted); }
.bc-sep { color: var(--muted-2); }
#bcCurrent { font-weight: 600; }

.btn-back {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  border-radius: 8px; padding: 6px 12px 6px 9px; font-size: 13px; font-weight: 500;
  font-family: var(--font); cursor: pointer; flex: none;
  transition: border-color .15s, color .15s, background .15s;
}
.btn-back:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn-back svg { width: 15px; height: 15px; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.h-select { display: flex; flex-direction: column; line-height: 1.2; }
.hs-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
.h-select select, .h-date input {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 5px 8px; font-size: 12px; background: var(--surface); color: var(--text);
  font-family: var(--font);
}
.h-select select:focus, .h-date input:focus { border-color: var(--primary); outline: none; }

.hdrop { position: relative; }
.hdrop-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 380px; max-width: 92vw;
  background: var(--surface); border: 1px solid var(--border); border-radius: 13px;
  box-shadow: var(--shadow); display: none; z-index: 70; overflow: hidden;
}
.hdrop.open .hdrop-menu { display: block; animation: fadeIn .14s ease; }
#userMenu.hdrop-menu { width: 220px; }

.notif-badge {
  position: absolute; top: 1px; right: 1px;
  min-width: 16px; height: 16px; border-radius: 999px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px;
}
.notif-menu-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.notif-menu-head h4 { margin: 0; font-size: 13px; }
.notif-scroll { max-height: 330px; overflow-y: auto; }
.notif-menu-foot { padding: 10px 14px; border-top: 1px solid var(--border); }

.menu-item {
  display: block; width: 100%; padding: 10px 14px;
  font-size: 13px; color: var(--text-2); border: none; background: none;
  text-align: left; cursor: pointer;
}
.menu-item:hover { background: var(--surface-2); }
.menu-item svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 9px; color: var(--muted); }
.menu-sep { height: 1px; background: var(--border); margin: 6px 0; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 10px; padding: 5px 10px 5px 5px; cursor: pointer;
}
.user-chip:hover { border-color: var(--border-strong); }
.avatar {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--primary-soft); color: var(--primary);
  font-weight: 700; font-size: 12px; display: grid; place-items: center;
}
.uc-text { display: flex; flex-direction: column; text-align: left; line-height: 1.25; }
.uc-text b { font-size: 12.5px; }
.uc-text i { font-style: normal; font-size: 11px; color: var(--muted); }

/* ---------- Páginas ---------- */

.pages { padding: 22px 20px 40px; max-width: 1280px; margin: 0 auto; }
.page { display: none; }
.page.active { display: block; animation: fadeIn .18s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.3px; }
.page-sub { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.page-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Botones ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); padding: 8px 14px; border-radius: 9px;
  cursor: pointer; font-size: 13px; font-weight: 500;
  font-family: var(--font); text-decoration: none; transition: .15s;
}
.btn:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn.sm.ghost { border-color: transparent; }
.btn.sm.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.sm.primary:hover { background: var(--primary-strong); color: #fff; }
.full { width: 100%; justify-content: center; margin-top: 12px; }
.danger-txt { color: var(--danger); }
.danger-txt:hover { color: var(--danger); background: var(--danger-soft); }

.file-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px dashed var(--primary); color: var(--primary);
  background: var(--primary-soft); padding: 8px 14px; border-radius: 9px;
  cursor: pointer; font-size: 13px; font-weight: 500;
}
.file-btn:hover { background: #e3edfd; }

.sheet-sel {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13px;
}
.sheet-sel label { color: var(--muted); margin: 0; font-size: 12px; }
.sheet-sel select {
  border: none; background: transparent; color: var(--text);
  font-size: 13px; font-family: var(--font); font-weight: 600;
  outline: none; cursor: pointer; max-width: 220px;
}

/* ---------- Inputs / selects ---------- */

.input, .select-input {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 8px 10px; border-radius: 8px;
  font-size: 13px; font-family: var(--font);
}
.input:focus, .select-input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.select-input { padding-right: 28px; }

.filters-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.count-tag {
  margin-left: auto; font-size: 12px; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}

/* ---------- Tarjetas ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 15px 16px 0; }
.card-title { font-size: 14px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 8px; }
.card-sub { font-size: 12px; color: var(--muted); margin: 3px 0 0; }
.card-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-body { padding: 14px 16px 16px; }

.dash-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.dash-card.span-12 { grid-column: span 12; }
.dash-card.span-8 { grid-column: span 8; }
.dash-card.span-4 { grid-column: span 4; }

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

.kmi-icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800; flex: none;
}
.kmi-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.kmi-value { font-size: 26px; font-weight: 700; letter-spacing: -.6px; margin: 7px 0 2px; }

.t-blue { background: #eff4ff; color: var(--primary); }
.t-green { background: var(--success-soft); color: var(--success); }
.t-red { background: var(--danger-soft); color: var(--danger); }
.t-orange { background: var(--warning-soft); color: var(--warning); }
.t-purple { background: var(--purple-soft); color: var(--purple); }
.t-gray { background: #f1f5f9; color: var(--muted); }

.pill-date { font-size: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: 7px 12px; border-radius: 999px; }

/* ---------- Pace ---------- */

.pace-col { padding: 8px 0 10px; }
.pace-col + .pace-col { border-top: 1px solid var(--border); }
.pace-head { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 700; letter-spacing: .6px; color: var(--muted); margin-bottom: 6px; }
.delta { font-size: 11px; font-weight: 700; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }
.metric { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 0; font-size: 13px; }
.m-label { color: var(--muted); }
.m-value { font-weight: 600; font-family: var(--mono); }

/* ---------- Charts ---------- */

.chart-host { position: relative; height: 220px; }

/* ---------- Notificaciones ---------- */

.notif-item { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--border); position: relative; }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--primary-soft); margin: 0 -8px; padding: 11px 8px; border-radius: 10px; }
.notif-tile { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 600; color: var(--text); }
.notif-desc { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.notif-time { font-size: 11px; color: var(--muted); margin-top: 3px; }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); flex: none; margin-top: 6px; }
.notif-item.unread .notif-dot { background: var(--primary); }
.hdrop-menu .notif-dot { cursor: pointer; }
.hdrop-menu .notif-dot:hover { background: var(--primary); }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 1.6; white-space: nowrap;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warn { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-neutral { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* ---------- Tablas genéricas ---------- */

.table-card { overflow: auto; }
table.htable { width: 100%; border-collapse: collapse; font-size: 13px; }
table.htable thead th {
  text-align: left; padding: 10px 12px;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); border-bottom: 1px solid var(--border);
  background: var(--surface-2); font-weight: 700; white-space: nowrap;
}
table.htable tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
table.htable tbody tr:hover td { background: var(--surface-2); }
table.htable tbody tr:last-child td { border-bottom: none; }
table.htable .right { text-align: right; }
table.htable thead th.right { text-align: right; }
table.htable .left { text-align: left; }

.gcell { display: flex; align-items: center; gap: 9px; }
.gcell > span { display: flex; flex-direction: column; line-height: 1.3; }
.g-avatar {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 11px; font-weight: 700; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.g-country { font-style: normal; font-size: 11px; color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12px; }
.dim { color: var(--muted); font-style: normal; }
.row-actions { white-space: nowrap; }
.empty-cell { text-align: center; padding: 28px !important; color: var(--muted); }

/* ---------- Modal ---------- */

.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-mask[hidden] { display: none; }
.modal {
  background: var(--surface); border-radius: 14px;
  width: 100%; max-width: 520px; max-height: 86vh; overflow: auto;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-x { border: none; background: none; font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; padding: 4px; }
.modal-x:hover { color: var(--text); }
.modal-body { padding: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ---------- Asistente de importación ---------- */

.imp-modal { width: 760px; max-width: 96vw; }
.imp-modal .modal-body { max-height: 72vh; overflow: auto; }
.imp-modal .form-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.imp-modal .form-row .lbl { min-width: 150px; font-size: 12px; color: var(--muted); font-weight: 600; }
.imp-modal .form-row .input { flex: 1; }
.imp-modal .imp-merge { display: flex; gap: 16px; font-size: 13px; color: var(--text-2); }
.imp-modal .imp-merge label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.imp-modal .imp-merge input { accent-color: var(--primary); }
.imp-tt { font-size: 12px; color: var(--muted); margin: 14px 0 6px; font-weight: 600; }
.imp-map { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 18px; }
.map-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.map-label { flex: 1; font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-select { width: 175px; flex: none; }
.imp-prev { width: 100%; border-collapse: collapse; font-size: 12px; }
.imp-prev th, .imp-prev td { padding: 6px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; text-align: left; }
.imp-prev thead th { background: var(--primary); color: #fff; font-weight: 600; position: sticky; top: 0; }
.imp-prev td { color: var(--text-2); font-family: var(--mono); }
.imp-prev .imp-rown { color: var(--muted); font-family: inherit; }
.imp-status { flex: 1; text-align: left; }
.imp-sheets { margin: 12px 0 14px; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.imp-sheet-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 12px; font-size: 13px; color: var(--text-2); }
.imp-sheet-row + .imp-sheet-row { border-top: 1px solid var(--border); }
.imp-sheet-row .badge { background: var(--primary-soft); color: var(--primary); border-radius: 999px; padding: 2px 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge.month { background: rgba(16, 185, 129, .15); color: #10b981; }
.badge.auto { background: rgba(59, 130, 246, .15); color: #3b82f6; }
.table-scroll { overflow: auto; max-height: 240px; border: 1px solid var(--border); border-radius: 8px; }


.dl { display: grid; grid-template-columns: auto 1fr; gap: 7px 18px; margin: 0; font-size: 13px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; color: var(--text-2); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.form-grid label input, .form-grid label select { text-transform: none; letter-spacing: normal; font-weight: 400; width: 100%; }
.form-grid .fg-full { grid-column: 1 / -1; }

/* ---------- Calendario ---------- */

.cal-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-range { font-weight: 600; font-size: 14px; min-width: 150px; }
.cal-legend { margin-left: auto; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.lg-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.cal-scroll { overflow-x: auto; }
.cal-sheet { min-width: 780px; }
.cal-head { display: grid; grid-template-columns: 150px repeat(7, 1fr); }
.cal-corner { background: var(--surface-2); border-bottom: 1px solid var(--border); padding: 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); display: flex; align-items: flex-end; }
.cal-cell { text-align: center; padding: 9px 4px; border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); background: var(--surface-2); }
.cal-cell.today { background: var(--primary-soft); }
.cc-dow { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
.cc-date { font-weight: 700; font-size: 16px; }
.cal-row { display: grid; grid-template-columns: 150px 1fr; }
.cal-room { padding: 9px 10px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; }
.cal-room b { font-size: 13px; }
.cal-room i { font-size: 10px; color: var(--muted); font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-track { position: relative; min-height: 58px; border-bottom: 1px solid var(--border); }
.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); height: 100%; }
.cal-day { border-left: 1px solid var(--border); }
.cal-day.today { background: var(--primary-soft); }
.cal-bar {
  position: absolute; top: 7px; bottom: 7px;
  border-radius: 6px; padding: 4px 7px; color: #fff;
  font-size: 10px; line-height: 1.35; font-weight: 600;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .22); z-index: 2; cursor: pointer;
}
.cal-bar:hover { filter: brightness(1.08); }

/* ---------- Reports ---------- */

.rep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 16px; }
.rep-card { border: 1px solid var(--border); border-radius: 11px; padding: 14px; background: var(--surface-2); }
.rep-card h4 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.rep-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.rep-row:last-child { border-bottom: none; }

/* ---------- Settings ---------- */

.settings-grid { display: grid; grid-template-columns: 210px 1fr; gap: 16px; align-items: start; }
.settings-nav { padding: 8px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 80px; }
.sn-item { text-align: left; border: none; background: none; padding: 9px 12px; border-radius: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.sn-item:hover { background: var(--surface-2); }
.sn-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.settings-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: none; }
.set-row b { display: block; font-size: 13px; }
.set-row .g-country { display: block; }
.switch { position: relative; width: 40px; height: 23px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider { position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; transition: .2s; cursor: pointer; }
.switch .slider::before { content: ''; position: absolute; width: 17px; height: 17px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(15, 23, 42, .25); }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(17px); }

/* ---------- Help ---------- */

.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 16px; }
.help-card { padding: 18px; }
.help-card h4 { margin: 12px 0 6px; font-size: 14px; }
.help-card p { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.help-search { max-width: 340px; }

/* ---------- Empty state ---------- */

.empty-state { text-align: center; padding: 56px 24px; }
.empty-state .es-icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; background: var(--surface-2); border: 1px dashed var(--border-strong); }
.empty-state h3 { margin: 0 0 6px; font-size: 16px; }
.empty-state p { color: var(--muted); margin: 0 0 16px; }

/* ---------- Toast ---------- */

.app-toast {
  position: fixed; bottom: 22px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #0f172a; color: #fff;
  padding: 10px 18px; border-radius: 10px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: .25s;
  z-index: 200; box-shadow: 0 8px 24px rgba(15, 23, 42, .35);
  max-width: 82vw;
}
.app-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.app-toast.error { background: #b91c1c; }

/* =========================================================
   Analytics (módulo previo) — reestilizado en tema claro
   ========================================================= */

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }

.filters {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end;
  padding: 12px 16px; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.filters label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 600; }
.filters input {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 6px 8px; border-radius: 7px; font-size: 13px; width: 150px;
  font-family: var(--font);
}
.filters input:focus { border-color: var(--primary); outline: none; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; margin: 0 0 20px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
  border-top: 3px solid var(--primary); box-shadow: var(--shadow-sm);
}
.kpi .label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.kpi .value { font-size: 22px; font-weight: 700; margin-top: 4px; font-family: var(--mono); }
.kpi .value small { font-size: 12px; color: var(--muted); font-weight: 400; }
.kpi.orange { border-top-color: var(--warning); }
.kpi.green { border-top-color: var(--success); }
.kpi.purple { border-top-color: var(--purple); }
.kpi.red { border-top-color: var(--danger); }
.kpi .value.orange { color: var(--warning); }
.kpi .value.green { color: var(--success); }
.kpi .value.purple { color: var(--purple); }
.kpi .value.red { color: var(--danger); }
.kpi .value.blue { color: var(--primary); }

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; margin: 0 0 20px; padding: 4px 18px 14px;
  box-shadow: var(--shadow-sm);
}
.panel[open] { border-color: var(--border-strong); }
.panel > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0 10px; font-size: 15px; font-weight: 600;
  color: var(--text); user-select: none;
}
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary::after { content: '▾'; color: var(--muted-2); font-size: 13px; transition: transform .18s; margin-left: auto; }
.panel[open] > summary::after { transform: rotate(180deg); }
.panel > summary:hover { color: var(--text); }
.pt-hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.panel-body { padding-top: 2px; }

.table-wrap { overflow: auto; max-height: 460px; border-radius: 9px; border: 1px solid var(--border); }
table#grid { border-collapse: collapse; width: 100%; font-size: 13px; }
table#grid th, table#grid td { padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table#grid thead th {
  position: sticky; top: 0;
  background: var(--surface-2); color: var(--text-2);
  font-size: 11.5px; text-align: right; z-index: 5; font-weight: 600;
}
table#grid thead th.rowhead { text-align: left; }
table#grid td { text-align: right; font-family: var(--mono); color: var(--text-2); }
table#grid td input {
  width: 100%; background: transparent; border: 1px solid transparent;
  color: var(--text); font-family: var(--mono); font-size: 13px;
  text-align: right; padding: 2px 4px; border-radius: 4px;
}
table#grid td input:focus { border-color: var(--primary); outline: none; background: var(--primary-soft); }
table#grid td.calc { color: var(--primary); background: rgba(37, 99, 235, .05); }
table#grid td.custom { color: var(--purple); background: rgba(124, 58, 237, .06); }
table#grid td.error { color: var(--danger); background: var(--danger-soft); }
table#grid td.del { text-align: center; }
table#grid td.del button { background: transparent; border: none; color: var(--danger); cursor: pointer; font-size: 14px; }
table#grid tr:hover td { background: var(--surface-2); }
table#grid tbody tr:last-child td { border-bottom: none; }
table#grid tr.month-row td { background: var(--primary-soft); color: var(--primary); font-family: inherit; font-weight: 600; }
table#grid tr.month-row td.m-label { text-align: left; color: var(--text); }
table#grid tr.month-row td.m-text { color: var(--muted); font-weight: 400; }
table#grid tr.month-row:hover td { background: #e3edfd; }
table#grid tr.month-row td.m-sum { color: var(--primary); }
.month-toggle {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); width: 24px; height: 20px; border-radius: 5px;
  cursor: pointer; font-size: 11px; line-height: 1;
}
.month-toggle:hover { color: var(--primary); border-color: var(--primary); }

table#grid th.chk, table#grid td.rowchk { width: 30px; text-align: center; }
table#grid td.rowchk input { width: auto; height: 15px; accent-color: var(--primary); cursor: pointer; }
table#grid thead th input#chkAllTop { accent-color: var(--primary); cursor: pointer; width: auto; }
table#grid tr.excluded td { opacity: .45; }

.formula-add { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.formula-add input {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 8px 10px; border-radius: 8px; font-family: var(--mono); flex: 1; min-width: 160px;
}
.formula-add input:focus { border-color: var(--primary); outline: none; }
.formula-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.formula-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; font-family: var(--mono); font-size: 13px;
  color: var(--text-2);
}
.formula-item .fname { color: var(--purple); font-weight: 700; }
.formula-item .fexpr { color: var(--text-2); }
.formula-item .fstatus { margin-left: auto; font-size: 12px; }
.formula-item .fstatus.ok { color: var(--success); }
.formula-item .fstatus.err { color: var(--danger); }
.formula-item button { background: transparent; border: none; color: var(--danger); cursor: pointer; }

.help { margin-top: 8px; color: var(--muted); font-size: 13px; }
.help summary { cursor: pointer; }
.help-body { padding: 10px 0 0; display: flex; gap: 24px; flex-wrap: wrap; }
.help-body .col { min-width: 220px; }
.help-body h4 { margin: 0 0 6px; color: var(--text-2); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.help-body code { color: var(--primary); }
.help-body ul { margin: 0; padding-left: 18px; }

.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.chart-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 11px; padding: 10px; box-shadow: var(--shadow-sm);
}
.chart-card:hover { border-color: var(--border-strong); }
.chart-card.editing { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.chart-card h3 { margin: 0 0 8px; font-size: 13px; color: var(--text-2); font-weight: 600; }
.chart-box { position: relative; height: 260px; }
.chart-empty { height: 100%; display: grid; place-items: center; color: var(--muted); font-size: 12px; border: 1px dashed var(--border-strong); border-radius: 8px; }
.map-host { width: 100%; height: 100%; border-radius: 8px; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chart-head h3 { margin: 0 0 8px; flex: 1; min-width: 0; }
.chart-actions { display: flex; gap: 4px; margin-bottom: 8px; }
.chart-actions button {
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  width: 26px; height: 24px; border-radius: 6px; cursor: pointer; font-size: 12px; line-height: 1;
}
.chart-actions button:hover { color: var(--text); border-color: var(--primary); }

.slicer-bar { display: flex; flex-direction: column; gap: 12px; }
.slicer-groups { display: flex; flex-direction: column; gap: 10px; }
.slicer-group { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.sg-head { display: flex; align-items: center; gap: 2px; min-width: 110px; }
.sg-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; padding: 6px 2px; font-weight: 600; }
.sg-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 11px; padding: 2px 4px; border-radius: 4px; line-height: 1; }
.sg-btn:hover { color: var(--text); background: var(--surface-2); }
.sg-add { display: flex; align-items: center; gap: 4px; }
.sg-add input {
  width: 100px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 4px 8px; border-radius: 6px; font-size: 12px;
}
.sg-add input:focus { border-color: var(--primary); outline: none; }
.sg-add button {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; cursor: pointer; padding: 3px 9px; font-size: 12px;
}
.sg-add button:hover { border-color: var(--primary); color: var(--primary); }
.sg-rename-input {
  background: var(--surface); border: 1px solid var(--primary); color: var(--text);
  padding: 4px 8px; border-radius: 6px; font-size: 13px; width: 130px;
}
.slicer-group .chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 3px 2px 10px; }
.slicer-group .chip .chip-main {
  background: none; border: none; color: inherit; cursor: pointer;
  font-size: 12px; padding: 3px 4px; line-height: 1.2;
}
.slicer-group .chip-x {
  background: none; border: none; color: var(--muted-2); cursor: pointer;
  font-size: 10px; padding: 2px 5px; border-radius: 50%; line-height: 1;
}
.slicer-group .chip-x:hover { color: var(--danger); background: var(--danger-soft); }
.slicer-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.slicer-actions select {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 6px 8px; border-radius: 7px; font-size: 12px; font-family: var(--font);
}

.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip {
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); padding: 5px 12px; border-radius: 999px;
  font-size: 12px; cursor: pointer; transition: .15s;
}
button.chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
button.chip.off { opacity: .5; }
label.chip { display: inline-flex; align-items: center; gap: 6px; }
label.chip input { accent-color: var(--primary); cursor: pointer; }
label.chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
label.chip.off { opacity: .55; }
.chip.no-opt, .no-opt { color: var(--muted); padding: 5px 0; font-size: 12px; }

.table-tools {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-bottom: 10px; padding: 8px 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px;
  font-size: 12px;
}
.tt-label { color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: .5px; font-weight: 600; }
.tt-sep { width: 1px; height: 20px; background: var(--border); }

.builder-form {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px; margin-bottom: 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 12px;
}
.builder-form > label {
  display: flex; flex-direction: column; gap: 5px;
  color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600;
}
.builder-form select, .builder-form input[type="text"], .builder-form input[type="number"] {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 7px 9px; border-radius: 7px; font-size: 13px; width: 100%;
  text-transform: none; letter-spacing: normal; font-weight: 400; font-family: var(--font);
}
.builder-form select:focus, .builder-form input:focus { border-color: var(--primary); outline: none; }
.builder-form label.chk { flex-direction: row; align-items: center; gap: 8px; text-transform: none; letter-spacing: normal; padding-top: 22px; font-weight: 400; color: var(--text-2); }
.builder-form label.chk input { accent-color: var(--primary); width: auto; }
.builder-form > label.val-chip-wrap { grid-column: 1 / -1; }
.builder-form label:last-child, .builder-form > .builder-actions { grid-column: 1 / -1; }
.builder-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.msg { min-height: 18px; font-size: 13px; margin-bottom: 8px; color: var(--danger); }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 16px 0 24px; }

/* ---------- Checkbox inline (toolbars y filtros) ---------- */

.chk-inline {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-2); cursor: pointer; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface-2); border-radius: 7px;
  padding: 5px 10px; user-select: none;
}
.chk-inline:hover { border-color: var(--primary); color: var(--primary); }
.chk-inline input { accent-color: var(--primary); margin: 0; }

/* ---------- Tabla: edición por doble clic ---------- */

.cell-value { cursor: text; }
.cell-value:hover { background: var(--primary-soft); outline: 1px dashed var(--primary); }
.cell-edit { width: 100%; min-width: 70px; border: 1px solid var(--primary); border-radius: 5px; padding: 2px 6px; font-size: 13px; font-family: var(--font); color: var(--text); background: #fff; outline: none; }

/* ---------- Dashboard: quick reports ---------- */

.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.quick-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; cursor: pointer; text-align: left; color: var(--text);
  transition: border-color .15s, box-shadow .15s, transform .15s; font-family: var(--font);
}
.quick-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.qc-title { font-size: 13.5px; font-weight: 600; }
.qc-desc { font-size: 12px; color: var(--muted); }
.qc-arrow { margin-top: 4px; font-size: 14px; color: var(--primary); font-weight: 700; }

/* ---------- Asistente IA ---------- */

.ai-open { color: var(--primary); }
.ai-open:hover { background: var(--primary-soft); }
.ai-open.active { background: var(--primary); color: #fff; }

.ai-chat {
  position: fixed; right: 20px; bottom: 20px; z-index: 120;
  width: 360px; max-width: calc(100vw - 24px); height: 520px; max-height: calc(100vh - 40px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, .22);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; transform: translateY(16px) scale(.98); pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.ai-chat.open { opacity: 1; transform: none; pointer-events: auto; }
.ai-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong)); color: #fff;
}
.ai-avatar { width: 30px; height: 30px; border-radius: 9px; background: rgba(255, 255, 255, .18); display: flex; align-items: center; justify-content: center; flex: none; }
.ai-avatar svg { width: 17px; height: 17px; }
.ai-title { flex: 1; min-width: 0; }
.ai-title b { display: block; font-size: 13px; }
.ai-title i { display: block; font-style: normal; font-size: 11px; opacity: .85; }
.ai-close { background: none; border: none; color: #fff; font-size: 18px; cursor: pointer; line-height: 1; padding: 2px 4px; }
.ai-close:hover { opacity: .8; }
.ai-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.ai-msg { display: flex; }
.ai-msg.user { justify-content: flex-end; }
.ai-bubble {
  max-width: 86%; padding: 8px 11px; border-radius: 12px; font-size: 13px; line-height: 1.45;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-bottom-left-radius: 4px; white-space: pre-wrap;
}
.ai-msg.user .ai-bubble { background: var(--primary); border-color: var(--primary); color: #fff; border-bottom-left-radius: 12px; border-bottom-right-radius: 4px; }
.ai-bubble b { font-weight: 600; }
.ai-sugs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; }
.ai-sug {
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2);
  border-radius: 999px; padding: 5px 10px; font-size: 11.5px; cursor: pointer; font-family: var(--font);
}
.ai-sug:hover { border-color: var(--primary); color: var(--primary); }
.ai-input { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--surface-2); }
.ai-input input { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: var(--font); outline: none; }
.ai-input input:focus { border-color: var(--primary); }

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .dash-card.span-8, .dash-card.span-4 { grid-column: span 12; }
}

@media (max-width: 980px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 0 0 40px rgba(15, 23, 42, .18);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar.collapsed { width: var(--sidebar-w); }
  .sidebar.collapsed .brand-name, .sidebar.collapsed .brand-sub,
  .sidebar.collapsed .nav-label, .sidebar.collapsed .nav-section { display: block; }
  .sidebar.collapsed .nav-item { justify-content: flex-start; padding: 9px 10px; }
  .main { margin-left: 0 !important; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; }
}

@media (max-width: 760px) {
  .uc-text { display: none; }
  .h-date { display: none; }
  .pages { padding: 16px 12px 32px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .charts-grid { grid-template-columns: 1fr; }
  .builder-form { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .topbar-right { gap: 6px; }
}

/* ---------- Resumen por hotel ---------- */

.hotel-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.hotel-top .badge { font-size: 12px; }
.hs-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
@media (max-width: 860px) { .hs-grid { grid-template-columns: 1fr; } }
.hs-block h4 { margin: 0 0 8px; font-size: 13px; color: var(--text-2); }
.hs-table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 9px; }
.hs-table-wrap table.htable { min-width: 520px; }
.hs-code { font-weight: 700; color: var(--primary); background: var(--primary-soft); border-radius: 5px; padding: 1px 6px; font-size: 11px; }
.hs-dest { font-size: 12px; color: var(--muted); }
.hs-bar { margin-bottom: 7px; }
.hs-bar .hb-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); margin-bottom: 3px; }
.hs-bar .hb-label b { font-family: var(--mono); font-weight: 600; }
.hs-bar .hb-track { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.hs-bar .hb-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), #7c9cf5); }


/* ---------- Acceso PIN ---------- */
.pin-overlay { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 20% -10%, #1e3a8a 0%, #0f172a 55%, #0b1020 100%); padding: 20px; }
.pin-overlay.hidden { display: none; }
.pin-card { width: 100%; max-width: 340px; background: #0f172a; border: 1px solid rgba(148,163,184,.18);
  border-radius: 18px; padding: 32px 28px; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.45); }
.pin-lock { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; }
.pin-lock svg { width: 26px; height: 26px; }
.pin-card h2 { margin: 0 0 4px; font-size: 20px; color: #f1f5f9; }
.pin-sub { margin: 0 0 20px; font-size: 13px; color: #94a3b8; }
#pinInput { width: 100%; box-sizing: border-box; text-align: center; font-size: 22px; letter-spacing: 8px; padding: 12px 10px;
  border-radius: 10px; border: 1px solid #334155; background: #0b1220; color: #e2e8f0; outline: none; }
#pinInput:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.25); }
.pin-error { min-height: 18px; margin-top: 8px; font-size: 13px; color: #f87171; }
#pinBtn { width: 100%; margin-top: 6px; }
.pin-hint { margin: 16px 0 0; font-size: 12px; color: #64748b; }
body.locked { overflow: hidden; }
body.locked .app { filter: blur(3px); pointer-events: none; user-select: none; }
.msg.ok { color: #16a34a; }
