@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

:root {
    color-scheme: light;
    --ink: #202922;
    --ink-soft: #58635b;
    --muted: #89918a;
    --line: #e5e9e3;
    --paper: #fff;
    --canvas: #f4f6f3;
    --green: #246b4a;
    --green-deep: #164933;
    --green-pale: #e1eee5;
    --orange: #d57445;
    --orange-pale: #f7e8de;
    --yellow-pale: #f3efd9;
    --red: #a6423d;
    --shadow: 0 14px 40px rgba(32, 41, 34, .055);
    font-family: 'DM Sans', 'Segoe UI', sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

.sidebar { position: fixed; z-index: 10; inset: 0 auto 0 0; display: flex; flex-direction: column; width: 246px; padding: 28px 19px 18px; background: #fbfcfa; border-right: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; width: fit-content; color: var(--ink); font: 800 20px/1 'Manrope', sans-serif; }
.brand small { display: block; margin-top: 5px; color: var(--muted); font: 700 8px/1 'DM Sans', sans-serif; letter-spacing: 1px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; color: #fff; background: var(--green); border-radius: 13px 5px 13px 5px; font: 800 15px 'Manrope', sans-serif; }
.side-nav { display: grid; gap: 7px; margin-top: 61px; }
.nav-link { display: flex; align-items: center; gap: 13px; min-height: 46px; padding: 0 13px; border-radius: 7px; color: #6e7870; font-size: 14px; font-weight: 600; transition: color .2s ease, background .2s ease, transform .2s ease; }
.nav-link:hover { color: var(--green-deep); background: #eff4ef; transform: translateX(2px); }
.nav-link.is-active { color: var(--green-deep); background: var(--green-pale); }
.nav-link svg { width: 19px; height: 19px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 15px 1px 0; border-top: 1px solid var(--line); }
.sidebar-user > div { min-width: 0; flex: 1; }
.sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { font-size: 12px; }
.sidebar-user small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; color: var(--green-deep); background: var(--yellow-pale); border-radius: 50%; font-weight: 700; }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; color: var(--ink-soft); border-radius: 7px; transition: background .2s ease, color .2s ease; }
.icon-button:hover { color: var(--red); background: var(--orange-pale); }
.icon-button svg { width: 17px; }
.main-content { min-height: 100vh; margin-left: 246px; padding: 0 42px 52px; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 105px; margin-bottom: 23px; border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 3px 0 0; font: 700 24px/1.25 'Manrope', sans-serif; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: 1.05px; }
.topbar .eyebrow { margin-bottom: 0; color: var(--muted); }
.topbar-user { display: flex; align-items: center; gap: 9px; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #65a678; box-shadow: 0 0 0 4px #e4f1e7; }
.welcome-row { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 27px 0 19px; }
.welcome-row h2 { margin: 0; font: 700 21px/1.3 'Manrope', sans-serif; }
.welcome-row .eyebrow { margin-bottom: 7px; }
.period-chip { display: inline-flex; align-items: center; gap: 9px; padding: 9px 12px; color: var(--ink-soft); background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 5px; font-size: 11px; font-weight: 600; }
.period-chip .status-dot { width: 7px; height: 7px; box-shadow: none; }
.metric-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 13px; margin-bottom: 17px; }
.metric { position: relative; overflow: hidden; min-height: 142px; padding: 18px 20px 16px; border-radius: 6px; animation: rise-in .45s both; }
.metric:nth-child(2) { animation-delay: .07s; }
.metric:nth-child(3) { animation-delay: .14s; }
.metric-green { color: #fff; background: var(--green); }
.metric-green::after { position: absolute; right: -23px; bottom: -49px; width: 145px; height: 145px; border: 1px solid rgba(255,255,255,.17); border-radius: 50%; content: ''; }
.metric-cream { background: var(--yellow-pale); }
.metric-slate { background: #e6ece8; }
.metric-head { display: flex; align-items: center; justify-content: space-between; gap: 9px; color: inherit; font-size: 11px; font-weight: 600; opacity: .82; }
.metric-head svg { width: 18px; height: 18px; }
.metric > strong { display: block; margin-top: 17px; font: 700 28px/1 'Manrope', sans-serif; }
.metric > strong small { font: 600 11px 'DM Sans', sans-serif; }
.metric > p { margin: 7px 0 0; color: inherit; font-size: 10px; opacity: .72; }
.content-grid { display: grid; gap: 15px; }
.dashboard-grid { grid-template-columns: minmax(270px, .85fr) minmax(0, 1.5fr); }
.panel { min-width: 0; padding: 21px; background: var(--paper); border: 1px solid rgba(229,233,227,.8); border-radius: 6px; box-shadow: var(--shadow); animation: rise-in .45s both; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 21px; }
.section-heading h2 { margin: 0; font: 700 16px/1.35 'Manrope', sans-serif; }
.section-heading .eyebrow { margin-bottom: 5px; }
.step-index { display: grid; place-items: center; width: 29px; height: 29px; color: var(--green); background: var(--green-pale); border-radius: 50%; font-size: 10px; font-weight: 700; }
.form-stack { display: grid; gap: 15px; }
.form-stack label { display: grid; gap: 7px; color: #47534a; font-size: 11px; font-weight: 700; }
.form-stack input, .form-stack select, .form-stack textarea { width: 100%; min-width: 0; min-height: 42px; padding: 10px 12px; color: var(--ink); background: #fbfcfa; border: 1px solid #dfe5df; border-radius: 4px; outline: 0; font-size: 12px; font-weight: 500; transition: border .18s ease, box-shadow .18s ease, background .18s ease; }
.form-stack textarea { min-height: 104px; resize: vertical; }
.form-stack input:focus, .form-stack select:focus, .form-stack textarea:focus { background: #fff; border-color: #5d9a75; box-shadow: 0 0 0 3px rgba(74,139,99,.12); }
.form-stack input::placeholder, .form-stack textarea::placeholder { color: #a1aaa2; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 0 15px; border: 1px solid transparent; border-radius: 4px; cursor: pointer; font-size: 11px; font-weight: 700; transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0) scale(.99); }
.button svg { width: 16px; height: 16px; }
.button-primary { color: #fff; background: var(--green); }
.button-primary:hover { background: var(--green-deep); box-shadow: 0 5px 13px rgba(22,73,51,.16); }
.button-dark { color: #fff; background: var(--ink); }
.button-dark:hover { background: #38443b; }
.button-outline { color: var(--ink); background: #fff; border-color: #dfe5df; }
.button-outline:hover { background: #f7faf7; border-color: #b9c9bc; }
.button-wide { width: 100%; margin-top: 4px; }
.text-link { display: inline-flex; gap: 6px; align-items: center; color: var(--green); font-size: 10px; font-weight: 700; }
.text-link:hover { color: var(--green-deep); }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th { padding: 0 12px 10px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 9px; font-weight: 700; letter-spacing: .55px; text-transform: uppercase; }
td { padding: 12px; color: var(--ink-soft); border-bottom: 1px solid #edf0ec; font-size: 10px; }
tbody tr:last-child td { border-bottom: 0; }
td strong { color: var(--ink); font-size: 11px; }
td small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.empty-state { display: grid; justify-items: center; gap: 9px; padding: 28px 12px; color: var(--muted); text-align: center; font-size: 11px; }
.empty-state p { margin: 0; }
.empty-state small { max-width: 250px; line-height: 1.6; }
.empty-state a { color: var(--green); font-weight: 700; }
.empty-icon { display: grid; place-items: center; width: 38px; height: 38px; color: var(--green); background: var(--green-pale); border-radius: 50%; }
.empty-icon svg { width: 18px; }
.notice { margin: 12px 0; padding: 11px 14px; border: 1px solid transparent; border-radius: 4px; font-size: 12px; animation: rise-in .2s both; }
.notice-success { color: #245a3d; background: #e6f2e8; border-color: #d1e8d6; }
.notice-error { color: #8c3732; background: #faeae7; border-color: #f0d1cc; }
.optional { color: var(--muted); font-size: 10px; font-weight: 500; }
.stock-forms { grid-template-columns: 1fr 1fr; }
.inventory-grid { grid-template-columns: 1fr 1fr; margin-top: 15px; }
.count-pill { padding: 6px 9px; color: var(--ink-soft); background: #f2f5f1; border-radius: 4px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.shared-list { display: grid; }
.shared-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 50px; border-bottom: 1px solid #edf0ec; }
.shared-row:last-child { border-bottom: 0; }
.shared-row strong, .shared-row small { display: block; }
.shared-row strong { font-size: 11px; }
.shared-row div small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.shared-row > span { color: var(--green-deep); font-size: 12px; font-weight: 700; white-space: nowrap; }
.shared-row > span small { display: inline; color: var(--muted); font-size: 9px; font-weight: 500; }
.cash-metrics { grid-template-columns: 1fr 1fr; max-width: 830px; }
.cash-grid { grid-template-columns: minmax(270px, .8fr) minmax(300px, 1.2fr); margin-bottom: 15px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 0; border: 0; }
.segmented legend { margin-bottom: 7px; color: #47534a; font-size: 11px; font-weight: 700; }
.segmented label { position: relative; }
.segmented input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.segmented span { display: grid; place-items: center; min-height: 37px; color: var(--ink-soft); background: #f5f7f4; border: 1px solid var(--line); border-radius: 4px; font-size: 11px; font-weight: 700; transition: background .18s, border .18s, color .18s; }
.segmented input:checked + span { color: var(--green-deep); background: var(--green-pale); border-color: #b8d4c0; }
.segmented input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }
.body-copy { margin: -5px 0 20px; color: var(--ink-soft); font-size: 11px; line-height: 1.7; }
.closure-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; padding: 13px; background: #f5f7f4; border-radius: 4px; }
.closure-summary span, .closure-summary strong { display: block; }
.closure-summary span { margin-bottom: 7px; color: var(--muted); font-size: 9px; }
.closure-summary strong { font-size: 12px; }
.ledger-panel { margin-top: 15px; }
.type-label { padding: 4px 7px; color: var(--ink-soft); background: #f2f5f1; border-radius: 3px; font-size: 9px; }
.amount-in { color: var(--green); font-weight: 700; }
.amount-out { color: var(--red); font-weight: 700; }
.request-layout { grid-template-columns: minmax(0, 1.25fr) minmax(240px, .75fr); }
.request-note { padding: 23px; color: #fff; background: var(--ink); border-radius: 6px; animation: rise-in .45s .08s both; }
.note-mark { display: grid; place-items: center; width: 35px; height: 35px; margin-bottom: 25px; color: #fff; background: rgba(255,255,255,.12); border-radius: 50%; }
.note-mark svg { width: 18px; }
.request-note .eyebrow { color: #acd0b8; }
.request-note h3 { margin: 0 0 10px; font: 700 17px 'Manrope', sans-serif; }
.request-note > p:not(.eyebrow) { color: #d1d8d2; font-size: 11px; line-height: 1.7; }
.note-divider { height: 1px; margin: 17px 0; background: rgba(255,255,255,.14); }
.request-list-panel { margin-top: 15px; }
.request-list { display: grid; }
.request-item { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 0; border-top: 1px solid #edf0ec; }
.request-main { min-width: 0; flex: 1; }
.request-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.status-badge { display: inline-flex; padding: 5px 8px; border-radius: 3px; font-size: 9px; font-weight: 700; }
.status-pending { color: #876323; background: #f5efd9; }
.status-approved { color: #245a3d; background: #e4f1e7; }
.status-rejected { color: #8c3732; background: #faeae7; }
.request-type { color: var(--ink); font-size: 10px; font-weight: 700; }
.request-date { color: var(--muted); font-size: 9px; }
.justification { margin: 10px 0; color: var(--ink-soft); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.vote-track { width: 100%; height: 4px; overflow: hidden; background: #edf0ec; border-radius: 3px; }
.vote-track span { display: block; height: 100%; background: #66a47a; border-radius: inherit; transition: width .3s ease; }
.vote-caption { display: flex; justify-content: space-between; gap: 12px; margin-top: 7px; color: var(--muted); font-size: 9px; }
.vote-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.vote-button { display: grid; justify-items: center; gap: 3px; min-width: 48px; padding: 8px 7px; border: 1px solid transparent; border-radius: 4px; cursor: pointer; transition: transform .18s ease, background .18s ease; }
.vote-button:hover { transform: translateY(-2px); }
.vote-button svg { width: 16px; height: 16px; }
.vote-button span { font-size: 9px; font-weight: 700; }
.vote-yes { color: var(--green-deep); background: var(--green-pale); }
.vote-yes:hover { background: #d0e5d5; }
.vote-no { color: var(--red); background: var(--orange-pale); }
.vote-no:hover { background: #f1d8cb; }
.voted-label { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; white-space: nowrap; }
.voted-label svg { width: 14px; height: 14px; }
.bottom-nav { display: none; }

.auth-page { min-height: 100vh; background: #eff3ee; background-image: linear-gradient(120deg, rgba(35,104,72,.035) 1px, transparent 1px), linear-gradient(rgba(35,104,72,.035) 1px, transparent 1px); background-size: 34px 34px; }
.auth-layout { display: grid; grid-template-columns: minmax(340px, .9fr) 1.1fr; min-height: 100vh; }
.auth-intro { display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: 36px clamp(30px, 6vw, 90px); color: #fff; background: var(--green-deep); }
.auth-intro .brand { color: #fff; }
.auth-intro .brand-mark { color: var(--green-deep); background: #d9eadc; }
.auth-intro .brand small { color: #b4cbbc; }
.intro-copy { max-width: 420px; padding: 50px 0; }
.intro-copy .eyebrow { color: #b7d7c1; }
.intro-copy h1 { margin: 0 0 19px; font: 700 clamp(34px, 4vw, 53px)/1.14 'Manrope', sans-serif; }
.intro-copy > p:last-child { max-width: 330px; color: #d1e0d5; font-size: 14px; line-height: 1.7; }
.intro-rule { display: flex; align-items: center; gap: 11px; color: #b4cbbc; font-size: 9px; font-weight: 700; letter-spacing: .9px; }
.intro-rule span { width: 29px; height: 2px; background: #e38a57; }
.auth-panel { display: grid; place-items: center; padding: 36px; }
.auth-form-wrap { width: min(100%, 385px); padding: 31px; background: rgba(255,255,255,.9); border: 1px solid #e3e9e1; border-radius: 6px; box-shadow: 0 20px 65px rgba(32,41,34,.08); animation: rise-in .5s both; }
.auth-form-wrap h2 { margin: 0; font: 700 21px/1.35 'Manrope', sans-serif; }
.auth-form-wrap > .muted { margin: 7px 0 22px; color: var(--muted); font-size: 11px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 19px; padding: 4px; background: #f1f4f0; border-radius: 4px; }
.auth-tab { min-height: 34px; color: var(--ink-soft); background: transparent; border: 0; border-radius: 3px; cursor: pointer; font-size: 11px; font-weight: 700; transition: color .18s, background .18s, box-shadow .18s; }
.auth-tab.is-active { color: var(--green-deep); background: #fff; box-shadow: 0 1px 5px rgba(32,41,34,.08); }
.is-hidden { display: none !important; }
.auth-form-wrap .notice { margin: 0 0 15px; }

@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1080px) {
    .sidebar { width: 210px; padding-right: 14px; padding-left: 14px; }
    .main-content { margin-left: 210px; padding-right: 27px; padding-left: 27px; }
    .metric-grid { grid-template-columns: 1fr 1fr; }
    .metric-green { grid-column: span 2; }
    .dashboard-grid { grid-template-columns: minmax(245px, .85fr) minmax(0, 1.15fr); }
}
@media (max-width: 1024px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 0 17px calc(85px + env(safe-area-inset-bottom)); }
    .topbar { min-height: 79px; margin-bottom: 12px; }
    .topbar h1 { font-size: 20px; }
    .topbar-user { font-size: 0; }
    .topbar-user .status-dot { width: 9px; height: 9px; }
    .welcome-row { align-items: start; flex-direction: column; gap: 12px; margin: 19px 0 14px; }
    .welcome-row h2 { font-size: 18px; }
    .welcome-row > .button { min-height: 37px; }
    .metric-grid { gap: 9px; margin-bottom: 11px; }
    .metric { min-height: 119px; padding: 14px; }
    .metric-green { grid-column: span 2; }
    .metric > strong { margin-top: 13px; font-size: 24px; }
    .metric-head { font-size: 10px; }
    .metric > p { font-size: 9px; }
    .dashboard-grid, .stock-forms, .inventory-grid, .cash-grid, .request-layout { grid-template-columns: 1fr; gap: 11px; }
    .panel { padding: 16px; }
    .section-heading { margin-bottom: 17px; }
    .section-heading h2 { font-size: 15px; }
    .activity-panel .section-heading { align-items: start; flex-direction: column; }
    .cash-metrics { max-width: none; }
    .cash-metrics .metric { grid-column: auto; }
    .request-note { padding: 18px; }
    .note-mark { margin-bottom: 15px; }
    .request-item { align-items: start; flex-direction: column; gap: 12px; }
    .vote-actions { align-self: end; }
    .vote-actions .vote-button { display: flex; align-items: center; gap: 6px; min-height: 37px; padding: 0 11px; }
    .bottom-nav { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, 1fr); padding: 7px 10px calc(7px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid var(--line); box-shadow: 0 -5px 20px rgba(32,41,34,.06); backdrop-filter: blur(14px); }
    .bottom-link { display: grid; justify-items: center; gap: 4px; min-height: 48px; padding: 4px 2px; color: #788279; border-radius: 5px; font-size: 9px; font-weight: 600; transition: color .18s, background .18s; }
    .bottom-link svg { width: 19px; height: 19px; }
    .bottom-link.is-active { color: var(--green-deep); background: #eff5f0; }
    .auth-layout { grid-template-columns: 1fr; min-height: 100vh; }
    .auth-intro { min-height: 0; padding: 22px 23px 19px; }
    .intro-copy { padding: 30px 0 10px; }
    .intro-copy h1 { margin-bottom: 8px; font-size: 27px; }
    .intro-copy > p:last-child { margin: 0; font-size: 11px; }
    .intro-rule { display: none; }
    .auth-panel { align-items: start; padding: 19px 16px 30px; }
    .auth-form-wrap { padding: 22px; }
}
@media (max-width: 390px) {
    .form-row { grid-template-columns: 1fr; }
    .metric > strong { font-size: 22px; }
    .panel { padding: 14px; }
    .vote-caption { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}