:root {
  --ink: #18231f;
  --muted: #68746f;
  --line: #dfe7e2;
  --surface: #ffffff;
  --canvas: #f3f6f4;
  --brand: #176a4b;
  --brand-dark: #0f5139;
  --brand-soft: #e7f4ed;
  --warning: #925d00;
  --warning-bg: #fff5d8;
  --danger: #a13333;
  --danger-bg: #fff0f0;
  --shadow: 0 12px 35px rgba(20, 45, 34, .07);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
a { color: var(--brand); text-underline-offset: 3px; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.95); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.nav-wrap { max-width: 1180px; min-height: 68px; margin: 0 auto; padding: 0 24px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); font-weight: 800; text-decoration: none; letter-spacing: -.02em; }
.brand small { display: block; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.brand-mark { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px; color: white; background: var(--brand); }
nav { display: flex; gap: 8px; }
nav a { padding: 9px 13px; border-radius: 9px; color: #4f5d57; text-decoration: none; font-size: 14px; font-weight: 650; }
nav a:hover, nav a.active { color: var(--brand-dark); background: var(--brand-soft); }
.account-menu { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.account-menu > span { display: grid; text-align: right; font-size: 12px; line-height: 1.25; }
.account-menu small { color: var(--muted); }
.account-menu form { margin: 0; }
.account-menu button { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: white; cursor: pointer; }
.page-shell { max-width: 1180px; margin: 0 auto; padding: 44px 24px 80px; }
.hero { max-width: 760px; margin-bottom: 26px; }
.hero h1, .page-heading h1 { margin: 4px 0 10px; font-size: clamp(30px, 5vw, 48px); line-height: 1.08; letter-spacing: -.035em; }
.hero p, .page-heading p { color: var(--muted); margin: 0; }
.eyebrow { margin: 0 !important; color: var(--brand); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow.success { color: var(--brand); }
.danger-text { color: var(--danger); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.form-card { max-width: 860px; padding: 28px; }
.stack { display: grid; gap: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
label { display: grid; gap: 8px; color: #33423c; font-size: 14px; font-weight: 700; }
input, select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cbd7d0; border-radius: 10px; color: var(--ink); background: white; font: inherit; }
input:focus, select:focus { outline: 3px solid rgba(23,106,75,.15); border-color: var(--brand); }
.file-field { padding: 18px; border: 1px dashed #aebfb6; border-radius: 13px; background: #fafcfb; }
.file-field input { padding: 8px; background: transparent; }
.file-field small, .muted { color: var(--muted); font-weight: 500; }
.actions { display: flex; justify-content: flex-end; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 10px 18px; border: 0; border-radius: 10px; font: inherit; font-weight: 750; text-decoration: none; cursor: pointer; }
.button.primary { color: white; background: var(--brand); }
.button.primary:hover { background: var(--brand-dark); }
.button.ghost { color: var(--brand); background: white; border: 1px solid var(--line); }
.steps { max-width: 860px; display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 18px; }
.steps div { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.steps strong { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: var(--brand); background: var(--brand-soft); }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-heading h1 { font-size: clamp(28px,4vw,42px); }
.meta-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin: 20px 0; }
.meta-grid.four { grid-template-columns: repeat(4,1fr); }
.metric { min-height: 105px; display: flex; flex-direction: column; justify-content: space-between; padding: 19px; }
.metric span { color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.metric strong { font-size: 22px; }
.metric .small-value { font-size: 14px; overflow-wrap: anywhere; }
.notice { margin: 18px 0; padding: 14px 16px; border-radius: 12px; font-weight: 650; }
.notice.warning { color: var(--warning); background: var(--warning-bg); border: 1px solid #efd998; }
.notice.danger { color: var(--danger); background: var(--danger-bg); border: 1px solid #efc4c4; }
.success-notice { color: var(--brand-dark); background: var(--brand-soft); border: 1px solid #bcdccb; }
.compact-notice { margin: 0 0 14px; }
.section-card { padding: 24px; margin-top: 20px; overflow: hidden; }
.section-card.subdued { background: #fafbfa; box-shadow: none; }
.section-title, .point-heading, .order-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; }
.section-title h2, .point-heading h2 { margin: 3px 0 0; font-size: 22px; }
.total { font-size: 27px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; text-align: left; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
.number { text-align: right; white-space: nowrap; }
.strong { font-weight: 800; }
.block { display: block; }
.availability { display: inline-block; color: #795209; background: #fff0c2; padding: 3px 7px; border-radius: 6px; font-size: 11px; font-weight: 750; }
.confirm-bar { position: sticky; bottom: 18px; display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 24px; padding: 16px 18px; border: 1px solid #b7c9c0; border-radius: 16px; background: rgba(255,255,255,.96); box-shadow: 0 18px 45px rgba(20,45,34,.16); backdrop-filter: blur(10px); }
.confirm-bar div { display: grid; }
.confirm-bar span { color: var(--muted); font-size: 12px; }
.confirm-bar strong { font-size: 24px; }
.badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; background: #edf1ef; color: #4d5954; }
.badge.large { padding: 8px 13px; font-size: 13px; }
.status-new { color: #315d87; background: #e8f2fc; }
.status-in_progress { color: #775908; background: #fff2c7; }
.status-purchased { color: #604b92; background: #eee9ff; }
.status-sent { color: #086c75; background: #ddf4f5; }
.status-received { color: #176a4b; background: #e1f4e9; }
.status-problem { color: #9b3434; background: #fde5e5; }
.status-closed { color: #59625e; background: #e9ecea; }
.clickable-table tbody tr:hover { background: #f7faf8; }
.empty { padding: 50px 24px; text-align: center; }
.empty strong { font-size: 21px; }
.empty p { color: var(--muted); }
.status-card { padding: 18px; margin: 20px 0; }
.status-form { display: grid; grid-template-columns: minmax(220px,1fr) auto; align-items: end; gap: 14px; }
.auth-shell { max-width: 900px; display: grid; grid-template-columns: 1fr minmax(320px, 420px); align-items: start; gap: 48px; margin: 50px auto 0; }
.auth-copy h1 { margin: 6px 0 14px; font-size: clamp(32px, 5vw, 50px); line-height: 1.05; letter-spacing: -.04em; }
.auth-copy p { color: var(--muted); }
.auth-card { padding: 26px; }
.auth-card label small { color: var(--muted); font-weight: 500; }
.auth-foot { margin: 20px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.request-sent { padding: 10px 0; text-align: center; }
.request-sent strong { font-size: 24px; }
.request-sent p { color: var(--muted); }
.filter-bar { display: flex; align-items: end; gap: 12px; padding: 16px 18px; margin-bottom: 18px; box-shadow: none; }
.filter-bar label { min-width: 260px; }
.admin-list { display: grid; }
.admin-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 18px; padding: 14px 2px; border-bottom: 1px solid var(--line); }
.admin-row:last-child { border-bottom: 0; }
.admin-row > div:first-child { display: grid; }
.admin-row small { color: var(--muted); }
.admin-actions { display: flex; gap: 8px; }
.admin-actions form { margin: 0; }
.user-status-pending { color: var(--warning); background: var(--warning-bg); }
.user-status-approved { color: var(--brand); background: var(--brand-soft); }
.user-status-rejected, .user-status-disabled { color: var(--danger); background: var(--danger-bg); }
.receipt-progress { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.receipt-column { min-width: 170px; }
.receipt-form { display: flex; align-items: center; gap: 7px; }
.receipt-toggle { display: flex; grid-template-columns: none; align-items: center; gap: 7px; font-size: 12px; white-space: nowrap; }
.receipt-toggle input { width: 18px; min-height: 18px; margin: 0; accent-color: var(--brand); }
.receipt-form .button { min-height: 34px; padding: 6px 9px; font-size: 11px; }
.receipt-meta { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.3; }
.summary-strip { display: grid; grid-template-columns: 2fr repeat(3,1fr); gap: 1px; overflow: hidden; margin-bottom: 34px; border: 1px solid var(--line); border-radius: 16px; background: var(--line); }
.summary-strip div { min-height: 102px; display: flex; flex-direction: column; justify-content: space-between; padding: 18px; background: white; }
.summary-strip span { color: var(--muted); font-size: 12px; }
.summary-strip strong { font-size: 25px; }
.workflow-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 38px 0 16px; }
.workflow-heading h2 { margin: 3px 0 0; font-size: 26px; letter-spacing: -.02em; }
.procurement-list { overflow: hidden; box-shadow: none; }
.procurement-list-head, .procurement-row { display: grid; grid-template-columns: minmax(0, 1fr) 100px 120px 120px; column-gap: 18px; }
.procurement-list-head { padding: 10px 18px; color: var(--muted); background: #f7faf8; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.procurement-list-head span:not(:first-child) { text-align: right; }
.procurement-row { align-items: start; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.procurement-row:last-child { border-bottom: 0; }
.procurement-product { min-width: 0; }
.procurement-product h3 { margin: 0; font-size: 15px; line-height: 1.3; }
.procurement-product > p { display: inline; margin: 3px 8px 0 0; color: var(--muted); font-size: 10px; }
.procurement-metric { padding-top: 1px; text-align: right; white-space: nowrap; font-size: 14px; }
.procurement-metric::before { display: none; content: attr(data-label); }
.price-conflict-text { color: var(--warning); }
.compact-price-warning { color: var(--warning); font-size: 10px; font-weight: 800; white-space: nowrap; }
.compact-source-list { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 5px; }
.compact-source-list a { color: var(--muted); font-size: 11px; line-height: 1.35; text-decoration: none; }
.compact-source-list a:hover { color: var(--brand); text-decoration: underline; }
.problem-section { margin-top: 42px; padding: 1px 20px 22px; border: 1px solid #efc4c4; border-radius: 20px; background: var(--danger-bg); }
.problem-section .workflow-heading { margin-top: 20px; }
.problem-grid { display: grid; gap: 12px; }
.problem-card { padding: 20px; border-color: #efc4c4; box-shadow: none; }
.order-total { white-space: nowrap; font-size: 20px; }
.compact-products { display: grid; gap: 0; margin: 14px 0 18px; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.compact-products li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.status-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.status-actions form { margin: 0; }
.problem-button { color: var(--danger); background: var(--danger-bg); border: 1px solid #efc4c4; }
.status-fallback { position: relative; color: var(--muted); font-size: 12px; }
.status-fallback summary { padding: 9px 4px; cursor: pointer; font-weight: 700; }
.status-fallback form { display: flex; align-items: center; gap: 8px; min-width: 300px; margin-top: 8px; }
.status-fallback select { min-height: 40px; }
.order-state { display: flex; align-items: center; gap: 12px; }
.order-state strong { white-space: nowrap; }
.compact-empty { padding: 30px 20px; }
.point-group { margin-top: 30px; }
.point-heading { padding: 0 4px; }
.point-heading strong { color: var(--brand); font-size: 21px; }
.order-card { padding: 22px; margin-top: 12px; }
.order-number { font-size: 18px; font-weight: 850; text-decoration: none; }
.order-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.inline-status { display: flex; align-items: center; gap: 8px; }
.inline-status select { width: 150px; }
.compact-button { min-height: 42px; color: var(--brand); background: var(--brand-soft); }
tfoot th { color: var(--ink); font-size: 13px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(260px,.75fr) minmax(0,1.6fr); gap: 18px; margin-top: 24px; }
.cycle-dashboard, .cash-dashboard, .previous-cycle { padding: 24px; }
.cycle-dashboard h2, .previous-cycle h2 { margin: 4px 0 20px; font-size: 25px; }
.funding-need { display: grid; gap: 3px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.funding-need span, .funding-result span, .cash-source small, .previous-cycle p, .previous-cycle small { color: var(--muted); }
.funding-need strong { font-size: 30px; }
.funding-result { display: grid; gap: 4px; margin: 17px 0; padding: 12px; border-radius: 11px; }
.funding-result.enough { color: var(--brand-dark); background: var(--brand-soft); }
.funding-result.shortage { color: var(--danger); background: var(--danger-bg); }
.funding-result.incomplete { color: var(--warning); background: var(--warning-bg); }
.funding-result small { font-size: 12px; }
.cash-dashboard .section-title { margin-bottom: 8px; }
.cash-source-list { display: grid; }
.cash-source { display: grid; grid-template-columns: minmax(130px,.8fr) minmax(150px,.8fr) minmax(210px,1fr); gap: 16px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.cash-source:last-child { border-bottom: 0; }
.cash-source > div { display: grid; }
.cash-current strong { font-size: 18px; }
.cash-current small { font-size: 11px; }
.cash-form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: center; }
.cash-form input { min-height: 40px; }
.cash-readonly { text-align: right; }
.previous-cycle { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-top: 18px; }
.previous-cycle h2 { margin-bottom: 5px; }
.previous-cycle p { margin: 4px 0; }
.previous-cycle > div:first-child { display: grid; }
.previous-actions { display: flex; align-items: center; gap: 9px; }
.previous-actions form { margin: 0; }
.success-text { color: var(--brand); }
.schedule-form { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.weekday-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.weekday-grid label { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; }
.weekday-grid input { width: 17px; min-height: 17px; margin: 0; accent-color: var(--brand); }
.cycle-date-form { display: grid; grid-template-columns: minmax(220px,320px) auto; align-items: end; justify-content: start; gap: 12px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.cycle-status-collecting { color: #315d87; background: #e8f2fc; }
.cycle-status-receiving { color: #775908; background: #fff2c7; }
.cycle-status-closed { color: #59625e; background: #e9ecea; }
.procurement-summary { grid-template-columns: repeat(4,1fr); }
.unconfirmed-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.unconfirmed-list li { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.unconfirmed-list li:last-child { border-bottom: 0; }
.unconfirmed-list span { color: var(--muted); font-size: 13px; }
.cycle-request-list { display: grid; }
.cycle-request-list article { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.cycle-request-list article:last-child { border-bottom: 0; }
.cycle-request-list p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.compact-cycle-list { border: 1px solid var(--line); border-radius: 12px; }
@media (max-width: 760px) {
  .nav-wrap { padding: 0 16px; align-items: stretch; flex-direction: column; gap: 5px; padding-top: 12px; }
  nav { width: 100%; overflow-x: auto; padding-bottom: 8px; }
  nav a { flex: 1 0 auto; text-align: center; }
  .account-menu { width: 100%; justify-content: space-between; margin: 0 0 9px; }
  .account-menu > span { text-align: left; }
  .page-shell { padding: 30px 14px 70px; }
  .form-grid, .meta-grid, .meta-grid.four, .steps, .summary-strip { grid-template-columns: 1fr; }
  .page-heading, .section-title, .order-head, .workflow-heading { align-items: stretch; flex-direction: column; }
  .page-heading .button { align-self: flex-start; }
  .summary-strip div { min-height: 76px; }
  .inline-status { width: 100%; }
  .inline-status select { flex: 1; width: auto; }
  .confirm-bar { bottom: 8px; }
  .status-form { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; gap: 20px; margin-top: 8px; }
  .auth-copy h1 { font-size: 34px; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .filter-bar label { min-width: 0; }
  .admin-row { grid-template-columns: 1fr auto; }
  .admin-actions { grid-column: 1 / -1; }
  .receipt-form { align-items: flex-start; flex-direction: column; }
  .procurement-list { border-radius: 14px; }
  .procurement-list-head { display: none; }
  .procurement-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px 14px; }
  .procurement-product { grid-column: 1 / -1; }
  .procurement-product h3 { font-size: 14px; }
  .procurement-metric { display: grid; gap: 1px; padding-top: 5px; text-align: left; font-size: 13px; }
  .procurement-metric::before { display: block; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
  .compact-source-list { display: grid; gap: 1px; margin-top: 4px; }
  .compact-source-list a { font-size: 10px; }
  .compact-products li { grid-template-columns: minmax(0,1fr) auto; gap: 5px 12px; }
  .compact-products li strong { grid-column: 2; }
  .status-actions { align-items: stretch; }
  .status-actions form { flex: 1 1 auto; }
  .status-actions .button { width: 100%; }
  .status-fallback { flex-basis: 100%; }
  .status-fallback form { min-width: 0; width: 100%; }
  .order-state { justify-content: space-between; }
  .dashboard-grid, .procurement-summary { grid-template-columns: 1fr; }
  .cash-source { grid-template-columns: 1fr; gap: 7px; }
  .cash-readonly { text-align: left; }
  .previous-cycle, .previous-actions, .schedule-form { align-items: stretch; flex-direction: column; }
  .previous-actions .button, .previous-actions form, .previous-actions form .button { width: 100%; }
  .cycle-date-form { grid-template-columns: 1fr; }
  .unconfirmed-list li { align-items: flex-start; flex-direction: column; gap: 2px; }
  .cycle-request-list article { grid-template-columns: 1fr auto; }
  .cycle-request-list article > strong { grid-column: 2; }
}
