:root {
  color-scheme: light;
  --navy-950: #071c2d;
  --navy-900: #0b273b;
  --navy-800: #123b54;
  --teal-700: #0c716b;
  --teal-600: #0d8580;
  --teal-100: #dff4f1;
  --blue-100: #e8f2ff;
  --blue-700: #245f9c;
  --green-100: #e3f6eb;
  --green-700: #187143;
  --amber-100: #fff3d3;
  --amber-800: #845500;
  --red-100: #fde7e5;
  --red-700: #a93731;
  --gray-25: #fafbfc;
  --gray-50: #f5f7f9;
  --gray-100: #e9eef2;
  --gray-200: #d7e0e7;
  --gray-400: #657681;
  --gray-600: #51616e;
  --gray-800: #263642;
  --white: #ffffff;
  --shadow: 0 10px 30px rgba(7, 28, 45, 0.07);
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--gray-50); }
body { min-height: 100vh; margin: 0; color: var(--gray-800); background: var(--gray-50); font-size: 14px; line-height: 1.45; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 3px solid rgba(13, 133, 128, 0.28);
  outline-offset: 2px;
}

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 15px 16px;
  overflow-y: auto;
  color: #e8f1f6;
  background: linear-gradient(180deg, var(--navy-950), var(--navy-900));
}
.brand, .login-brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark {
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, var(--teal-600), var(--teal-700));
  box-shadow: 0 8px 18px rgba(0, 0, 0, .18);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
}
.brand strong, .login-brand strong { display: block; font-size: 17px; line-height: 1.2; }
.brand small, .login-brand small { display: block; margin-top: 2px; color: #9eb2c0; font-size: 11px; }
.beta-pill {
  align-self: flex-start;
  margin: 18px 0 16px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  color: #b8dcd8;
  background: rgba(12, 113, 107, .22);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}
.nav-section { margin: 12px 0 18px; }
.nav-section > small { display: block; margin: 0 10px 7px; color: #7690a0; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.nav-link {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 3px 0;
  padding: 9px 11px;
  border-radius: 10px;
  color: #b9c9d2;
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
}
.nav-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-link.active { color: #fff; background: rgba(13, 133, 128, .32); box-shadow: inset 3px 0 var(--teal-600); }
.nav-link:not(.disabled):hover { color: #fff; background: rgba(255, 255, 255, .07); }
.nav-link em { margin-left: auto; padding: 2px 6px; border-radius: 999px; color: #acd7d3; background: rgba(13, 133, 128, .2); font-size: 8px; font-style: normal; letter-spacing: .05em; }
.nav-link.disabled { opacity: .48; cursor: default; }
.sidebar-user { margin-top: auto; display: flex; align-items: center; gap: 9px; padding: 13px 9px 2px; border-top: 1px solid rgba(255, 255, 255, .09); }
.sidebar-user .avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--teal-700); font-weight: 800; }
.sidebar-user strong, .sidebar-user small { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { font-size: 12px; }
.sidebar-user small { margin-top: 2px; color: #8fa6b4; font-size: 10px; }
.sidebar-overlay { display: none; }
.sr-only, caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.main { min-width: 0; }
.topbar {
  height: 78px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 clamp(18px, 3vw, 38px);
  border-bottom: 1px solid var(--gray-100);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
}
.topbar p, .topbar h1 { margin: 0; }
.topbar p { color: var(--gray-400); font-size: 10px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.topbar h1 { margin-top: 2px; color: var(--navy-950); font-size: clamp(18px, 2vw, 23px); }
.logout-form { margin-left: auto; }
.menu-button { display: none; }
.content { padding: 28px clamp(18px, 3vw, 38px) 54px; }

.hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  padding: clamp(22px, 4vw, 35px);
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(120deg, var(--navy-900), #0d4c5b 72%, var(--teal-700));
  box-shadow: var(--shadow);
}
.hero-card h2 { margin: 5px 0 8px; font-size: clamp(24px, 3vw, 33px); }
.hero-card p { max-width: 680px; margin: 0; color: #c8d9df; line-height: 1.6; }
.hero-status { min-width: 185px; padding: 16px; border: 1px solid rgba(255,255,255,.15); border-radius: 12px; background: rgba(255,255,255,.08); }
.hero-status span, .hero-status strong, .hero-status small { display: block; }
.hero-status span { color: #b7cbd3; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.hero-status strong { margin: 5px 0; font-size: 16px; }
.hero-status small { color: #a8d5d0; font-size: 10px; }
.eyebrow { color: var(--teal-700); font-size: 10px; font-weight: 850; letter-spacing: .11em; }
.hero-card .eyebrow { color: #90d4cf; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card {
  display: block;
  padding: 19px;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 5px 18px rgba(7, 28, 45, .04);
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease;
}
.stat-card:hover { transform: translateY(-2px); border-color: #b9d8d5; }
.stat-card span, .stat-card small { display: block; }
.stat-card span { color: var(--gray-600); font-size: 12px; font-weight: 700; }
.stat-card strong { display: block; margin: 7px 0 4px; color: var(--navy-950); font-size: 29px; }
.stat-card small { color: var(--gray-400); font-size: 12px; }

.grid-two { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
.grid-two.grid-single { grid-template-columns: minmax(0, 760px); }
.grid-admin { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .65fr); gap: 18px; align-items: start; }
.panel { padding: 22px; border: 1px solid var(--gray-100); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.narrow-panel { max-width: 640px; }
.create-user-panel { position: sticky; top: 18px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.panel-heading h2 { margin: 4px 0 0; color: var(--navy-950); font-size: 19px; }

.flow-list, .review-list { margin: 0; padding: 0; list-style: none; }
.flow-list li { display: flex; align-items: center; gap: 13px; position: relative; padding: 10px 0; }
.flow-list li:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 42px; bottom: -5px; width: 1px; background: var(--gray-200); }
.flow-list li > span { z-index: 1; width: 31px; height: 31px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: var(--teal-700); background: var(--teal-100); font-size: 11px; font-weight: 850; }
.flow-list strong, .flow-list small { display: block; }
.flow-list strong { font-size: 13px; }
.flow-list small { margin-top: 2px; color: var(--gray-600); line-height: 1.4; }
.review-list li { display: grid; grid-template-columns: 46px 1fr; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--gray-100); }
.review-list li:last-child { border: 0; }
.review-list strong { color: var(--teal-700); font-size: 22px; text-align: right; }
.review-list span { color: var(--gray-600); font-size: 12px; line-height: 1.45; }

.alert { margin-bottom: 16px; padding: 11px 13px; border: 1px solid transparent; border-radius: 10px; font-size: 13px; line-height: 1.5; }
.alert-info { color: var(--blue-700); border-color: #cfe2f7; background: var(--blue-100); }
.alert-success { color: var(--green-700); border-color: #c6e9d4; background: var(--green-100); }
.alert-warning { color: var(--amber-800); border-color: #efdb9f; background: var(--amber-100); }
.alert-error { color: var(--red-700); border-color: #f0c8c4; background: var(--red-100); }

.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; white-space: nowrap; font-size: 11px; font-weight: 800; letter-spacing: .015em; }
.badge-neutral { color: var(--gray-600); background: var(--gray-100); }
.badge-muted { color: var(--gray-600); background: var(--gray-100); }
.badge-primary { color: var(--teal-700); background: var(--teal-100); }
.badge-success { color: var(--green-700); background: var(--green-100); }
.badge-warning { color: var(--amber-800); background: var(--amber-100); }
.badge-danger { color: var(--red-700); background: var(--red-100); }

.button {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  font-weight: 750;
}
.button-primary { color: #fff; background: var(--teal-700); }
.button-primary:hover { background: #095e59; }
.button-secondary { color: var(--teal-700); border-color: #b7d8d5; background: #f6fbfa; }
.button-ghost { color: var(--gray-600); border-color: var(--gray-200); background: #fff; }
.button-danger-soft { color: var(--red-700); border-color: #edc5c1; background: var(--red-100); }
.button-small { min-height: 38px; padding: 7px 10px; font-size: 12px; }
.button-wide { width: 100%; }
.button:disabled, .icon-button:disabled { opacity: .5; cursor: not-allowed; }
.icon-button { border: 0; background: transparent; cursor: pointer; }

.stack-form { display: grid; gap: 14px; }
.stack-form label { display: grid; gap: 6px; color: var(--gray-800); font-size: 13px; font-weight: 750; }
.stack-form label small, .stack-form > small { color: var(--gray-400); font-size: 12px; font-weight: 500; line-height: 1.45; }
input, select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--gray-200);
  border-radius: 9px;
  color: var(--gray-800);
  background: #fff;
}
textarea { resize: vertical; }
input::placeholder { color: #6f7f8a; opacity: 1; }
textarea::placeholder { color: #6f7f8a; opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: var(--teal-600); outline: 3px solid rgba(13,133,128,.11); }
[hidden] { display: none !important; }

.page-actions { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 19px; }
.page-actions h2 { margin: 3px 0 4px; color: var(--navy-950); font-size: clamp(21px, 2.5vw, 27px); }
.page-actions p { margin: 0; color: var(--gray-600); }
.mini-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(130px, 210px)); gap: 12px; margin-bottom: 18px; }
.mini-stat-grid-5 { grid-template-columns: repeat(5, minmax(120px, 1fr)); }
.mini-stat { padding: 14px 16px; border: 1px solid var(--gray-100); border-radius: 11px; background: #fff; box-shadow: 0 4px 14px rgba(7,28,45,.04); text-decoration: none; }
.mini-stat span, .mini-stat strong { display: block; }
.mini-stat span { color: var(--gray-600); font-size: 11px; font-weight: 700; }
.mini-stat strong { margin-top: 2px; color: var(--teal-700); font-size: 22px; }
.procurement-form { display: grid; gap: 17px; }
.procurement-form .page-actions { margin-bottom: 0; }
.form-section { box-shadow: 0 5px 18px rgba(7,28,45,.04); }
.panel-heading h3 { margin: 2px 0 0; color: var(--navy-950); font-size: 17px; }
.section-title { display: flex; align-items: center; gap: 10px; }
.step-chip { width: 28px; height: 28px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--teal-700); background: var(--teal-100); font-size: 11px; font-weight: 850; }
.form-grid { display: grid; gap: 15px; }
.form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid label { display: grid; align-content: start; gap: 6px; color: var(--gray-800); font-size: 12px; font-weight: 750; }
.form-grid label small { color: var(--gray-400); font-weight: 500; line-height: 1.4; }
.span-all { grid-column: 1 / -1; }
.required { color: var(--red-700); }
.procurement-items table { min-width: 1160px; }
.procurement-items-vendor table { min-width: 1400px; }
.procurement-items th:nth-child(1), .procurement-items td:nth-child(1) { width: 44px; }
.procurement-items th:nth-child(2), .procurement-items td:nth-child(2) { width: 115px; }
.procurement-items .item-description { min-width: 240px; }
.procurement-items th:nth-child(4), .procurement-items td:nth-child(4) { width: 105px; }
.procurement-items th:nth-child(5), .procurement-items td:nth-child(5) { width: 100px; }
.procurement-items th:nth-child(6), .procurement-items td:nth-child(6) { width: 165px; }
.procurement-items th:nth-child(8), .procurement-items td:nth-child(8) { width: 190px; }
.procurement-items th:nth-child(9), .procurement-items td:nth-child(9) { width: 210px; }
.procurement-items:not(.procurement-items-vendor) th:nth-child(9), .procurement-items:not(.procurement-items-vendor) td:nth-child(9) { width: 44px; }
.procurement-items input, .procurement-items select, .procurement-items textarea { min-height: 38px; padding: 7px 8px; font-size: 12px; }
.procurement-items textarea { min-height: 58px; overflow-y: hidden; line-height: 1.4; resize: vertical; }
.item-vendor-field { min-width: 190px; }
.item-notes-field { min-width: 210px; }
.item-total { white-space: nowrap; color: var(--navy-950); font-weight: 750; }
.remove-item { width: 34px; height: 34px; border-radius: 8px; color: var(--red-700); background: var(--red-100); font-size: 20px; }
.mobile-field-label { display: none; }
tfoot td { border-top: 2px solid var(--gray-200); color: var(--navy-950); font-weight: 800; }
tfoot td:first-child { text-align: right; }
.form-hint { margin: 12px 0 0; color: var(--gray-400); font-size: 11px; }
.attachment-intro { display: flex; align-items: center; justify-content: space-between; gap: 14px; border-style: dashed; }
.attachment-intro strong, .attachment-intro small { display: block; }
.attachment-intro small { margin-top: 4px; color: var(--gray-600); }
.form-submit-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 20px; border: 1px solid #bddbd8; border-radius: 12px; background: #f3fbfa; box-shadow: var(--shadow); }
.form-submit-bar strong, .form-submit-bar small { display: block; }
.form-submit-bar small { max-width: 640px; margin-top: 3px; color: var(--gray-600); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .7fr); gap: 18px; margin-bottom: 18px; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--gray-100); }
.detail-list div { padding: 12px 8px; border-bottom: 1px solid var(--gray-100); }
.detail-list dt { color: var(--gray-400); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.detail-list dd { margin: 4px 0 0; color: var(--navy-950); }
.detail-list dd small { display: block; margin-top: 2px; color: var(--gray-400); }
.text-detail { margin-top: 16px; }
.text-detail span { color: var(--gray-400); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.text-detail p { margin: 5px 0 0; white-space: pre-wrap; line-height: 1.6; }
.hrd-review-note { padding: 12px 14px; border-left: 3px solid var(--teal-600); background: #f3fbfa; }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: 17px 1fr; gap: 10px; padding-bottom: 17px; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 10px; bottom: 0; width: 1px; background: var(--gray-200); }
.timeline li > span { z-index: 1; width: 11px; height: 11px; margin-top: 4px; border: 2px solid #fff; border-radius: 50%; background: var(--teal-600); box-shadow: 0 0 0 2px var(--teal-100); }
.timeline strong, .timeline small { display: block; }
.timeline small { margin-top: 3px; color: var(--gray-400); }
.timeline p { margin: 4px 0 0; color: var(--gray-600); font-size: 12px; }
.attachment-list, .revision-list { margin: 0; padding: 0; list-style: none; }
.attachment-list { display: grid; gap: 8px; }
.attachment-list li { display: grid; grid-template-columns: 138px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px; border: 1px solid var(--gray-100); border-radius: 11px; background: var(--gray-25); transition: border-color .16s ease, box-shadow .16s ease, opacity .16s ease; }
.attachment-list li.is-dragging { opacity: .48; }
.attachment-list li.is-drag-over { border-color: var(--teal-600); box-shadow: 0 0 0 3px rgba(13, 133, 128, .12); }
.attachment-list strong, .attachment-list small { display: block; overflow-wrap: anywhere; }
.attachment-list small { margin-top: 3px; color: var(--gray-400); }
.attachment-thumbnail, .attachment-file-icon { position: relative; display: grid; width: 138px; height: 92px; overflow: hidden; place-items: center; border: 1px solid var(--gray-200); border-radius: 8px; background: #fff; }
.attachment-thumbnail img { width: 100%; height: 100%; object-fit: contain; transition: transform .16s ease; }
.attachment-thumbnail img.rotation-90, .attachment-thumbnail img.rotation-270 { transform: rotate(90deg) scale(.65); }
.attachment-thumbnail img.rotation-180 { transform: rotate(180deg); }
.attachment-thumbnail img.rotation-270 { transform: rotate(270deg) scale(.65); }
.attachment-sequence { position: absolute; top: 6px; left: 6px; z-index: 1; min-width: 24px; height: 24px; display: grid !important; place-items: center; padding: 0 6px; border: 2px solid #fff; border-radius: 999px; color: #fff; background: var(--teal-700); box-shadow: 0 2px 7px rgba(7,28,45,.2); font-size: 11px; font-weight: 850; }
.attachment-file-icon { color: var(--red-700); background: #fff8f7; font-size: 12px; font-weight: 850; letter-spacing: .08em; }
.attachment-meta { min-width: 0; }
.attachment-meta small strong { display: inline; color: inherit; }
.attachment-tools, .attachment-tool-row { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.attachment-tools { max-width: 370px; }
.attachment-inline-form { display: inline-flex; margin: 0; }
.attachment-icon-button { min-width: 34px; min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 6px 9px; border: 1px solid var(--gray-200); border-radius: 8px; color: var(--teal-700); background: #fff; cursor: pointer; font-weight: 800; }
.attachment-icon-button:hover { border-color: #9fcac6; background: var(--teal-100); }
.attachment-drag-handle { cursor: grab; touch-action: none; }
.attachment-drag-handle:active { cursor: grabbing; }
.attachment-order-form { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; padding: 12px 14px; border: 1px dashed #a9cbc8; border-radius: 10px; background: #f5fbfa; }
.attachment-order-form p { margin: 0; }
.attachment-order-form strong, .attachment-order-form small { display: block; }
.attachment-order-form small { margin-top: 3px; color: var(--gray-600); }
.empty-inline { margin: 0; color: var(--gray-400); }
.upload-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--gray-100); }
.upload-form label { display: grid; gap: 6px; color: var(--gray-800); font-size: 12px; font-weight: 750; }
.upload-form label small { color: var(--gray-400); font-weight: 500; }
.decision-panel { margin-top: 18px; border-color: #b7d8d5; }
.decision-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.decision-form label { display: grid; gap: 6px; color: var(--gray-800); font-size: 12px; font-weight: 750; }
.decision-link { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.decision-link strong, .decision-link small { display: block; }
.decision-link small { margin-top: 4px; color: var(--gray-600); }
.revision-list { display: grid; gap: 0; }
.revision-list li { padding: 12px 4px; border-top: 1px solid var(--gray-100); }
.revision-list li:first-child { border-top: 0; }
.revision-list strong, .revision-list small { display: block; }
.revision-list small { margin-top: 3px; color: var(--gray-400); }
.revision-list p { margin: 6px 0 0; color: var(--gray-600); line-height: 1.45; }
del { color: var(--red-700); text-decoration-thickness: 2px; }
.revised-value { color: var(--green-700); }
.item-type-label { color: var(--gray-600); font-weight: 800; letter-spacing: .02em; }
.item-vendor { margin-top: 5px; color: var(--teal-700); font-size: 11px; font-weight: 650; line-height: 1.35; }
.item-note { white-space: pre-wrap; line-height: 1.45; }
.row-added { background: #f2fbf6; }
.row-deleted { color: var(--gray-400); background: #fff7f6; }
.filter-bar { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto auto; gap: 9px; margin-bottom: 15px; }
.filter-bar select { width: auto; min-width: 155px; }
.filter-field { display: block; }
.mini-form { width: 230px; display: grid; gap: 7px; margin-top: 8px; padding: 10px; border: 1px solid var(--gray-100); border-radius: 9px; background: var(--gray-25); }
.mini-form label { display: grid; gap: 4px; color: var(--gray-600); font-size: 11px; font-weight: 700; }
.mini-form input { min-height: 39px; font-size: 12px; }
.action-stack { display: flex; align-items: flex-start; gap: 7px; flex-wrap: wrap; }
details summary { min-height: 38px; display: inline-flex; align-items: center; cursor: pointer; color: var(--teal-700); font-size: 12px; font-weight: 750; }

.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--gray-100); border-radius: 10px; }
.table-wrap:focus-visible { outline-offset: 3px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead { background: var(--gray-50); }
th { padding: 10px 11px; color: var(--gray-600); text-align: left; white-space: nowrap; font-size: 11px; letter-spacing: .035em; text-transform: uppercase; }
td { padding: 11px; border-top: 1px solid var(--gray-100); vertical-align: top; }
td strong, td small { display: block; }
td strong { color: var(--navy-950); }
td small { margin-top: 3px; color: var(--gray-400); font-size: 11px; }
tbody tr:hover { background: #fbfdfd; }
.wide-cell { min-width: 220px; max-width: 400px; line-height: 1.45; }
.empty { padding: 28px; color: var(--gray-400); text-align: center; }
code { padding: 2px 5px; border-radius: 5px; color: var(--navy-800); background: var(--gray-100); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.muted { color: var(--gray-400); }

.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 10% 5%, #dff4f1, transparent 32%), linear-gradient(145deg, #f7fafb, #e8eff3); }
.login-card { width: min(100%, 420px); padding: clamp(25px, 5vw, 38px); border: 1px solid rgba(255,255,255,.8); border-radius: 18px; background: rgba(255,255,255,.96); box-shadow: 0 24px 70px rgba(7,28,45,.14); }
.login-brand { color: var(--navy-950); }
.login-brand small { color: var(--gray-400); }
.login-card .beta-pill { margin: 23px 0 25px; color: var(--teal-700); border-color: #b7d8d5; background: var(--teal-100); }
.login-card h1 { margin: 0 0 7px; color: var(--navy-950); font-size: 28px; }
.login-card > .muted { margin: 0 0 22px; color: var(--gray-600); font-size: 12px; line-height: 1.6; }
.login-foot { margin: 23px 0 0; color: var(--gray-400); text-align: center; font-size: 11px; }
.error-card { text-align: center; }
.error-code { display: block; color: var(--teal-700); font-size: 48px; font-weight: 850; }

.print-body { min-height: 100vh; padding: 28px; color: #101c29; background: #e9eef1; }
.print-document { width: min(100%, 1120px); margin: 0 auto; padding: 30px 34px; background: #fff; box-shadow: var(--shadow); font-size: 12px; }
.print-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-bottom: 20px; }
.print-toolbar > span { margin-right: auto; color: var(--gray-600); font-size: 12px; }
.print-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 13px; border-bottom: 2px solid #165d31; }
.print-brand { display: flex; min-width: 0; align-items: center; gap: 18px; }
.print-logo-crop { flex: 0 0 58px; width: 58px; height: 58px; overflow: hidden; border-radius: 9px; }
.print-logo { display: block; width: 137px; max-width: none; height: auto; transform: translate(-40px, -39.5px); }
.print-title { min-width: 0; }
.print-kicker { display: block; margin-bottom: 3px; color: #19713c; font-size: 12px; font-weight: 850; letter-spacing: .11em; }
.print-header h1, .print-header p { margin: 0; }
.print-header h1 { font-size: 24px; line-height: 1.15; }
.print-header p, .print-header small { color: var(--gray-600); }
.print-document-meta { flex: 0 0 auto; min-width: 170px; text-align: right; }
.print-header strong, .print-header small { display: block; }
.print-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 12px 0; overflow: hidden; border: 1px solid var(--gray-200); border-radius: 6px; }
.print-summary div { min-width: 0; padding: 7px 9px; border-right: 1px solid var(--gray-200); border-bottom: 1px solid var(--gray-200); }
.print-summary div:nth-child(3n) { border-right: 0; }
.print-summary div:nth-last-child(-n+3) { border-bottom: 0; }
.print-summary dt { color: var(--gray-400); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.print-summary dd { margin: 3px 0 0; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.print-vehicle strong, .print-vehicle span { display: block; }
.print-vehicle span { margin-top: 2px; color: var(--gray-600); font-size: 12px; }
.print-document section { margin-top: 13px; }
.print-document section h2 { margin: 0 0 6px; font-size: 16px; }
.print-document section > p { white-space: pre-wrap; line-height: 1.4; }
.print-reason { padding: 8px 10px; border-left: 3px solid #d9ab22; background: #fffcf3; }
.print-reason h2 { margin-bottom: 3px !important; }
.print-reason p { margin: 0; font-size: 12px; }
.print-review-note { padding: 8px 10px; border-left: 3px solid var(--teal-600); background: #f3fbfa; }
.print-review-note h2 { margin-bottom: 3px !important; }
.print-review-note p { margin: 0; font-size: 12px; }
.print-document th, .print-document td small, .print-document .item-vendor, .print-document .badge { font-size: 12px; }
.print-attachment-page { margin-top: 38px !important; padding-top: 18px; border-top: 2px solid #165d31; }
.print-attachment-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.print-attachment-header h2 { margin: 0 !important; font-size: 18px !important; }
.print-attachment-header > div:last-child { text-align: right; }
.print-attachment-header strong, .print-attachment-header small { display: block; }
.print-attachment-header small { color: var(--gray-600); }
.print-attachment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 12px; min-height: 600px; }
.print-attachment-grid figure { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; margin: 0; overflow: hidden; border: 1px solid var(--gray-200); border-radius: 7px; }
.print-image-frame { display: grid; min-height: 0; padding: 6px; place-items: center; background: #f5f7f8; }
.print-image-frame img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.print-image-frame img.rotation-90 { transform: rotate(90deg) scale(var(--quarter-turn-scale, .59)); }
.print-image-frame img.rotation-180 { transform: rotate(180deg); }
.print-image-frame img.rotation-270 { transform: rotate(270deg) scale(var(--quarter-turn-scale, .59)); }
.print-attachment-grid figcaption { padding: 6px 8px; border-top: 1px solid var(--gray-200); }
.print-attachment-grid figcaption strong, .print-attachment-grid figcaption span { display: block; overflow-wrap: anywhere; }
.print-attachment-grid figcaption span { margin-top: 2px; color: var(--gray-600); font-size: 12px; }
.print-attachment-count-1 { --quarter-turn-scale: .72; grid-template-columns: minmax(0, 82%); grid-template-rows: minmax(0, 1fr); justify-content: center; }
.print-attachment-count-2 { --quarter-turn-scale: .83; grid-template-rows: minmax(0, 1fr); }
.print-attachment-count-3 { --quarter-turn-scale: .59; }
.print-attachment-count-3 figure:first-child { --quarter-turn-scale: .83; grid-row: 1 / 3; }
.print-attachment-count-4 { --quarter-turn-scale: .59; }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-admin { grid-template-columns: 1fr; }
  .create-user-panel { position: static; }
  .form-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
  .mini-stat-grid-5 { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-102%); visibility: hidden; width: 248px; transition: transform .2s ease, visibility .2s; box-shadow: 16px 0 45px rgba(7,28,45,.2); }
  body.nav-open { overflow: hidden; }
  body.nav-open .sidebar { transform: translateX(0); visibility: visible; }
  .sidebar-overlay { position: fixed; inset: 0; z-index: 15; display: block; visibility: hidden; opacity: 0; border: 0; background: rgba(7,28,45,.48); cursor: pointer; transition: opacity .2s ease, visibility .2s; }
  body.nav-open .sidebar-overlay { visibility: visible; opacity: 1; }
  .menu-button { display: inline-grid; width: 38px; height: 38px; place-items: center; border-radius: 9px; color: var(--navy-900); background: var(--gray-100); font-size: 18px; }
  .topbar { position: sticky; top: 0; z-index: 10; height: 70px; }
  .grid-two { grid-template-columns: 1fr; }
  .hero-card { align-items: flex-start; flex-direction: column; }
  .hero-status { width: 100%; }
  .page-actions, .form-submit-bar { align-items: stretch; flex-direction: column; }
  .form-submit-bar .action-stack { justify-content: flex-end; }
  .upload-form, .decision-form { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .content { padding: 18px 12px 40px; }
  .topbar { padding: 0 12px; }
  .topbar p { display: none; }
  .topbar h1 { font-size: 16px; }
  .logout-form .button { min-height: 35px; padding: 7px 10px; }
  .hero-card { padding: 21px; }
  .hero-card h2 { font-size: 24px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { padding: 15px; }
  .stat-card strong { font-size: 24px; }
  .panel { padding: 15px; border-radius: 12px; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .filter-bar input { grid-column: 1 / -1; }
  .filter-bar select { width: 100%; min-width: 0; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .span-all { grid-column: auto; }
  .mini-stat-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .mini-stat-grid-5 { grid-template-columns: repeat(2, 1fr); }
  .mini-stat { padding: 11px; }
  .mini-stat strong { font-size: 19px; }
  .form-submit-bar .action-stack { display: grid; grid-template-columns: 1fr; }
  .form-submit-bar .button { width: 100%; }
  .detail-list { grid-template-columns: 1fr; }
  .attachment-list li { grid-template-columns: 92px minmax(0, 1fr); align-items: center; }
  .attachment-thumbnail, .attachment-file-icon { width: 92px; height: 72px; }
  .attachment-tools { grid-column: 1 / -1; max-width: none; justify-content: flex-start; }
  .attachment-tool-row { justify-content: flex-start; }
  .attachment-order-form { align-items: stretch; flex-direction: column; }
  .attachment-order-form .button { width: 100%; }
  .decision-link { align-items: stretch; flex-direction: column; }
  .print-body { padding: 0; }
  .print-document { padding: 18px 12px; }
  .print-header { align-items: stretch; flex-direction: column; gap: 12px; }
  .print-brand { gap: 10px; }
  .print-logo-crop { flex-basis: 48px; width: 48px; height: 48px; }
  .print-logo { width: 114px; transform: translate(-33px, -33px); }
  .print-document-meta { min-width: 0; text-align: left; }
  .print-summary { grid-template-columns: 1fr 1fr; }
  .login-body { padding: 14px; }
  .login-card { padding: 25px 20px; }
}

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

@media print {
  @page { size: A4 landscape; margin: 9mm; }
  * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .print-body { padding: 0; background: #fff; }
  .print-document { width: 100%; padding: 0; box-shadow: none; }
  .print-toolbar { display: none; }
  .print-header { gap: 5mm; padding-bottom: 3mm; }
  .print-brand { gap: 4mm; }
  .print-logo-crop { flex-basis: 14mm; width: 14mm; height: 14mm; border-radius: 2mm; }
  .print-logo { width: 33.2mm; transform: translate(-9.65mm, -9.55mm); }
  .print-header h1 { font-size: 20px; }
  .print-document-meta { min-width: 39mm; }
  .print-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 3mm 0; }
  .print-summary div { padding: 1.5mm 2mm; }
  .print-document section { margin-top: 3mm; }
  .print-document table { font-size: 12px; }
  .print-document th, .print-document td { padding: 1.3mm 1.5mm; }
  .print-reason, .print-review-note { break-inside: avoid; }
  .print-items thead { display: table-header-group; }
  .print-items tr { break-inside: avoid; }
  .print-attachment-page { min-height: 189mm; margin: 0 !important; padding: 0; border-top: 0; break-before: page; page-break-before: always; break-inside: avoid; }
  .print-attachment-header { height: 15mm; margin: 0 0 3mm; padding-bottom: 2mm; border-bottom: 1px solid #165d31; }
  .print-attachment-grid { height: 166mm; min-height: 0; gap: 3mm; }
  .print-attachment-grid figure { border-radius: 1.5mm; break-inside: avoid; }
  .print-image-frame { padding: 1.5mm; }
  .print-attachment-grid figcaption { padding: 1.5mm 2mm; }
}
