:root {
    --bg: #f4f8fb;
    --bg-soft: #eef7fb;
    --panel: #ffffff;
    --ink: #121a2b;
    --muted: #647386;
    --line: #dfe8ee;
    --primary: #1097d4;
    --primary-strong: #0877ad;
    --nav: #0f5572;
    --nav-deep: #0b314d;
    --green: #10a979;
    --green-dark: #067c5a;
    --danger: #db2d35;
    --warning: #f2a51a;
    --violet: #9b5de5;
    --radius: 8px;
    --shadow: 0 16px 36px rgba(18, 26, 43, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    background: #fff;
    color: var(--ink);
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(16, 151, 212, 0.7);
    box-shadow: 0 0 0 3px rgba(16, 151, 212, 0.12);
}

textarea {
    min-height: 96px;
    resize: vertical;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

label input,
label select,
label textarea {
    color: var(--ink);
    font-weight: 400;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0;
    text-transform: uppercase;
}

td small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
}

code {
    background: #eef5f8;
    border-radius: 6px;
    padding: 2px 5px;
}

pre {
    max-width: 560px;
    overflow: auto;
    background: #101820;
    color: #eef6f7;
    border-radius: 8px;
    padding: 12px;
}

.auth-shell {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(16, 151, 212, 0.18), transparent 32%),
        linear-gradient(135deg, rgba(16, 169, 121, 0.10), rgba(16, 151, 212, 0.10)),
        var(--bg);
}

.auth-main {
    width: min(460px, 100%);
}

.login-card,
.panel,
.metric,
.notice-card,
.pending-card,
.mini-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.login-card {
    padding: 30px;
}

.login-brand {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 24px;
}

.brand-mark {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 10px;
    background: linear-gradient(135deg, #28bde7, #0d7dbc);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 10px 22px rgba(16, 151, 212, 0.28);
}

.brand-mark.large {
    width: 54px;
    height: 54px;
}

.brand-drop {
    width: 14px;
    height: 18px;
    background: #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
}

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

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: auto;
    background: linear-gradient(180deg, var(--nav), var(--nav-deep));
    color: #f6fbff;
    padding: 18px 14px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 12px;
}

.brand strong {
    display: block;
    font-size: 17px;
}

.brand small {
    display: block;
    color: rgba(246, 251, 255, 0.68);
    margin-top: 2px;
    font-size: 10px;
    font-weight: 800;
}

.sidebar nav {
    display: grid;
    gap: 4px;
    padding-bottom: 18px;
}

.nav-section {
    margin: 16px 8px 6px;
    color: rgba(246, 251, 255, 0.58);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.nav-link {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 10px;
    align-items: center;
    min-height: 38px;
    color: rgba(246, 251, 255, 0.88);
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
}

.nav-icon {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.10);
    color: #d8f3ff;
    font-size: 10px;
    font-weight: 900;
}

.nav-badge {
    min-width: 22px;
    border-radius: 999px;
    padding: 2px 6px;
    background: var(--warning);
    color: #301f00;
    text-align: center;
    font-size: 11px;
    font-weight: 900;
}

.sidebar-logout {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 15px 10px 4px;
    color: rgba(246, 251, 255, 0.86);
    font-weight: 800;
}

.main {
    min-width: 0;
    padding: 0 28px 32px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    min-height: 66px;
    margin: 0 -28px 24px;
    padding: 12px 28px;
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.topbar h1,
.panel h2,
.login-card h1,
.hero-copy h1 {
    margin: 0;
}

.topbar h1 {
    font-size: 20px;
}

.eyebrow {
    margin: 0 0 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.userbar,
.actions,
.toolbar,
.inline-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.userbar {
    text-align: right;
}

.userbar small {
    display: block;
    color: var(--muted);
    margin-top: 2px;
}

.avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: linear-gradient(135deg, #26b8e6, #0c79b6);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(12, 121, 182, 0.25);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 9px 16px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    white-space: nowrap;
    font-weight: 800;
}

.button.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 12px 22px rgba(16, 151, 212, 0.22);
}

.button.primary:hover {
    background: var(--primary-strong);
}

.button.success {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
    box-shadow: 0 12px 22px rgba(16, 169, 121, 0.20);
}

.button.success:hover {
    background: var(--green-dark);
}

.button.danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.button.ghost {
    background: transparent;
}

.button.small {
    min-height: 34px;
    padding: 6px 10px;
}

.stack {
    display: grid;
    gap: 16px;
}

.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.dashboard-hero h2 {
    margin: 0 0 4px;
    font-size: 28px;
}

.dashboard-hero p {
    margin: 0;
    color: var(--muted);
}

.notice-card {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 18px;
    margin-bottom: 18px;
    border-color: #f2cad0;
    background: linear-gradient(90deg, #fff3f0, #fffaf0);
}

.notice-card.good {
    border-color: #ccefe3;
    background: linear-gradient(90deg, #edfff8, #f7fffb);
}

.notice-card strong {
    display: block;
    margin-bottom: 4px;
}

.notice-card p {
    margin: 0;
    color: var(--muted);
}

.notice-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 12px;
    background: var(--danger);
    color: #fff;
    font-weight: 900;
}

.notice-card.good .notice-icon {
    background: var(--green);
}

.pending-card {
    padding: 18px;
    margin-bottom: 18px;
    border-color: #f0df99;
    background: #fffaf0;
}

.pending-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.pending-head h2 {
    margin: 0 0 3px;
    font-size: 20px;
}

.pending-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.mini-card {
    padding: 14px;
    box-shadow: none;
}

.mini-card strong,
.mini-card span,
.mini-card small {
    display: block;
}

.mini-card span {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 8px;
    font-weight: 800;
}

.mini-card small {
    color: var(--muted);
    margin-top: 5px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric {
    min-height: 118px;
    padding: 18px;
}

.metric.primary {
    background: linear-gradient(135deg, #14bd8d, #078f67);
    color: #fff;
    border-color: transparent;
}

.metric span,
.metric small {
    display: block;
    color: var(--muted);
}

.metric.primary span,
.metric.primary small {
    color: rgba(255, 255, 255, 0.84);
}

.metric strong {
    display: block;
    font-size: 30px;
    margin-top: 8px;
}

.ops-alerts-panel {
    border-color: #ded9fb;
    background: linear-gradient(135deg, #ffffff 0%, #fbfcff 58%, #f4fff9 100%);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.ops-alerts-panel.has-new-alert {
    border-color: rgba(111, 92, 231, 0.58);
    box-shadow: 0 18px 38px rgba(111, 92, 231, 0.16);
    transform: translateY(-1px);
}

.ops-alerts-heading {
    align-items: center;
}

.ops-alerts-status {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.ops-alerts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.ops-alert-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    min-height: 112px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 8px 18px rgba(52, 50, 74, 0.05);
    text-decoration: none;
}

.ops-alert-card:hover {
    border-color: rgba(111, 92, 231, 0.36);
    box-shadow: 0 12px 24px rgba(52, 50, 74, 0.10);
}

.ops-alert-card > div {
    min-width: 0;
}

.ops-alert-card span:not(.ops-alert-icon),
.ops-alert-card small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.ops-alert-card strong {
    display: block;
    margin-top: 4px;
    overflow-wrap: anywhere;
    font-size: 15px;
}

.ops-alert-card p {
    margin: 6px 0;
    color: #56536b;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.ops-alert-card small {
    text-transform: none;
}

.ops-alert-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #eef2ff;
    color: var(--primary-strong);
    font-size: 12px;
    font-weight: 900;
}

.ops-alert-card.severity-danger {
    border-color: #facaca;
    background: #fff8f8;
}

.ops-alert-card.severity-danger .ops-alert-icon {
    background: #fde8e6;
    color: var(--danger);
}

.ops-alert-card.severity-warning {
    border-color: #f3df9e;
    background: #fffdf6;
}

.ops-alert-card.severity-warning .ops-alert-icon {
    background: #fff4d6;
    color: #8a5b00;
}

.ops-alert-card.is-clear {
    border-color: #cbeee1;
    background: #f7fffb;
}

.ops-alert-card.is-clear .ops-alert-icon {
    background: #e6f7f1;
    color: #0a704f;
}

.ops-alerts-more {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.seller-stop-alert {
    color: var(--danger) !important;
    font-weight: 900;
}

.metric-kicker {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    margin-bottom: 10px;
    background: #e9f7fd;
    color: var(--primary);
    font-size: 11px;
    font-weight: 900;
}

.metric-kicker.green {
    background: #e8fbf4;
    color: var(--green-dark);
}

.metric-kicker.yellow {
    background: #fff4d4;
    color: #916100;
}

.metric-kicker.violet {
    background: #f2eafd;
    color: var(--violet);
}

.panel {
    padding: 20px;
    margin-bottom: 18px;
}

.panel.narrow {
    max-width: 780px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.section-heading h2 {
    font-size: 20px;
}

.toolbar {
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.toolbar select,
.toolbar input {
    width: auto;
    min-width: 180px;
}

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

.inline-label {
    display: inline-grid;
    min-width: 190px;
}

.weekly-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.metric.danger-metric strong {
    color: var(--danger);
}

.span-2 {
    grid-column: 1 / -1;
}

.table-wrap {
    overflow: auto;
}

.file-current-preview,
.record-file-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    color: var(--primary-strong);
    font-size: 12px;
    font-weight: 800;
}

.file-current-preview img,
.record-file-link img {
    width: 58px;
    height: 42px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 4px;
}

.photo-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.photo-strip a {
    display: inline-flex;
    width: 54px;
    height: 42px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.photo-strip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.supplies-table {
    min-width: 1320px;
    table-layout: fixed;
}

.supplies-table .col-id {
    width: 56px;
}

.supplies-table .col-name {
    width: 270px;
}

.supplies-table .col-unit {
    width: 104px;
}

.supplies-table .col-stock {
    width: 128px;
}

.supplies-table .col-origin {
    width: 96px;
}

.supplies-table .col-date {
    width: 170px;
}

.supplies-table .col-actions {
    width: 172px;
}

.supplies-table th {
    white-space: nowrap;
}

.supply-name-cell {
    font-weight: 800;
    line-height: 1.35;
    overflow-wrap: break-word;
}

.supply-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.record-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.record-row-actions .inline-form {
    display: inline-flex;
    gap: 0;
}

.supply-actions .inline-form {
    display: inline-flex;
    gap: 0;
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
}

.icon-button.success {
    border-color: #c9efe2;
    background: #e6f7f1;
    color: #0a704f;
}

.icon-button.danger {
    border-color: #f7cbc7;
    background: #fde8e6;
    color: var(--danger);
}

.section-heading.compact {
    margin-bottom: 12px;
}

.water-param-card {
    display: grid;
    gap: 14px;
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #f9fcfd;
}

.field-label-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
}

.field-tooltip {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #fff4d6;
    color: #8a5b00;
    font-size: 12px;
    font-weight: 900;
    cursor: help;
    box-shadow: 0 6px 14px rgba(138, 91, 0, 0.16);
}

.field-tooltip::after {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    z-index: 20;
    width: max-content;
    max-width: min(300px, 82vw);
    padding: 9px 11px;
    border-radius: 8px;
    background: #111827;
    color: #fff;
    content: attr(data-tooltip-text);
    font-size: 12px;
    line-height: 1.35;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 6px);
    transition: opacity 0.16s ease, transform 0.16s ease;
    white-space: normal;
}

.field-tooltip::before {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 3px);
    z-index: 21;
    border: 6px solid transparent;
    border-top-color: #111827;
    content: "";
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%);
    transition: opacity 0.16s ease;
}

.field-tooltip:hover::after,
.field-tooltip:focus::after,
.field-tooltip:hover::before,
.field-tooltip:focus::before {
    opacity: 1;
    transform: translate(-50%, 0);
}

.field-tooltip:hover::before,
.field-tooltip:focus::before {
    transform: translateX(-50%);
}

.dose-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border: 1px solid #cdebf5;
    border-radius: var(--radius);
    background: #eefafe;
    color: var(--primary-strong);
}

.dose-box strong,
.dose-box span {
    display: block;
}

.dose-box span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.water-log-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.water-log-summary div {
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.water-log-summary span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.water-log-summary strong {
    display: block;
    margin-top: 5px;
}

.chlorination-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
    align-items: start;
}

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

.chlorination-result-band {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 14px;
    border-radius: 8px;
    background: linear-gradient(90deg, #f1fbff, #effcf6);
}

.chlorination-result-band div {
    min-height: 70px;
    padding: 12px;
    border: 1px solid #d4edf4;
    border-radius: 8px;
    background: #fff;
}

.chlorination-result-band span,
.chlorination-kpis span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.chlorination-result-band strong {
    display: block;
    margin-top: 7px;
    color: var(--green-dark);
    font-size: 24px;
}

.chlorination-result-band p {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.chlorination-side {
    position: sticky;
    top: 94px;
}

.chlorination-kpis {
    display: grid;
    gap: 10px;
}

.chlorination-kpis div {
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}

.chlorination-kpis strong {
    display: block;
    margin-top: 5px;
    overflow-wrap: anywhere;
}

.chlorination-table td:nth-child(6) .badge {
    min-width: 72px;
    justify-content: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 900;
    background: #eef3f5;
    color: #31424d;
}

.badge.active,
.badge.web,
.badge.pull {
    background: #e6f7f1;
    color: #0a704f;
}

.badge.suspended,
.badge.warning {
    background: #fff4d6;
    color: #8a5b00;
}

.badge.cancelled,
.badge.expired,
.badge.danger {
    background: #fde8e6;
    color: var(--danger);
}

.badge.app,
.badge.push {
    background: #e8f4fb;
    color: var(--primary-strong);
}

.badge.pendiente {
    background: #fff4d6;
    color: #8a5b00;
}

.badge.asignado {
    background: #eef2ff;
    color: #4f46e5;
}

.badge.en_ruta {
    background: #e8f4fb;
    color: var(--primary-strong);
}

.badge.entregado {
    background: #e6f7f1;
    color: #0a704f;
}

.badge.cancelado {
    background: #fde8e6;
    color: var(--danger);
}

.alert {
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 14px;
    background: #e8f4fb;
    color: var(--primary-strong);
    font-weight: 700;
}

.alert.success {
    background: #e6f7f1;
    color: #0a704f;
}

.alert.danger {
    background: #fde8e6;
    color: var(--danger);
}

.alert.warning {
    background: #fff4d6;
    color: #8a5b00;
}

.muted {
    color: var(--muted);
}

details summary {
    cursor: pointer;
    color: var(--primary-strong);
    font-weight: 800;
}

.chart-card {
    min-height: 260px;
}

.bar-chart {
    display: grid;
    grid-template-columns: repeat(7, minmax(34px, 1fr));
    gap: 12px;
    align-items: end;
    min-height: 190px;
    padding-top: 18px;
}

.bar {
    display: grid;
    align-items: end;
    gap: 8px;
    height: 170px;
}

.bar-fill {
    min-height: 8px;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(180deg, #61ddb7, #13a87a);
}

.bar label {
    text-align: center;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.dashboard-insights-panel {
    overflow: hidden;
    border-color: #dce7f0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.98)),
        radial-gradient(circle at 12% 0%, rgba(16, 151, 212, 0.12), transparent 30%),
        radial-gradient(circle at 92% 14%, rgba(16, 169, 121, 0.12), transparent 28%);
}

.dashboard-insights-heading {
    margin-bottom: 14px;
}

.dashboard-chart-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-chart-card {
    min-width: 0;
    min-height: 300px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 24px rgba(18, 26, 43, 0.06);
}

.dashboard-chart-head {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    margin-bottom: 10px;
}

.dashboard-chart-head span {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    border-radius: 8px;
    background: #e8f4fb;
    color: var(--primary-strong);
    font-size: 13px;
    font-weight: 900;
}

.dashboard-chart-card h3 {
    margin: 0;
    font-size: 15px;
}

.dashboard-axis-chart {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
    min-height: 212px;
    padding-top: 6px;
}

.dashboard-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3px 0 38px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-align: right;
}

.dashboard-bars {
    position: relative;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(44px, 1fr);
    gap: 12px;
    align-items: end;
    min-width: 0;
    padding: 10px 8px 0;
    border-left: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(to bottom, rgba(223, 232, 238, 0.72) 1px, transparent 1px);
    background-size: 100% 40px;
    overflow-x: auto;
}

.dashboard-bar-item {
    display: grid;
    grid-template-rows: 24px 150px auto;
    gap: 7px;
    align-items: end;
    min-width: 52px;
    text-align: center;
}

.dashboard-bar-item strong {
    align-self: center;
    color: var(--ink);
    font-size: 12px;
}

.dashboard-bar-item i {
    display: block;
    width: 100%;
    height: max(8px, var(--bar-height));
    border-radius: 8px 8px 2px 2px;
    background: var(--bar-color);
    background: linear-gradient(180deg, color-mix(in srgb, var(--bar-color), white 18%), var(--bar-color));
    box-shadow: 0 10px 18px color-mix(in srgb, var(--bar-color), transparent 72%);
}

.dashboard-bar-item span {
    min-height: 34px;
    color: #283349;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.12;
}

.dashboard-chart-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 9px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.dashboard-chart-legend i {
    width: 16px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--green));
}

.dashboard-line-shell {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 8px;
    min-height: 258px;
}

.dashboard-line-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 12px 0 62px;
    color: #38445c;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    text-align: right;
}

.dashboard-line-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    scrollbar-color: rgba(109, 92, 231, 0.38) transparent;
    scrollbar-width: thin;
}

.dashboard-line-scroll::-webkit-scrollbar {
    height: 8px;
}

.dashboard-line-scroll::-webkit-scrollbar-track {
    border-radius: 999px;
    background: #eef3f8;
}

.dashboard-line-scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--green));
}

.dashboard-line-chart {
    display: block;
    max-width: none;
    min-width: 100%;
    height: 258px;
    overflow: visible;
}

.dashboard-line-chart line {
    stroke: #dfe8ee;
    stroke-width: 1;
}

.dashboard-line-chart text {
    fill: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.dashboard-line-chart .line-area {
    fill: url(#dashboardLineFill);
}

.dashboard-line-chart .line-stroke {
    fill: none;
    stroke: var(--primary);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dashboard-line-chart circle {
    fill: var(--primary);
    stroke: #fff;
    stroke-width: 3;
    filter: drop-shadow(0 5px 8px rgba(16, 151, 212, 0.26));
}

.dashboard-line-chart .point-value {
    fill: var(--ink);
    text-anchor: middle;
    font-size: 13px;
    font-weight: 900;
}

.dashboard-line-chart .point-label {
    fill: #283349;
    text-anchor: end;
    font-size: 13px;
    font-weight: 900;
}

.dashboard-money-chart {
    display: grid;
    grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    min-height: 220px;
}

.dashboard-donut {
    position: relative;
    display: block;
    width: 178px;
    max-width: 100%;
    aspect-ratio: 1;
    margin: 0 auto;
    border-radius: 999px;
    background: conic-gradient(var(--donut-gradient));
    box-shadow: inset 0 0 0 1px rgba(18, 26, 43, 0.04), 0 14px 24px rgba(18, 26, 43, 0.08);
}

.dashboard-donut::after {
    position: absolute;
    inset: 34px;
    border-radius: inherit;
    background: #fff;
    content: "";
    box-shadow: inset 0 0 0 1px rgba(18, 26, 43, 0.04);
}

.dashboard-donut-content {
    position: absolute;
    inset: 38px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.dashboard-donut span,
.dashboard-donut strong,
.dashboard-donut small {
    display: block;
    text-align: center;
}

.dashboard-donut span,
.dashboard-donut small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.dashboard-donut strong {
    margin: 5px 0;
    font-size: 16px;
    line-height: 1.05;
}

.dashboard-money-list {
    display: grid;
    gap: 10px;
}

.dashboard-money-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-money-list span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: #283349;
    font-size: 12px;
    font-weight: 800;
}

.dashboard-money-list i {
    width: 11px;
    height: 11px;
    flex: 0 0 auto;
    border-radius: 999px;
    box-shadow: 0 0 0 3px #eef5f8;
}

.dashboard-money-list strong {
    white-space: nowrap;
    font-size: 12px;
}

@media (max-width: 1180px) {
    .dashboard-chart-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-chart-card {
        min-height: auto;
    }

    .dashboard-money-chart {
        grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .dashboard-chart-card {
        padding: 14px;
    }

    .dashboard-axis-chart {
        grid-template-columns: 30px minmax(0, 1fr);
    }

    .dashboard-bars {
        grid-auto-columns: minmax(48px, 72px);
    }

    .dashboard-line-shell {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .dashboard-line-axis {
        font-size: 12px;
    }

    .dashboard-money-chart {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .dashboard-money-list {
        width: 100%;
    }
}

.landing-shell {
    min-height: 100vh;
    background: #f7fbfd;
}

.landing-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px clamp(18px, 6vw, 72px);
    color: var(--ink);
    background: rgba(247, 251, 253, 0.84);
    border-bottom: 1px solid rgba(223, 232, 238, 0.7);
    backdrop-filter: blur(16px);
}

.landing-brand,
.landing-links,
.landing-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.landing-brand strong {
    font-size: 22px;
}

.landing-links a {
    color: #4c5b68;
    font-weight: 800;
}

.landing-hero {
    position: relative;
    display: grid;
    align-items: center;
    min-height: 780px;
    padding: 116px clamp(22px, 7vw, 88px) 90px;
    color: #fff;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(6, 25, 43, 0.92) 0%, rgba(6, 25, 43, 0.78) 42%, rgba(6, 25, 43, 0.32) 100%),
        url("../img/aquaruta-panel.jpeg") center right / cover no-repeat;
}

.landing-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 86px;
    background: linear-gradient(180deg, transparent, #f7fbfd);
}

.hero-copy {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    border-radius: 999px;
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #eaf9ff;
    font-weight: 900;
}

.hero-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #23d3a0;
}

.hero-copy h1 {
    max-width: 700px;
    margin-top: 28px;
    font-size: clamp(46px, 7vw, 86px);
    line-height: 0.95;
}

.hero-copy p {
    max-width: 630px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 21px;
    line-height: 1.45;
}

.hero-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 30px;
}

.hero-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 26px;
    margin-top: 30px;
    color: rgba(255, 255, 255, 0.82);
    font-weight: 800;
}

.hero-checks span::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 8px;
    border-radius: 999px;
    background: #23d3a0;
}

.landing-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    padding: 44px clamp(22px, 7vw, 88px) 76px;
    background: #f7fbfd;
}

.landing-stat {
    text-align: center;
}

.landing-stat strong {
    display: block;
    color: var(--primary);
    font-size: clamp(34px, 5vw, 58px);
}

.landing-stat span {
    color: var(--muted);
    font-weight: 800;
}

@media (max-width: 1100px) {
    .landing-links {
        display: none;
    }

    .pending-list,
    .metrics-grid,
    .weekly-summary,
    .water-log-summary,
    .landing-stats,
    .chlorination-layout,
    .payment-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        max-height: none;
    }

    .main {
        padding: 0 16px 24px;
    }

    .topbar {
        position: static;
        margin: 0 -16px 18px;
        padding: 14px 16px;
        align-items: stretch;
        flex-direction: column;
    }

    .userbar {
        justify-content: space-between;
        text-align: left;
    }

    .dashboard-hero,
    .notice-card,
    .pending-head,
    .section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .ops-alerts-status {
        justify-content: flex-start;
    }

    .form-grid,
    .chlorination-form,
    .chlorination-layout,
    .chlorination-result-band,
    .pending-list,
    .metrics-grid,
    .weekly-summary,
    .water-log-summary,
    .landing-stats {
        grid-template-columns: 1fr;
    }

    .chlorination-side {
        position: static;
    }

    .dose-box {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar select,
    .toolbar input,
    .toolbar .button {
        width: 100%;
    }

    .landing-nav {
        position: static;
        flex-wrap: wrap;
    }

    .landing-actions {
        width: 100%;
    }

    .landing-actions .button {
        flex: 1;
    }

    .landing-hero {
        min-height: 680px;
        padding-top: 58px;
        background:
            linear-gradient(180deg, rgba(6, 25, 43, 0.94), rgba(6, 25, 43, 0.58)),
            url("../img/aquaruta-panel.jpeg") center / cover no-repeat;
    }

    .hero-copy h1 {
        font-size: 46px;
    }
}

/* SICOP ERP operational shell */
:root {
    --bg: #f6f6fb;
    --panel: #ffffff;
    --ink: #34324a;
    --muted: #76748a;
    --line: #e7e5ef;
    --primary: #6f5ce7;
    --primary-strong: #5846cb;
    --green: #18a875;
    --danger: #dc2626;
    --warning: #e5a100;
    --shadow: 0 12px 30px rgba(52, 50, 74, 0.08);
}

.app-shell {
    grid-template-columns: 230px minmax(0, 1fr);
    background: var(--bg);
}

.sidebar {
    background: #fff;
    color: var(--muted);
    box-shadow: 10px 0 28px rgba(52, 50, 74, 0.06);
}

.brand {
    border-bottom: 0;
    margin-bottom: 26px;
}

.brand strong {
    color: #5b55e6;
}

.brand small,
.nav-section {
    color: #9b98ad;
}

.brand-mark {
    background: #f7f7ff;
    color: var(--primary);
    box-shadow: none;
    border: 1px solid #e9e7ff;
}

.brand-drop {
    width: 17px;
    height: 17px;
    border-radius: 5px;
    background: var(--primary);
    transform: none;
}

.nav-link {
    color: #706d82;
    font-weight: 700;
}

.nav-link:hover,
.nav-link.active {
    background: #7b68ee;
    color: #fff;
    box-shadow: 0 8px 18px rgba(111, 92, 231, 0.25);
}

.nav-group {
    display: grid;
    gap: 2px;
}

.nav-group summary {
    cursor: pointer;
    list-style: none;
}

.nav-group summary::-webkit-details-marker {
    display: none;
}

.nav-children {
    display: grid;
    gap: 2px;
    margin: 2px 0 8px 42px;
}

.nav-child {
    border-radius: 7px;
    padding: 7px 8px;
    color: #7c788d;
    font-size: 12px;
    font-weight: 800;
}

.nav-child:hover,
.nav-child.active {
    background: #f1efff;
    color: #5b55e6;
}

.nav-icon {
    background: transparent;
    color: inherit;
}

.sidebar-logout {
    border-top-color: var(--line);
    color: #706d82;
}

.topbar {
    min-height: 56px;
    margin-top: 16px;
    border: 0;
    border-radius: 6px;
    box-shadow: var(--shadow);
    background: #fff;
}

.button.primary {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 10px 18px rgba(111, 92, 231, 0.20);
}

.button.primary:hover {
    background: var(--primary-strong);
}

.button.success {
    background: var(--green);
    border-color: var(--green);
}

.metric.primary {
    background: #e9e6ff;
    color: var(--primary-strong);
    border-color: #d8d2ff;
}

.metric.primary span,
.metric.primary small {
    color: #6a6297;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding-top: 22px;
}

.check-row input {
    width: auto;
}

.color-dot {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--line);
}

.color-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
}

.color-picker {
    display: grid;
    gap: 10px;
}

.color-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 7px 10px;
    background: #fff;
}

.color-input-row input[type="color"] {
    width: 46px;
    height: 30px;
    border: 0;
    border-radius: 6px;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.color-input-row span {
    color: var(--ink);
    font-weight: 800;
}

.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-swatch-button {
    width: 30px;
    height: 30px;
    border: 2px solid #fff;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 0 0 1px var(--line), 0 6px 12px rgba(52, 50, 74, 0.12);
}

.color-swatch-button.selected {
    box-shadow: 0 0 0 3px rgba(111, 92, 231, 0.30), 0 6px 12px rgba(52, 50, 74, 0.16);
}

.color-picker .button {
    justify-self: start;
}

.qr-thumb {
    width: 54px;
    height: 54px;
    display: block;
}

.qr-panel {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfbff;
}

.qr-card {
    width: 132px;
    height: 132px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.seller-supply-fields {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid #d4edf4;
    border-radius: 8px;
    background: #f5fcff;
}

.seller-supply-fields[hidden] {
    display: none;
}

.seller-supply-fields .section-heading {
    margin-bottom: 0;
}

.qr-display {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 22px;
    align-items: center;
}

.qr-display img {
    width: 220px;
    height: 220px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.row-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.employee-capture-panel .employee-form {
    margin-bottom: 22px;
}

.employee-list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 18px;
    margin-top: 6px;
    margin-bottom: 12px;
    border-top: 1px solid var(--line);
}

.employee-list-heading h3 {
    margin: 0;
    font-size: 18px;
}

.employee-list-heading span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.employees-table th:last-child,
.employees-table td:last-child {
    min-width: 170px;
}

.employee-actions {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.employee-actions .inline-form {
    gap: 0;
}

.is-muted-row {
    opacity: 0.68;
}

.folio-form {
    align-items: end;
}

.folio-result-band {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(90deg, #f8fbff, #f4fff9);
}

.folio-result-band input {
    color: var(--green-dark);
    font-size: 18px;
    font-weight: 900;
}

.folios-table th:nth-child(4),
.folios-table td:nth-child(4) {
    min-width: 140px;
}

.folios-table strong {
    color: var(--green-dark);
}

@media (max-width: 820px) {
    .folio-result-band {
        grid-template-columns: 1fr;
    }
}

.vehicle-load-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.96), rgba(247, 252, 255, 0.92)),
        url("../img/aquaruta-panel.jpeg") center right / cover no-repeat;
    box-shadow: var(--shadow);
}

.vehicle-load-hero h2,
.vehicle-load-hero p {
    margin: 0;
}

.vehicle-load-hero h2 {
    font-size: 26px;
}

.vehicle-load-hero p {
    max-width: 620px;
    color: var(--muted);
}

.vehicle-load-hero strong {
    display: inline-grid;
    place-items: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    background: #fff;
    color: var(--primary-strong);
    border: 1px solid var(--line);
}

.vehicle-assign-form {
    display: grid;
    grid-template-columns: 180px minmax(220px, 1fr) minmax(260px, 1fr) auto;
    gap: 14px;
    align-items: end;
}

.vehicle-assignment-strip {
    display: flex;
    align-items: stretch;
    gap: 12px;
    margin-top: 18px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.vehicle-assignment-card {
    display: grid;
    gap: 5px;
    min-width: 230px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
}

.vehicle-assignment-card.active {
    border-color: rgba(111, 92, 231, 0.42);
    background: #f5f2ff;
    box-shadow: 0 12px 22px rgba(111, 92, 231, 0.16);
}

.vehicle-assignment-card span,
.vehicle-assignment-card small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.vehicle-load-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 18px;
    align-items: start;
}

.vehicle-load-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.vehicle-load-title h2,
.vehicle-load-title span {
    margin: 0;
}

.vehicle-load-title span {
    color: var(--muted);
    font-weight: 800;
}

.vehicle-turn-pill {
    display: grid;
    place-items: center;
    min-width: 86px;
    min-height: 76px;
    border-radius: 8px;
    background: #ecfdf5;
    color: var(--green-dark);
}

.vehicle-turn-pill span {
    color: var(--green-dark);
    font-size: 11px;
    text-transform: uppercase;
}

.vehicle-turn-pill strong {
    font-size: 26px;
}

.lot-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.lot-editor {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfbff;
}

.lot-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.lot-editor-head h3 {
    margin: 0;
    font-size: 17px;
}

.lot-editor-head strong {
    display: inline-grid;
    place-items: center;
    min-width: 42px;
    height: 34px;
    border-radius: 999px;
    background: #e8f7fb;
    color: var(--primary-strong);
}

.lot-add-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(100px, 0.8fr) 80px auto;
    gap: 8px;
    align-items: end;
}

.mini-table-wrap {
    max-height: 190px;
    overflow: auto;
}

.mini-table-wrap table {
    min-width: 0;
}

.vehicle-return-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.vehicle-load-side {
    position: sticky;
    top: 94px;
    display: grid;
    gap: 10px;
}

.vehicle-load-side .button {
    width: 100%;
}

.vehicle-turn-history {
    display: grid;
    gap: 7px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.vehicle-turn-history span {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f7f7fb;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

@media (max-width: 1120px) {
    .vehicle-assign-form,
    .vehicle-load-layout,
    .lot-editor-grid {
        grid-template-columns: 1fr;
    }

    .vehicle-load-side {
        position: static;
    }
}

@media (max-width: 760px) {
    .vehicle-load-hero,
    .vehicle-load-title {
        align-items: stretch;
        flex-direction: column;
    }

    .lot-add-row,
    .vehicle-return-grid {
        grid-template-columns: 1fr;
    }
}

.visit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.report-form {
    display: grid;
    gap: 16px;
}

.report-form [hidden] {
    display: none !important;
}

.report-form .actions {
    justify-content: center;
}

.route-report-panel {
    overflow: hidden;
}

.route-report-map-shell {
    position: relative;
    min-height: 460px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #e8eef3;
}

.route-report-map {
    width: 100%;
    min-height: 460px;
}

.route-report-map .leaflet-control-attribution {
    font-size: 10px;
}

.route-report-legend .route-stop-legend i {
    background: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.14);
}

.route-report-empty {
    position: absolute;
    inset: 0;
    z-index: 500;
    display: grid;
    place-content: center;
    gap: 6px;
    padding: 24px;
    text-align: center;
    pointer-events: none;
    background: rgba(248, 250, 252, 0.82);
}

.route-report-empty strong {
    color: var(--ink);
}

.route-report-empty span {
    max-width: 520px;
    color: var(--muted);
}

.route-report-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.route-report-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    background: #fff;
    font-size: 12px;
    font-weight: 800;
}

.route-report-legend i {
    width: 11px;
    height: 11px;
    border-radius: 999px;
}

.compliance-hero {
    overflow: hidden;
    border-top: 4px solid #2563eb;
}

.compliance-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.compliance-heading h2 {
    margin-bottom: 4px;
}

.compliance-heading p:last-child {
    margin: 0;
    color: var(--muted);
}

.compliance-final-badge {
    flex: 0 0 auto;
    padding: 12px 16px;
    border-radius: 6px;
    color: #fff;
    background: #0f4fc7;
    font-size: 22px;
    font-weight: 900;
}

.compliance-score-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.compliance-score {
    display: grid;
    gap: 5px;
    min-height: 124px;
    padding: 16px;
    border: 1px solid var(--line);
    border-left: 5px solid #2563eb;
    border-radius: 6px;
    background: #f8fbff;
}

.compliance-score.visits {
    border-left-color: #0f9f6e;
    background: #f2fcf7;
}

.compliance-score.clients {
    border-left-color: #7c3aed;
    background: #faf7ff;
}

.compliance-score span,
.compliance-kpis span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.compliance-score strong {
    color: var(--ink);
    font-size: 34px;
    line-height: 1;
}

.compliance-score small,
.compliance-kpis small {
    color: var(--muted);
}

.compliance-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.compliance-kpis article {
    display: grid;
    gap: 5px;
    min-height: 112px;
    padding: 15px;
    border: 1px solid var(--line);
    border-top: 4px solid #2563eb;
    border-radius: 6px;
    background: #fff;
}

.compliance-kpis article.good { border-top-color: #22a861; }
.compliance-kpis article.neutral { border-top-color: #9aa3af; }
.compliance-kpis article.warning { border-top-color: #f59e0b; }
.compliance-kpis article.danger { border-top-color: #ef4444; }

.compliance-kpis strong {
    color: var(--ink);
    font-size: 28px;
}

.compliance-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(300px, 0.8fr);
    gap: 16px;
}

.compliance-chart-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.compliance-chart-legend span,
.compliance-distribution-list span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.compliance-chart-legend i,
.compliance-distribution-list i {
    width: 11px;
    height: 11px;
    border-radius: 3px;
}

.compliance-chart-legend i.sale,
.compliance-distribution-list i.sale { background: #22a861; }
.compliance-chart-legend i.no-sale,
.compliance-distribution-list i.no-sale { background: #9aa3af; }
.compliance-chart-legend i.outside,
.compliance-distribution-list i.outside { background: #f59e0b; }
.compliance-chart-legend i.missed,
.compliance-distribution-list i.missed { background: #ef4444; }

.compliance-daily-chart {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    min-height: 255px;
    margin-top: 18px;
    padding: 22px 8px 0;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    background: repeating-linear-gradient(to bottom, transparent 0 49px, #edf1f6 50px);
}

.compliance-day {
    display: grid;
    grid-template-rows: 24px auto 18px 18px;
    align-items: end;
    justify-items: center;
    flex: 0 0 48px;
    min-height: 230px;
}

.compliance-day > strong {
    align-self: start;
    color: #0f3e8e;
    font-size: 10px;
}

.compliance-day-bar {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: 30px;
    min-height: 4px;
    overflow: hidden;
    border-radius: 4px 4px 0 0;
    background: #edf1f6;
}

.compliance-day-bar i { display: block; min-height: 3px; }
.compliance-day-bar i.sale { background: #22a861; }
.compliance-day-bar i.no-sale { background: #9aa3af; }
.compliance-day-bar i.outside { background: #f59e0b; }
.compliance-day-bar i.missed { background: #ef4444; }
.compliance-day > span { color: var(--ink); font-weight: 900; }
.compliance-day > small { color: var(--muted); font-size: 10px; }

.compliance-distribution {
    display: flex;
    flex-direction: column;
}

.compliance-donut {
    display: grid;
    place-items: center;
    width: 176px;
    height: 176px;
    margin: 16px auto;
    border-radius: 50%;
    background: var(--distribution);
}

.compliance-donut > div {
    display: grid;
    place-items: center;
    width: 108px;
    height: 108px;
    border-radius: 50%;
    background: #fff;
}

.compliance-donut strong { color: var(--ink); font-size: 27px; }
.compliance-donut span { color: var(--muted); font-size: 12px; font-weight: 800; }

.compliance-distribution-list {
    display: grid;
    gap: 9px;
}

.compliance-distribution-list span {
    justify-content: flex-start;
    color: var(--muted);
    font-size: 13px;
}

.compliance-distribution-list strong {
    margin-left: auto;
    color: var(--ink);
}

.compliance-insights-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.compliance-alerts > div:not(.section-heading),
.compliance-low-list > div:not(.section-heading) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}

.compliance-alerts > div:last-child,
.compliance-low-list > div:last-child { border-bottom: 0; }
.compliance-alerts strong { min-width: 52px; color: #c2410c; text-align: right; }
.compliance-low-list span { display: grid; color: var(--ink); font-weight: 800; }
.compliance-low-list small { color: var(--muted); font-weight: 600; }
.compliance-low-list strong { color: #dc2626; }

.compliance-no-sale-panel,
.compliance-matrix-panel {
    margin-top: 16px;
}

.compliance-no-sale-panel td small,
.compliance-matrix th small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

.compliance-matrix-wrap {
    max-height: 680px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.compliance-matrix {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.compliance-matrix th,
.compliance-matrix td {
    min-width: 46px;
    padding: 9px 8px;
    text-align: center;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.compliance-matrix thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #f6f8fb;
}

.compliance-matrix th:nth-child(1),
.compliance-matrix td:nth-child(1) { position: sticky; left: 0; min-width: 44px; z-index: 3; background: #fff; }
.compliance-matrix th:nth-child(2),
.compliance-matrix td:nth-child(2) { position: sticky; left: 44px; min-width: 70px; z-index: 3; background: #fff; }
.compliance-matrix th:nth-child(3),
.compliance-matrix td:nth-child(3) { position: sticky; left: 114px; min-width: 190px; z-index: 3; background: #fff; text-align: left; }
.compliance-matrix thead th:nth-child(-n+3) { z-index: 6; background: #f6f8fb; }

.compliance-cell { font-weight: 900; }
.compliance-cell.sale { color: #086c3d; background: #baf2cf; }
.compliance-cell.no_sale { color: #4b5563; background: #dde2e8; }
.compliance-cell.outside { color: #9a4e00; background: #ffe0a8; }
.compliance-cell.missed { color: #b91c1c; background: #ffc6c6; }
.compliance-cell.empty { background: #fff; }

@media (max-width: 980px) {
    .compliance-score-grid,
    .compliance-dashboard-grid,
    .compliance-insights-grid { grid-template-columns: 1fr; }
    .compliance-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
    .compliance-heading { align-items: stretch; flex-direction: column; }
    .compliance-final-badge { width: fit-content; }
    .compliance-kpis { grid-template-columns: 1fr; }
    .compliance-matrix th:nth-child(3),
    .compliance-matrix td:nth-child(3) { min-width: 150px; }
}

@media (max-width: 760px) {
    .route-report-map-shell,
    .route-report-map {
        min-height: 380px;
    }
}

.sicop-report-hero {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 56%, #f2fff8 100%);
}

.sicop-report-filter {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    align-items: end;
}

.sicop-report-filter .actions {
    display: flex;
}

.sicop-report-filter .actions .button {
    width: 100%;
}

.sicop-report-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
    gap: 18px;
    align-items: start;
}

.sicop-report-catalog {
    display: grid;
    gap: 18px;
}

.sicop-report-group {
    margin-bottom: 0;
}

.sicop-report-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
}

.sicop-report-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    min-height: 104px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcff;
    color: var(--ink);
    text-decoration: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.sicop-report-card:hover,
.sicop-report-card.active {
    border-color: rgba(111, 92, 231, 0.38);
    box-shadow: 0 12px 24px rgba(52, 50, 74, 0.10);
    transform: translateY(-1px);
}

.sicop-report-card.active {
    background: #f4f1ff;
}

.report-card-code {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #e8f4fb;
    color: var(--primary-strong);
    font-size: 12px;
    font-weight: 900;
}

.report-card-code.large {
    width: 48px;
    height: 48px;
    background: #e6f7f1;
    color: #0a704f;
}

.sicop-report-card strong,
.sicop-report-card small {
    display: block;
}

.sicop-report-card strong {
    margin-bottom: 6px;
}

.sicop-report-card small,
.sicop-report-description {
    color: var(--muted);
    line-height: 1.45;
}

.sicop-report-detail {
    position: sticky;
    top: 88px;
}

.sicop-report-summary {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.sicop-report-summary div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.sicop-report-summary span {
    color: var(--muted);
    font-weight: 800;
}

.sicop-report-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.sicop-report-fields span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f0f6fb;
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
}

.sicop-report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.sicop-report-actions .button:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.orders-layout {
    display: grid;
    grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.order-list {
    display: grid;
    gap: 12px;
}

.order-card {
    display: grid;
    gap: 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fbfbff;
}

.order-card h3,
.order-card p {
    margin: 0;
}

.order-card small,
.order-source {
    color: var(--muted);
    font-weight: 800;
}

.order-card > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.order-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.order-meta strong {
    font-size: 20px;
}

.map-field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.map-field-head span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.map-field-head small {
    display: block;
    margin-top: 3px;
    color: #706d82;
    font-size: 12px;
}

.client-map {
    width: 100%;
    min-height: 310px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #edf3f8;
}

.client-map .leaflet-control-attribution {
    font-size: 10px;
}

.map-status {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.field-help {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text);
    font-weight: 800;
}

.checkbox-line input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.customer-linked {
    width: fit-content;
    padding: 5px 9px;
    border-radius: 999px;
    background: #e7f8ef;
    color: #08704c;
}

.map-shell {
    position: relative;
}

.ops-map {
    position: relative;
    min-height: 330px;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid var(--line);
    background:
        linear-gradient(90deg, rgba(111, 92, 231, 0.08) 1px, transparent 1px),
        linear-gradient(0deg, rgba(111, 92, 231, 0.08) 1px, transparent 1px),
        linear-gradient(135deg, #e8f7ef, #edf3ff 52%, #f8f4e8);
    background-size: 80px 80px, 80px 80px, cover;
}

.ops-map.real-map {
    min-height: 380px;
    background: #e8eef3;
}

.ops-map.real-map .leaflet-control-attribution {
    font-size: 10px;
}

.map-tabs {
    position: absolute;
    left: 16px;
    top: 16px;
    z-index: 700;
    display: flex;
    overflow: hidden;
    border-radius: 6px;
    background: #fff;
    box-shadow: var(--shadow);
}

.map-legend {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 14px;
    z-index: 700;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    pointer-events: none;
}

.map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 9px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    font-size: 12px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(52, 50, 74, 0.12);
}

.map-legend i {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(52, 50, 74, 0.16);
}

.map-legend .truck-legend {
    width: 22px;
    height: 13px;
    border-radius: 3px;
    background: linear-gradient(90deg, #d7dde6 0 42%, #68c9ee 42% 100%);
}

.sicop-truck-marker {
    filter: drop-shadow(0 8px 12px rgba(15, 23, 42, 0.25));
}

.sicop-truck-marker.stale {
    opacity: 0.62;
    filter: grayscale(0.25) drop-shadow(0 6px 10px rgba(15, 23, 42, 0.2));
}

.sicop-truck-marker-fallback span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 30px;
    border: 2px solid #0f3ea8;
    border-radius: 8px;
    background: #dbeafe;
    color: #0f3ea8;
    font-size: 10px;
    font-weight: 900;
    box-shadow: 0 8px 12px rgba(15, 23, 42, 0.2);
}

.dashboard-map-marker {
    background: transparent;
    border: 0;
}

.dashboard-map-marker span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 3px solid rgba(255, 255, 255, 0.92);
    border-radius: 999px;
    color: #fff;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(52, 50, 74, 0.28);
}

.leaflet-popup-content strong,
.leaflet-popup-content small {
    display: block;
}

.leaflet-popup-content small {
    margin-top: 4px;
    color: var(--muted);
    font-weight: 700;
}

.map-tabs strong,
.map-tabs span {
    padding: 10px 14px;
}

.map-tabs span {
    color: var(--muted);
    border-left: 1px solid var(--line);
}

.map-pin {
    position: absolute;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 3px solid rgba(255, 255, 255, 0.86);
    border-radius: 999px;
    color: #fff;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(52, 50, 74, 0.24);
    transform: translate(-50%, -50%);
}

.map-pin small {
    position: absolute;
    top: 32px;
    left: 50%;
    min-width: 110px;
    color: #d71920;
    font-size: 11px;
    text-align: center;
    text-transform: uppercase;
    transform: translateX(-50%);
}

.driver-chip {
    position: absolute;
    bottom: 14px;
    z-index: 4;
    min-width: 88px;
    border-radius: 999px;
    padding: 7px 10px;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    text-align: center;
    box-shadow: 0 8px 16px rgba(52, 50, 74, 0.20);
}

.empty-map {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 6px;
    color: var(--muted);
    text-align: center;
}

.empty-map strong {
    color: var(--ink);
}

.visit-form {
    align-items: stretch;
    flex-wrap: wrap;
}

.visit-form select,
.visit-form input {
    width: 110px;
    min-width: 0;
}

.seller-grid {
    display: grid;
    grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.camera-box {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 260px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #111827;
}

.camera-box video {
    width: 100%;
    height: 260px;
    object-fit: cover;
}

.camera-status {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    border-radius: 6px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.camera-actions,
.seller-search {
    margin-top: 14px;
}

.customer-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.customer-summary div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fbfbff;
}

.customer-summary span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.customer-summary strong {
    display: block;
    margin-top: 6px;
    font-size: 24px;
}

.detail-list {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px 14px;
    margin: 0;
}

.detail-list dt {
    color: var(--muted);
    font-weight: 800;
}

.detail-list dd {
    margin: 0;
}

.attendance-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 18px;
    align-items: start;
}

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

.attendance-form label small {
    color: var(--muted);
    font-weight: 700;
}

.attendance-justification[hidden] {
    display: none;
}

.attendance-justification textarea {
    min-height: 118px;
}

.attendance-submit {
    justify-content: center;
    padding-top: 8px;
}

.attendance-side-panel {
    position: sticky;
    top: 82px;
}

.attendance-status-list {
    display: grid;
    gap: 12px;
}

.attendance-status-list span {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.dot {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: var(--muted);
    box-shadow: 0 0 0 4px #f2f1f8;
}

.dot.active {
    background: var(--green);
}

.dot.warning {
    background: var(--warning);
}

.dot.danger {
    background: var(--danger);
}

.attendance-table {
    min-width: 760px;
}

.loan-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
    align-items: start;
}

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

.loan-form textarea {
    min-height: 118px;
}

.loan-submit {
    justify-content: center;
    padding-top: 8px;
}

.loan-side-panel {
    position: sticky;
    top: 82px;
}

.loan-mini-summary {
    display: grid;
    gap: 5px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfbff;
}

.loan-mini-summary span,
.loan-mini-summary small {
    color: var(--muted);
    font-weight: 800;
}

.loan-mini-summary strong {
    font-size: 28px;
}

.loan-payment-form {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.loan-table {
    min-width: 880px;
}

.loan-debt {
    color: var(--danger);
}

.payment-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}

.payment-search-form {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(260px, 1fr) auto;
    gap: 14px;
    align-items: end;
    margin-bottom: 18px;
}

.payment-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.payment-summary-grid div {
    min-height: 102px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfbff;
}

.payment-summary-grid div.debt {
    border-color: #f5c7c7;
    background: #fff6f5;
}

.payment-summary-grid span,
.payment-summary-grid small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.payment-summary-grid strong {
    display: block;
    margin-top: 6px;
    font-size: 24px;
}

.payment-summary-grid .debt strong {
    color: var(--danger);
}

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

.payment-form textarea {
    min-height: 96px;
}

.payment-submit {
    justify-content: center;
}

.payment-side-panel {
    position: sticky;
    top: 82px;
}

.payment-big-number,
.payment-loan-list {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfbff;
}

.payment-big-number span,
.payment-big-number small {
    color: var(--muted);
    font-weight: 800;
}

.payment-big-number strong {
    font-size: 30px;
}

.payment-side-list {
    display: grid;
    gap: 8px;
    margin: 14px 0;
}

.payment-side-list span,
.payment-loan-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-weight: 800;
}

.payment-side-list strong {
    color: var(--ink);
}

.payment-loan-list b {
    color: var(--danger);
}

.payment-loan-list .button {
    width: fit-content;
    margin-top: 8px;
}

.payment-attendance-table {
    min-width: 720px;
}

.payment-history-table {
    min-width: 920px;
}

.cleaning-area-panel,
.maintenance-area-panel {
    border: 1px solid #cfe8f8;
    border-radius: 8px;
    margin-top: 16px;
    overflow: hidden;
    background: #f4fbff;
}

.maintenance-area-panel {
    border-color: #c9c6ba;
    background: #f7f6f1;
}

.section-heading.compact {
    margin: 0;
    padding: 14px 16px;
    border-bottom: 1px solid #d7edf9;
    background: #ffffff;
}

.section-heading.compact h3 {
    margin: 0;
}

.cleaning-area-row,
.maintenance-area-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin: 12px;
    padding: 12px 14px;
    border: 1px solid #64bff0;
    border-radius: 8px;
    background: #81C9FA;
    box-shadow: 0 8px 18px rgba(39, 130, 190, 0.16);
}

.maintenance-area-row {
    border-color: #c1bfb2;
    background: #DAD7CD;
    box-shadow: 0 8px 18px rgba(92, 89, 78, 0.14);
}

.cleaning-area-row:last-child,
.maintenance-area-row:last-child {
    border-bottom: 1px solid #64bff0;
}

.maintenance-area-row:last-child {
    border-bottom-color: #c1bfb2;
}

.cleaning-area-row strong,
.maintenance-area-row strong {
    display: block;
    color: #173149;
    font-size: 15px;
    font-weight: 900;
}

.maintenance-area-row strong {
    color: #33342d;
}

.cleaning-area-row small,
.maintenance-area-row small {
    display: block;
    margin-top: 3px;
    color: #244b65;
    font-weight: 800;
}

.maintenance-area-row small {
    color: #55584d;
}

.cleaning-choice,
.maintenance-choice {
    display: inline-flex;
    gap: 6px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.56);
}

.cleaning-choice label,
.maintenance-choice label {
    display: inline-flex;
    margin: 0;
    color: #16324a;
    font-size: 12px;
    font-weight: 900;
}

.maintenance-choice label {
    color: #3c4035;
}

.cleaning-choice input,
.maintenance-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cleaning-choice span,
.maintenance-choice span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    min-width: 58px;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: #234762;
    font-weight: 900;
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.cleaning-choice span::before,
.maintenance-choice span::before {
    content: "";
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-radius: 999px;
    background: #fff;
}

.cleaning-choice input:checked + span,
.maintenance-choice input:checked + span {
    border-color: #ffffff;
    background: #ffffff;
    color: #0f6091;
    box-shadow: 0 4px 10px rgba(23, 49, 73, 0.14);
}

.maintenance-choice input:checked + span {
    color: #515548;
    box-shadow: 0 4px 10px rgba(74, 74, 65, 0.14);
}

.cleaning-choice input:checked + span::before,
.maintenance-choice input:checked + span::before {
    border-color: #0f6091;
    background: radial-gradient(circle at center, #0f6091 0 42%, #fff 47% 100%);
}

.maintenance-choice input:checked + span::before {
    border-color: #515548;
    background: radial-gradient(circle at center, #515548 0 42%, #fff 47% 100%);
}

.empty-state {
    display: grid;
    gap: 4px;
    padding: 18px;
    color: var(--muted);
    text-align: center;
}

.empty-state strong {
    color: var(--ink);
}

@media (max-width: 860px) {
    .topbar {
        margin-top: 0;
    }

    .visit-grid {
        grid-template-columns: 1fr;
    }

    .map-field-head {
        align-items: stretch;
        flex-direction: column;
    }

    .map-field-head .button {
        width: 100%;
    }

    .visit-form select,
    .visit-form input {
        width: 100%;
    }

    .seller-grid,
    .attendance-layout,
    .attendance-form,
    .loan-layout,
    .loan-form,
    .payment-layout,
    .payment-form,
    .payment-search-form,
    .payment-summary-grid,
    .orders-layout,
    .sicop-report-layout,
    .customer-summary,
    .detail-list,
    .cleaning-area-row,
    .maintenance-area-row,
    .qr-display {
        grid-template-columns: 1fr;
    }

    .sicop-report-detail {
        position: static;
    }

    .cleaning-choice,
    .maintenance-choice {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media print {
    .sidebar,
    .topbar,
    .qr-view-panel .section-heading .button,
    .qr-view-panel .actions {
        display: none !important;
    }

    .app-shell {
        display: block;
        background: #fff;
    }

    .main {
        padding: 0;
    }

    .panel {
        border: 0;
        box-shadow: none;
    }
}
