/* Shared design tokens and components; application layouts live in workspace.css. */
:root {
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
  font-size:14px; line-height:1.6; color:var(--ink); background:var(--paper);
  --ink:#22343b; --muted:#5c7079; --accent:#116c60; --accent-hover:#09594f;
  --accent-soft:#edf7f3; --paper:#f4f7f8; --surface:#fff; --line:#dce5e8;
  --danger:#b02e35; --danger-soft:#fff3f2; --warning:#80551d; --warning-soft:#fff8e8;
  --radius:12px; --shadow:0 3px 12px #193e4710; --header-height:72px; --sidebar-width:224px;
}
* { box-sizing:border-box; }
[hidden] { display:none!important; }
body { margin:0; }
button,input,select,textarea { font:inherit; }
button,a,input,select,textarea { -webkit-tap-highlight-color:transparent; }
button,input,select,textarea,summary { scroll-margin-top:100px; }
button { border:1px solid transparent; border-radius:8px; min-height:42px; padding:9px 16px; background:var(--accent); color:#fff; cursor:pointer; font-weight:600; line-height:1.5; display:inline-flex; justify-content:center; align-items:center; gap:8px; transition:background-color .14s,border-color .14s; }
button:hover { background:var(--accent-hover); }
button:disabled { background:#ecf0f2; border-color:#dce5e8; color:#6f7e84; cursor:not-allowed; }
.secondary { background:#fff; border-color:#ccdadd; color:#36535c; }
.secondary:hover { background:#f0f6f5; border-color:#7aa59d; }
.text-button { background:transparent; color:var(--accent); padding:8px; }
.text-button:hover { background:var(--accent-soft); }
.danger { background:var(--danger); }
.danger:hover { background:#912129; }
.icon-button { width:42px; padding:9px; flex:0 0 42px; }
.icon { display:inline-block; width:20px; height:20px; flex:0 0 20px; vertical-align:middle; }
:focus-visible { outline:3px solid #207fa0; outline-offset:3px; }
input,select,textarea { display:block; width:100%; min-width:0; max-width:100%; min-height:44px; margin-top:7px; padding:10px 12px; border:1px solid #becdd2; border-radius:8px; color:var(--ink); background:#fff; line-height:1.5; }
input:hover,select:hover,textarea:hover { border-color:#7f9fa7; }
input:disabled,select:disabled,textarea:disabled { background:#f0f3f5; color:var(--muted); }
[aria-invalid=true] { border-color:var(--danger); }
input[type=checkbox] { accent-color:var(--accent); width:18px; height:18px; min-height:18px; margin:0; flex:0 0 18px; }
input::placeholder,textarea::placeholder { color:var(--muted); opacity:1; }
textarea { min-height:112px; resize:vertical; }
label { display:block; margin:18px 0; color:#304851; font-size:13px; font-weight:600; min-width:0; }
.inline-check { display:flex; align-items:center; gap:9px; min-height:44px; margin:8px 0; font-weight:500; }
.field-error,.inline-error { display:block; color:var(--danger); font-size:13px; margin:6px 0 0; }
.field-error:empty,.inline-error:empty { display:none; }
h1,h2,h3,p { overflow-wrap:anywhere; }
h1 { font-size:26px; letter-spacing:-.035em; line-height:1.35; margin:0 0 10px; }
h2 { font-size:18px; line-height:1.45; margin:0 0 16px; }
h3 { font-size:15px; margin:24px 0 12px; }
p { margin:10px 0; }
.muted { color:var(--muted); font-size:13px; line-height:1.8; }
.eyebrow { color:var(--accent); font-size:11px; letter-spacing:.12em; font-weight:700; margin:0 0 10px; }
.panel { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:28px; box-shadow:var(--shadow); min-width:0; }
.section-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:16px; }
.section-heading h1,.section-heading h2 { margin:0; }
.section-heading>div { min-width:0; }
.section-heading>button { flex-shrink:0; }
.actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-top:20px; }
.item { display:flex; gap:20px; justify-content:space-between; align-items:center; padding:19px 0; border-bottom:1px solid #e7edef; min-width:0; }
.item:last-child { border-bottom:0; }
.item>div:first-child { min-width:0; flex:1; }
.item strong { display:block; font-size:14px; font-weight:600; overflow-wrap:anywhere; }
.item small { color:var(--muted); font-size:12px; line-height:1.8; }
.item>button,.item>.actions { flex-shrink:0; }
.item .actions { margin:0; }
.pill { display:inline-flex; align-items:center; gap:5px; padding:3px 9px; border-radius:6px; font-size:11px; font-weight:600; background:#eff2f4; color:#465b65; margin:5px 8px 5px 0; white-space:nowrap; vertical-align:middle; }
.pill::before { content:''; width:5px; height:5px; background:currentColor; border-radius:50%; }
.pill.PENDING,.pill.RETURNED { background:#fff3dc; color:#835510; }
.pill.APPROVED,.pill.PUBLISHED { background:#e8f5ee; color:#256843; }
.pill.REJECTED { background:#fdecec; color:#a63030; }
.pill.DRAFT { background:#edf0fc; color:#4c5a90; }
.pill.WITHDRAWN { background:#eef1f3; color:#52616b; }
.empty,.state-view { text-align:center; padding:36px 20px; color:var(--muted); border:1px dashed var(--line); background:#fafcfc; border-radius:10px; margin:16px 0; overflow-wrap:anywhere; }
.state-view>.icon { display:block; width:30px; height:30px; margin:0 auto 12px; color:#688d8c; }
.state-view strong { display:block; color:#3b545d; font-size:14px; }
.state-view p { margin:8px 0 14px; font-size:13px; }
.state-view.state-error { background:var(--danger-soft); border-color:#efcbc8; }
.state-error>.icon { color:var(--danger); }
.state-loading { min-height:150px; }
.state-loading>.spinner { margin:0 auto 12px; }
.spinner { width:18px; height:18px; flex:0 0 18px; display:inline-block; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.notice { position:fixed; z-index:100; top:84px; right:24px; max-width:min(560px,calc(100vw - 32px)); display:flex; align-items:flex-start; gap:10px; padding:14px 16px; border-radius:10px; background:#ecf8f0; color:#205c3c; border:1px solid #a6ceba; box-shadow:0 8px 30px #193e471f; }
.notice.error { background:#fff4f2; border-color:#e4b3b0; color:#983335; }
.notice-message { flex:1; min-width:0; overflow-wrap:anywhere; }
.notice button { padding:0; width:30px; min-height:30px; flex:0 0 30px; background:transparent; color:inherit; }
.banner { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; padding:14px 18px; margin-bottom:20px; border:1px solid #e4d2ac; border-radius:10px; background:var(--warning-soft); color:#6d501d; }
.banner p { margin:0; flex:1; min-width:180px; }
dialog { width:min(820px,calc(100% - 32px)); max-height:calc(100dvh - 48px); overflow:auto; overscroll-behavior:contain; border:1px solid var(--line); border-radius:16px; padding:28px; color:var(--ink); background:#fff; box-shadow:0 24px 80px #15323b40; }
dialog::backdrop { background:#122c396b; }
dialog>.dialog-footer { position:sticky; bottom:-28px; background:#fff; border-top:1px solid var(--line); padding:16px 0 0; margin-top:24px; justify-content:flex-end; }
dialog h2 { margin-top:0; }
.data-row { display:grid; grid-template-columns:130px minmax(0,1fr); gap:16px; padding:10px 0; border-bottom:1px solid #edf1f3; font-size:13px; overflow-wrap:anywhere; }
.data-row>span:first-child { color:var(--muted); }
.data-row>span:last-child { white-space:pre-wrap; }
.unread-dot { display:inline-block; width:7px; height:7px; background:var(--accent); border-radius:50%; margin-right:8px; }
summary { cursor:pointer; padding:14px; border-radius:8px; font-weight:600; color:#38535c; }
details { border:1px solid var(--line); border-radius:10px; margin:16px 0; }
details[open]>summary { border-bottom:1px solid var(--line); background:#f7fafb; border-radius:10px 10px 0 0; }
details>p,details>.data-row { margin-left:16px; margin-right:16px; }
.skip-link { position:fixed; top:-100px; left:16px; z-index:200; background:#fff; color:var(--accent); padding:10px 16px; border-radius:8px; }
.skip-link:focus { top:8px; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }

.reminded-task{border-left:4px solid #b36a16;background:#fffaf0}.reminded-task .work-notice-meta{color:#8a4b09}#pending-list>div:first-child>label{max-width:560px;margin-bottom:16px}#message-work-panel>details{margin:16px 0}

.reference-picker{width:min(760px,94vw);max-height:88vh;overflow:auto}.reference-picker>.actions>input[type=search]{flex:1;min-width:180px}.reference-card{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid #d5e2e3;border-radius:8px;margin:8px 0}.reference-card small{display:block;color:#496373;margin-top:5px}.reference-card input{width:auto;flex:0 0 auto}.reference-card span,.reference-card>div{flex:1;min-width:0;overflow-wrap:anywhere}.related-request-field{position:relative}.reference-validity{position:absolute;width:1px!important;height:1px!important;opacity:0;padding:0!important;border:0;pointer-events:none}
.reference-tabs{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}.reference-tabs button[aria-pressed="true"]{background:#176b5d;color:#fff;border-color:#176b5d}.reference-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:10px 0 16px}.reference-filters select{min-width:0}.reference-card>.reference-state{flex:0 0 auto;width:auto;white-space:nowrap;font-size:12px;font-weight:700;padding:5px 9px;border-radius:999px;background:#eef3f4;color:#4b6270}.reference-card>.reference-state-PENDING{background:#fff0d5;color:#9a5b00}.reference-card>.reference-state-APPROVED{background:#e4f5ed;color:#16734b}.reference-card>.reference-state-REJECTED,.reference-card>.reference-state-RETURNED{background:#fde9e9;color:#a32935}@media(max-width:600px){.reference-filters{grid-template-columns:1fr}.reference-card{align-items:flex-start}.reference-card>.reference-state{align-self:flex-start}}

.request-search{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;align-items:end;margin:20px 0 8px}.request-search label{display:flex;flex-direction:column;gap:7px}.request-search button{margin:0}.request-search input,.request-search select{width:100%;min-width:0}

.request-result-summary small{display:block;margin-top:4px}.request-result-summary{min-width:0;overflow-wrap:anywhere}

.purchase-items-field{min-width:0;margin:20px 0;padding:18px;border:1px solid var(--line);border-radius:10px;background:#fafcfc}
.purchase-items-field legend{font-weight:700;padding:0 7px}
.purchase-items-field .field-help{display:block;margin:0 0 10px;color:var(--muted)}
.purchase-item-row{padding:14px;margin:12px 0;border:1px solid var(--line);border-radius:9px;background:#fff}
.purchase-item-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.purchase-item-head button{min-height:34px;padding:5px 11px}
.purchase-item-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 14px}
.purchase-item-grid label{margin:8px 0 2px}
.purchase-item-grid label:last-child{grid-column:1/-1}
.purchase-items-field>label{margin:18px 0 0}
.purchase-items-detail{margin:18px 0}
.purchase-items-detail h4{margin:0 0 8px}
.purchase-items-scroll{max-width:100%;overflow-x:auto;border:1px solid var(--line);border-radius:8px}
.purchase-items-detail table{width:100%;min-width:580px;border-collapse:collapse;font-size:13px}
.purchase-items-detail th,.purchase-items-detail td{padding:9px 10px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top;overflow-wrap:anywhere}
.purchase-items-detail th{background:#f2f7f6;white-space:nowrap}
.purchase-items-detail tr:last-child td{border-bottom:0}
.purchase-items-note{white-space:pre-wrap;margin-top:4px}
@media(max-width:600px){.purchase-item-grid{grid-template-columns:1fr}.purchase-item-grid label:last-child{grid-column:auto}}
