:root {
  color-scheme: light;
  --ink: #14221e;
  --muted: #7b8984;
  --green: #123f34;
  --green-2: #1d5b4b;
  --green-soft: #edf5f2;
  --line: #e3e9e6;
  --surface: #f7f9f8;
  --warning: #c46e16;
  --warning-soft: #fff3df;
  --danger: #b83434;
  --shadow: 0 12px 36px rgba(18, 63, 52, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef2f0;
  color: var(--ink);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #eef2f0; }
body { min-height: 100dvh; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(18, 63, 52, .2); outline-offset: 2px; }

.app-shell { min-height: 100dvh; display: grid; place-items: start center; padding: 0; }
.phone-frame { position: relative; width: 100%; min-height: 100dvh; background: #fff; overflow: hidden; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: calc(28px + env(safe-area-inset-top)) 20px 12px; background: #fff; position: sticky; top: 0; z-index: 10; }
.header-copy { display: flex; align-items: center; gap: 8px; min-width: 0; }
.header-copy h1 { margin: 2px 0 0; font-size: clamp(1.55rem, 7vw, 2rem); line-height: 1.05; letter-spacing: -.035em; overflow-wrap: anywhere; }
.eyebrow { font-size: .76rem; color: var(--muted); font-weight: 650; letter-spacing: .01em; text-transform: none; }
.page-content { padding: 8px 20px calc(96px + env(safe-area-inset-bottom)); }

.avatar-button, .square-button { border: 0; background: var(--green); color: #fff; display: grid; place-items: center; flex: 0 0 auto; }
.avatar-button { width: 42px; height: 42px; border-radius: 13px; font-weight: 750; }
.square-button { width: 40px; height: 40px; border-radius: 12px; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.icon-button.plain { margin-left: -10px; background: transparent; border-color: transparent; }

.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); padding: 9px 8px calc(10px + env(safe-area-inset-bottom)); backdrop-filter: blur(14px); z-index: 20; }
.nav-item { border: 0; background: transparent; color: #8c9994; display: grid; justify-items: center; gap: 3px; padding: 4px; font-size: .67rem; font-weight: 650; }
.nav-item svg { stroke-width: 1.7; }
.nav-item.active { color: var(--green); }

.status-card { background: var(--green); color: #fff; border-radius: 22px; padding: 20px; margin: 4px 0 20px; box-shadow: var(--shadow); }
.status-card > div:first-child { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.status-card strong { font-size: 1.65rem; letter-spacing: -.03em; }
.status-label { color: rgba(255,255,255,.72); font-size: .82rem; }
.status-meta { margin-top: 14px; color: rgba(255,255,255,.76); font-size: .8rem; border-top: 1px solid rgba(255,255,255,.16); padding-top: 12px; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 20px 0 10px; }
.section-title h2 { font-size: .95rem; margin: 0; letter-spacing: -.01em; }
.section-title span, .text-button { color: var(--muted); font-size: .76rem; }
.text-button { border: 0; background: transparent; padding: 0; }

.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metric { border: 1px solid var(--line); border-radius: 16px; padding: 14px 12px; min-width: 0; }
.metric span { display: block; font-size: .72rem; color: var(--muted); text-transform: capitalize; overflow-wrap: anywhere; }
.metric strong { display: block; margin-top: 5px; font-size: 1.35rem; }

.stack { display: grid; gap: 14px; }
.stack.compact { gap: 8px; }
.list-row { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 16px; min-height: 62px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 11px 12px; color: var(--ink); text-align: left; }
.list-row.static { cursor: default; grid-template-columns: auto 1fr; }
.list-row.action-row { margin-top: 10px; }
.row-copy { min-width: 0; }
.row-copy strong { display: block; font-size: .88rem; overflow-wrap: anywhere; }
.row-copy small { display: block; color: var(--muted); margin-top: 3px; font-size: .73rem; text-transform: none; }
.record-icon, .person-avatar, .check-badge { width: 34px; height: 34px; border-radius: 11px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-weight: 800; }
.record-icon.warn { background: var(--warning-soft); color: var(--warning); }
.person-avatar { background: var(--green); color: #fff; font-size: .72rem; }

.empty-card { border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; align-items: center; gap: 12px; color: var(--ink); }
.empty-card small { display: block; color: var(--muted); margin-top: 3px; }
.empty-state { min-height: 320px; display: grid; place-items: center; align-content: center; text-align: center; padding: 32px 16px; }
.empty-state h2 { margin: 12px 0 6px; }
.empty-state p { color: var(--muted); line-height: 1.55; margin: 0 0 18px; max-width: 320px; }
.empty-icon { width: 52px; height: 52px; border-radius: 16px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; }

.search-box { background: #f3f5f4; color: #a0aaa6; border-radius: 13px; padding: 13px 14px; font-size: .86rem; margin-bottom: 12px; }
.chip-row { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.chip { background: #f2f4f3; color: #6f7c77; border-radius: 999px; padding: 8px 13px; font-size: .72rem; white-space: nowrap; }
.chip.active { background: var(--green); color: #fff; }

.document-preview { height: 218px; background: #f0f3f2; border-radius: 22px; display: grid; place-items: center; position: relative; margin-bottom: 14px; }
.paper { width: 132px; height: 158px; border-radius: 7px; background: #fff; box-shadow: 0 12px 28px rgba(0,0,0,.08); display: grid; place-items: center; align-content: center; text-align: center; gap: 12px; padding: 12px; }
.paper strong { color: var(--green); font-size: 1.25rem; overflow-wrap: anywhere; }
.paper span { font-size: .65rem; color: var(--muted); }
.verified-badge { position: absolute; bottom: 18px; background: var(--green-soft); color: var(--green); border-radius: 999px; padding: 6px 10px; font-size: .68rem; font-weight: 700; }
.detail-table { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.detail-table > div { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px; border-bottom: 1px solid var(--line); }
.detail-table > div:last-child { border-bottom: 0; }
.detail-table span { color: var(--muted); font-size: .74rem; }
.detail-table strong { font-size: .78rem; text-align: right; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; }

.timeline { display: grid; gap: 13px; }
.timeline.compact { gap: 10px; }
.audit-row { position: relative; display: grid; grid-template-columns: 14px 1fr; gap: 8px; align-items: start; }
.audit-row::before { content: ''; position: absolute; left: 6px; top: 12px; bottom: -14px; width: 1px; background: var(--line); }
.audit-row:last-child::before { display: none; }
.audit-dot { width: 9px; height: 9px; margin-top: 4px; border-radius: 999px; background: #8db3a7; box-shadow: 0 0 0 4px #edf4f1; z-index: 1; }
.audit-row strong { display: block; font-size: .78rem; }
.audit-row small { display: block; color: var(--muted); font-size: .68rem; margin-top: 3px; }

.company-card { border: 1px solid var(--line); border-radius: 17px; padding: 12px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.company-logo { width: 42px; height: 42px; border-radius: 12px; background: var(--green); color: white; display: grid; place-items: center; font-weight: 750; }
.company-card strong { display: block; font-size: .85rem; }
.company-card small { display: block; color: var(--muted); font-size: .7rem; margin-top: 3px; }
.online-dot { width: 8px; height: 8px; border-radius: 999px; background: #2fb178; }
.notice-card { background: var(--surface); border-radius: 16px; padding: 14px; }
.notice-card strong { font-size: .82rem; text-transform: capitalize; }
.notice-card p { margin: 4px 0 0; color: var(--muted); font-size: .74rem; line-height: 1.45; }

label { display: grid; gap: 7px; font-size: .73rem; color: #66746f; font-weight: 650; }
input, select { width: 100%; border: 1px solid var(--line); background: white; border-radius: 12px; min-height: 46px; padding: 0 12px; color: var(--ink); }
input::placeholder { color: #afb8b5; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.upload-box { min-height: 176px; border: 1px dashed #aebdb7; border-radius: 18px; display: grid; justify-items: center; align-content: center; gap: 6px; color: var(--ink); text-align: center; padding: 20px; position: relative; }
.upload-box input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-box small { color: var(--muted); font-weight: 400; }
.upload-icon { width: 36px; height: 36px; border-radius: 11px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-size: 1.2rem; }
.choose-file { background: var(--green); color: #fff; padding: 7px 10px; border-radius: 9px; font-size: .68rem; max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.primary, .secondary { border: 0; border-radius: 13px; min-height: 48px; padding: 0 18px; font-weight: 750; }
.primary { background: var(--green); color: #fff; }
.secondary { background: #edf1ef; color: var(--ink); }
.primary.inline { min-height: 42px; width: auto; }

.auth-screen { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: #fff; }
.auth-card { width: min(380px, 100%); text-align: center; }
.auth-card h1 { margin: 16px 0 8px; font-size: 2rem; letter-spacing: -.04em; }
.auth-card p { color: var(--muted); line-height: 1.55; margin: 0 0 20px; }
.auth-card .primary { width: 100%; }
.brand-mark { width: 52px; height: 52px; background: var(--green); color: white; border-radius: 16px; display: grid; place-items: center; margin: 0 auto; font-weight: 800; }
.intro-block { margin-bottom: 6px; }
.intro-block .brand-mark { margin: 0 0 16px; }
.intro-block h2 { font-size: 1.45rem; margin: 0 0 6px; }
.intro-block p { margin: 0; color: var(--muted); line-height: 1.5; font-size: .85rem; }
.toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #152a24; color: #fff; border-radius: 12px; padding: 10px 14px; font-size: .78rem; z-index: 50; max-width: calc(100vw - 32px); box-shadow: var(--shadow); }

@media (min-width: 720px) {
  .app-shell { padding: 28px; }
  .phone-frame { width: min(1120px, calc(100vw - 56px)); min-height: calc(100dvh - 56px); border-radius: 28px; box-shadow: var(--shadow); display: grid; grid-template-columns: 210px 1fr; grid-template-rows: auto 1fr; }
  .page-header { grid-column: 2; position: static; padding: 34px 40px 12px; }
  .page-content { grid-column: 2; padding: 12px 40px 48px; max-width: 820px; width: 100%; }
  .bottom-nav { position: static; transform: none; grid-column: 1; grid-row: 1 / span 2; width: auto; max-width: none; border-top: 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; padding: 34px 16px; align-items: stretch; background: #fbfcfb; }
  .nav-item { grid-template-columns: 26px 1fr; justify-items: start; align-items: center; text-align: left; padding: 12px 14px; border-radius: 12px; font-size: .82rem; }
  .nav-item.active { background: var(--green-soft); }
  .metric-grid { gap: 12px; }
  .toast { bottom: 36px; }
}

@media (max-width: 360px) {
  .page-header, .page-content { padding-left: 15px; padding-right: 15px; }
  .two-col { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
