:root {
  color-scheme: light;
  --ink: #17231d;
  --muted: #68736d;
  --line: #dfe5e1;
  --paper: #f5f6f2;
  --card: #ffffff;
  --forest: #18382a;
  --green: #2f684c;
  --mint: #dceadf;
  --gold: #c3954a;
  --risk: #a3483d;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
body.authenticated { overflow: hidden; padding-bottom: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.muted { color: var(--muted); line-height: 1.7; }
.status { position: fixed; z-index: 20; top: 18px; left: 50%; transform: translateX(-50%); max-width: min(90vw, 520px); padding: 12px 18px; border-radius: 12px; color: white; background: var(--forest); box-shadow: 0 16px 44px #17231d33; }
.status.error { background: var(--risk); }
.status.success { background: var(--green); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 1.1fr) minmax(420px, .9fr); }
.login-brand { display: flex; flex-direction: column; justify-content: center; padding: clamp(48px, 8vw, 120px); color: white; background: radial-gradient(circle at 78% 24%, #5e866b 0, transparent 28%), linear-gradient(145deg, #10261d, #234634 70%, #10261d); }
.login-brand .mark { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 64px; border: 1px solid #ffffff77; border-radius: 50%; font-family: Georgia, serif; font-size: 28px; }
.login-brand p { font-size: 11px; font-weight: 800; letter-spacing: .22em; color: #dbe9df; }
.login-brand h1 { margin: 12px 0 28px; font-family: Georgia, "Songti SC", serif; font-weight: 500; font-size: clamp(38px, 5vw, 66px); line-height: 1.18; }
.login-brand span { color: #cbd9d0; }
.login-card { display: flex; flex-direction: column; justify-content: center; gap: 30px; width: min(100%, 560px); padding: clamp(40px, 8vw, 100px); background: white; }
.login-card h2, .password-panel h2, .view-heading h2 { margin: 0; font-size: 28px; }
form { display: grid; gap: 16px; }
label { display: grid; gap: 8px; color: #435149; font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #cfd8d2; border-radius: 10px; padding: 13px 14px; color: var(--ink); background: white; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px #2f684c1f; }
textarea { resize: vertical; line-height: 1.55; }
button { border: 1px solid var(--line); border-radius: 10px; padding: 11px 16px; color: var(--ink); background: white; font-weight: 750; }
button:hover { border-color: #a9b8ae; }
button.primary { border-color: var(--forest); color: white; background: var(--forest); }
.login-card small { color: var(--muted); }
.workspace { height: 100vh; display: grid; grid-template-columns: 250px 1fr; overflow: hidden; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 30px 20px; color: white; background: var(--forest); }
.brand { display: flex; align-items: center; gap: 12px; margin: 0 10px 44px; }
.brand > span { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #ffffff55; border-radius: 50%; font-family: Georgia, serif; font-size: 21px; }
.brand div { display: grid; }
.brand small { color: #afc3b7; }
.sidebar nav { display: grid; gap: 8px; }
.sidebar .nav-button { display: flex; align-items: center; gap: 14px; border: 0; padding: 13px 14px; color: #bdcec4; background: transparent; text-align: left; }
.sidebar .nav-button span { color: #809a8b; font-size: 11px; }
.sidebar .nav-button.active { color: white; background: #ffffff16; }
.boundary { margin-top: auto; display: grid; gap: 4px; padding: 15px; border: 1px solid #ffffff1f; border-radius: 12px; background: #ffffff0b; }
.boundary i { width: 7px; height: 7px; border-radius: 50%; background: #87c89d; }
.boundary small { color: #afc3b7; }
.main-panel { min-width: 0; height: 100vh; overflow-y: auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 104px; padding: 22px clamp(24px, 4vw, 58px); border-bottom: 1px solid var(--line); background: #ffffffcc; backdrop-filter: blur(12px); }
.topbar p { margin: 0 0 7px; color: var(--muted); font-size: 12px; }
.topbar h1 { margin: 0; font-size: 20px; }
.account { display: grid; grid-template-columns: auto auto auto; align-items: center; gap: 10px 14px; text-align: right; }
.account span { grid-column: 1 / 3; color: var(--muted); font-size: 11px; }
.account button { grid-column: 3; grid-row: 1 / 3; padding: 8px 11px; }
.password-panel { margin: clamp(24px, 4vw, 58px); padding: clamp(24px, 4vw, 44px); border: 1px solid #c8d9ce; border-radius: 18px; background: linear-gradient(120deg, #edf4ef, white); }
.password-panel > div { margin-bottom: 24px; }
.password-panel p:not(.eyebrow) { color: var(--muted); }
.password-panel form { max-width: 520px; }
.view { padding: clamp(24px, 4vw, 58px); }
.view-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.view-heading p:not(.eyebrow) { margin-bottom: 0; color: var(--muted); }
.date-field { width: 190px; }
.entry-card, .record-card, .empty-state { border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: 0 12px 30px #1c2d2410; }
.entry-card { margin-bottom: 24px; padding: 24px; }
.entry-heading, .form-actions, .record-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.entry-heading h3 { margin: 0; }
.entry-heading span { color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.wide { grid-column: 1 / -1; }
.form-actions { justify-content: flex-end; }
.record-list { display: grid; gap: 14px; }
.record-card { padding: 22px; }
.record-code { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.record-head h3 { margin: 5px 0 0; }
.pill { padding: 6px 9px; border-radius: 99px; color: #506158; background: #edf1ee; font-size: 11px; }
.pill.submitted, .pill.closed { color: #24523b; background: var(--mint); }
.pill.waiting_store { color: #843c34; background: #f6e4e1; }
.pill.waiting_region { color: #7b581c; background: #f6ecd7; }
.record-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.record-metrics div, .review-detail div { display: grid; gap: 5px; }
.record-metrics span, .review-detail span { color: var(--muted); font-size: 12px; }
.review-detail { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 20px; }
.review-detail strong { line-height: 1.55; }
.inline-form { grid-template-columns: 1fr 1fr; align-items: end; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.inline-form button, .inline-form .check-label { grid-column: 1 / -1; }
.check-label { display: flex; align-items: center; }
.check-label input { width: auto; }
.empty-state { padding: 50px 24px; text-align: center; }
.empty-state p, .loading { color: var(--muted); }
.mobile-nav { display: none; }
@media (max-width: 780px) {
  body { padding-bottom: 72px; }
  .login-shell { display: block; background: white; }
  .login-brand { min-height: 34vh; padding: 42px 24px; justify-content: flex-end; }
  .login-brand .mark { width: 42px; height: 42px; margin-bottom: 30px; }
  .login-brand h1 { margin-bottom: 10px; font-size: 34px; }
  .login-card { padding: 34px 24px 50px; }
  .workspace { display: block; }
  .main-panel { padding-bottom: 72px; }
  .sidebar { display: none; }
  .topbar { min-height: 84px; padding: 16px 18px; }
  .topbar > div:first-child h1 { display: none; }
  .topbar p { margin: 0; }
  .account { display: flex; gap: 8px; }
  .account span { display: none; }
  .account strong { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account button { padding: 7px 9px; font-size: 12px; }
  .password-panel, .view { margin: 0; padding: 24px 16px; }
  .view-heading { align-items: stretch; flex-direction: column; gap: 16px; }
  .date-field { width: 100%; }
  .entry-card, .record-card { padding: 18px; border-radius: 14px; }
  .form-grid, .inline-form { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .record-metrics, .review-detail { grid-template-columns: 1fr; }
  .form-actions button { flex: 1; }
  .mobile-nav { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr 1fr; padding: 9px max(12px, env(safe-area-inset-right)) calc(9px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); border-top: 1px solid var(--line); background: #ffffffef; backdrop-filter: blur(16px); }
  .mobile-nav .nav-button { border: 0; color: var(--muted); background: transparent; }
  .mobile-nav .nav-button.active { color: white; background: var(--forest); }
}
