:root {
    color-scheme: light;
    --ink: #172b26;
    --muted: #5d7169;
    --line: #dce7e1;
    --surface: #fff;
    --canvas: #f5f8f6;
    --green: #14674f;
    --green-dark: #103c31;
    --green-soft: #e3f2ea;
    --amber: #9a5807;
    --shadow: 0 1px 2px #173e2611, 0 8px 24px #21332c05;
    font-family: Inter, "Segoe UI", system-ui, sans-serif;
    background: var(--canvas);
    color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.48; font-size: .925rem; }
[hidden] { display: none !important; }
a { color: var(--green); text-underline-offset: .2em; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #43a58a; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 700; line-height: 1.15; letter-spacing: -.035em; }
h1 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); }
h2 { font-size: 1.22rem; }
h3 { font-size: 1.04rem; }
p + p { margin-top: .6rem; }
small, .muted, .hint { color: var(--muted); }
a[href]:hover { text-decoration: underline; }
.icon { display: inline-block; flex: 0 0 auto; width: 1.1rem; height: 1.1rem; vertical-align: -.18em; }
.skip-link { position: absolute; top: -5rem; left: 1rem; z-index: 2000; padding: .65rem 1rem; color: var(--ink); background: white; border-radius: .5rem; }
.skip-link:focus { top: .5rem; }

.sidebar { position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 1100; width: 231px; padding: 25px 15px 13px; background: #133b33; color: #e9f9f1; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 1.28rem; font-weight: 755; letter-spacing: -.055em; color: inherit; text-decoration: none; line-height: 1.03; }
.sidebar .brand { margin: 0 8px 36px; }
.brand:hover { text-decoration: none !important; }
.brand-mark { display: inline-grid; place-items: center; width: 39px; height: 39px; border-radius: 12px; background: #b8f4d1; color: #164e3b; }
.brand-mark .icon { width: 24px; height: 24px; }
.brand-os { color: #a9ead0; }
.brand small { display: block; margin-top: 5px; color: #abc8be; font-weight: 500; letter-spacing: 0; font-size: .71rem; }
.navigation { display: grid; align-content: start; gap: 4px; overflow: auto; padding-bottom: .5rem; }
.nav-label { color: #a6c4b8; font-size: .68rem; letter-spacing: .13em; text-transform: uppercase; font-weight: 700; padding: 7px 12px 9px; }
.nav-link { min-height: 42px; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border: 1px solid transparent; border-radius: 9px; color: #deeee7; text-decoration: none; font-size: .89rem; font-weight: 550; }
.nav-link .icon { color: #b2d1c5; }
.nav-link:hover { background: #204d42; text-decoration: none !important; }
.nav-link.selected { color: #e9fff4; background: #29594a; border-color: #3f7661; font-weight: 670; }
.nav-link.selected .icon { color: #b8f4d1; }
.sidebar-footer { display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin-top: auto; border-top: 1px solid #ffffff22; padding: 14px 1px 2px; }
.profile { display: flex; align-items: center; gap: 9px; min-width: 0; }
.profile > span:last-child { overflow: hidden; }
.profile strong, .profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile strong { font-size: .82rem; }
.profile small { color: #b2cfc4; font-size: .7rem; }
.avatar { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #b3e5ce50; border-radius: 50%; background: #265346; color: #c8f1de; font-weight: 720; font-size: .75rem; }
.icon-button { display: inline-grid; place-items: center; width: 2.15rem; height: 2.15rem; border: 0; border-radius: .55rem; color: inherit; background: transparent; }
.icon-button:hover { background: #687a721c; }
.sidebar-signout { color: #c4e3d5; }
.sidebar-signout:hover { background: #285548; }
.page-shell { margin-left: 231px; min-width: 0; min-height: 100vh; }
.topbar { height: 60px; display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 0 30px; background: #ffffffdf; border-bottom: 1px solid var(--line); }
.topbar-path, .topbar-right { display: inline-flex; gap: 10px; align-items: center; color: var(--muted); font-size: .79rem; }
.topbar-path strong { color: var(--ink); }
.topbar-right { margin-left: auto; }
.mode-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid #d2e8da; background: #eaf6ee; color: #24563f; border-radius: 999px; font-size: .72rem; font-weight: 620; white-space: nowrap; }
.mode-pill i { width: 6px; height: 6px; background: #3d9369; border-radius: 50%; }
.nav-toggle { display: none; }
.page-content { max-width: 1510px; margin: 0 auto; padding: 29px 30px 46px; }
.page-content > h1 { margin-bottom: .5rem; }
.page-content > section + section, .page-content > details + details { margin-top: 1rem; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 23px; }
.page-heading p { color: var(--muted); margin-top: 7px; }

.panel, .card { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); padding: 19px; min-width: 0; box-shadow: var(--shadow); }
.panel > h2 + *, .panel > h3 + * { margin-top: .65rem; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .65rem; margin-bottom: 13px; }
.panel-heading p { color: var(--muted); margin-top: 5px; font-size: .82rem; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 17px; }
.metric-card { min-width: 0; position: relative; min-height: 128px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: var(--shadow); padding: 16px; }
.metric-card p { margin-top: 1px; color: #365047; padding-right: 40px; font-size: .79rem; font-weight: 650; min-height: 37px; }
.metric-card strong { display: block; color: #122e25; font-size: 1.82rem; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.metric-card small { display: block; margin-top: 8px; font-size: .73rem; }
.metric-card .metric-icon { position: absolute; top: 14px; right: 13px; }
.metric-icon { display: inline-grid; flex: 0 0 auto; place-items: center; width: 33px; height: 33px; border-radius: 9px; }
.mint { color: #22644f; background: #e3f2e8; }
.blue { color: #2b5e8a; background: #e8f1fa; }
.amber { color: #8a530f; background: #f9edd8; }
.rose { color: #935064; background: #f9e9ed; }
.overview-grid { display: grid; align-items: start; grid-template-columns: minmax(0, 1.68fr) minmax(0, 1fr); gap: 16px; }
.activity-panel, .attention-panel { min-height: 302px; }
.period-chip { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; color: #4f675e; font-weight: 600; font-size: .73rem; }
.activity-total { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin: 15px 0; }
.activity-total strong { font-size: 1.6rem; line-height: 1; letter-spacing: -.065em; }
.activity-total small { font-size: .73rem; }
.sales-chart { display: grid; gap: 12px; grid-template-columns: repeat(7, minmax(0, 1fr)); padding-top: 3px; }
.chart-day { min-width: 0; display: grid; text-align: center; row-gap: 7px; color: var(--muted); font-size: .75rem; }
.chart-track { height: 116px; display: flex; justify-content: center; align-items: flex-end; border-bottom: 1px solid #dce9e2; background: repeating-linear-gradient(to top, transparent 0, transparent 27px, #edf3ef 27px, #edf3ef 28px); }
.chart-bar { display: block; height: var(--bar-height, 2%); width: min(76%, 42px); border-radius: 5px 5px 0 0; background: #8bc6ad; }
.chart-bar.current { background: #176c51; }
.attention-list { margin: 8px 0 12px; }
.attention-item { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 9px; padding: 11px 0; align-items: start; border-bottom: 1px solid #e9efeb; text-decoration: none; color: var(--ink); }
.attention-item strong, .attention-item small { display: block; }
.attention-item strong { font-size: .82rem; font-weight: 650; }
.attention-item small { margin-top: 3px; font-size: .74rem; }
.task-dot { width: 7px; height: 7px; border-radius: 50%; background: #c0862c; margin-top: 6px; }
.task-date { color: var(--muted); white-space: nowrap; font-size: .72rem; }
.text-link { text-decoration: none; font-weight: 670; font-size: .82rem; display: inline-flex; align-items: center; gap: 5px; }
.channel-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 9px; border-top: 1px solid #ebf0ed; padding: 11px 0; font-size: .84rem; }
.channel-color { width: 9px; height: 9px; background: currentColor; border-radius: 50%; }
.cell-detail { display: block; font-size: .73rem; }
.empty-block { padding: 14px 11px; border-radius: .55rem; background: var(--canvas); color: var(--muted); font-size: .83rem; }

.button, button.primary, input[type=submit] { display: inline-flex; gap: .5em; justify-content: center; align-items: center; min-height: 40px; padding: .48rem .85rem; border: 1px solid var(--green); border-radius: 8px; background: var(--green); color: white; font-weight: 630; font-size: .86rem; text-align: center; text-decoration: none; white-space: normal; }
.button:hover { filter: brightness(.96); text-decoration: none !important; }
.button.secondary, .button.link { background: #fff; border-color: #cfdfd7; color: #235844; }
.button.compact { min-height: 33px; padding: .32rem .57rem; font-size: .76rem; }
.button.danger { background: #fff6f6; border-color: #e9bdbd; color: #8a2929; }
.actions, .toolbar, .filters, .inline-form { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; }
.filter-bar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: .55rem .65rem; padding-bottom: .35rem; }
.filter-bar > label:not(:has(input[type=checkbox])) { flex: 1 1 135px; }
.filter-bar > label:has(input[type=checkbox]), .filter-bar > a { align-self: flex-end; min-height: 38px; align-items: center; }
.filter-bar > a { display: inline-flex; padding: .3rem .45rem; }
.stack { display: grid; gap: .7rem; align-content: start; }
.grid, .form-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr)); }
.grid > *, .stack > * { min-width: 0; }
.split, .two-column { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.staff-row { grid-template-columns: 1.5fr 1fr 1fr .75fr auto; align-items: end; }
.staff-row > div { align-self: center; }
label { display: grid; gap: 5px; color: #38514a; font-size: .83rem; font-weight: 640; }
label:has(input[type=checkbox]), label:has(input[type=radio]) { display: flex; gap: .5rem; align-items: center; }
input:not([type=checkbox]):not([type=radio]), select, textarea { min-width: 0; width: 100%; padding: .53rem .64rem; border: 1px solid #cbdcd2; border-radius: 7px; color: var(--ink); background: #fff; min-height: 38px; }
textarea { min-height: 74px; resize: vertical; }
input[type=checkbox], input[type=radio] { accent-color: var(--green); }
details > summary { font-weight: 690; cursor: pointer; }
details[open] > summary { margin-bottom: .75rem; }
fieldset { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: .8rem; }
legend { font-weight: 680; }
.section-body, .section-space { margin-top: .9rem; }
.badge, .status-badge, .chip { display: inline-flex; align-items: center; padding: .18rem .5rem; border-radius: 999px; background: #eaf0ee; color: #455a50; font-size: .72rem; font-weight: 680; white-space: nowrap; }
.badge-green, .badge.success, .badge.active, .badge.confirmed { background: #e1f2e6; color: #1c603f; }
.badge-amber, .badge.warning, .badge.dormant { background: #fbefdb; color: #87530f; }
.badge-red, .badge.error, .badge.paused { background: #fae9e9; color: #8d3030; }
.badge-blue { background: #e5f0fa; color: #265c88; }
.tabular { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { border-bottom: 1px solid #e7efea; padding: .65rem .6rem; vertical-align: middle; }
th { background: #f1f6f3; color: #4b6259; font-size: .73rem; font-weight: 720; letter-spacing: .01em; white-space: nowrap; }
td { font-size: .83rem; }
tbody tr:last-child td { border-bottom: 0; }
[role=navigation] svg { width: 1rem; height: 1rem; }
.feedback { border: 1px solid #d0e7da; color: #20543d; padding: .67rem .9rem; border-radius: .55rem; background: #e8f5ee; margin-bottom: .8rem; overflow-wrap: anywhere; }
.feedback-error { border-color: #efcece; color: #862e2e; background: #fdf1f1; }
.feedback ul { padding-left: 1.25em; margin: .3rem 0 0; }
.map-canvas, .pin-map { border-radius: .75rem; border: 1px solid var(--line); background: #e4ede7; min-height: 320px; }
[class*="leaflet"] .button { min-height: 30px; }

.guest { min-height: 100vh; display: grid; place-items: center; background: #e8f0eb; padding: 25px; }
.guest-content { width: min(100%, 925px); }
.login-grid { display: grid; grid-template-columns: 1.04fr 1fr; border: 1px solid #cbded2; border-radius: 20px; overflow: hidden; box-shadow: 0 24px 70px #203f3324; }
.login-brand { display: flex; align-items: flex-start; justify-content: center; flex-direction: column; min-height: 450px; padding: clamp(28px, 6vw, 61px); background: radial-gradient(ellipse at 85% 80%, #235e4e 0, #123c31 72%); color: #eefdF5; }
.login-brand .brand { margin-bottom: 33px; }
.login-brand h1 { max-width: 12em; font-size: clamp(1.9rem, 3.6vw, 3rem); }
.login-brand p { margin-top: 15px; color: #c4ddd2; }
.login-features { display: flex; flex-wrap: wrap; gap: .7rem; padding-top: 22px; color: #e0f3e8; font-size: .77rem; }
.login-features span { display: inline-flex; align-items: center; gap: .25rem; }
.login-features .icon { width: .9rem; height: .9rem; }
.login-form { padding: clamp(25px, 6vw, 57px); background: white; }
.login-form h2 { font-size: 1.8rem; }
.login-form p { margin: .45rem 0 1.2rem; }
.login-form .button { width: 100%; }
.demo-form { border-top: 1px solid var(--line); margin-top: 1.2rem; padding-top: 1rem; }
.field-offline, .offline-shell { width: min(100% - 2rem, 720px); margin: 1rem auto; }

@media (max-width: 1130px) {
    .page-content { padding-inline: 23px; }
    .topbar { padding-inline: 23px; }
    .metric-card { padding: 13px; }
}
@media (max-width: 900px) {
    .sidebar { width: 219px; }
    .page-shell { margin-left: 219px; }
    .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .overview-grid { grid-template-columns: 1fr; }
    .activity-panel, .attention-panel { min-height: auto; }
    .staff-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .sidebar { display: none; width: min(87vw, 265px); box-shadow: 0 2px 120px #0b2d2390; top: 54px; }
    body.nav-open .sidebar { display: flex; }
    .sidebar .brand { margin-bottom: 22px; }
    .nav-toggle { display: inline-grid; }
    .page-shell { margin-left: 0; }
    .topbar { height: 54px; padding-inline: 12px; gap: 6px; position: sticky; top: 0; z-index: 1090; }
    .topbar-path > span { display: none; }
    .topbar-right { gap: 6px; }
    .page-content { padding: 18px 12px 34px; }
    .page-heading { align-items: flex-start; margin-bottom: 15px; flex-wrap: wrap; gap: 10px; }
    .page-heading p { font-size: .85rem; }
    .metrics-grid, .overview-grid { gap: 10px; margin-bottom: 12px; }
    .metric-card { min-height: 107px; padding: 10px; }
    .metric-card p { min-height: 37px; font-size: .73rem; padding-right: 28px; }
    .metric-card strong { font-size: 1.5rem; }
    .metric-card small { margin-top: 5px; font-size: .68rem; }
    .metric-card .metric-icon { width: 25px; height: 25px; top: 8px; right: 7px; border-radius: 7px; }
    .metric-card .metric-icon .icon { width: .88rem; height: .88rem; }
    .panel, .card { padding: 13px; }
    .split, .two-column { grid-template-columns: 1fr; }
    .guest { padding: 13px; }
    .login-grid { grid-template-columns: 1fr; }
    .login-brand { padding: 23px; min-height: auto; }
    .login-brand .brand { margin-bottom: 16px; }
    .login-features { padding-top: 13px; }
}
@media (max-width: 355px) { .topbar-date { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
