:root {
  color-scheme: light;
  --forest: #0c5139;
  --forest-deep: #073d2c;
  --green: #2f7b49;
  --lime: #a4c947;
  --earth: #65432d;
  --ink: #26362d;
  --muted: #78857c;
  --paper: #f5f8f4;
  --line: #e6ece5;
  --white: #fff;
  --shadow: 0 12px 35px rgba(32, 71, 48, .07);
  font-family: "DM Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }
.sidebar {
  background: linear-gradient(165deg, var(--forest-deep), #0c523a 72%, #135b3b);
  bottom: 0; color: white; display: flex; flex-direction: column; left: 0;
  padding: 22px 15px 16px; position: fixed; top: 0; width: 258px; z-index: 20;
}
.brand { align-items: center; display: flex; gap: 12px; min-height: 70px; padding: 0 9px 22px; }
.brand img { background: white; border-radius: 12px; height: 54px; object-fit: contain; padding: 4px; width: 54px; }
.brand span { color: #dce8df; font-size: 11px; line-height: 1.4; }
.brand strong { color: white; display: block; font-family: Manrope, sans-serif; font-size: 14px; letter-spacing: -.3px; }
.side-nav { display: grid; gap: 5px; margin-top: 20px; }
.side-nav a { align-items: center; border-radius: 11px; color: #d3e2d7; display: flex; font-size: 13px; font-weight: 600; gap: 12px; min-height: 47px; padding: 10px 13px; transition: background .2s, color .2s; }
.side-nav a:hover, .side-nav a.active { background: rgba(255,255,255,.13); color: #fff; }
.side-nav a.active { box-shadow: inset 3px 0 var(--lime); }
.nav-icon { align-items: center; color: #c6e58e; display: inline-flex; font-size: 19px; justify-content: center; width: 22px; }
.sidebar-footer { align-items: center; border-top: 1px solid rgba(255,255,255,.15); display: flex; gap: 10px; margin-top: auto; padding: 18px 4px 2px; }
.user-avatar { align-items: center; background: var(--lime); border-radius: 50%; color: var(--forest-deep); display: inline-flex; flex: 0 0 36px; font-weight: 800; height: 36px; justify-content: center; }
.user-meta { flex: 1; min-width: 0; }
.user-meta strong, .user-meta small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta strong { font-size: 11px; }
.user-meta small { color: #bdd0c2; font-size: 10px; margin-top: 3px; text-transform: capitalize; }
.logout-form { margin: 0; }
.icon-button { background: transparent; border: 0; color: white; font-size: 21px; padding: 5px; }

.main-content { margin-left: 258px; min-height: 100vh; }
.topbar { align-items: center; background: rgba(255,255,255,.88); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; min-height: 101px; padding: 20px clamp(22px, 4vw, 58px); }
.topbar .eyebrow { margin-bottom: 5px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: Manrope, "Segoe UI", sans-serif; letter-spacing: -.5px; }
.topbar h1 { font-size: 24px; margin: 0; }
.eyebrow { color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: 1.5px; margin-bottom: 8px; text-transform: uppercase; }
.top-datetime { align-items: flex-end; display: flex; flex-direction: column; gap: 7px; }
.top-date { color: var(--muted); font-size: 11px; }
.live-clock { align-items: center; background: #edf5ed; border: 1px solid #e0ecdf; border-radius: 999px; color: var(--forest); display: inline-flex; font-family: Manrope, "Segoe UI", sans-serif; font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 800; gap: 8px; min-height: 34px; padding: 6px 12px; }
.clock-dot { animation: clock-pulse 1.8s ease-in-out infinite; background: #60a867; border-radius: 50%; height: 7px; width: 7px; }
.clock-zone { border-left: 1px solid #d5e4d4; color: #708579; font-family: "DM Sans", "Segoe UI", sans-serif; font-size: 9px; font-weight: 600; padding-left: 8px; }
@keyframes clock-pulse { 50% { box-shadow: 0 0 0 4px rgba(96,168,103,.15); } }
.page-content { margin: 0 auto; max-width: 1500px; padding: 28px clamp(18px, 4vw, 58px) 55px; }
.app-footer { border-top: 1px solid var(--line); color: #8a968d; font-size: 10px; margin-top: 22px; padding: 15px 3px 0; text-align: center; }
.app-credit { color: #8a968d; font-size: 10px; margin-top: 22px; text-align: center; }
.menu-toggle { background: transparent; border: 0; color: var(--forest); display: none; font-size: 23px; }

.welcome-banner { align-items: center; background: linear-gradient(115deg, #eaf3e9, #f8fbf2 65%, #e8f1df); border: 1px solid #e5eee0; border-radius: 19px; display: flex; justify-content: space-between; margin-bottom: 21px; min-height: 154px; overflow: hidden; padding: 29px 35px; position: relative; }
.welcome-banner h2 { color: var(--forest-deep); font-size: 25px; margin-bottom: 6px; }
.welcome-banner p { color: #718077; font-size: 13px; margin: 0; }
.banner-leaf { color: rgba(47,123,73,.18); font-family: Georgia, serif; font-size: 140px; line-height: .7; position: absolute; right: 32px; top: 9px; transform: rotate(-20deg); }
.stats-grid { display: grid; gap: 15px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 20px; }
.stat-card { align-items: center; background: white; border: 1px solid #edf1ec; border-radius: 15px; box-shadow: 0 5px 22px rgba(32,71,48,.035); display: flex; gap: 14px; min-height: 114px; padding: 19px; }
.stat-icon { align-items: center; border-radius: 13px; display: flex; flex: 0 0 42px; font-size: 19px; height: 42px; justify-content: center; }
.stat-icon.green { background: #e5f2e7; color: var(--green); }
.stat-icon.lime { background: #f0f5dd; color: #779b26; }
.stat-icon.brown { background: #f4ece5; color: var(--earth); }
.stat-icon.gold { background: #f7f0df; color: #ab8436; }
.stat-card span:not(.stat-icon) { color: var(--muted); display: block; font-size: 11px; }
.stat-card strong { color: var(--forest-deep); display: block; font-family: Manrope, sans-serif; font-size: 20px; margin: 3px 0; }
.stat-card small { color: #97a198; font-size: 10px; }
.dashboard-grid { display: grid; gap: 18px; grid-template-columns: 1.1fr 1fr; margin-bottom: 19px; }
.panel { background: white; border: 1px solid #edf1ec; border-radius: 16px; box-shadow: var(--shadow); margin-bottom: 18px; padding: 23px; }
.section-heading { align-items: center; display: flex; gap: 15px; justify-content: space-between; margin-bottom: 20px; }
.section-heading .eyebrow { margin-bottom: 4px; }
.section-heading h2, .panel h2 { color: #294435; font-size: 17px; margin-bottom: 0; }
.text-link { color: var(--green); font-size: 12px; font-weight: 700; }
.metric-row { align-items: center; display: flex; gap: 22px; min-height: 140px; }
.metric-row p { font-size: 12px; line-height: 1.55; margin: 7px 0 13px; max-width: 290px; }
.metric-ring { align-items: center; background: radial-gradient(circle at center, white 57%, transparent 58%), conic-gradient(var(--lime) 0 78%, #eaf0e9 78% 100%); border-radius: 50%; display: flex; flex-direction: column; height: 105px; justify-content: center; min-width: 105px; }
.metric-ring strong { color: var(--forest); font-family: Manrope, sans-serif; font-size: 26px; }
.metric-ring span { color: var(--muted); font-size: 10px; }
.quick-actions { padding-bottom: 13px; }
.quick-link { align-items: center; border-top: 1px solid #eff2ee; display: flex; gap: 12px; padding: 12px 1px; }
.quick-link > span { align-items: center; background: #eef5eb; border-radius: 10px; color: var(--green); display: inline-flex; font-size: 17px; height: 35px; justify-content: center; width: 35px; }
.quick-link div { flex: 1; }
.quick-link strong, .quick-link small { display: block; }
.quick-link strong { font-size: 12px; }
.quick-link small { color: var(--muted); font-size: 10px; margin-top: 3px; }
.quick-link b { color: #8da296; }
.decorative-panel { align-items: center; background: linear-gradient(110deg, #fff, #f1f7ed); display: flex; gap: 22px; min-height: 125px; overflow: hidden; position: relative; }
.decorative-tree { color: #b7cf9f; font-size: 64px; }
.decorative-panel h2 { margin: 0 0 6px; }
.decorative-panel p:last-child { font-size: 12px; margin: 0; }

.content-grid { align-items: start; display: grid; gap: 19px; }
.form-layout { grid-template-columns: minmax(250px, .7fr) minmax(0, 1.4fr); }
.payment-layout { grid-template-columns: minmax(300px, 1.1fr) minmax(270px, .9fr); }
.form-panel { position: sticky; top: 20px; }
.profile-panel { max-width: 560px; position: static; }
.backup-panel { max-width: 850px; }
.stack-form { display: grid; gap: 14px; }
.vehicle-entry-fields { background: #f7faf6; border: 1px solid #e7eee5; border-radius: 11px; display: grid; gap: 12px; padding: 14px; }
.vehicle-entry-fields .eyebrow, .vehicle-entry-fields .hint { grid-column: 1 / -1; margin: 0; }
.vehicle-entry-fields[hidden] { display: none; }
label, .stack-label { color: #4a5b50; display: grid; font-size: 11px; font-weight: 700; gap: 7px; }
input, select, textarea { background: #fff; border: 1px solid #dfe7df; border-radius: 9px; color: var(--ink); min-height: 42px; outline: none; padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: #69a37b; box-shadow: 0 0 0 3px rgba(47,123,73,.1); }
textarea { resize: vertical; }
.form-grid { align-items: end; display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(130px, 1fr)); }
.form-actions { align-items: center; display: flex; gap: 9px; }
.button { align-items: center; border: 1px solid transparent; border-radius: 9px; display: inline-flex; font-size: 11px; font-weight: 700; justify-content: center; min-height: 39px; padding: 10px 14px; text-align: center; transition: background .2s, transform .2s; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--green); color: white; }
.button.primary:hover { background: var(--forest); }
.button.secondary { background: #eef5ee; border-color: #e3ede3; color: var(--forest); }
.button.whatsapp-button { background: #1c9a5a; color: white; }
.button.small { font-size: 10px; min-height: 31px; padding: 7px 10px; white-space: nowrap; }
.button.full-width { width: 100%; }
.space-top { margin-top: 15px; }
.hint { color: var(--muted); font-size: 11px; line-height: 1.5; margin: 16px 0 0; }
.stack-label { margin-top: 20px; }
.table-panel { min-width: 0; }
.table-search { max-width: 220px; min-height: 37px; }
.table-wrap { overflow-x: auto; width: 100%; }
table { border-collapse: collapse; font-size: 11px; min-width: 660px; text-align: left; width: 100%; }
th { background: #f7f9f6; color: #718078; font-size: 9px; font-weight: 800; letter-spacing: .6px; padding: 11px 12px; text-transform: uppercase; }
td { border-bottom: 1px solid #eef2ed; color: #526158; padding: 12px; vertical-align: middle; }
td strong, td small { display: block; }
td strong { color: #34493b; }
td small { color: #8c9990; font-size: 10px; margin-top: 4px; }
.action-cell { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; }
.text-button { background: none; border: 0; font-size: 11px; padding: 0; }
.danger-text { color: #b34b42; }
.wa-inline { color: #238551; display: block; font-size: 10px; margin-top: 4px; }
.empty-state { color: #8d9990; padding: 28px; text-align: center; }
.status-pill { border-radius: 20px; display: inline-block; font-size: 10px; font-weight: 700; padding: 5px 9px; white-space: nowrap; }
.status-pill.paid { background: #e8f4e9; color: #287545; }
.status-pill.warning { background: #fff2dd; color: #96650f; }
.status-pill.inactive { background: #f0f1f0; color: #6f7771; }
.inline-form { align-items: center; display: flex; gap: 6px; min-width: 285px; }
.inline-form input { min-height: 32px; padding: 5px; width: auto; }
.alert { border: 1px solid transparent; border-radius: 10px; font-size: 12px; line-height: 1.5; margin-bottom: 16px; padding: 11px 13px; }
.alert.success { background: #eaf6eb; border-color: #d5ebd6; color: #28683b; }
.alert.error { background: #fff0ed; border-color: #f5d6d1; color: #a44135; }
.alert.info { background: #eef5ed; border-color: #e0eadc; color: #48654d; }
.compact-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compact-stats .stat-card { min-height: 94px; }

.auth-page { align-items: center; background: radial-gradient(ellipse at 18% 14%, #e7f2e4, transparent 37%), linear-gradient(140deg, #f8faf6, #edf4eb); display: flex; justify-content: center; min-height: 100vh; padding: 22px; }
.auth-card { background: white; border: 1px solid #e9eee7; border-radius: 20px; box-shadow: 0 20px 70px rgba(30,75,47,.12); max-width: 430px; padding: 34px; width: 100%; }
.auth-logo { display: block; height: 102px; margin: 0 auto 17px; object-fit: contain; width: 100%; }
.auth-card h1 { color: var(--forest-deep); font-size: 25px; margin-bottom: 7px; text-align: center; }
.auth-card > .eyebrow, .auth-card > .muted { text-align: center; }
.auth-card > .muted { font-size: 12px; margin-bottom: 23px; }
.auth-card .stack-form { margin-top: 22px; }

.document-page { background: #eef2ed; min-height: 100vh; padding: 20px; }
.document-toolbar { align-items: center; display: flex; justify-content: space-between; margin: 0 auto 18px; max-width: 850px; }
.toolbar-actions { display: flex; gap: 9px; }
.receipt-document { background: white; box-shadow: 0 10px 38px rgba(33,59,39,.12); color: #2c382e; margin: 0 auto; max-width: 850px; min-height: 900px; padding: 44px 54px; }
.receipt-header { align-items: center; border-bottom: 1px solid #e8eee8; display: grid; gap: 20px; grid-template-columns: 128px 1fr auto; padding-bottom: 22px; }
.receipt-header img { height: 112px; object-fit: contain; width: 128px; }
.receipt-header h1 { color: var(--forest); font-size: 20px; letter-spacing: 1px; line-height: 1.2; margin: 0 0 7px; }
.receipt-header p { color: #859087; font-size: 11px; margin: 0; }
.receipt-number { border: 1px solid #dce9dc; border-radius: 11px; min-width: 110px; padding: 11px; text-align: center; }
.receipt-number span, .receipt-number strong { display: block; }
.receipt-number span { color: #76847a; font-size: 9px; font-weight: 800; letter-spacing: .8px; }
.receipt-number strong { color: var(--forest); font-family: Manrope, sans-serif; font-size: 26px; margin-top: 3px; }
.receipt-date { color: var(--earth); font-size: 12px; font-weight: 700; margin: 19px 0; text-align: right; }
.receipt-rule { background: linear-gradient(90deg, var(--forest), var(--lime)); height: 3px; }
.receipt-main { padding: 27px 0; }
.receipt-main h2 { color: var(--forest); font-size: 20px; }
.amount-intro { color: #45554a; font-size: 14px; }
.amount-box { align-items: center; background: #f1f7ef; border: 1px solid #e1eddf; border-radius: 12px; display: flex; justify-content: space-between; margin: 19px 0 23px; padding: 15px 18px; }
.amount-box span { color: #64806a; font-size: 10px; font-weight: 800; letter-spacing: .7px; }
.amount-box strong { color: var(--forest); font-family: Manrope, sans-serif; font-size: 22px; }
.receipt-fields { display: grid; gap: 12px; }
.receipt-fields p { border-bottom: 1px solid #eff2ef; font-size: 12px; line-height: 1.5; margin: 0; padding-bottom: 9px; }
.receipt-fields strong { color: #53665a; font-size: 10px; letter-spacing: .35px; }
.receipt-issuer { border-top: 1px solid #e9eee9; display: flex; flex-direction: column; gap: 5px; margin-top: 13px; padding: 18px 0; }
.receipt-issuer span { color: #7c8a80; font-size: 10px; }
.receipt-issuer strong { color: var(--forest); font-size: 13px; }
.receipt-conditions { background: #f7f8f5; border-left: 3px solid var(--earth); border-radius: 0 8px 8px 0; padding: 14px 16px; }
.receipt-conditions h2 { color: var(--earth); font-size: 10px; letter-spacing: .7px; margin: 0 0 7px; }
.receipt-conditions p { color: #647068; font-size: 9px; line-height: 1.55; margin: 0; }
.receipt-footer { border-top: 1px solid #e8eee8; color: #869187; display: flex; font-size: 9px; justify-content: space-between; margin-top: 25px; padding-top: 13px; }
.document-credit { border-top: 1px solid #eef1ed; color: #879188; font-size: 8px; margin-top: 12px; padding-top: 9px; text-align: center; }
.pdf-hint { color: #6d7b71; font-size: 11px; margin: 16px auto; max-width: 850px; text-align: center; }
.debt-banner { align-items: center; background: #fff4e5; border: 1px solid #f1dfc4; border-radius: 10px; color: #775520; display: flex; justify-content: space-between; margin: 20px 0; padding: 15px; }
.debt-banner strong { font-size: 17px; }
.statement-document .receipt-main h3 { color: #52665a; font-size: 13px; margin: 18px 0 10px; }
.statement-table table { min-width: 0; }
.statement-table tfoot th { background: #edf5eb; color: var(--forest); font-size: 11px; }
.paid-banner { align-items: center; background: #eaf6eb; border: 1px solid #d7ead8; border-radius: 12px; color: #28683b; display: flex; gap: 14px; margin: 28px 0; padding: 20px; }
.paid-banner > span { align-items: center; background: #d8ecd9; border-radius: 50%; display: flex; font-size: 21px; height: 40px; justify-content: center; width: 40px; }
.paid-banner strong { font-size: 14px; }
.paid-banner p { font-size: 12px; margin: 5px 0 0; }
.mobile-scrim { display: none; }

@media (max-width: 1120px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-layout, .payment-layout { grid-template-columns: 1fr; }
  .form-panel { position: static; }
}
@media (max-width: 760px) {
  .sidebar { box-shadow: 8px 0 30px rgba(0,0,0,.16); transform: translateX(-105%); transition: transform .22s ease; width: 275px; }
  body.menu-open .sidebar { transform: translateX(0); }
  .mobile-scrim { background: rgba(14,32,20,.36); inset: 0; position: fixed; z-index: 15; }
  body.menu-open .mobile-scrim { display: block; }
  .main-content { margin-left: 0; }
  .topbar { gap: 12px; min-height: 78px; padding: 15px 17px; }
  .menu-toggle { display: inline-flex; }
  .topbar h1 { font-size: 19px; }
  .topbar .eyebrow { font-size: 8px; letter-spacing: 1px; }
  .top-datetime { align-items: flex-end; gap: 3px; }
  .top-date { display: block; font-size: 8px; }
  .live-clock { font-size: 10px; min-height: 29px; padding: 5px 8px; }
  .clock-zone { font-size: 8px; padding-left: 6px; }
  .page-content { padding: 19px 15px 35px; }
  .welcome-banner { min-height: 135px; padding: 22px; }
  .welcome-banner h2 { font-size: 21px; }
  .banner-leaf { font-size: 100px; right: 4px; top: 20px; }
  .stats-grid { gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card { gap: 9px; min-height: 96px; padding: 12px; }
  .stat-icon { flex-basis: 34px; height: 34px; }
  .stat-card strong { font-size: 16px; }
  .stat-card span:not(.stat-icon) { font-size: 10px; }
  .stat-card small { font-size: 9px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .panel { border-radius: 13px; padding: 17px; }
  .section-heading { align-items: flex-start; }
  .section-heading h2, .panel h2 { font-size: 15px; }
  .table-search { max-width: 145px; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .document-page { padding: 10px; }
  .document-toolbar { align-items: stretch; flex-direction: column; gap: 8px; }
  .toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .receipt-document { min-height: 0; padding: 25px 22px; }
  .receipt-header { gap: 10px; grid-template-columns: 70px 1fr auto; }
  .receipt-header img { height: 69px; width: 70px; }
  .receipt-header h1 { font-size: 13px; }
  .receipt-header p { font-size: 9px; }
  .receipt-number { min-width: 67px; padding: 7px; }
  .receipt-number span { font-size: 7px; }
  .receipt-number strong { font-size: 19px; }
  .receipt-date { font-size: 10px; }
  .amount-box { align-items: flex-start; flex-direction: column; gap: 7px; }
  .amount-box strong { font-size: 18px; }
  .debt-banner { align-items: flex-start; flex-direction: column; gap: 8px; }
  .receipt-footer { flex-direction: column; gap: 5px; }
}
@media (max-width: 420px) {
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { align-items: flex-start; flex-direction: column; }
  .quick-link { gap: 8px; }
  .auth-card { padding: 27px 22px; }
}
@media print {
  @page { margin: 12mm; size: A4; }
  body, .document-page { background: white !important; padding: 0; }
  .no-print { display: none !important; }
  .receipt-document { box-shadow: none; margin: 0; max-width: none; min-height: 0; padding: 0; }
  .receipt-header, .receipt-fields, .amount-box, .receipt-conditions, .paid-banner, .debt-banner, table, .document-credit { break-inside: avoid; }
  .receipt-conditions p { font-size: 8px; }
  .receipt-footer { margin-top: 16px; }
}
