:root {
  --ink: #16231d;
  --muted: #748078;
  --line: #e4e9e2;
  --paper: #fbfcf8;
  --mint: #dcefe1;
  --green: #2e7658;
  --green-dark: #193d2d;
  --orange: #e9a160;
  --rose: #f5d9d4;
  --violet: #5550dd;
}
:root.dark { --ink: #edf5ef; --muted: #9aaba0; --line: #2b3b32; --paper: #111a15; --green-dark: #d7f0dd; }
:root.dark body { background: var(--paper); color: var(--ink); }
:root.dark .sidebar, :root.dark .topbar { background: #17231c; border-color: var(--line); }
:root.dark .card, :root.dark .panel, :root.dark .icon-btn, :root.dark .search, :root.dark .input, :root.dark .select, :root.dark .secondary-btn { background: #1b2921; border-color: var(--line); color: var(--ink); }
:root.dark .nav a { color: #a7b9ac; }
:root.dark .nav a:hover, :root.dark .nav a.active { color: #183527; background: #d7f0dd; }
:root.dark .table th { background: #1b2921; }
:root.dark .table td, :root.dark .list-row { border-color: var(--line); }
:root.dark .brand-mark { background: #d7f0dd; color: #193d2d; }
:root.dark .date-popover { background: #1b2921; border-color: var(--line); color: var(--ink); }
:root.dark .app-dialog, :root.dark .app-dialog .input, :root.dark .app-dialog .select { background: #1b2921; color: var(--ink); border-color: var(--line); }
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 256px; padding: 22px 18px; border-right: 1px solid var(--line); background: #f1f5ed; position: fixed; inset: 0 auto 0 0; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 800; margin: 0 8px 38px; }
.brand-mark { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--green-dark); color: white; font-weight: 900; }
.nav-label { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin: 0 10px 10px; }
.nav { display: grid; gap: 5px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 12px 13px; color: #64736a; border-radius: 12px; font-size: 13px; font-weight: 700; }
.nav a:hover, .nav a.active { color: var(--green-dark); background: white; box-shadow: 0 6px 18px #496b5012; }
.nav-icon { width: 20px; text-align: center; font-size: 17px; }
.user-chip { position: absolute; bottom: 20px; left: 18px; right: 18px; border-top: 1px solid var(--line); padding-top: 16px; display: flex; gap: 10px; align-items: center; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #e6c6b0; font-size: 12px; font-weight: 800; }
.user-chip strong { display: block; font-size: 12px; }
.user-chip small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.main { margin-left: 256px; flex: 1; min-width: 0; }
.topbar { height: 76px; display: flex; justify-content: space-between; align-items: center; padding: 0 42px; border-bottom: 1px solid #eef1eb; }
.crumbs { color: var(--muted); font-size: 12px; font-weight: 700; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.search { width: 265px; padding: 11px 15px; border: 1px solid var(--line); border-radius: 13px; background: white; outline: none; }
.icon-btn, .primary-btn, .secondary-btn { border: 0; border-radius: 12px; cursor: pointer; font-weight: 800; }
.icon-btn { width: 42px; height: 42px; background: white; border: 1px solid var(--line); }
.date-popover { position: fixed; z-index: 20; top: 88px; right: 42px; display: flex; align-items: center; gap: 11px; min-width: 235px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: 0 16px 35px #213c2920; opacity: 0; pointer-events: none; transform: translateY(-7px); transition: opacity .2s ease, transform .2s ease; }
.date-popover.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.date-popover-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; color: var(--green); background: var(--mint); font-weight: 900; }
.date-popover small, .date-popover strong { display: block; }.date-popover small { color: var(--muted); font-size: 10px; font-weight: 800; }.date-popover strong { margin-top: 2px; font-size: 12px; }.date-popover button { margin-left: auto; border: 0; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; }
.primary-btn { padding: 12px 17px; background: var(--green); color: white; }
.secondary-btn { padding: 11px 15px; background: white; color: var(--ink); border: 1px solid var(--line); }
.content { max-width: 1480px; padding: 42px; margin: auto; }
.eyebrow { color: var(--green); font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 8px 0 7px; font-size: clamp(29px, 4vw, 45px); letter-spacing: -.05em; }
.subtitle { margin: 0; color: var(--muted); font-size: 14px; }
.page-head { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 30px; }
.actions { display: flex; gap: 9px; }
.cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 15px; margin-bottom: 20px; }
.card { border: 1px solid var(--line); border-radius: 22px; background: white; padding: 20px; min-height: 130px; box-shadow: 0 8px 30px #213c2910; }
.card.wide { grid-column: span 2; }
.card.green { background: #e7f8ee; border-color: #ccebd8; }
.card.rose { background: #fff0ef; border-color: #f8dedd; }
.card.amber { background: #fff8e8; border-color: #f6e4b9; }
.card.violet { background: var(--violet); border-color: var(--violet); color: white; }
.card-label { color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.card.green .card-label { color: #27845f; }.card.rose .card-label { color: #cf3751; }.card.amber .card-label { color: #bf710d; }.card.violet .card-label { color: #cfceff; }
.metric { margin-top: 13px; font-size: 25px; letter-spacing: -.04em; font-weight: 900; }
.progress { height: 7px; overflow: hidden; border-radius: 99px; background: #e7ece7; margin-top: 13px; }
.progress i { display: block; height: 100%; background: #45c993; border-radius: inherit; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); gap: 20px; }
.panel { border: 1px solid var(--line); border-radius: 23px; background: white; box-shadow: 0 8px 30px #213c290a; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 15px; }.panel-head p { color: var(--muted); font-size: 12px; margin: 5px 0 0; }
.panel-body { padding: 24px; }
.chart { height: 260px; display: flex; align-items: end; gap: 14px; padding: 20px 10px 0; border-bottom: 1px dashed #dfe5df; }
.bar-wrap { flex: 1; height: 100%; display: flex; align-items: end; gap: 4px; }
.bar { flex: 1; border-radius: 7px 7px 0 0; min-height: 10px; background: #a7ccb8; }.bar.orange { background: #ebb27e; }
.chart-labels { display: flex; justify-content: space-around; color: var(--muted); font-size: 10px; padding-top: 10px; }
.list { display: grid; gap: 3px; }.list-row { display: flex; align-items: center; justify-content: space-between; padding: 15px 0; border-bottom: 1px solid #f0f3ef; font-size: 13px; }.list-row:last-child { border-bottom: 0; }.list-row small { display: block; color: var(--muted); margin-top: 4px; font-size: 11px; }.amount { font-weight: 900; }
.toolbar { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--line); }.toolbar form { display: flex; gap: 8px; }
.input, .select { padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--ink); outline: none; }
.table-wrap { overflow-x: auto; }.table { width: 100%; border-collapse: collapse; min-width: 780px; }.table th { color: var(--muted); background: #fafcf9; font-size: 10px; text-align: left; text-transform: uppercase; letter-spacing: .08em; }.table th, .table td { padding: 17px 22px; border-bottom: 1px solid #eef2ed; }.table td { font-size: 13px; }.table td strong { display: block; }.table td small { display: block; color: var(--muted); margin-top: 4px; }.pill { display: inline-flex; padding: 5px 9px; border-radius: 99px; font-size: 10px; font-weight: 900; }.pill.open { color: #b62d45; background: #fff0f1; }.pill.closed { color: #207b58; background: #e8f7ed; }
.area-label { display: block; width: fit-content; margin-bottom: 7px; padding: 3px 7px; border-radius: 5px; background: #f0efff; color: #554fda; font-size: 10px; font-weight: 800; text-transform: uppercase; }.address-cell { max-width: 240px; color: var(--muted); }.row-actions { display: flex; align-items: center; gap: 6px; }.action-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-size: 17px; font-weight: 900; }.action-paid { color: #07966c; background: #e9fbf3; border-color: #cef4e4; }.action-whatsapp { color: #07966c; background: #e9fbf3; border-color: #cef4e4; }.action-view { color: #3479e8; background: #edf4ff; border-color: #dce9ff; }.action-edit { color: #6558e8; background: #f0efff; border-color: #e2e0ff; }.action-delete { color: #e2445b; background: #fff0f1; border-color: #ffe0e4; }.action-btn:hover { filter: brightness(.96); transform: translateY(-1px); }.action-btn.is-disabled { cursor: default; opacity: .7; }
.app-dialog { width: min(440px, calc(100vw - 32px)); max-height: min(90vh, 760px); padding: 0; border: 0; border-radius: 22px; color: var(--ink); background: white; box-shadow: 0 25px 80px #17231c35; overflow: auto; }.app-dialog::backdrop { background: #17231c66; backdrop-filter: blur(4px); }.dialog-form { position: relative; display: grid; gap: 18px; padding: 30px; }.dialog-form h2 { margin: 0; padding-right: 28px; font-size: 21px; letter-spacing: -.03em; }.dialog-subtitle { margin: -10px 0 0; color: var(--muted); font-size: 13px; }.dialog-subtitle strong { color: var(--violet); }.dialog-close { position: absolute; top: 16px; right: 17px; width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 24px; }.required-mark { color: #dc3951; }.optional-mark, .field-hint { color: var(--muted); font-size: 11px; font-weight: 500; }.field-hint { margin-top: -3px; }.dialog-submit { width: 100%; padding: 13px 16px; border: 0; border-radius: 12px; background: var(--violet); color: #fff; cursor: pointer; font-weight: 800; }.paid-submit { background: #07966c; }.delete-submit { background: #d93650; }.detail-dialog { width: min(540px, calc(100vw - 32px)); }.detail-dialog .dialog-form { gap: 20px; }.detail-dialog h2 { padding: 4px 28px 8px; text-align: center; }.detail-list { display: grid; gap: 11px; }.detail-list p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }.detail-list strong { color: var(--ink); }.detail-list a { color: var(--violet); font-weight: 800; }.detail-list [hidden] { display: none; }.dialog-actions { display: flex; gap: 10px; }.dialog-actions > * { flex: 1; text-align: center; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }.field { display: grid; gap: 7px; }.field.full { grid-column: 1 / -1; }.field label { color: var(--muted); font-size: 11px; font-weight: 800; }.field .input, .field .select { width: 100%; }.form-actions { display: flex; justify-content: end; gap: 8px; margin-top: 18px; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #eef4ea; }.login-box { display: grid; grid-template-columns: .9fr 1.1fr; max-width: 920px; width: 100%; overflow: hidden; border-radius: 28px; background: white; box-shadow: 0 25px 80px #2845311c; }.login-brand { padding: 50px; color: white; background: var(--green-dark); position: relative; overflow: hidden; }.login-brand:after { content: ""; position: absolute; width: 280px; height: 280px; right: -120px; bottom: -100px; border-radius: 50%; background: #9cdbc13b; }.login-brand h1 { font-size: 37px; margin-top: 70px; }.login-brand p { color: #b9d5c3; line-height: 1.6; }.login-form { padding: 50px; }.login-form h2 { font-size: 28px; margin: 0 0 8px; }.login-form p { color: var(--muted); font-size: 13px; margin: 0 0 28px; }.error { padding: 12px 14px; margin-bottom: 18px; border-radius: 11px; color: #b72b45; background: #fff0f1; font-size: 12px; font-weight: 700; }
@media (max-width: 1100px) { .cards { grid-template-columns: repeat(3, 1fr); }.card.wide { grid-column: span 1; } }
@media (max-width: 800px) { .sidebar { width: 72px; padding: 18px 10px; }.brand { justify-content: center; margin: 0 0 28px; }.brand span, .nav-label, .nav a span, .user-chip div:last-child { display: none; }.nav a { justify-content: center; }.user-chip { left: 10px; right: 10px; justify-content: center; }.main { margin-left: 72px; }.topbar { padding: 0 18px; }.search { display: none; }.content { padding: 26px 18px; }.page-head { align-items: start; flex-direction: column; }.grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr 1fr; gap: 10px; }.card { padding: 15px; min-height: 115px; }.metric { font-size: 19px; }.form-grid { grid-template-columns: 1fr; }.field.full { grid-column: auto; }.login-box { grid-template-columns: 1fr; }.login-brand { padding: 28px; }.login-brand h1 { margin-top: 25px; font-size: 30px; }.login-form { padding: 28px; } }
