:root {
  color-scheme: light;
  --ink: #1b2328;
  --muted: #5d6b73;
  --line: #d3dadf;
  --paper: #f1f3f5;
  --white: #fff;
  --navy: #0b3347;
  --navy-2: #176889;
  --teal: #176889;
  --teal-light: #dcebf2;
  --blue-bright: #1e88c8;
  --green: #2e9e4f;
  --amber: #a76812;
  --amber-light: #fff3df;
  --red: #b3261e;
  --shadow: 0 10px 30px rgba(11, 51, 71, .09);
  font-family: "DM Sans", "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 340px; min-height: 100vh; color: var(--ink); background: var(--paper); }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, .92fr) 1.08fr; background: var(--white); }
.login-brand { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 100vh; padding: 9vw; overflow: hidden; color: white; background: radial-gradient(ellipse at 16% 84%, rgba(16, 137, 125, .31), transparent 42%), linear-gradient(145deg, #102b3b, #173e50); }
.login-brand::after { position: absolute; right: -180px; bottom: -235px; width: 560px; height: 560px; border: 1px solid rgba(255,255,255,.11); border-radius: 50%; box-shadow: 0 0 0 52px rgba(255,255,255,.025), 0 0 0 104px rgba(255,255,255,.02); content: ""; }
.brand-mark { display: grid; width: 52px; height: 52px; place-items: center; border: 1px solid rgba(255,255,255,.28); border-radius: 16px; color: white; background: linear-gradient(145deg, #19a698, #08756f); font: 800 27px Manrope, sans-serif; box-shadow: 0 8px 22px rgba(0, 0, 0, .13); }
.login-brand .brand-mark { margin-bottom: 58px; }
.eyebrow { margin: 0 0 11px; color: var(--teal); font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.login-brand .eyebrow { color: #80cfc3; }
.login-brand h1 { margin: 0; font: 700 clamp(36px, 4vw, 58px)/1.13 Manrope, sans-serif; letter-spacing: -.055em; }
.login-copy { max-width: 430px; margin: 23px 0 0; color: #c1d0d5; font-size: 15px; line-height: 1.8; }
.login-footnote { position: absolute; z-index: 1; bottom: 40px; display: flex; align-items: center; gap: 9px; color: #c1d0d5; font-size: 12px; }
.login-panel { display: grid; place-items: center; padding: 40px; }
.login-card { width: min(390px, 100%); }
.login-card h2 { margin: 0 0 8px; font: 700 30px Manrope, sans-serif; letter-spacing: -.04em; }
.muted { color: var(--muted); }
.login-card > .muted { margin: 0 0 32px; font-size: 14px; }
.login-card label { display: block; margin: 18px 0 8px; font-size: 12px; font-weight: 700; }
.login-card input { width: 100%; height: 48px; padding: 0 13px; border: 1px solid #dce4e6; border-radius: 9px; outline: none; color: var(--ink); background: white; transition: border .15s, box-shadow .15s; }
.login-card input:focus, .search-box:focus-within { border-color: #159b8e; box-shadow: 0 0 0 3px rgba(21,155,142,.11); }
.button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 8px; font-size: 12px; font-weight: 700; transition: transform .15s, background .15s; }
.button:active { transform: translateY(1px); }
.button:disabled { cursor: wait; opacity: .65; }
.button-primary { color: white; background: var(--teal); }
.button-primary:hover { background: #08796f; }
.button-wide { width: 100%; min-height: 48px; margin-top: 24px; }
.login-security { margin: 18px 0 0; color: #96a2a7; font-size: 11px; text-align: center; }
.form-error { color: var(--red); font-size: 12px; line-height: 1.5; }

.app-layout { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 2; display: flex; width: 248px; flex-direction: column; padding: 28px 18px 18px; color: white; background: var(--navy); }
.brand-lockup { display: flex; align-items: center; gap: 11px; padding: 2px 5px 31px; color: white; text-decoration: none; }
.brand-lockup strong { display: block; font: 800 20px Manrope, sans-serif; letter-spacing: -.06em; }
.brand-lockup strong span { color: #74c9bd; }
.brand-lockup small { display: block; margin-top: 3px; color: #8da5ae; font-size: 8px; font-weight: 700; letter-spacing: .15em; }
.brand-mark-small { width: 39px; height: 39px; border-radius: 12px; font-size: 21px; }
.nav-caption { margin: 8px 10px 11px; color: #7d97a1; font-size: 9px; font-weight: 700; letter-spacing: .13em; }
.main-nav { display: grid; gap: 6px; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; color: #afc0c6; background: transparent; text-align: left; font-size: 12px; font-weight: 600; }
.nav-item:hover { color: white; background: rgba(255,255,255,.06); }
.nav-item.is-active { color: white; background: rgba(67, 174, 158, .2); box-shadow: inset 3px 0 #42b8a7; }
.nav-icon { width: 18px; color: #83c9be; font-size: 18px; text-align: center; }
.sidebar-bottom { display: grid; gap: 15px; margin-top: auto; padding: 14px 7px 3px; border-top: 1px solid rgba(255,255,255,.1); }
.connection-state { display: flex; align-items: center; gap: 8px; color: #aec1c6; font-size: 10px; }
.online-dot { display: inline-block; width: 7px; height: 7px; flex: none; border-radius: 50%; background: #45c7a5; box-shadow: 0 0 0 3px rgba(69,199,165,.12); }
.logout-button { display: flex; align-items: center; gap: 10px; padding: 9px 0; border: 0; color: #d0dcdf; background: transparent; text-align: left; font-size: 11px; }
.logout-button:hover { color: white; }
.logout-button span { font-size: 18px; }
.sidebar .nav-item[hidden] { display: none; }

.workspace { min-height: 100vh; margin-left: 248px; }
.topbar { position: sticky; top: 0; z-index: 1; display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 15px; padding: 0 40px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: #879399; font-size: 11px; }
.breadcrumb-divider { color: #c2cbce; }
.breadcrumb strong { color: var(--ink); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.last-updated { color: #91a0a5; font-size: 10px; }
.button-refresh { min-height: 35px; border: 1px solid #dce5e6; color: #43575e; background: white; }
.button-refresh span { margin-right: 6px; color: var(--teal); font-size: 17px; vertical-align: -1px; }
.button-refresh:hover { border-color: #9acbc4; background: #f6fbfa; }
.user-chip { display: flex; align-items: center; gap: 8px; padding-left: 15px; border-left: 1px solid var(--line); }
.avatar { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 50%; color: #0a766e; background: #ddf2ed; font-size: 11px; font-weight: 700; }
.user-name { max-width: 145px; overflow: hidden; color: #465960; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.page-content { width: min(1400px, 100%); margin: auto; padding: 34px 40px 24px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.page-heading h1 { margin: 0 0 6px; font: 700 26px Manrope, sans-serif; letter-spacing: -.045em; }
.page-heading .muted { margin: 0; font-size: 12px; }
.live-badge { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; padding: 8px 11px; border: 1px solid #dbece8; border-radius: 20px; color: #41786e; background: #f6fbf9; font-size: 10px; font-weight: 600; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 17px; }
.metric-card, .panel, .zone-card { border: 1px solid #e8edef; border-radius: 12px; background: var(--white); box-shadow: var(--shadow); }
.metric-card { min-height: 132px; padding: 18px 18px 16px; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: #708087; font-size: 10px; font-weight: 600; }
.metric-icon { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 9px; color: #0b897d; background: var(--teal-light); font-size: 14px; }
.metric-card:nth-child(2) .metric-icon { color: #a66d1a; background: var(--amber-light); }
.metric-card:nth-child(3) .metric-icon { color: #5280aa; background: #e9f2fa; }
.metric-card:nth-child(4) .metric-icon { color: #755db0; background: #f0ecfa; }
.metric-value { display: block; margin-top: 13px; color: var(--ink); font: 700 24px Manrope, sans-serif; letter-spacing: -.04em; }
.metric-foot { display: block; margin-top: 5px; color: #8b989d; font-size: 10px; }
.panel { margin-bottom: 16px; padding: 21px 22px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 17px; }
.panel-heading h2 { margin: 0 0 5px; font: 700 14px Manrope, sans-serif; letter-spacing: -.02em; }
.panel-heading .muted { margin: 0; font-size: 10px; }
.panel-unit { color: #8c999e; font-size: 9px; font-weight: 700; letter-spacing: .1em; }
.chart-panel { min-height: 228px; }
.weekly-chart { display: grid; min-height: 135px; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: end; gap: 18px; padding: 0 7px; }
.chart-day { display: grid; height: 125px; grid-template-rows: 1fr 15px; justify-items: center; gap: 6px; }
.chart-bar-wrap { display: flex; width: 100%; align-items: flex-end; justify-content: center; }
.chart-bar { width: min(27px, 60%); min-height: 3px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, #3eb5a2, #128b80); }
.chart-day:first-child .chart-bar, .chart-day:last-child .chart-bar { background: #cbeae4; }
.chart-label { color: #8a979c; font-size: 9px; }
.zone-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.zone-card { width: 100%; padding: 16px; text-align: left; cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s; }
.zone-card:hover { transform: translateY(-2px); border-color: #a9d6cf; box-shadow: 0 12px 27px rgba(20, 88, 81, .09); }
.zone-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.zone-card h3 { margin: 0; font: 700 13px Manrope, sans-serif; }
.zone-arrow { color: #0b897d; font-size: 18px; }
.zone-card .zone-meta { margin: 5px 0 14px; color: #849197; font-size: 10px; }
.zone-stats { display: flex; align-items: center; gap: 17px; padding-top: 12px; border-top: 1px solid #edf0f1; color: #67777e; font-size: 10px; }
.zone-stats strong { display: block; margin-top: 3px; color: var(--ink); font-size: 12px; }
.zone-debt { margin-left: auto; text-align: right; }
.text-button { border: 0; color: var(--teal); background: transparent; font-size: 10px; font-weight: 700; }
.text-button:hover { color: #075f58; }
.content-view { animation: appear .2s ease-out; }
@keyframes appear { from { opacity: .6; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.customers-panel { margin-top: 18px; padding: 22px 0 0; overflow: hidden; }
.customers-heading { align-items: flex-end; padding: 0 22px; }
.customers-heading h2 { font-size: 17px; }
.search-box { display: flex; width: min(340px, 45%); height: 39px; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid #dce5e6; border-radius: 8px; color: #829096; transition: border .15s, box-shadow .15s; }
.search-box > span { font-size: 18px; }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 10px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
thead { background: #f8fafa; }
th { padding: 11px 15px; color: #87949a; font-size: 8px; font-weight: 700; letter-spacing: .09em; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 22px; }
th:last-child, td:last-child { padding-right: 22px; }
td { padding: 13px 15px; border-top: 1px solid #edf0f1; color: #5f7077; font-size: 10px; vertical-align: middle; }
td.customer-cell { color: var(--ink); font-weight: 700; }
.customer-phone { display: block; margin-top: 4px; color: #929da1; font-size: 9px; font-weight: 400; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 20px; color: #277b59; background: #e8f6ed; font-size: 9px; font-weight: 600; white-space: nowrap; }
.status-pill.inactive { color: #8b7070; background: #f5eded; }
.balance { color: #9c5f14; font-weight: 700; white-space: nowrap; }
.align-right { text-align: right; }
.empty-state { padding: 25px; color: #8a979c; font-size: 11px; text-align: center; }
.row-actions { min-width: 150px; white-space: nowrap; }
.small-button { margin: 2px 4px 2px 0; padding: 6px 8px; border: 1px solid #dce6e7; border-radius: 6px; color: #315b5b; background: #fff; font-size: 9px; font-weight: 600; }
.small-button:hover { border-color: #a6d2cb; background: #f3faf8; }
.small-button.small-danger { border-color: #f0d8d5; color: #a34e49; }
.small-button.small-danger:hover { background: #fff6f5; }
.add-customer-action { display: flex; justify-content: flex-end; padding: 0 22px 14px; }
.filter-row { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.filter-row label, .form-grid > label { display: grid; gap: 7px; color: #52656c; font-size: 10px; font-weight: 600; }
.filter-row input, .filter-row select, .form-grid input, .form-grid select { min-height: 38px; min-width: 150px; padding: 0 10px; border: 1px solid #dce5e6; border-radius: 7px; outline: 0; color: var(--ink); background: white; font-size: 11px; }
.filter-row input:focus, .filter-row select:focus, .form-grid input:focus, .form-grid select:focus { border-color: #159b8e; box-shadow: 0 0 0 3px rgba(21,155,142,.1); }
.filter-row > .muted { margin: 0 0 11px auto; font-size: 10px; }
.report-metrics { margin-top: 15px; }
.module-skeleton { min-height: 250px; }
.notice-success { border-color: #c6e6d8; color: #2d7353; background: #f2fbf6; }
.modal-backdrop { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; padding: 25px; background: rgba(11, 31, 40, .55); backdrop-filter: blur(3px); }
.modal-card { width: min(680px, 100%); max-height: min(88vh, 900px); overflow: auto; border: 1px solid #e0e8e9; border-radius: 14px; background: white; box-shadow: 0 25px 90px rgba(3, 22, 31, .28); }
.modal-heading { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); background: white; }
.modal-heading h2 { margin: 0; font: 700 16px Manrope, sans-serif; }
.icon-close { width: 30px; height: 30px; border: 0; border-radius: 50%; color: #6f7e83; background: #f1f5f5; font-size: 21px; }
.modal-content { padding: 20px 22px 23px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid .field-wide { grid-column: 1 / -1; }
.form-grid fieldset { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.form-grid legend { padding: 0 5px; color: #52656c; font-size: 10px; font-weight: 700; }
.zone-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.zone-checks label, .checkbox-label { display: flex !important; align-items: center; gap: 8px !important; color: #596c72 !important; font-size: 10px !important; font-weight: 500 !important; }
.zone-checks input, .checkbox-label input { min-width: 0; min-height: 0; accent-color: var(--teal); }
.checkbox-label { align-self: center; min-height: 36px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 5px; }
.receipt-preview { max-width: 400px; margin: auto; padding: 12px; color: #40535a; text-align: center; }
.receipt-brand { display: flex; justify-content: center; align-items: center; gap: 10px; margin-bottom: 18px; text-align: left; }
.receipt-brand strong, .receipt-brand small { display: block; }
.receipt-brand small { margin-top: 3px; color: #849197; font-size: 8px; letter-spacing: .12em; }
.receipt-number { padding: 12px; border-block: 1px dashed #c7d1d4; font-weight: 700; }
.receipt-total { margin: 20px 0; color: var(--teal); font: 800 28px Manrope, sans-serif; }
.receipt-preview .form-actions { margin-top: 25px; }
.notice { margin-bottom: 20px; padding: 12px 15px; border: 1px solid; border-radius: 9px; font-size: 11px; line-height: 1.5; }
.notice-error { border-color: #f0d2d0; color: #984646; background: #fff7f6; }
.skeleton { min-height: 95px; border-radius: 12px; background: linear-gradient(90deg, #edf1f2 25%, #f6f8f8 50%, #edf1f2 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.page-footer { display: flex; justify-content: space-between; padding: 10px 2px 0; color: #9aa5a9; font-size: 9px; }

@media (max-width: 1100px) {
  .sidebar { width: 215px; }
  .workspace { margin-left: 215px; }
  .topbar { padding: 0 25px; }
  .page-content { padding: 29px 25px 20px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .zone-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 740px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-brand { min-height: 250px; padding: 30px; }
  .login-brand .brand-mark { margin-bottom: 22px; }
  .login-brand h1 { font-size: 35px; }
  .login-copy { margin-top: 12px; font-size: 12px; }
  .login-footnote { display: none; }
  .login-panel { padding: 38px 25px; }
  .sidebar { position: sticky; top: 0; inset: auto; width: 100%; height: 59px; flex-direction: row; align-items: center; justify-content: space-between; padding: 0 12px; }
  .brand-lockup { padding: 0; }
  .brand-lockup strong { font-size: 16px; }
  .brand-lockup small, .nav-caption, .sidebar-bottom, .nav-item:not(.is-active) { display: none; }
  .brand-mark-small { width: 34px; height: 34px; }
  .main-nav { display: flex; overflow: visible; }
  .nav-item { min-height: 36px; padding: 0 10px; font-size: 10px; }
  .workspace { margin-left: 0; }
  .topbar { position: relative; min-height: 54px; padding: 0 15px; }
  .breadcrumb { font-size: 10px; }
  .topbar-actions { gap: 9px; }
  .last-updated, .user-name { display: none; }
  .user-chip { padding-left: 8px; }
  .button-refresh { min-height: 32px; padding: 0 9px; font-size: 10px; }
  .page-content { padding: 24px 15px 18px; }
  .page-heading { align-items: flex-start; }
  .page-heading h1 { font-size: 22px; }
  .page-heading .muted { max-width: 280px; line-height: 1.5; }
  .live-badge { padding: 7px; font-size: 0; }
  .live-badge .online-dot { margin: 0; }
  .metric-grid { gap: 9px; }
  .metric-card { min-height: 112px; padding: 13px; }
  .metric-value { font-size: 19px; }
  .metric-top { font-size: 9px; }
  .metric-icon { width: 25px; height: 25px; }
  .zone-grid { grid-template-columns: 1fr; }
  .panel { padding: 17px 14px; }
  .customers-heading { align-items: stretch; flex-direction: column; padding: 0 14px; }
  .search-box { width: 100%; }
  th { padding: 10px; }
  td { padding: 11px 10px; }
  th:first-child, td:first-child { padding-left: 14px; }
  th:last-child, td:last-child { padding-right: 14px; }
  .page-footer { gap: 10px; font-size: 8px; }
}

@media print {
  body.print-report * { visibility: hidden !important; }
  body.print-report #module-view, body.print-report #module-view * { visibility: visible !important; }
  body.print-report #module-view { position: absolute; inset: 0; display: block; padding: 20px; background: white; }
  body:not(.print-report) * { visibility: hidden !important; }
  body:not(.print-report) #modal-root, body:not(.print-report) #modal-root * { visibility: visible !important; }
  body:not(.print-report) #modal-root { position: absolute; inset: 0; display: block; padding: 0; background: white; }
  body:not(.print-report) .modal-card { width: 100%; max-height: none; overflow: visible; border: 0; box-shadow: none; }
  body:not(.print-report) .modal-heading, body:not(.print-report) .receipt-preview .form-actions { display: none !important; }
  body:not(.print-report) .modal-content { padding: 0; }
}

/* Tema EnCobros: colores del logo y de la app Android, tipografía más grande */
@media screen {
  :root { font-size: 17px; }
  body { font-size: 16px; }
  .login-brand { background: radial-gradient(ellipse at 16% 84%, rgba(30, 136, 200, .45), transparent 46%), linear-gradient(145deg, #0b3347, #176889); }
  .login-brand .eyebrow { color: #9bd3f2; font-size: 13px; }
  .login-brand h1 { font-size: clamp(40px, 4.4vw, 64px); }
  .login-copy { color: #dbe9f0; font-size: 18px; }
  .login-footnote { color: #dbe9f0; font-size: 14px; }
  .login-logo { width: min(330px, 80%); margin: 0 0 40px -12px; }
  .login-card-logo { display: block; width: 190px; margin: 0 auto 6px; }
  .eyebrow { color: var(--blue-bright); font-size: 13px; }
  .login-card h2 { font-size: 34px; }
  .login-card > .muted { font-size: 16px; }
  .login-card label { font-size: 15px; }
  .login-card input { height: 54px; font-size: 16px; border-color: #b9c6cd; }
  .login-card input:focus, .search-box:focus-within, .filter-row input:focus, .filter-row select:focus, .form-grid input:focus, .form-grid select:focus { border-color: var(--blue-bright); box-shadow: 0 0 0 3px rgba(30, 136, 200, .2); }
  .login-security { color: var(--muted); font-size: 13px; }
  .form-error { font-size: 14px; }
  .button { min-height: 46px; padding: 0 20px; border-radius: 9px; font-size: 15px; }
  .button-primary { background: linear-gradient(135deg, #1e88c8, #176889); box-shadow: 0 6px 16px rgba(23, 104, 137, .28); }
  .button-primary:hover { background: linear-gradient(135deg, #176889, #0b3347); }
  .button-wide { min-height: 54px; font-size: 16px; }

  .sidebar { width: 280px; background: linear-gradient(180deg, #0b3347 0%, #124f69 100%); }
  .workspace { margin-left: 280px; }
  .brand-lockup { padding: 0 0 22px; }
  .brand-logo { width: 100%; max-width: 220px; height: auto; display: block; }
  .nav-caption { color: #9bd3f2; font-size: 12px; }
  .nav-item { min-height: 50px; gap: 13px; color: #dbe9f0; font-size: 16px; font-weight: 600; }
  .nav-item:hover { background: rgba(255, 255, 255, .1); }
  .nav-item.is-active { background: rgba(30, 136, 200, .38); box-shadow: inset 4px 0 #5cc0f2; }
  .nav-icon { width: 22px; color: #7fd0f7; font-size: 21px; }
  .connection-state { color: #dbe9f0; font-size: 14px; }
  .online-dot { background: #4fd273; box-shadow: 0 0 0 3px rgba(79, 210, 115, .22); }
  .logout-button { color: #fff; font-size: 15px; }

  .topbar { min-height: 76px; border-bottom: 3px solid var(--blue-bright); background: #fff; }
  .breadcrumb { color: var(--muted); font-size: 15px; }
  .breadcrumb strong { color: var(--navy); font-weight: 700; }
  .last-updated { color: var(--muted); font-size: 13px; }
  .button-refresh { min-height: 42px; border-color: #b9c6cd; color: var(--navy); }
  .button-refresh span { color: var(--blue-bright); }
  .avatar { width: 38px; height: 38px; color: #fff; background: var(--teal); font-size: 14px; }
  .user-name { font-size: 15px; color: var(--ink); }
  .page-heading h1 { color: var(--navy); font-size: 32px; }
  .page-heading .muted { font-size: 15px; }
  .live-badge { border-color: #bfe1f3; color: #0b5d86; background: #e8f4fb; font-size: 13px; }

  .metric-card, .panel, .zone-card { border-color: #d3dadf; }
  .metric-card { min-height: 150px; border-top: 4px solid var(--blue-bright); }
  .metric-card:nth-child(2) { border-top-color: var(--green); }
  .metric-card:nth-child(3) { border-top-color: var(--amber); }
  .metric-card:nth-child(4) { border-top-color: var(--red); }
  .metric-top { color: var(--muted); font-size: 14px; }
  .metric-card strong, .metric-value { font-size: 1.15em; }
  .zone-card h3 { font-size: 17px; }
  .zone-arrow, .text-button { color: var(--blue-bright); }
  .zone-card .zone-meta, .zone-stats { color: var(--muted); font-size: 13px; }
  .zone-stats strong { font-size: 16px; }
  .text-button { font-size: 14px; }
  .customers-heading h2, .panel h2 { color: var(--navy); font-size: 21px; }
  .search-box { height: 46px; border-color: #b9c6cd; }
  .search-box input { font-size: 15px; }
  thead { background: #e3edf2; }
  th { padding: 14px 15px; color: var(--navy); font-size: 12px; font-weight: 800; }
  td { padding: 16px 15px; color: #33434b; font-size: 15px; }
  td.customer-cell { color: var(--navy); }
  .customer-phone { color: var(--muted); font-size: 13px; }
  tbody tr:hover { background: #f1f7fb; }
  .status-pill { padding: 6px 11px; color: #1f7a3b; background: #def3e4; font-size: 13px; font-weight: 700; }
  .status-pill.inactive { color: #8a3b36; background: #f8e3e1; }
  .balance { color: #965b0b; }
  .empty-state { color: var(--muted); font-size: 15px; }
  .small-button { padding: 8px 11px; border-color: #b9c6cd; color: var(--teal); font-size: 13px; }
  .small-button:hover { border-color: var(--blue-bright); background: #e8f4fb; }
  .filter-row label, .form-grid > label { color: #33434b; font-size: 14px; }
  .filter-row input, .filter-row select, .form-grid input, .form-grid select { min-height: 46px; border-color: #b9c6cd; font-size: 15px; }
  .filter-row > .muted { font-size: 14px; }
  .modal-heading h2 { color: var(--navy); font-size: 21px; }
  .form-grid legend { font-size: 14px; }
  .zone-checks label, .checkbox-label { color: #33434b !important; font-size: 14px !important; }
  .receipt-brand small { font-size: 11px; }
  .receipt-total { color: var(--teal); }
  .notice { font-size: 15px; }
  .notice-error { border-color: #f0c4c1; color: #8f241e; background: #fdf0ef; }
  .notice-success { border-color: #bfe3cb; color: #1f6b3a; background: #eef9f1; }
  .page-footer { color: var(--muted); font-size: 12px; }

  /* Sin tonos verdosos: azules del logo y de la app, gris institucional */
  .login-brand .eyebrow, .nav-caption { color: #a9d8f3; }
  .brand-lockup { display: block; padding: 0 0 26px; }
  .brand-logo { display: block; width: 220px; max-width: 100%; height: auto; object-fit: contain; }
  .login-logo { display: block; width: 300px; max-width: 100%; height: auto; margin: 0 0 40px; object-fit: contain; }
  .button-primary:hover { background: linear-gradient(135deg, #176889, #0b3347); }
  .nav-icon { color: #7fc4ee; }
  .nav-item.is-active { background: rgba(30, 136, 200, .38); box-shadow: inset 4px 0 #5cb8f0; }
  .online-dot { background: #5cb8f0; box-shadow: 0 0 0 3px rgba(92, 184, 240, .25); }
  .button-refresh:hover { border-color: var(--blue-bright); background: #e8f4fb; }
  .metric-icon { color: var(--teal); background: #dcebf2; }
  .metric-card:nth-child(2) .metric-icon { color: #4b4d4c; background: #e8eaec; }
  .zone-arrow { color: var(--blue-bright); }
  .text-button:hover { color: #0b3347; }
  .small-button:hover { border-color: var(--blue-bright); background: #e8f4fb; }
  .receipt-total { color: var(--teal); }
  .metric-card:nth-child(2) { border-top-color: #4b4d4c; }
  .status-pill { color: #176889; background: #dcebf2; }
  .status-pill.inactive { color: #4b4d4c; background: #e8eaec; }
  .notice-success { border-color: #bcd8e8; color: #0b3347; background: #e8f4fb; }
  .login-card input:focus, .search-box:focus-within { border-color: var(--blue-bright); }
  .panel .muted, .panel-heading .muted, .zone-grid .muted { font-size: 14px; }
  .panel-unit { color: var(--teal); font-size: 13px; font-weight: 700; }
  .page-footer { font-size: 13px; }
  .nav-item { min-height: 44px; }
  .main-nav { scrollbar-width: thin; scrollbar-color: #5cb8f0 transparent; }
  .main-nav::-webkit-scrollbar { width: 6px; }
  .main-nav::-webkit-scrollbar-thumb { border-radius: 6px; background: #5cb8f0; }
  .main-nav::-webkit-scrollbar-track { background: transparent; }

  /* Tipografía ampliada */
  :root { font-size: 18px; }
  body { font-size: 18px; }
  .sidebar { width: 300px; }
  .workspace { margin-left: 300px; }
  .brand-logo { width: 240px; }
  .nav-caption { font-size: 13px; }
  .nav-item { min-height: 48px; font-size: 18px; }
  .nav-icon { font-size: 23px; }
  .connection-state { font-size: 15px; }
  .logout-button { font-size: 17px; }
  .breadcrumb { font-size: 17px; }
  .last-updated { font-size: 14px; }
  .button { font-size: 17px; min-height: 48px; }
  .button-refresh { min-height: 46px; }
  .user-name { font-size: 17px; }
  .avatar { width: 42px; height: 42px; font-size: 16px; }
  .page-content { width: 100%; max-width: none; margin: 0; padding: 32px 36px 28px; }
  .topbar { padding: 0 36px; }
  .zone-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .metric-grid { gap: 20px; }
  .customers-panel, .panel { width: 100%; }
  .search-box { width: min(480px, 50%); }
  .page-heading h1 { font-size: 38px; }
  .page-heading .muted { font-size: 17px; }
  .eyebrow { font-size: 14px; }
  .live-badge { font-size: 15px; }
  .metric-top { font-size: 16px; }
  .metric-card { min-height: 165px; }
  .metric-card strong { font-size: 30px; }
  .zone-card h3 { font-size: 20px; }
  .zone-card .zone-meta, .zone-stats { font-size: 15px; }
  .zone-stats strong { font-size: 18px; }
  .text-button { font-size: 16px; }
  .customers-heading h2, .panel h2 { font-size: 24px; }
  .panel .muted, .panel-heading .muted, .zone-grid .muted { font-size: 16px; }
  .panel-unit { font-size: 15px; }
  .search-box { height: 50px; }
  .search-box input { font-size: 17px; }
  th { padding: 16px 16px; font-size: 14px; }
  td { padding: 18px 16px; font-size: 17px; }
  .customer-phone { font-size: 15px; }
  .status-pill { padding: 7px 13px; font-size: 15px; }
  .empty-state { font-size: 17px; }
  .small-button { padding: 9px 13px; font-size: 15px; }
  .filter-row label, .form-grid > label { font-size: 16px; }
  .filter-row input, .filter-row select, .form-grid input, .form-grid select { min-height: 50px; font-size: 17px; }
  .filter-row > .muted { font-size: 16px; }
  .modal-card { width: min(760px, 100%); }
  .modal-heading h2 { font-size: 24px; }
  .form-grid legend { font-size: 16px; }
  .zone-checks label, .checkbox-label { font-size: 16px !important; }
  .notice { font-size: 17px; }
  .page-footer { font-size: 14px; }
  .receipt-total { font-size: 34px; }
  .login-card h2 { font-size: 38px; }
  .login-card > .muted { font-size: 18px; }
  .login-card label { font-size: 17px; }
  .login-card input { height: 58px; font-size: 18px; }
  .login-brand h1 { font-size: clamp(42px, 4.6vw, 68px); }
  .login-copy { font-size: 20px; }
  .login-security, .form-error { font-size: 15px; }

  /* Jerarquía equilibrada y colores más vivos */
  :root { font-size: 16px; --blue-bright: #1e90e0; --teal: #1470a0; --navy: #0a3a5a; }
  body { font-size: 16px; background: #eef3f8; }
  .sidebar { background: linear-gradient(180deg, #0a3a5a 0%, #0f5d8c 60%, #1470a0 100%); }
  .nav-item { font-size: 16px; min-height: 46px; }
  .nav-item.is-active { background: linear-gradient(90deg, rgba(30, 144, 224, .6), rgba(30, 144, 224, .22)); box-shadow: inset 4px 0 #6cc8ff; }
  .nav-icon { color: #8fd4ff; }
  .topbar { border-bottom: 3px solid #1e90e0; }
  .breadcrumb { font-size: 15px; }
  .button { font-size: 15px; }
  .button-primary { background: linear-gradient(135deg, #1e90e0, #1470a0); box-shadow: 0 6px 16px rgba(30, 144, 224, .35); }
  .button-primary:hover { background: linear-gradient(135deg, #1470a0, #0a3a5a); }
  .user-name { font-size: 15px; }
  .avatar { background: linear-gradient(135deg, #1e90e0, #1470a0); }
  .page-heading h1 { font-size: 36px; color: #0a3a5a; }
  .page-heading .muted { font-size: 16px; }
  .eyebrow { color: #1e90e0; }
  .live-badge { border-color: #a9d8f8; color: #0b5d94; background: #e1f1fd; font-size: 14px; }

  .metric-card, .panel, .zone-card { border: 1px solid #cfdde8; box-shadow: 0 8px 24px rgba(20, 112, 160, .12); }
  .metric-card { border-top-width: 5px; background: linear-gradient(180deg, #ffffff 0%, #f3f9fe 100%); }
  .metric-card:nth-child(1) { border-top-color: #1e90e0; }
  .metric-card:nth-child(2) { border-top-color: #2e9e4f; }
  .metric-card:nth-child(3) { border-top-color: #f0a020; }
  .metric-card:nth-child(4) { border-top-color: #d8392f; }
  .metric-top { color: #4b5b65; font-size: 14px; font-weight: 700; letter-spacing: .02em; }
  .metric-card strong { font-size: 34px; color: #0a3a5a; }
  .metric-icon { color: #fff; background: #1e90e0; }
  .metric-card:nth-child(2) .metric-icon { color: #fff; background: #2e9e4f; }
  .metric-card:nth-child(3) .metric-icon { color: #fff; background: #f0a020; }
  .metric-card:nth-child(4) .metric-icon { color: #fff; background: #d8392f; }

  .zone-card h3 { font-size: 20px; color: #0a3a5a; }
  .zone-card .zone-meta, .zone-stats { font-size: 14px; }
  .zone-stats strong { font-size: 17px; }
  .zone-card:hover { border-color: #1e90e0; box-shadow: 0 10px 28px rgba(30, 144, 224, .22); }
  .customers-heading h2, .panel h2 { font-size: 24px; color: #0a3a5a; }
  .panel .muted, .panel-heading .muted, .zone-grid .muted { font-size: 14px; }
  .text-button { font-size: 15px; color: #1470a0; }

  thead { background: linear-gradient(90deg, #d4e9f8, #e3f0fa); }
  th { color: #0a3a5a; font-size: 13px; }
  td { font-size: 15px; color: #2b3b44; }
  td.customer-cell { font-size: 16px; font-weight: 700; color: #0a3a5a; }
  .customer-phone { font-size: 13px; }
  tbody tr:hover { background: #e8f4fd; }
  .status-pill { color: #0b5d94; background: #d4ebfb; font-size: 13px; }
  .status-pill.inactive { color: #5a5d5c; background: #e6e8e8; }
  .balance { color: #c0720a; font-size: 16px; }
  .small-button { color: #1470a0; border-color: #a9d8f8; background: #f3f9fe; font-size: 14px; }
  .small-button:hover { color: #fff; border-color: #1e90e0; background: #1e90e0; }
  .small-button.small-danger { color: #d8392f; border-color: #f2c4c0; background: #fff6f5; }
  .small-button.small-danger:hover { color: #fff; background: #d8392f; border-color: #d8392f; }

  .filter-row label, .form-grid > label { font-size: 14px; font-weight: 700; color: #0a3a5a; }
  .filter-row input, .filter-row select, .form-grid input, .form-grid select { min-height: 46px; font-size: 15px; border-color: #a9bfcf; }
  .filter-row > .muted { font-size: 14px; }
  .search-box input { font-size: 15px; }
  .empty-state { font-size: 15px; }
  .modal-heading h2 { font-size: 22px; color: #0a3a5a; }
  .modal-heading { border-bottom: 3px solid #1e90e0; }
  .form-grid legend { font-size: 14px; }
  .zone-checks label, .checkbox-label { font-size: 15px !important; }
  .notice { font-size: 15px; }
  .page-footer { font-size: 13px; }
  .receipt-total { font-size: 32px; color: #1470a0; }
  .login-card h2 { font-size: 36px; }
  .login-card > .muted { font-size: 16px; }
  .login-card label { font-size: 15px; }
  .login-card input { height: 54px; font-size: 16px; }
  .login-copy { font-size: 18px; }
  .login-brand { background: radial-gradient(ellipse at 16% 84%, rgba(30, 144, 224, .6), transparent 46%), linear-gradient(145deg, #0a3a5a, #1470a0); }
}
@media screen and (max-width: 1100px) {
  .sidebar { width: 240px; }
  .workspace { margin-left: 240px; }
}
@media screen and (max-width: 740px) {
  .sidebar { width: 100%; }
  .workspace { margin-left: 0; }
  .brand-logo { max-width: 120px; }
  .login-logo { width: 220px; margin-bottom: 20px; }
  .nav-item { min-height: 40px; font-size: 14px; }
}

@media screen {
  body { background: radial-gradient(ellipse at 100% 0%, #d6ecfb 0%, transparent 45%), radial-gradient(ellipse at 0% 100%, #dff3e6 0%, transparent 40%), #eaf1f8; }
  .page-content { background: transparent; }

  .metric-card { position: relative; overflow: hidden; transition: transform .18s, box-shadow .18s; }
  .metric-card::after { content: ""; position: absolute; right: -34px; bottom: -34px; width: 120px; height: 120px; border-radius: 50%; opacity: .14; background: currentColor; pointer-events: none; }
  .metric-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(20, 112, 160, .22); }
  .metric-card:nth-child(1) { color: #1e90e0; background: linear-gradient(160deg, #ffffff 30%, #d9eefc 100%); }
  .metric-card:nth-child(2) { color: #2e9e4f; background: linear-gradient(160deg, #ffffff 30%, #dcf3e3 100%); }
  .metric-card:nth-child(3) { color: #f0a020; background: linear-gradient(160deg, #ffffff 30%, #fdeccd 100%); }
  .metric-card:nth-child(4) { color: #d8392f; background: linear-gradient(160deg, #ffffff 30%, #fbdcd9 100%); }
  .metric-card .metric-value, .metric-card strong { color: #0a3a5a; }
  .metric-foot { font-size: 14px; color: #3e5460; }
  .metric-icon { width: 40px; height: 40px; font-size: 20px; border-radius: 12px; box-shadow: 0 6px 14px rgba(10, 58, 90, .25); }

  .panel { position: relative; border-top: 4px solid #1e90e0; background: linear-gradient(180deg, #ffffff 0%, #f6fafe 100%); }
  .chart-panel { border-top-color: #2e9e4f; background: linear-gradient(180deg, #ffffff 0%, #eef9f1 100%); }
  .chart-day { height: 160px; }
  .chart-bar { width: min(38px, 70%); background: linear-gradient(180deg, #4cc2ff, #1470a0); box-shadow: 0 4px 10px rgba(30, 144, 224, .3); transition: transform .15s, filter .15s; }
  .chart-day:hover .chart-bar { filter: brightness(1.12); transform: scaleY(1.03); transform-origin: bottom; }
  .chart-day:last-child .chart-bar { background: linear-gradient(180deg, #5fd88a, #2e9e4f); box-shadow: 0 4px 10px rgba(46, 158, 79, .35); }
  .chart-day:first-child .chart-bar { background: linear-gradient(180deg, #4cc2ff, #1470a0); }
  .chart-label { font-size: 13px; font-weight: 700; color: #4b6370; }

  .zone-card { position: relative; border-left: 6px solid #1e90e0; background: linear-gradient(135deg, #ffffff 40%, #e6f3fd 100%); transition: transform .18s, box-shadow .18s, border-color .18s; }
  .zone-card:nth-child(4n+2) { border-left-color: #2e9e4f; background: linear-gradient(135deg, #ffffff 40%, #e2f5e9 100%); }
  .zone-card:nth-child(4n+3) { border-left-color: #f0a020; background: linear-gradient(135deg, #ffffff 40%, #fdf0d6 100%); }
  .zone-card:nth-child(4n+4) { border-left-color: #8a5cd6; background: linear-gradient(135deg, #ffffff 40%, #efe8fb 100%); }
  .zone-card:hover { transform: translateY(-4px); }
  .zone-arrow { color: #fff; background: #1e90e0; border-radius: 50%; width: 32px; height: 32px; display: grid; place-items: center; }
  .zone-card:nth-child(4n+2) .zone-arrow { background: #2e9e4f; }
  .zone-card:nth-child(4n+3) .zone-arrow { background: #f0a020; }
  .zone-card:nth-child(4n+4) .zone-arrow { background: #8a5cd6; }
  .zone-debt strong { color: #c0720a; }
  .zone-stats strong { color: #0a3a5a; }

  thead { background: linear-gradient(90deg, #bfe0f8, #d9ecfa); }
  tbody tr:nth-child(even) { background: #f3f9fe; }
  tbody tr:hover { background: #dcefff; }
  .status-pill:not(.inactive) { color: #14733a; background: #d3f2de; }
  .panel-heading h2, .customers-heading h2 { position: relative; padding-left: 14px; }
  .panel-heading h2::before, .customers-heading h2::before { content: ""; position: absolute; left: 0; top: 14%; bottom: 14%; width: 5px; border-radius: 3px; background: linear-gradient(180deg, #1e90e0, #2e9e4f); }

  .icon-action { display: inline-grid; width: 38px; height: 38px; place-items: center; padding: 0; border: 0; border-radius: 10px; color: #fff; cursor: pointer; background: #1e90e0; box-shadow: 0 3px 8px rgba(10, 58, 90, .22); transition: transform .12s, filter .12s, box-shadow .12s; }
  .icon-action svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .icon-action:hover { transform: translateY(-2px); filter: brightness(1.1); box-shadow: 0 7px 14px rgba(10, 58, 90, .3); }
  .icon-action:focus-visible { outline: 3px solid #0a3a5a; outline-offset: 2px; }
  .icon-action.tone-blue { background: linear-gradient(135deg, #1e90e0, #1470a0); }
  .icon-action.tone-green { background: linear-gradient(135deg, #3cb862, #2e9e4f); }
  .icon-action.tone-amber { background: linear-gradient(135deg, #f7b73a, #e08e0b); }
  .icon-action.tone-orange { background: linear-gradient(135deg, #f58a3c, #dd6a14); }
  .icon-action.tone-red { background: linear-gradient(135deg, #ee5a50, #c9302a); }
  .row-actions { min-width: 0; gap: 8px; }
  .floating-tip { position: fixed; z-index: 1000; max-width: 240px; padding: 7px 12px; border-radius: 8px; color: #fff; background: #0a3a5a; font-size: 14px; font-weight: 600; pointer-events: none; box-shadow: 0 6px 16px rgba(10, 58, 90, .35); }
  .floating-tip[hidden] { display: none; }
}

@media screen {
  .filter-row { gap: 16px 20px; padding: 4px 2px 18px; align-items: flex-end; }
  .filter-row label { gap: 8px; }
  .filter-row #service-search { min-width: 340px; }
  .filter-row select { min-width: 190px; }
  .filter-row .button { min-height: 46px; padding: 0 20px; }
  .filter-row input[type="search"], .search-box input[type="search"] { background-image: none; }
  .search-box { padding: 0 16px; gap: 12px; background: #fff; border-color: #a9bfcf; }
  .search-box > span { font-size: 22px; color: #1470a0; }
  .table-scroll { margin-top: 6px; }
  th, td { padding: 16px 18px; }
  .row-actions { display: table-cell; width: 1%; min-width: 0; text-align: right; white-space: nowrap; padding-top: 12px; padding-bottom: 12px; }
  .row-actions .small-button { margin: 0 0 0 8px; padding: 9px 16px; border-radius: 8px; font-weight: 700; line-height: 1.1; }
  .row-actions .icon-action { width: 34px; height: 34px; margin-left: 6px; vertical-align: middle; }
  .row-actions .icon-action svg { width: 18px; height: 18px; }
  table:has(td.row-actions) th:last-child { text-align: right; }
  .customer-phone { margin-top: 4px; }
  .panel { padding: 22px 24px; }
  .panel-heading, .customers-heading { margin-bottom: 18px; gap: 16px; }
  .form-grid { gap: 18px 20px; }
  .form-actions { gap: 12px; margin-top: 6px; }
}

/* Paleta sobria: suaviza los colores intensos */
@media screen {
  .metric-card:nth-child(1) { background: linear-gradient(160deg, #fff 40%, #eef5fb 100%); }
  .metric-card:nth-child(2) { background: linear-gradient(160deg, #fff 40%, #eff7f2 100%); }
  .metric-card:nth-child(3) { background: linear-gradient(160deg, #fff 40%, #fbf5e8 100%); }
  .metric-card:nth-child(4) { background: linear-gradient(160deg, #fff 40%, #fbefee 100%); }
  .metric-card::after { opacity: .06; }
  .metric-card:nth-child(1) { border-top-color: #4a8fc2; }
  .metric-card:nth-child(2) { border-top-color: #4f9a6a; }
  .metric-card:nth-child(3) { border-top-color: #cf9a3f; }
  .metric-card:nth-child(4) { border-top-color: #c9605a; }
  .metric-card:nth-child(2) .metric-icon { background: #4f9a6a; }
  .metric-card:nth-child(3) .metric-icon { background: #cf9a3f; }
  .metric-card:nth-child(4) .metric-icon { background: #c9605a; }
  .metric-card:nth-child(1) .metric-icon { background: #4a8fc2; }
  .panel { border-top-color: #6fa3cc; background: #fff; }
  .chart-panel { border-top-color: #7fb092; background: #fff; }
  .chart-bar { background: linear-gradient(180deg, #7db4d9, #3f7fae); box-shadow: none; }
  .chart-day:first-child .chart-bar { background: linear-gradient(180deg, #7db4d9, #3f7fae); }
  .chart-day:last-child .chart-bar { background: linear-gradient(180deg, #86c19a, #4f9a6a); box-shadow: none; }
  .zone-card, .zone-card:nth-child(4n+2), .zone-card:nth-child(4n+3), .zone-card:nth-child(4n+4) { background: #fff; border-left-color: #6fa3cc; }
  .zone-card:nth-child(4n+2) { border-left-color: #7fb092; }
  .zone-card:nth-child(4n+3) { border-left-color: #d8b06a; }
  .zone-card:nth-child(4n+4) { border-left-color: #a493c9; }
  .zone-card .zone-arrow { background: #6fa3cc; }
  .zone-card:nth-child(4n+2) .zone-arrow { background: #7fb092; }
  .zone-card:nth-child(4n+3) .zone-arrow { background: #d8b06a; }
  .zone-card:nth-child(4n+4) .zone-arrow { background: #a493c9; }
  thead { background: #e6eef5; }
  .panel-heading h2::before, .customers-heading h2::before { background: #6fa3cc; }
  .icon-action { box-shadow: none; }
  .icon-action.tone-blue { background: #4a8fc2; }
  .icon-action.tone-green { background: #4f9a6a; }
  .icon-action.tone-amber { background: #cf9a3f; }
  .icon-action.tone-orange { background: #d38449; }
  .icon-action.tone-red { background: #c9605a; }
  .sidebar { background: linear-gradient(180deg, #0f3a55 0%, #165476 100%); }
  .nav-item.is-active { background: rgba(255, 255, 255, .14); box-shadow: inset 4px 0 #7fbfe6; }
}

/* Coherencia: azul de marca + 3 colores semánticos (verde, ámbar, rojo) con mejor contraste */
@media screen {
  :root { --brand: #14608a; --brand-dark: #0a3a5a; --ok: #2f7d52; --warn: #b9780f; --bad: #b53a33; }
  body { color: #1b2a36; background: #eaf0f5; }
  .metric-card, .panel, .zone-card { border-color: #c5d3de; }
  .metric-card:nth-child(1) { border-top-color: var(--brand); }
  .metric-card:nth-child(2) { border-top-color: var(--ok); }
  .metric-card:nth-child(3) { border-top-color: var(--warn); }
  .metric-card:nth-child(4) { border-top-color: var(--bad); }
  .metric-card:nth-child(1) .metric-icon { background: var(--brand); }
  .metric-card:nth-child(2) .metric-icon { background: var(--ok); }
  .metric-card:nth-child(3) .metric-icon { background: var(--warn); }
  .metric-card:nth-child(4) .metric-icon { background: var(--bad); }
  .metric-card .metric-value, .metric-card strong { color: var(--brand-dark); }
  .panel, .chart-panel { border-top-color: var(--brand); }
  .chart-bar, .chart-day:first-child .chart-bar { background: linear-gradient(180deg, #4d90b8, var(--brand)); }
  .chart-day:last-child .chart-bar { background: linear-gradient(180deg, #55a77a, var(--ok)); }
  .zone-card, .zone-card:nth-child(4n+2), .zone-card:nth-child(4n+3), .zone-card:nth-child(4n+4) { border-left-color: var(--brand); }
  .zone-card .zone-arrow, .zone-card:nth-child(4n+2) .zone-arrow, .zone-card:nth-child(4n+3) .zone-arrow, .zone-card:nth-child(4n+4) .zone-arrow { background: var(--brand); }
  thead { background: #dbe7f0; }
  thead th { color: var(--brand-dark); }
  .panel-heading h2::before, .customers-heading h2::before { background: var(--brand); }
  .icon-action.tone-blue { background: var(--brand); }
  .icon-action.tone-green { background: var(--ok); }
  .icon-action.tone-amber { background: var(--warn); }
  .icon-action.tone-orange { background: #5f7a8c; }
  .icon-action.tone-red { background: var(--bad); }
  .button-primary { background: var(--brand); box-shadow: none; }
  .button-primary:hover { background: var(--brand-dark); }
  .avatar { background: var(--brand); }
  .sidebar { background: linear-gradient(180deg, var(--brand-dark) 0%, #104a70 100%); }
}

/* Marca en gris del logo */
@media screen {
  :root { --brand: #4b4d4c; --brand-dark: #2b2d2c; }
  body { background: #eceeed; }
  .metric-card, .panel, .zone-card { border-color: #cdd0cf; }
  .chart-bar, .chart-day:first-child .chart-bar { background: linear-gradient(180deg, #8a8d8c, var(--brand)); }
  thead { background: #e0e2e1; }
  .sidebar { background: linear-gradient(180deg, #2b2d2c 0%, #3d3f3e 100%); }
  .nav-item.is-active { background: rgba(255, 255, 255, .12); box-shadow: inset 4px 0 #9aa09e; }
  .metric-card:hover, .zone-card:hover { box-shadow: 0 10px 24px rgba(43, 45, 44, .16); }
}

/* Tarjetas con color de contraste (texto claro sobre fondo sólido) */
@media screen {
  .metric-card { border: 0; color: #fff; }
  .metric-card::after { background: #fff; opacity: .12; }
  .metric-card:nth-child(1) { background: linear-gradient(145deg, #4b4d4c, #2b2d2c); }
  .metric-card:nth-child(2) { background: linear-gradient(145deg, #2f7d52, #1f5d3b); }
  .metric-card:nth-child(3) { background: linear-gradient(145deg, #c98a1c, #9a640a); }
  .metric-card:nth-child(4) { background: linear-gradient(145deg, #c24a42, #8f2a24); }
  .metric-card, .metric-card strong, .metric-card .metric-value, .metric-card span, .metric-card small, .metric-card p { color: #fff; }
  .metric-card .metric-icon, .metric-card:nth-child(n) .metric-icon { color: #fff; background: rgba(255, 255, 255, .2); }
  .zone-card { background: #fff; border-left-width: 8px; }
  .zone-card:nth-child(4n+1) { border-left-color: #4b4d4c; }
  .zone-card:nth-child(4n+2) { border-left-color: #2f7d52; }
  .zone-card:nth-child(4n+3) { border-left-color: #c98a1c; }
  .zone-card:nth-child(4n+4) { border-left-color: #c24a42; }
  .zone-card:nth-child(4n+1) .zone-arrow { background: #4b4d4c; }
  .zone-card:nth-child(4n+2) .zone-arrow { background: #2f7d52; }
  .zone-card:nth-child(4n+3) .zone-arrow { background: #c98a1c; }
  .zone-card:nth-child(4n+4) .zone-arrow { background: #c24a42; }
}

/* Azul de acento: foco y líneas resaltadas */
@media screen {
  :root { --accent: #1e88e5; --accent-dark: #1565c0; }
  input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(30, 136, 229, .25); }
  button:focus-visible, a:focus-visible, .icon-action:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
  .panel, .chart-panel { border-top-color: var(--accent); }
  .panel-heading h2::before, .customers-heading h2::before { background: var(--accent); }
  thead { border-bottom: 3px solid var(--accent); }
  .nav-item.is-active { box-shadow: inset 4px 0 var(--accent); background: rgba(30, 136, 229, .28); }
  .topbar, .app-header, header.topbar { border-bottom-color: var(--accent); }
  .button-primary { background: var(--accent); }
  .button-primary:hover { background: var(--accent-dark); }
  .icon-action.tone-blue { background: var(--accent); }
  .chart-bar, .chart-day:first-child .chart-bar { background: linear-gradient(180deg, #64b5f6, var(--accent)); }
  tbody tr:hover { background: #e3f1fd; box-shadow: inset 3px 0 var(--accent); }
  a, .link-button { color: var(--accent-dark); }
  .avatar { background: var(--accent); }
  .topbar { border-bottom: 4px solid var(--accent); }
  .sidebar { border-right: 0; }
  .nav-item .nav-icon { color: #64b5f6; }
  .nav-item:hover { background: rgba(30, 136, 229, .22); box-shadow: none; }
  .nav-item.is-active { background: var(--accent); box-shadow: none; color: #fff; }
  .nav-item.is-active .nav-icon { color: #fff; }
  .breadcrumb strong { color: var(--accent-dark); }
  .topbar .button-secondary:hover, .topbar-actions button:hover { border-color: var(--accent); color: var(--accent-dark); }
}

/* Colores más vivos en tarjetas y acciones */
@media screen {
  .metric-card:nth-child(1) { background: linear-gradient(145deg, #5f6261, #353837); }
  .metric-card:nth-child(2) { background: linear-gradient(145deg, #2fa264, #1b7a47); }
  .metric-card:nth-child(3) { background: linear-gradient(145deg, #f0a021, #cc7d08); }
  .metric-card:nth-child(4) { background: linear-gradient(145deg, #e5483d, #b82a22); }
  .zone-card:nth-child(4n+1) { border-left-color: #5f6261; }
  .zone-card:nth-child(4n+2) { border-left-color: #2fa264; }
  .zone-card:nth-child(4n+3) { border-left-color: #f0a021; }
  .zone-card:nth-child(4n+4) { border-left-color: #e5483d; }
  .zone-card:nth-child(4n+1) .zone-arrow { background: #5f6261; }
  .zone-card:nth-child(4n+2) .zone-arrow { background: #2fa264; }
  .zone-card:nth-child(4n+3) .zone-arrow { background: #f0a021; }
  .zone-card:nth-child(4n+4) .zone-arrow { background: #e5483d; }
  .icon-action { box-shadow: 0 3px 8px rgba(0, 0, 0, .18); }
  .icon-action:hover { filter: brightness(1.1); transform: translateY(-1px); }
  .icon-action.tone-blue { background: #1e88e5; }
  .icon-action.tone-green { background: #2fa264; }
  .icon-action.tone-amber { background: #f0a021; }
  .icon-action.tone-orange { background: #6b7f8e; }
  .icon-action.tone-red { background: #e5483d; }
}
