:root {
    color-scheme: light;
    --brand-50: #F2FBF2;
    --brand-100: #E1F6E1;
    --brand-200: #BFECC0;
    --brand-300: #8DDB90;
    --brand-400: #57C85C;
    --brand-500: #26AB26;
    --brand-600: #208F22;
    --brand-700: #19721D;
    --brand-800: #0E570E;
    --brand-900: #0B430D;
    --brand-950: #062A08;
    --background: #FBFAF7;
    --surface: #FFFFFF;
    --surface-subtle: #F6F5F1;
    --surface-raised: #FFFFFF;
    --text-primary: #181A17;
    --text-secondary: #696963;
    --text-muted: #96968F;
    --text-inverse: #FFFFFF;
    --border: #E5E4DF;
    --border-strong: #D3D3CD;
    --primary: #0E570E;
    --primary-hover: #0B430D;
    --primary-active: #083708;
    --primary-content: #FFFFFF;
    --secondary: #26AB26;
    --secondary-hover: #208F22;
    --secondary-content: #FFFFFF;
    --accent: #B88A38;
    --accent-subtle: #FBF6E9;
    --info: #3478B8;
    --info-bg: #EDF5FC;
    --danger-content: #FFFFFF;
    --warning: #B7791F;
    --warning-bg: #FFF7E6;
    --danger: #C73E3E;
    --danger-bg: #FCEEEE;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-full: 9999px;
    --shadow-xs: 0 1px 2px rgba(24, 26, 23, .04);
    --shadow-sm: 0 1px 2px rgba(24, 26, 23, .04), 0 6px 16px rgba(24, 26, 23, .05);
    --shadow-md: 0 2px 4px rgba(24, 26, 23, .05), 0 12px 32px rgba(24, 26, 23, .08);
    --duration-fast: 120ms;
    --duration-normal: 180ms;
    --duration-slow: 240ms;
    --ease-standard: cubic-bezier(.2, .8, .2, 1);
    --ui-base-100: var(--surface);
    --ui-base-200: var(--background);
    --ui-base-300: var(--border);
    --ui-base-content: var(--text-primary);
    --ui-primary: var(--primary);
    --text-main: var(--text-primary);
    --text-soft: var(--text-secondary);
    --text-faint: var(--text-muted);
    --line: var(--border);
    --accent: var(--secondary);
    --accent-soft: var(--secondary);
}
[data-theme="light"] {
    color-scheme: light;
}

[data-theme="dark"] {
    color-scheme: dark;
    --background: #0D120D;
    --surface: #131A13;
    --surface-subtle: #182018;
    --surface-raised: #1C251C;
    --text-primary: #F3F5F0;
    --text-secondary: #B7BCAF;
    --text-muted: #848B80;
    --text-inverse: #0D120D;
    --border: #293229;
    --border-strong: #394439;
    --primary: #57C85C;
    --primary-hover: #6BD26F;
    --primary-active: #8DDB90;
    --primary-content: #081108;
    --secondary: #8DDB90;
    --secondary-hover: #A3E3A5;
    --secondary-content: #081108;
    --accent: #D0AA59;
    --accent-soft: var(--secondary);
    --accent-subtle: #292313;
    --warning: #D4A64A;
    --warning-bg: #2B2313;
    --info: #6AA7D8;
    --info-bg: #142534;
    --danger-content: #FFFFFF;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .16);
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, .18);
    --shadow-md: 0 16px 40px rgba(0, 0, 0, .24);
    --ui-base-100: var(--surface);
    --ui-base-200: var(--background);
    --ui-base-300: var(--border);
    --ui-base-content: var(--text-primary);
    --ui-primary: var(--primary);
    --text-main: var(--text-primary);
    --text-soft: var(--text-secondary);
    --text-faint: var(--text-muted);
    --line: var(--border);
}

html {
    scroll-padding-top: 4rem;
}

body {
    margin: 0;
    min-width: 320px;
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-primary);
    background: var(--background);
    -webkit-font-smoothing: antialiased;
}

body.app-shell { min-height: 100vh; font-size: .875rem; }
body.public-shell, body.auth-shell { background: var(--background); }
h1, h2 { font-family: "The Seasons", "Cormorant Garamond", Georgia, serif; font-weight: 400; letter-spacing: -.025em; }
h1 { font-size: clamp(1.75rem, 2vw, 2.25rem); line-height: 1.15; }
h2 { font-size: clamp(1.4rem, 1.8vw, 1.75rem); line-height: 1.2; }
h3, h4 { font-family: Inter, ui-sans-serif, system-ui, sans-serif; letter-spacing: -.015em; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--secondary) 35%, transparent); outline-offset: 3px; }
img { max-width: 100%; }
textarea { resize: vertical; }
input[type="date"], input[type="time"] { min-width: 0; }

.page-wrap { width: 100%; min-width: 0; }
.page-wrap > :last-child { margin-bottom: 0; }
.app-shell .page-wrap { min-height: calc(100vh - 10rem); }
.table th { color: var(--text-muted); font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.table td { vertical-align: middle; }
.table tbody tr { border-color: var(--border); }
.table tbody tr:hover { background: color-mix(in srgb, var(--text-primary) 4%, transparent); }
.card { min-width: 0; border-radius: var(--radius-lg); }
.card:not(.bg-transparent) { box-shadow: var(--shadow-xs); }
.btn { min-height: 2.5rem; border-radius: var(--radius-md); font-weight: 600; letter-spacing: -.01em; text-transform: none; transition: background-color var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard); }
.btn-sm { min-height: 2rem; border-radius: var(--radius-sm); }
.btn-lg { min-height: 2.75rem; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-content); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-primary:active { background: var(--primary-active); border-color: var(--primary-active); }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text-primary); }
.btn-outline:hover { background: var(--surface-subtle); border-color: var(--primary); color: var(--primary); }
.btn-ghost:hover { background: var(--surface-subtle); color: var(--text-primary); }
.btn-error, .btn-danger { background: var(--danger); border-color: var(--danger); color: var(--danger-content); }
.input, .select, .textarea, .file-input { max-width: 100%; min-height: 2.5rem; border-radius: var(--radius-md); border-color: var(--border-strong); background: var(--surface); color: var(--text-primary); box-shadow: none; }
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.input:focus, .select:focus, .textarea:focus, .file-input:focus { border-color: var(--secondary); outline: 3px solid color-mix(in srgb, var(--secondary) 16%, transparent); outline-offset: 0; }
.fieldset-legend { font-size: .875rem; font-weight: 600; }
.label { color: var(--text-secondary); white-space: normal; }
.alert { border-radius: var(--radius-md); box-shadow: none; }
.stat { min-width: 0; }
.stat-value { color: var(--text-primary); font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.stat-title { color: var(--text-secondary); }
.badge { border-radius: var(--radius-full); font-weight: 600; padding-inline: .625rem; padding-block: .25rem; }
.modal { z-index: 80; }
.modal-box { max-height: 88dvh; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface); color: var(--text-primary); box-shadow: var(--shadow-md); }
.modal-backdrop, .modal::backdrop { background: rgb(24 26 23 / .42); }

.app-brand-mark {
    display: inline-grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    flex: 0 0 auto;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: var(--primary-content);
}
.app-logo-pair { display: inline-flex; min-width: 0; align-items: center; }
.app-logo { display: block; width: auto; height: 2.25rem; max-width: 100%; object-fit: contain; }
.app-logo-light { display: block; }
.app-logo-dark { display: none; }
[data-theme="dark"] .app-logo-light { display: none; }
[data-theme="dark"] .app-logo-dark { display: block; }
.app-sidebar-brand .app-logo-pair { width: 9.25rem; justify-content: center; }
.app-sidebar-brand .app-logo { height: 2.25rem; }
.public-brand .app-logo { height: 2.5rem; width: 9.25rem; }
.auth-brand .app-logo { height: 2.5rem; width: 9.25rem; }

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 70;
    display: flex;
    width: 16rem;
    flex-direction: column;
    background: var(--surface);
    color: var(--text-primary);
    border-right: 1px solid var(--border);
    transition: transform var(--duration-normal) var(--ease-standard);
}
.app-sidebar-brand { display: flex; flex-direction: column; align-items: center; gap: .375rem; padding: .875rem 1.25rem .8rem; border-bottom: 1px solid var(--border); text-align: center; }
.app-sidebar-brand .app-brand-mark { background: var(--brand-100); color: var(--brand-800); }
[data-theme="dark"] .app-sidebar-brand .app-brand-mark { background: var(--brand-900); color: var(--brand-300); }
.app-sidebar-brand .min-w-0 { width: 100%; }
.app-sidebar-brand small { display: block; color: var(--text-muted); font-size: .6875rem; letter-spacing: .02em; }
.app-sidebar .menu { width: 100%; padding: .75rem .875rem; gap: .25rem; }
.app-sidebar .menu-title { margin: .75rem 0 .25rem; color: var(--text-muted); font-size: .625rem; letter-spacing: .12em; text-transform: uppercase; }
.app-sidebar .menu li > a { min-height: 2.5rem; padding: .625rem .75rem; border-radius: var(--radius-sm); color: var(--text-secondary); font-weight: 500; gap: .75rem; }
.app-sidebar .menu li > a i { width: 1.125rem; text-align: center; font-size: .875rem; color: var(--text-muted); }
.app-sidebar .menu li > a:hover { background: var(--surface-subtle); color: var(--text-primary); }
.app-sidebar .menu li > a[aria-current="page"] { position: relative; background: var(--brand-50); color: var(--primary); font-weight: 600; }
.app-sidebar .menu li > a[aria-current="page"]::before { position: absolute; inset: .5rem auto .5rem 0; width: 3px; border-radius: 0 3px 3px 0; background: var(--secondary); content: ""; }
[data-theme="dark"] .app-sidebar .menu li > a[aria-current="page"] { background: #182B18; color: var(--brand-300); }
.app-sidebar .menu li > a[aria-current="page"] i { color: var(--secondary); }
.app-sidebar-footer { margin-top: auto; padding: 1rem 1.25rem 1.5rem; border-top: 1px solid var(--border); }
.app-sidebar-footer a { display: flex; align-items: center; gap: .625rem; color: var(--text-secondary); font-size: .75rem; }
.app-topbar { min-height: 4rem; position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 94%, transparent); padding: .625rem 1.5rem; gap: .75rem; }
.app-topbar-actions { display: flex; flex: 0 0 auto; align-items: center; gap: .5rem; }
.app-topbar-divider { display: block; width: 1px; height: 1.75rem; background: var(--border); }
.app-topbar .dropdown-content { border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); }
.app-topbar .dropdown-content button { width: 100%; justify-content: flex-start; }
.app-topbar-caption { font-size: .7rem; color: var(--text-muted); }
.app-sidebar-overlay { display: none; }
.app-footer { color: var(--text-muted); border-top: 1px solid var(--border); background: var(--surface); font-size: .75rem; }
.skip-link { position: fixed; top: .5rem; left: 1rem; z-index: 100; transform: translateY(-200%); padding: .75rem 1rem; border-radius: var(--radius-sm); background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.skip-link:focus { transform: translateY(0); }

.theme-menu summary { list-style: none; }
.theme-menu summary::-webkit-details-marker { display: none; }
.theme-menu .theme-choice { width: 100%; justify-content: flex-start; color: var(--text-secondary); }
.theme-menu .theme-choice[aria-pressed="true"] { color: var(--primary); background: var(--brand-50); }
[data-theme="dark"] .theme-menu .theme-choice[aria-pressed="true"] { background: #182B18; color: var(--brand-300); }
.theme-choice-check { visibility: hidden; }
.theme-choice[aria-pressed="true"] .theme-choice-check { visibility: visible; }

.empty-state { padding: 3rem 1.5rem; text-align: center; color: var(--text-secondary); }
.empty-state > :first-child { margin-inline: auto; }
.loading-state { color: var(--text-muted); }
.skeleton { background: color-mix(in srgb, var(--text-muted) 16%, transparent); }

@media (min-width: 1024px) {
    body.app-shell { padding-left: 16rem; }
}
@media (max-width: 1023px) {
    .app-sidebar { transform: translateX(-100%); }
    .sidebar-open .app-sidebar { transform: translateX(0); }
    .sidebar-open .app-sidebar-overlay { display: block; position: fixed; inset: 0; z-index: 60; background: rgb(24 26 23 / .42); }
    body.sidebar-open { overflow: hidden; }
    .app-topbar { padding: .625rem 1rem; }
}
@media (max-width: 639px) {
    .app-shell .input, .app-shell .select, .app-shell .textarea { font-size: 1rem; }
    .stat-value { font-size: 1.75rem; }
    .alert { grid-auto-flow: column; text-align: left; }
    .page-wrap { padding-inline: 1rem; }
    .modal-box { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}
@media (max-width: 639px) {
    .app-topbar { flex-wrap: nowrap; gap: .375rem; padding: .5rem .75rem; }
    .app-topbar > .min-w-0 { flex: 1 1 auto; }
    .app-topbar-caption { display: none; }
    .app-topbar-actions { gap: .125rem; }
    .app-topbar-actions > .btn-outline[data-help-open] { width: 2.5rem; padding-inline: 0; }
    .app-topbar-actions > .dropdown { flex: 0 0 auto; }
    .app-topbar-actions > .dropdown > summary { min-width: 2.5rem; justify-content: center; gap: .25rem; padding-inline: .375rem; }
    .app-topbar-actions > .dropdown:last-child > summary { width: 2.75rem; padding-inline: .25rem; }
    .app-topbar-divider { display: none; }
}
@media (max-width: 639px) {
    .public-shell main { text-align: center; }
    .public-shell main :is(h1, h2, h3, p, dl, ul, ol, blockquote) { text-align: center; }
    .public-shell main :is(h1, h2, h3, p) { margin-inline: auto; }
    .public-shell main .alert { text-align: center; }
    .public-shell main ol li > span { margin-inline: auto; }
    .public-shell main .flex { align-items: center; justify-content: center; }
    .public-shell .app-footer, .public-shell .app-footer > div { text-align: center; }
    .public-shell .app-footer > div, .public-shell .app-footer nav { align-items: center; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
    body.app-shell { padding-left: 0; background: #fff; }
    .app-sidebar, .app-sidebar-overlay, .app-topbar, .app-footer, .skip-link { display: none; }
    .page-wrap { max-width: none; padding: 0; }
}

div[class*="whatsapp"][style*="fixed"],
div[id*="whatsapp"][style*="fixed"],
a[class*="whatsapp"][style*="fixed"],
a[id*="whatsapp"][style*="fixed"],
div[class*="wa-widget"],
div[id*="wa-widget"],
div[class*="click-to-chat"],
div[id*="click-to-chat"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
