:root {
  --ink: #17242b;
  --muted: #6a7a82;
  --line: #dce5e8;
  --soft: #f3f7f8;
  --paper: #ffffff;
  --brand: #155e75;
  --brand-2: #0e7490;
  --brand-soft: #e6f4f7;
  --green: #167a56;
  --green-soft: #e6f6ef;
  --orange: #b65c12;
  --orange-soft: #fff2e5;
  --red: #b53838;
  --red-soft: #fdecec;
  --shadow: 0 18px 50px rgba(21, 46, 56, .12);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--soft); color: var(--ink); font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1.1fr) minmax(380px, .9fr); background: var(--paper); }
.login-visual { padding: 8vw; display: flex; flex-direction: column; justify-content: space-between; color: white; background: radial-gradient(circle at 20% 15%, rgba(255,255,255,.13), transparent 26%), linear-gradient(145deg, #103c4b, #155e75 55%, #0e7490); }
.login-logo { display: flex; gap: 14px; align-items: center; font-size: 18px; }
.login-logo .brand-mark { background: white; color: var(--brand); }
.login-copy { max-width: 650px; }
.login-copy h1 { font-size: clamp(34px, 5vw, 66px); line-height: 1.08; margin: 0 0 22px; letter-spacing: -.04em; }
.login-copy p { line-height: 1.9; color: rgba(255,255,255,.78); max-width: 560px; }
.login-points { display: flex; gap: 24px; flex-wrap: wrap; color: rgba(255,255,255,.85); font-size: 14px; }
.login-panel { display: grid; place-items: center; padding: 48px; }
.auth-card { width: min(420px, 100%); }
.auth-card h2 { font-size: 30px; margin: 8px 0; }
.auth-card > p { color: var(--muted); line-height: 1.7; margin-bottom: 30px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 16px 18px; background: #103c4b; color: white; display: flex; flex-direction: column; }
.brand { padding: 0 10px 28px; display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: white; background: linear-gradient(145deg, #2ca5bd, #0e7490); font-weight: 800; }
.brand div:last-child { display: flex; flex-direction: column; gap: 2px; }
.brand span { font-size: 12px; color: rgba(255,255,255,.6); letter-spacing: .12em; }
.side-nav { display: grid; gap: 5px; }
.nav-btn { width: 100%; border: 0; border-radius: 11px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; background: transparent; color: rgba(255,255,255,.7); text-align: left; }
.nav-btn:hover, .nav-btn.active { color: white; background: rgba(255,255,255,.1); }
.nav-icon { width: 24px; text-align: center; font-size: 18px; }
.sidebar-foot { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid rgba(255,255,255,.12); display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: #d8eff3; color: var(--brand); font-weight: 700; flex: 0 0 auto; }
.sidebar-user { min-width: 0; display: flex; flex-direction: column; flex: 1; }
.sidebar-user strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
.sidebar-user span { color: rgba(255,255,255,.55); font-size: 11px; margin-top: 3px; }
.icon-btn { border: 0; background: transparent; color: inherit; width: 36px; height: 36px; border-radius: 9px; font-size: 22px; }
.icon-btn:hover { background: rgba(127,127,127,.12); }

.workspace { min-width: 0; }
.topbar { min-height: 112px; padding: 26px clamp(22px, 4vw, 52px); background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 24px; position: sticky; top: 0; z-index: 8; backdrop-filter: blur(12px); }
.eyebrow { margin: 0 0 5px; text-transform: uppercase; letter-spacing: .1em; font-size: 11px; font-weight: 700; color: var(--brand-2); }
.topbar h1 { margin: 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.03em; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.search-box { width: min(310px, 26vw); height: 42px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); display: flex; align-items: center; gap: 8px; }
.search-box input { width: 100%; border: 0; outline: none; background: transparent; color: var(--ink); }
.btn { min-height: 42px; border-radius: 11px; padding: 0 17px; border: 1px solid var(--line); background: white; color: var(--ink); font-weight: 650; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(20,60,75,.1); }
.btn-primary { color: white; border-color: var(--brand); background: var(--brand); }
.btn-danger { color: var(--red); border-color: #efcaca; background: var(--red-soft); }
.btn-ghost { background: transparent; }
.btn-small { min-height: 34px; padding: 0 12px; font-size: 13px; }

.page-content { padding: 30px clamp(22px, 4vw, 52px) 70px; }
.page-lead { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-lead h2 { margin: 0; font-size: 20px; }
.page-lead p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; margin-bottom: 28px; }
.metric { min-height: 132px; padding: 20px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); position: relative; overflow: hidden; }
.metric::after { content: ""; width: 80px; height: 80px; position: absolute; right: -30px; bottom: -35px; border-radius: 50%; background: var(--brand-soft); }
.metric span { color: var(--muted); font-size: 13px; }
.metric strong { display: block; font-size: 34px; margin-top: 16px; letter-spacing: -.04em; }
.metric em { font-style: normal; font-size: 12px; color: var(--brand-2); }
.metric-link { width: 100%; color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease; }
.metric-link:hover { border-color: #e8c899; box-shadow: 0 11px 28px rgba(70,50,20,.09); transform: translateY(-2px); }
.metric-link:focus-visible { outline: 3px solid var(--brand-soft); outline-offset: 2px; }
.todo-card { margin-bottom: 20px; }
.todo-total { min-width: 34px; height: 34px; padding: 0 9px; display: inline-grid; place-items: center; border-radius: 10px; color: var(--brand); background: var(--brand-soft); font-size: 18px; font-weight: 800; }
.todo-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
.todo-entry { width: 100%; min-height: 86px; padding: 16px 22px; display: grid; grid-template-columns: 46px 1fr auto 18px; align-items: center; gap: 14px; border: 0; color: var(--ink); background: white; text-align: left; cursor: pointer; transition: background-color .2s ease; }
.todo-entry:nth-child(odd) { border-right: 1px solid var(--line); }
.todo-entry:nth-child(n+3) { border-top: 1px solid var(--line); }
.todo-entry:hover:not(:disabled) { background: #fffaf2; }
.todo-entry:disabled { cursor: default; }
.todo-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--brand); background: var(--brand-soft); font-size: 17px; font-weight: 800; }
.todo-entry > span:nth-child(2) strong, .todo-entry > span:nth-child(2) small { display: block; }
.todo-entry > span:nth-child(2) strong { font-size: 15px; }
.todo-entry > span:nth-child(2) small { margin-top: 5px; color: var(--muted); font-size: 12px; }
.todo-entry > em { color: var(--brand); font-size: 30px; font-style: normal; font-weight: 800; }
.todo-entry > em small { margin-left: 4px; font-size: 11px; font-weight: 500; }
.todo-entry > i { color: var(--muted); font-size: 22px; font-style: normal; }
.todo-empty { min-height: 92px; padding: 18px 22px; display: flex; align-items: center; gap: 14px; color: var(--muted); }
.todo-empty > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-soft); font-weight: 800; }
.todo-empty strong, .todo-empty small { display: block; }
.todo-empty strong { color: var(--ink); }
.todo-empty small { margin-top: 5px; font-size: 12px; }
.active-filter { margin: -4px 0 16px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #f1d6ae; border-radius: 9px; color: #a95d04; background: #fff8ed; font-size: 13px; font-weight: 700; }
.active-filter button { border: 0; color: var(--brand); background: transparent; font-weight: 700; cursor: pointer; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, .75fr); gap: 18px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h3 { margin: 0; font-size: 16px; }
.card-body { padding: 20px; }
.empty { min-height: 220px; padding: 36px 20px; display: grid; place-items: center; text-align: center; color: var(--muted); }
.empty-mark { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; margin: 0 auto 13px; color: var(--brand); background: var(--brand-soft); font-size: 26px; }
.empty h3 { color: var(--ink); margin: 0 0 7px; font-size: 16px; }
.empty p { margin: 0 0 16px; max-width: 390px; line-height: 1.7; font-size: 13px; }
.activity-list { display: grid; gap: 16px; }
.activity { display: grid; grid-template-columns: 10px 1fr; gap: 12px; align-items: start; }
.activity-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand-2); margin-top: 5px; box-shadow: 0 0 0 4px var(--brand-soft); }
.activity p { margin: 0; font-size: 13px; line-height: 1.5; }
.activity time { color: var(--muted); font-size: 11px; }

.toolbar { padding: 15px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: white; color: var(--muted); padding: 7px 11px; border-radius: 999px; font-size: 12px; }
.chip.active { color: var(--brand); border-color: #acd4dd; background: var(--brand-soft); }
.data-list { display: grid; }
.list-row { padding: 18px 20px; display: grid; grid-template-columns: minmax(200px, 1.5fr) minmax(120px,.8fr) minmax(100px,.6fr) auto; gap: 18px; align-items: center; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: #fbfdfd; }
.item-title { min-width: 0; }
.item-title strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.item-title span, .list-meta { color: var(--muted); font-size: 12px; margin-top: 5px; }
.badge { display: inline-flex; align-items: center; min-height: 25px; padding: 0 9px; border-radius: 999px; font-size: 11px; color: var(--brand); background: var(--brand-soft); white-space: nowrap; }
.badge.green { color: var(--green); background: var(--green-soft); }
.badge.orange { color: var(--orange); background: var(--orange-soft); }
.badge.red { color: var(--red); background: var(--red-soft); }
.progress-line { height: 6px; border-radius: 99px; background: #e8eff1; overflow: hidden; margin-top: 8px; }
.progress-line i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #2ca5bd); border-radius: 99px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(12,31,38,.48); display: grid; place-items: center; padding: 20px; backdrop-filter: blur(4px); }
.modal-card { width: min(760px, 100%); max-height: min(900px, 92vh); display: flex; flex-direction: column; background: white; border-radius: 20px; box-shadow: var(--shadow); }
.modal-head { padding: 20px 22px 16px; display: flex; justify-content: space-between; align-items: start; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 22px; }
.modal-body { padding: 22px; overflow: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 17px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 700; color: #41525a; }
.field label small { color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; border: 1px solid #ccd9dd; border-radius: 10px; padding: 10px 12px; outline: none; background: white; color: var(--ink); }
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--brand-soft); }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; padding-top: 7px; }
.hint { margin: 0; padding: 12px 0; color: var(--muted); font-size: 12px; line-height: 1.7; border-bottom: 1px solid var(--line); }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.detail-cell { padding: 12px; border-radius: 11px; background: var(--soft); }
.detail-cell span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.detail-cell strong { font-size: 13px; }
.timeline { position: relative; margin: 22px 0; display: grid; gap: 0; }
.timeline-step { position: relative; min-height: 58px; display: grid; grid-template-columns: 28px 1fr; gap: 12px; }
.timeline-step::after { content: ""; position: absolute; left: 13px; top: 24px; bottom: 0; width: 2px; background: var(--line); }
.timeline-step:last-child::after { display: none; }
.step-dot { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #e8eff1; color: var(--muted); font-size: 11px; z-index: 1; }
.timeline-step.done .step-dot { color: white; background: var(--green); }
.timeline-step.current .step-dot { color: white; background: var(--brand-2); box-shadow: 0 0 0 5px var(--brand-soft); }
.timeline-step strong { display: block; font-size: 13px; margin-top: 4px; }
.timeline-step small { color: var(--muted); }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--line); }
.notice { border-left: 3px solid var(--brand-2); padding: 10px 14px; color: #43555d; background: var(--brand-soft); font-size: 12px; line-height: 1.7; }
.settings-section { padding: 20px; border-bottom: 1px solid var(--line); }
.settings-section:last-child { border-bottom: 0; }
.settings-section h3 { margin: 0 0 8px; }
.settings-section > p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.settings-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.toast { position: fixed; z-index: 80; left: 50%; bottom: 28px; transform: translateX(-50%); color: white; background: #173b48; padding: 12px 18px; border-radius: 11px; box-shadow: var(--shadow); font-size: 13px; }
.mobile-nav { display: none; }
.login-help { margin-top: 22px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.permission-note { width: 100%; margin: 0; color: var(--orange); font-size: 13px; }
.required-tag { display: inline-flex; margin-left: 5px; padding: 2px 6px; border-radius: 999px; color: var(--red); background: var(--red-soft); font-size: 10px; font-style: normal; font-weight: 600; vertical-align: 1px; }
.inventory-picker { display: grid; gap: 9px; }
.inventory-picker label { min-height: 58px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; display: grid; grid-template-columns: 1fr 88px 32px; align-items: center; gap: 9px; }
.inventory-picker label > span { display: grid; gap: 3px; }
.inventory-picker small { color: var(--muted); }
.inventory-picker input, .receipt-list input { min-height: 38px; width: 100%; border: 1px solid #ccd9dd; border-radius: 9px; padding: 7px 9px; }
.inventory-picker em { color: var(--muted); font-size: 12px; font-style: normal; }
.receipt-list { display: grid; gap: 9px; }
.receipt-list label { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; display: grid; grid-template-columns: 1fr 100px; align-items: center; gap: 12px; font-size: 13px; }
.check-field { min-height: 46px; padding: 11px 13px; border-radius: 10px; background: var(--soft); display: flex; align-items: center; gap: 10px; font-size: 13px; }
.check-field input { width: 18px; height: 18px; accent-color: var(--brand); }
.purchase-summary { margin: 16px 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.purchase-summary div { display: grid; gap: 4px; }
.purchase-summary span { color: var(--muted); font-size: 11px; }
.purchase-summary strong { font-size: 13px; }
.purchase-summary img { grid-column: 1 / -1; width: min(360px, 100%); max-height: 240px; object-fit: contain; border-radius: 9px; border: 1px solid var(--line); background: var(--soft); }
.link-button { border: 0; padding: 0; color: var(--brand-2); background: transparent; font-weight: 700; text-decoration: underline; }
.account-list { display: grid; gap: 8px; margin-top: 14px; }
.account-row { padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; display: grid; grid-template-columns: 36px minmax(0,1fr) auto auto; align-items: center; gap: 11px; }
.account-row > div:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.account-row span:not(.badge) { color: var(--muted); font-size: 11px; }
@media (max-width:760px){.account-row{grid-template-columns:36px minmax(0,1fr) auto}.account-row>.btn{grid-column:2/-1;width:100%}}

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .search-box { display: none; }
}

@media (max-width: 760px) {
  .login-shell { display: block; min-height: 100vh; }
  .login-visual { min-height: 280px; padding: 30px 24px; }
  .login-copy h1 { font-size: 34px; margin-top: 42px; }
  .login-copy p { display: none; }
  .login-points { gap: 12px; font-size: 12px; }
  .login-panel { padding: 34px 22px; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .topbar { position: static; min-height: 98px; padding: 20px 18px 16px; align-items: flex-end; }
  .top-actions .btn { width: 42px; padding: 0; font-size: 0; }
  .top-actions .btn::after { content: "+"; font-size: 23px; }
  .page-content { padding: 20px 16px 100px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .metric { min-height: 112px; padding: 16px; }
  .metric strong { font-size: 29px; margin-top: 12px; }
  .page-lead { align-items: center; }
  .list-row { grid-template-columns: 1fr auto; gap: 9px; padding: 16px; }
  .list-row > :nth-child(2), .list-row > :nth-child(3) { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full, .form-actions { grid-column: auto; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal-card { width: 100%; max-height: 94vh; border-radius: 20px 20px 0 0; }
  .mobile-nav { position: fixed; display: grid; grid-template-columns: repeat(5, 1fr); left: 0; right: 0; bottom: 0; z-index: 20; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid var(--line); backdrop-filter: blur(14px); }
  .mobile-nav .nav-btn { color: var(--muted); padding: 5px 2px; display: flex; flex-direction: column; gap: 2px; text-align: center; font-size: 10px; }
  .mobile-nav .nav-btn.active { color: var(--brand); background: var(--brand-soft); }
  .mobile-nav .nav-icon { font-size: 18px; }
  .inventory-picker label { grid-template-columns: 1fr 72px 24px; }
  .purchase-summary { grid-template-columns: 1fr; }
  .purchase-summary img { grid-column: auto; }
}

@media (max-width: 390px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric { min-height: 98px; }
  .detail-grid { grid-template-columns: 1fr; }
}

/* Warm desktop theme and page-based workflow */
:root {
  --ink: #252321;
  --muted: #77716b;
  --line: #e7e2dc;
  --soft: #f7f6f4;
  --paper: #ffffff;
  --brand: #d97706;
  --brand-2: #ea8a12;
  --brand-soft: #fff4e5;
  --orange: #c96c07;
  --orange-soft: #fff1dd;
  --shadow: 0 10px 30px rgba(72, 54, 34, .07);
  --radius: 12px;
}

html, body { background: #faf9f7; color: var(--ink); }
.app-shell { display: block; min-height: 100vh; }
.app-header { height: 72px; padding: 0 clamp(22px, 4vw, 54px); display: grid; grid-template-columns: 220px 1fr auto; align-items: center; gap: 28px; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand-text { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.brand-text strong { font-size: 26px; font-weight: 850; letter-spacing: -.045em; }
.brand-text span { color: var(--muted); font-size: 13px; }
.top-nav { height: 100%; display: flex; justify-content: center; gap: clamp(5px, 1.5vw, 20px); position: relative; }
.top-nav .nav-btn { width: auto; height: 100%; padding: 0 16px; border-radius: 0; justify-content: center; color: #4d4945; position: relative; transition: color .28s ease, transform .28s cubic-bezier(.22,1,.36,1), background-color .28s ease; }
.top-nav .nav-btn:hover { color: var(--brand); background: transparent; transform: translateY(-2px); }
.top-nav .nav-btn.active { color: var(--brand); background: transparent; font-weight: 750; }
.top-nav .nav-btn.active::after { display: none; }
.nav-slide-indicator { position: absolute; left: 0; bottom: 0; height: 3px; border-radius: 999px 999px 0 0; background: var(--brand); opacity: 0; pointer-events: none; box-shadow: 0 -2px 9px rgba(217,119,6,.22); transition: width .46s cubic-bezier(.2,.8,.2,1), transform .46s cubic-bezier(.2,.8,.2,1), opacity .18s ease; will-change: width, transform; }
.nav-slide-indicator.no-transition { transition: none; }
.top-nav .nav-icon { display: none; }
.header-user { display: flex; align-items: center; gap: 9px; min-width: 180px; justify-content: flex-end; }
.header-user .sidebar-user { display: flex; }
.header-user .sidebar-user span { color: var(--muted); }
.header-user .icon-btn { color: var(--muted); }
.avatar { color: var(--brand); background: var(--brand-soft); }

.workspace { min-width: 0; }
.topbar { min-height: 108px; padding: 24px clamp(18px, 2.2vw, 36px) 18px; position: static; background: transparent; border: 0; }
.topbar h1 { font-size: clamp(34px, 3.5vw, 44px); font-weight: 800; line-height: 1.08; letter-spacing: -.045em; }
.eyebrow { color: var(--brand); }
.search-box { border-color: var(--line); border-radius: 8px; background: white; }
.btn { border-radius: 8px; }
.btn-primary { border-color: var(--brand); background: linear-gradient(180deg, #ed981f, #d97706); box-shadow: 0 7px 18px rgba(217,119,6,.18); }
.btn-primary:hover { box-shadow: 0 9px 22px rgba(217,119,6,.24); }
.page-content { width: 100%; max-width: none; margin: 0; padding: 0 clamp(18px, 2.2vw, 36px) 64px; }
.page-content.page-switching { animation: pageSwitch .28s cubic-bezier(.2,.8,.2,1); }
@keyframes pageSwitch { from { transform: translateY(6px); } to { transform: translateY(0); } }
.card { border-color: var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { padding: 18px 22px; }
.card-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.metric-grid { gap: 18px; margin-bottom: 20px; }
.metric { min-height: 122px; border-radius: var(--radius); border-color: var(--line); box-shadow: var(--shadow); }
.metric::after { background: var(--brand-soft); }
.metric strong { color: var(--brand); }
.metric em { color: var(--orange); }
.chip { border: 0; border-radius: 8px; padding: 9px 16px; }
.chip.active { color: var(--brand); border: 0; background: var(--brand-soft); }
.progress-line i { background: var(--brand); }
.badge { color: var(--orange); background: var(--brand-soft); }
.notice { border-color: var(--brand); background: var(--brand-soft); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.progress-card { margin-bottom: 20px; }
.progress-table { min-width: 980px; }
.progress-card { overflow-x: auto; }
.progress-table-head, .progress-row { display: grid; grid-template-columns: minmax(340px, 2.4fr) .52fr .68fr .7fr .86fr .54fr 42px; gap: 10px; align-items: center; }
.progress-table-head { min-height: 46px; padding: 0 28px; color: var(--muted); background: #fbfaf8; border-bottom: 1px solid var(--line); font-size: 12px; }
.progress-row { min-height: 88px; padding: 14px 28px; border-bottom: 1px solid var(--line); font-size: 13px; }
.progress-row:last-child { border-bottom: 0; }
.progress-row:hover { background: #fffdf9; }
.progress-main { min-width: 0; padding-left: 4px; padding-right: 14px; }
.progress-main strong, .progress-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-main small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.current-stage { color: var(--orange); }
.compact-flow { width: 100%; margin-top: 10px; display: flex; gap: 4px; }
.compact-flow i { height: 5px; flex: 1; max-width: 42px; border-radius: 99px; background: #ebe7e1; }
.compact-flow i.done { background: #73a884; }
.compact-flow i.current { background: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.status-pill { display: inline-flex; min-height: 25px; padding: 0 9px; align-items: center; border-radius: 999px; color: var(--brand); background: var(--brand-soft); font-style: normal; font-size: 11px; white-space: nowrap; }
.status-pill.archived { color: var(--green); background: var(--green-soft); }
.status-pill.cancelled { color: var(--orange); background: var(--orange-soft); }
.table-link { border: 0; color: var(--brand); background: transparent; padding: 8px 0; font-weight: 700; }

.recent-activity-wide { margin-top: 20px; }
.search-results { display: grid; gap: 20px; }
.search-summary { align-items: end; }

.business-layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 18px; align-items: start; }
.business-main { min-width: 0; display: grid; gap: 18px; }
.business-aside { display: grid; gap: 16px; position: sticky; top: 94px; }
.side-card { padding: 20px; }
.side-card h3 { margin: 0 0 9px; font-size: 15px; }
.side-card p { margin: 0 0 16px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.quick-link { width: 100%; min-height: 54px; padding: 0 4px; display: flex; align-items: center; justify-content: space-between; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); font-weight: 650; text-align: left; }
.quick-link:last-child { border-bottom: 0; }
.quick-link span { color: var(--brand); font-size: 20px; }

.inline-page { animation: pageIn .2s ease; }
@keyframes pageIn { from { opacity: .3; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.back-link { margin: 0 0 16px; padding: 0; border: 0; background: transparent; color: var(--brand); font-weight: 700; }
.inline-page-body { background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(20px, 3vw, 34px); }
.inline-page-body.form-page-narrow { width: min(1120px, 100%); margin-inline: auto; }
.form-page-narrow .form-grid { width: min(960px, 100%); margin-inline: auto; }
.inline-page-body > .detail-grid:first-child { margin-top: 0; }
.inline-page .form-grid { max-width: 920px; }
.timeline-step.current .step-dot { background: var(--brand); box-shadow: 0 0 0 5px var(--brand-soft); }
.required-tag { color: var(--orange); background: var(--orange-soft); }
.permission-note { color: var(--orange); }
.workorder-layout { display: grid; grid-template-columns: minmax(300px,.8fr) minmax(420px,1.2fr); gap: 28px; align-items: start; margin-top: 26px; }
.workorder-timeline { padding-right: 24px; border-right: 1px solid var(--line); }
.workorder-timeline > h3 { margin: 0 0 16px; font-size: 16px; }
.current-action { padding: 22px; border: 1px solid #efd7b6; border-radius: 12px; background: #fffdf9; position: sticky; top: 96px; }
.current-action-head { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.current-action-head span { color: var(--brand); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.current-action-head h3 { margin: 5px 0 0; font-size: 21px; }
.rollback-button { flex: 0 0 auto; min-height: 30px; padding: 0 10px; border: 1px solid #efb3ad; border-radius: 7px; color: #c63c32; background: #fff5f4; font-size: 11px; font-weight: 750; cursor: pointer; transition: background-color .2s ease, border-color .2s ease, transform .2s ease; }
.rollback-button:hover:not(:disabled) { border-color: #dc6259; background: #ffe9e7; transform: translateY(-1px); }
.rollback-button:disabled { opacity: .42; cursor: not-allowed; }
.pagination { padding: 18px 22px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; border-top: 1px solid var(--line); }
.page-numbers { display: flex; gap: 6px; }
.page-ellipsis { min-width: 20px; display: inline-grid; place-items: center; color: var(--muted); }
.page-number { min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: white; cursor: pointer; }
.page-number.active { border-color: var(--brand); color: white; background: var(--brand); }
.page-jump { margin-left: 8px; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.page-jump input { width: 58px; height: 32px; padding: 0 7px; border: 1px solid var(--line); border-radius: 7px; text-align: center; }
.current-action .form-grid { gap: 13px; }
.one-column { grid-template-columns: 1fr; }
.one-column .field, .one-column .full { grid-column: 1; }
.action-help { margin: 0 0 15px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.full-action { width: 100%; min-height: 46px; grid-column: 1 / -1; }
.decision-actions { display: flex; gap: 10px; }
.decision-actions .btn { flex: 1; }
.plan-edit-button { width: 100%; margin-top: 10px; }

.login-visual { background: linear-gradient(145deg, #2d2925, #514535 60%, #8a591f); }
.login-logo { font-size: 20px; }

@media (max-width: 1120px) {
  .app-header { grid-template-columns: 180px 1fr auto; padding-inline: 24px; }
  .top-nav { gap: 0; }
  .top-nav .nav-btn { padding-inline: 11px; }
  .header-user .sidebar-user { display: none; }
  .header-user { min-width: auto; }
  .business-layout { grid-template-columns: 1fr; }
  .business-aside { grid-template-columns: repeat(2,1fr); position: static; }
}

@media (max-width: 760px) {
  .app-header { display: none; }
  .topbar { min-height: 96px; padding: 22px 18px 15px; }
  .page-content { padding: 0 15px 96px; }
  .business-aside { grid-template-columns: 1fr; }
  .progress-table { min-width: 0; }
  .progress-table-head { display: none; }
  .progress-row { min-height: 0; padding: 16px; grid-template-columns: 1fr auto; gap: 8px 12px; }
  .progress-row > span { display: none; }
  .progress-row .current-stage { display: block; grid-column: 2; grid-row: 1; }
  .progress-row .table-link { grid-column: 2; grid-row: 2; }
  .compact-flow i { max-width: none; }
  .inline-page-body { padding: 18px 16px; }
  .workorder-layout { grid-template-columns: 1fr; gap: 16px; }
  .workorder-timeline { padding-right: 0; border-right: 0; }
  .current-action { position: static; padding: 18px 15px; }
  .todo-list { grid-template-columns: 1fr; }
  .todo-entry { min-height: 78px; padding: 14px 16px; grid-template-columns: 40px 1fr auto 12px; gap: 10px; border-right: 0 !important; border-top: 1px solid var(--line); }
  .todo-entry:first-child { border-top: 0; }
  .todo-icon { width: 38px; height: 38px; border-radius: 10px; }
  .todo-entry > em { font-size: 25px; }
  .pagination { padding: 16px 12px; }
  .page-jump { width: 100%; margin: 4px 0 0; justify-content: center; }
  .login-visual { background: linear-gradient(145deg, #2d2925, #8a591f); }
  .mobile-nav .nav-btn.active { color: var(--brand); background: var(--brand-soft); }
}
