:root {
  color-scheme: light;
  --page: #f5f8ff;
  --surface: #ffffff;
  --surface-soft: #f4f7ff;
  --ink: #0e2051;
  --muted-ink: #586985;
  --line: #dce6f7;
  --side: #071741;
  --shadow: 0 16px 40px rgba(26, 55, 123, .10);
  --glass: linear-gradient(145deg, rgba(255,255,255,.98), rgba(235,243,255,.85));
  background: var(--page);
  color: var(--ink);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0b1430;
  --surface: #142449;
  --surface-soft: #1b315e;
  --ink: #f5f8ff;
  --muted-ink: #b9c8e6;
  --line: #314c7e;
  --side: #071129;
  --shadow: 0 18px 42px rgba(0, 4, 18, .28);
  --glass: linear-gradient(145deg, rgba(39,63,107,.96), rgba(20,36,73,.94));
}
html, body { min-width: 320px; max-width: 100%; overflow-x: hidden; background: var(--page); color: var(--ink); }
body, button, input, select, textarea { font-family: Inter, "Segoe UI", Arial, sans-serif; }
button { -webkit-tap-highlight-color: transparent; }
.shell { grid-template-columns: 252px minmax(0, 1fr); background: var(--page); }
.side { background: linear-gradient(165deg, #0a245c 0%, var(--side) 62%); box-shadow: 9px 0 28px rgba(5,21,63,.13); }
.brand { display: flex; align-items: center; gap: 12px; line-height: .95; color: #fff; margin: 6px 8px 30px; }
.brand span:not(.brand-mark) { color: #fff; }
.brand b { font-weight: 850; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 46px; border-radius: 16px; background: linear-gradient(140deg, #20c5ff, #0875e5 45%, #814be4); color: #fff; box-shadow: inset 0 2px 3px #ffffff77, 0 7px 15px #1787eb66; font-weight: 900; }
.nav-label { color: #a9c6f3; margin-top: 22px; }
.nav button { color: #e2eeff; font-weight: 680; margin: 3px 0; border: 1px solid transparent; }
.nav button:hover, .nav button.active { background: linear-gradient(115deg, #0878f6, #18a8ff); border-color: #72caff; box-shadow: inset 0 1px 3px #ffffff77, 0 7px 18px #128aff66; }
.nav-business { display: flex; align-items: center; gap: 10px; }
.nav-dot { display: inline-block; flex: 0 0 9px; width: 9px; height: 9px; border-radius: 50%; background: #8db5ff; }
.nav-dot.guarderia { background: #b56dff; }
.nav-dot.lavanderia { background: #ff637a; }
.nav-dot.limpieza { background: #35a6ff; }
.side-foot { border-color: #486492; }
.content { min-width: 0; width: 100%; padding: 24px clamp(16px, 2vw, 35px) 44px; }
.top { padding-bottom: 8px; margin-bottom: 17px; }
.top-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.top h1 { color: var(--ink); font-size: clamp(1.7rem, 3vw, 2.5rem); letter-spacing: -.045em; }
.top p { color: var(--muted-ink); font-size: .97rem; }
.pill { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 5px 12px #17479515; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 13px; background: var(--glass); color: var(--ink); box-shadow: inset 0 1px #ffffff88, 0 6px 14px #164b9919; font-size: 1.3rem; }
.primary { background: linear-gradient(115deg, #087af3, #2566d9); border: 1px solid #6acbff; box-shadow: inset 0 2px 2px #ffffff99, 0 9px 19px #087dec42; }
.primary:hover { filter: brightness(1.06); }
.text-button { color: #1168db; font-weight: 720; }
.cards { gap: 14px; }
.business-card { min-width: 0; min-height: 155px; padding: 20px; border: 1px solid #ffffff82; border-radius: 20px; box-shadow: inset 0 2px 2px #ffffff6e, 0 12px 27px #14367730; }
.business-card::before { content: ""; position: absolute; inset: 0 0 50%; border-radius: inherit; background: linear-gradient(#ffffff59, #ffffff00); pointer-events: none; }
.business-card img { width: 42%; height: 78%; right: 8px; top: 10px; opacity: 1; filter: saturate(1.16) brightness(1.08) drop-shadow(0 9px 10px #06154455); }
.business-card strong { font-size: 1.19rem; max-width: 58%; text-shadow: 0 2px 4px #06154450; }
.business-card small { max-width: 58%; font-size: .83rem; }
.guarderia.business-card { background: linear-gradient(125deg, #cd79ef, #8637ce 70%, #5d20a8); }
.lavanderia.business-card { background: linear-gradient(125deg, #ff7890, #e93957 68%, #c82247); }
.limpieza.business-card { background: linear-gradient(125deg, #2ca5fa, #0868d5 68%, #103991); }
.section { background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow), inset 0 1px #ffffff99; border-radius: 19px; padding: 21px; }
.section .section { box-shadow: none; }
.section h2, .section h3 { color: var(--ink); }
.stats { gap: 12px; }
.stat { min-width: 0; border: 1px solid var(--line); background: var(--surface-soft); box-shadow: inset 0 1px #ffffff9c; }
.stat:nth-child(4n + 1) { background: linear-gradient(130deg, #f6ecff, #eee3ff); }
.stat:nth-child(4n + 2) { background: linear-gradient(130deg, #fff3f5, #ffe6ec); }
.stat:nth-child(4n + 3) { background: linear-gradient(130deg, #edf7ff, #deefff); }
.stat:nth-child(4n + 4) { background: linear-gradient(130deg, #effff6, #dffae9); }
:root[data-theme="dark"] .stat { background: var(--surface-soft); }
.stat strong { color: var(--ink); overflow-wrap: anywhere; font-size: clamp(1.35rem, 2.2vw, 1.75rem); }
.stat span { color: var(--muted-ink); }
.toolbar { min-width: 0; }
.toolbar > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.toolbar input, .toolbar select, .form-grid input, .form-grid select, .form-grid textarea, .auth-card input { min-width: 0; max-width: 100%; background: var(--surface); color: var(--ink); border-color: var(--line); }
.toolbar input, .toolbar select { padding: 11px 12px; border-radius: 11px; }
.form-grid { min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
.form-grid label { min-width: 0; color: var(--ink); }
.time-12 { display: grid; grid-template-columns: minmax(0,1fr) 72px minmax(0,1fr); gap: 7px; }
.time-12 input, .time-12 select { width: 100%; }
.permission-group { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-top: 12px; background: var(--surface); }
.permission-heading { display: flex !important; align-items: center; gap: 9px; margin: 0 0 9px !important; font-weight: 800; }
.permission-heading input, .permission-grid input { width: auto !important; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 4px 13px; }
.permission-grid label { display: flex !important; align-items: center; gap: 8px; margin: 0 !important; padding: 6px; font-weight: 570; }
.permission-disabled { opacity: .45; pointer-events: none; }
.staff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 13px; }
.staff-card, .audit-card { min-width: 0; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); padding: 16px; box-shadow: 0 6px 16px #173b770e; }
.staff-main { display: grid; gap: 5px; text-align: left; width: 100%; border: 0; background: transparent; color: var(--ink); padding: 0; }
.staff-main strong { font-size: 1.12rem; }
.staff-main span { color: var(--muted-ink); }
.staff-main small { color: #1675dc; }
.staff-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 5px; }
.audit-list { display: grid; gap: 10px; }
.audit-card p { color: var(--muted-ink); margin: 7px 0; overflow-wrap: anywhere; }
.audit-card details { margin-top: 10px; }
.audit-card summary { color: #1168db; font-weight: 700; cursor: pointer; }
.audit-card li { padding: 4px 0; overflow-wrap: anywhere; }
@media (max-width: 680px) { .permission-grid { grid-template-columns: 1fr; } }
.modal { background: var(--surface); color: var(--ink); width: min(720px, 100%); max-width: 100%; box-shadow: 0 25px 80px #030a2c66; }
.close { background: var(--surface-soft); color: var(--ink); }
.table-wrap { max-width: 100%; overflow-x: auto; }
table { min-width: 600px; }
th, td { border-color: var(--line); color: var(--ink); }
th { color: var(--muted-ink); }
tbody tr:hover { background: var(--surface-soft); }
.empty { background: var(--surface-soft); color: var(--muted-ink); }
.muted { color: var(--muted-ink); }
.notice { background: var(--surface-soft); color: var(--ink); border: 1px solid var(--line); }
.report-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 16px; }
.chart-panel { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 17px; min-width: 0; }
.chart-panel h3 { margin: 0 0 10px; }
.bar-pair { display: flex; align-items: flex-end; gap: 4px; height: 110px; }
.bar-pair span { display: block; width: 14px; border-radius: 6px 6px 2px 2px; }
.report-bars { display: flex; justify-content: space-around; align-items: flex-end; min-height: 130px; border-bottom: 1px solid var(--line); padding: 10px 0 0; }
.report-income { background: linear-gradient(#149cff, #5a6bf1); }
.report-outflow { background: linear-gradient(#ff768a, #f34e6c); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 13px; color: var(--muted-ink); font-size: .85rem; }
.chart-legend b { color: var(--ink); }
.report-ring { width: 145px; height: 145px; border-radius: 50%; flex: 0 0 145px; display: grid; place-items: center; }
.report-ring::after { content: ""; grid-area: 1/1; width: 95px; height: 95px; border-radius: 50%; background: var(--surface); }
.ring-label { grid-area: 1/1; z-index: 1; text-align: center; font-weight: 800; color: var(--ink); }
.report-share { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.report-share-list { flex: 1; min-width: 155px; }
.report-share-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: .86rem; }
.report-share-row span { color: var(--muted-ink); }
.business-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 122px; color: #fff; border-radius: 20px; padding: 16px 22px; box-shadow: inset 0 2px #ffffff88, 0 12px 30px #23478933; overflow: hidden; }
.business-hero.guarderia { background: linear-gradient(115deg, #bc5ee4, #7530ca); }
.business-hero.lavanderia { background: linear-gradient(115deg, #fa6c83, #d72b4c); }
.business-hero.limpieza { background: linear-gradient(115deg, #288cf3, #0b4fae); }
.business-hero h2 { color: #fff; margin: 0 0 6px; }
.business-hero p { margin: 0; color: #fff; }
.business-hero img { width: 120px; height: 95px; object-fit: contain; filter: brightness(1.1) saturate(1.15) drop-shadow(0 6px 8px #06154455); }
.scope-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.scope-actions button { border: 1px solid var(--line); color: var(--ink); background: var(--glass); border-radius: 12px; padding: 10px 13px; font-weight: 700; box-shadow: inset 0 1px #ffffffaa; }
.scope-actions button.active { color: #fff; background: linear-gradient(110deg, #137cf5, #1661d7); border-color: #70c8ff; }
.mobile-bottom { display: none; }
.receipt-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 330px); gap: 18px; align-items: start; }
.receipt-paper { background: #fff; color: #111; border: 1px solid #c9d0da; border-radius: 3px; padding: 17px; margin: 0 auto; box-shadow: 0 12px 25px #1420472b; overflow-wrap: anywhere; }
.receipt-paper h3 { color: #111; text-align: center; margin: 0 0 10px; }
.receipt-paper p { margin: 5px 0; }
.receipt-paper hr { border: 0; border-top: 1px dashed #777; margin: 11px 0; }
.receipt-paper .receipt-row { display: flex; justify-content: space-between; gap: 9px; }
.receipt-paper .receipt-row strong { text-align: right; }
.receipt-preview-wrap { background: var(--surface-soft); padding: 16px; border-radius: 15px; overflow: auto; }
.auth-card { background: var(--surface); color: var(--ink); }
.auth-card h2 { color: var(--ink); }
.auth-card-wrap { background: var(--page); }
.auth-art { background: radial-gradient(circle at 25% 20%, #1758b4, transparent 40%), linear-gradient(145deg, #0d2b65, #071638); }
@media (max-width: 900px) {
  .shell { display: block; padding-bottom: 68px; }
  .side { width: min(300px, 84vw); }
  .mobile-bottom { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 15; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 25px #0718381e; justify-content: space-around; gap: 2px; padding: 5px 6px max(5px, env(safe-area-inset-bottom)); }
  .mobile-bottom button { min-width: 0; flex: 1; border: 0; background: transparent; color: var(--muted-ink); padding: 7px 1px; border-radius: 9px; font-size: .70rem; font-weight: 750; display: flex; flex-direction: column; align-items: center; gap: 3px; }
  .mobile-bottom button.active { color: #126ff0; background: var(--surface-soft); }
  .mobile-bottom .mobile-icon { font-size: 1.15rem; line-height: 1; }
}
@media (max-width: 680px) {
  .content { padding: 16px 13px 24px; }
  .top { align-items: center; }
  .top-heading { flex: 1; }
  .top h1 { font-size: 1.54rem; overflow-wrap: anywhere; }
  .top p { font-size: .83rem; }
  .top-actions .pill { display: none; }
  .mobile-toggle { flex: 0 0 auto; }
  .cards { grid-template-columns: 1fr; gap: 10px; }
  .business-card { min-height: 112px; padding: 15px; }
  .business-card img { width: 35%; height: 92%; top: 4px; }
  .business-card strong { font-size: 1.05rem; max-width: 65%; }
  .business-card small { max-width: 65%; }
  .section { padding: 16px; margin-top: 13px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .stat { padding: 13px; }
  .stat strong { font-size: 1.3rem; }
  .stat span { font-size: .82rem; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { border-radius: 20px 20px 0 0; padding: 17px; max-height: 93dvh; width: 100%; }
  .modal-head { gap: 10px; }
  .modal-head h2 { font-size: 1.2rem; }
  .form-actions { flex-wrap: wrap; }
  .form-actions button { min-height: 44px; }
  .report-grid, .receipt-layout { grid-template-columns: 1fr; }
  .toolbar input { width: 100%; min-width: 0; }
  .toolbar > div { width: 100%; }
  .toolbar select, .toolbar button { flex: 1; }
  .business-hero { min-height: 96px; padding: 12px; }
  .business-hero img { width: 82px; height: 72px; }
  .business-hero h2 { font-size: 1.12rem; }
  .scope-actions { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 3px; }
  .scope-actions button { flex: 0 0 auto; white-space: nowrap; }
  input, select, textarea { font-size: 16px !important; }
}
@media print {
  .side, .mobile-bottom, .top-actions, .scope-actions { display: none !important; }
  .content { padding: 0; }
  .section, .chart-panel { box-shadow: none; }
}
.install-button{border:1px solid #6fa8f8;border-radius:12px;background:linear-gradient(135deg,#e6f3ff,#d9e8ff);color:#103b82;padding:11px 14px;font-size:1rem;font-weight:750;white-space:nowrap;box-shadow:0 6px 18px #1d63b21c}
#install-app{display:block;width:100%;margin-top:12px}
.install-hint{font-size:.9rem;line-height:1.4;margin:10px 0 0}
@media(max-width:620px){#install-app-top{font-size:.85rem;padding:9px 10px}.top-actions{gap:6px;flex-shrink:0}}
