/* ==========================================================================
   Samraat UI — design system for the Procurement-to-Asset platform.
   Brand: Samraat crimson + charcoal (from samraat-logo.jpeg).
   This file replaces app.css, samraat-theme.css, access.css and enterprise.css.
   Page-specific layout lives in the per-screen stylesheets.
   ========================================================================== */

:root {
  /* Brand */
  --brand: #b3222f;
  --brand-600: #9c1d29;
  --brand-700: #7f1721;
  --brand-50: #fdf3f4;
  --brand-100: #fae1e4;
  --brand-200: #f2bfc5;
  --charcoal: #4a4a4c;
  --charcoal-900: #2b2b2d;

  /* Neutrals */
  --ink: #1d2127;
  --ink-2: #3c424a;
  --muted: #6a717a;
  --subtle: #959ba3;
  --line: #e5e7eb;
  --line-strong: #d4d8de;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fa;
  --surface-3: #f1f2f4;

  /* Status */
  --success: #17794b; --success-bg: #e4f4eb; --success-line: #b9e2cb;
  --warning: #935c00; --warning-bg: #fff4d9; --warning-line: #f3dc9e;
  --danger: #b3222f;  --danger-bg: #fdecee;  --danger-line: #f4c3c8;
  --info: #24598a;    --info-bg: #e7f0f9;    --info-line: #bcd4ec;

  /* Shape & depth */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 6px 16px -4px rgba(16, 24, 40, .10), 0 2px 6px -2px rgba(16, 24, 40, .06);
  --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, .22);
  --ring: 0 0 0 3px rgba(179, 34, 47, .16);

  --sidebar-w: 280px;
  --topbar-h: 64px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;

  /* Legacy aliases still referenced by per-screen stylesheets */
  --samraat-red: var(--brand);
  --samraat-charcoal: var(--charcoal);
  --enterprise-red: var(--brand);
  --enterprise-ink: var(--ink);
  --enterprise-muted: var(--muted);
  --enterprise-border: var(--line);
  --blue: var(--brand);
  --navy: var(--charcoal-900);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
[hidden] { display: none !important; }
.hidden { display: none !important; }
.module-tab-hidden { display: none !important; }
.module-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.module-tabs button { margin: 0; background: white; color: var(--ink); border: 1px solid var(--line); }
.module-tabs button[aria-selected="true"] { background: var(--brand); color: white; border-color: var(--brand); }
@media print { .module-tab-hidden { display: block !important; } .module-tabs { display: none !important; } }
.pagination-off-page { display: none !important; }
.record-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 12px 0; }
.record-pagination > span { margin-right: auto; color: var(--muted); font-size: 12px; }
.record-pagination button { margin: 0; padding: 5px 10px; }
.record-pagination button[aria-current="page"] { background: var(--brand) !important; color: white !important; }
@media print { .pagination-off-page { display: revert !important; } .record-pagination { display: none !important; } }
[data-denied] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; }
h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; margin: 0 0 12px; }
h3 { font-size: 14px; font-weight: 650; margin: 18px 0 10px; }
p { margin: 0 0 12px; }
a { color: var(--brand); text-decoration: none; font-weight: 550; }
a:hover { color: var(--brand-700); text-decoration: underline; text-underline-offset: 3px; }
small { font-size: 12px; }
strong, b { font-weight: 650; }
pre {
  margin: 0; padding: 16px; overflow: auto; max-height: 520px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
  font: 12.5px/1.6 "Cascadia Code", Consolas, monospace; color: var(--ink-2); white-space: pre-wrap;
}
::selection { background: var(--brand-100); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 8px; color: var(--brand); font-size: 11px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 14px; height: 3px; border-radius: 2px; background: var(--brand); }
.muted { color: var(--muted); font-size: 13.5px; }
.required { color: var(--brand); }
.reason-highlight { background: var(--brand-50); border-left: 3px solid var(--brand); padding: 12px !important; font-weight: 650; }

/* ==========================================================================
   App shell
   ========================================================================== */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 50;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.sidebar-brand {
  display: block; padding: 22px 22px 18px;
  border-bottom: 1px solid var(--line);
  text-decoration: none !important;
}
.sidebar-brand img {
  display: block; width: 100%; max-width: 190px; height: auto;
}
.sidebar-brand span {
  display: flex; align-items: center; gap: 8px; margin-top: 12px; white-space: nowrap;
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.sidebar-brand span::before { content: ""; width: 18px; height: 3px; background: var(--brand); border-radius: 2px; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 10px 12px 18px; scrollbar-width: thin; }
.nav-group {
  display: block; margin: 18px 10px 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--subtle);
}
.sidebar nav a {
  position: relative; display: flex; align-items: center; gap: 11px;
  margin: 1px 0; padding: 8px 10px; border-radius: var(--radius);
  color: var(--ink-2); font-size: 13px; font-weight: 550; line-height: 1.3;
  text-decoration: none; transition: background .15s, color .15s;
}
.sidebar nav a:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.sidebar nav a.active { background: var(--brand-50); color: var(--brand-700); font-weight: 650; }
.sidebar nav a.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--brand);
}
.nav-icon { flex: none; width: 18px; height: 18px; color: var(--subtle); }
.sidebar nav a:hover .nav-icon { color: var(--ink-2); }
.sidebar nav a.active .nav-icon { color: var(--brand); }
.nav-label { flex: 1; min-width: 0; }
.nav-step {
  flex: none; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 6px; background: var(--surface-3); color: var(--muted);
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.sidebar nav a.active .nav-step { background: var(--brand); color: #fff; }
.sidebar-foot {
  padding: 14px 22px 18px; border-top: 1px solid var(--line);
  font-size: 11px; line-height: 1.5; color: var(--subtle);
}
.sidebar-scrim { display: none; }

main { margin-left: var(--sidebar-w); min-width: 0; min-height: 100vh; }
.page { max-width: 1640px; margin: 0 auto; padding: 28px 32px 56px; }

/* Top bar */
.session-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  height: var(--topbar-h); padding: 0 32px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-toggle { display: none !important; }
.global-search { position: relative; flex: 1; max-width: 520px; margin-right: auto; }
.global-search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--subtle); pointer-events: none; }
.global-search input {
  margin: 0; height: 40px; padding-left: 38px;
  background: var(--surface-2); border-color: var(--line);
}
.global-search input:focus { background: var(--surface); }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 80;
  width: min(520px, 86vw); max-height: 440px; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 6px;
}
.search-results a {
  display: block; padding: 10px 12px; border-radius: var(--radius);
  color: var(--ink); font-weight: 600; text-decoration: none;
}
.search-results a:hover { background: var(--brand-50); text-decoration: none; }
.search-results small {
  display: block; margin-bottom: 2px; color: var(--brand); font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.search-results p { margin: 0; padding: 14px; color: var(--muted); }

.icon-button, .session-bell {
  position: relative; display: inline-grid; place-items: center;
  width: 40px; height: 40px; margin: 0; padding: 0;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: none;
}
.icon-button:hover, .session-bell:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line-strong); }
.icon-button svg, .session-bell svg { width: 18px; height: 18px; }
#notification-count {
  position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px;
  display: grid; place-items: center; border: 2px solid var(--surface); border-radius: 99px;
  background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 1;
}
#notification-count[data-zero] { display: none; }
.topbar-divider { width: 1px; height: 28px; background: var(--line); margin: 0 4px; }
.session-user { display: flex; align-items: center; gap: 10px; }
.session-avatar {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-700)); color: #fff;
  font-size: 13px; font-weight: 700; letter-spacing: .02em;
}
.session-user-text { display: flex; flex-direction: column; line-height: 1.25; }
.session-user-text strong { font-size: 13.5px; color: var(--ink); }
.session-user-text small { font-size: 11.5px; color: var(--muted); }
.session-header form { margin: 0; }

/* ==========================================================================
   Page header
   ========================================================================== */
main header {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 20px;
  margin-bottom: 24px;
}
main header h1 + .muted, main header .muted { margin: 6px 0 0; max-width: 860px; }
main header > a, main header > button { flex: none; }
header.page-header { display: block; }
header.page-header .muted { margin-top: 6px; }

/* ==========================================================================
   Surfaces
   ========================================================================== */
.panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 20px 22px;
  margin-bottom: 20px;
}
.panel > h2:first-child { margin-top: 0; }
.panel > .muted:last-child, .panel > p:last-child { margin-bottom: 0; }

/* Section heading: full-bleed band at the top of a panel */
.section-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: -20px -22px 18px; padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}
.section-heading h2 { margin: 0; font-size: 16px; }
.section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.section-heading > div:first-child { display: flex; align-items: center; gap: 12px; min-width: 0; }
/* Extraction screen markup: number + h2 + p as siblings */
.extraction-panel .section-heading > div:first-child {
  display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center;
}
.extraction-panel .section-heading p { grid-column: 2; }
.section-heading button, .section-heading a { margin: 0; flex: none; }
.section-number {
  grid-row: 1 / span 2;
  display: grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--brand-50); color: var(--brand);
  border: 1px solid var(--brand-100);
  font-size: 14px; font-weight: 750;
}
.panel-heading {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  margin: -20px -22px 16px; padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}
.panel-heading h2 { margin: 0; font-size: 16px; }
.panel-heading > span {
  padding: 4px 10px; border-radius: 99px; background: var(--surface-3);
  color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase;
}
.panel-heading input { max-width: 320px; margin: 0; }
.panel-heading button, .panel-heading a { margin: 0; }

/* Simple grids */
.grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px; }
.po-grid, .request-form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.po-grid > .panel { margin-bottom: 0; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.cards article { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.cards p { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.cards strong { font-size: 18px; text-transform: capitalize; }

/* Notices & callouts */
.notice, .review-notice, .extract-help, .asset-note {
  padding: 12px 14px; border-radius: var(--radius);
  background: var(--brand-50); border: 1px solid var(--brand-100); border-left: 3px solid var(--brand);
  color: var(--ink-2); font-size: 13px; line-height: 1.6;
}
.notice { background: var(--info-bg); border-color: var(--info-line); border-left-color: var(--info); }
.provider-status {
  margin: 0 0 16px; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--line); border-left: 3px solid var(--subtle); background: var(--surface-2);
  font-size: 13px;
}
.provider-status.ready { border-color: var(--success-line); border-left-color: var(--success); background: var(--success-bg); color: #0f5134; }
.provider-status.not-ready { border-color: var(--danger-line); border-left-color: var(--danger); background: var(--danger-bg); color: var(--brand-700); }

/* ==========================================================================
   Forms
   ========================================================================== */
label { display: block; margin: 16px 0 0; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 9px 12px;
  font: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input, select { min-height: 40px; }
textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236a717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
input::placeholder, textarea::placeholder { color: var(--subtle); }
input:hover, select:hover, textarea:hover { border-color: #c2c7ce; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input[readonly], textarea[readonly] { background: var(--surface-2); color: var(--ink-2); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-3); color: var(--muted); cursor: not-allowed; }
input[type=checkbox], input[type=radio] {
  display: inline-block; width: 16px; height: 16px; min-height: 0; margin: 0 8px 0 0; padding: 0;
  vertical-align: -3px; accent-color: var(--brand); box-shadow: none; cursor: pointer;
}
input[type=file] { padding: 6px; cursor: pointer; }
input[type=file]::file-selector-button {
  margin-right: 12px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--surface-2); color: var(--ink-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
input[type=date] { min-width: 0; }
label:has(> input[type=checkbox]), label:has(> input[type=radio]) { font-weight: 550; cursor: pointer; }
fieldset { margin: 16px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); }
legend { padding: 0 6px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.form-result { min-height: 18px; margin: 10px 0 0; font-size: 13px; font-weight: 550; }
.form-result:empty { margin: 0; min-height: 0; }
.form-result.ok { color: var(--success); }
.form-result.error { color: var(--danger); }

/* ==========================================================================
   Buttons
   ========================================================================== */
button, .button-link, a.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; margin-top: 14px; padding: 8px 16px;
  font: inherit; font-size: 13.5px; font-weight: 600; line-height: 1.2; white-space: nowrap;
  color: #fff; background: var(--brand);
  border: 1px solid var(--brand); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(127, 23, 33, .18);
  cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
}
button:hover, .button-link:hover, a.button:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; text-decoration: none; }
button:active { background: var(--brand-700); }
button:focus-visible, a:focus-visible { outline: none; box-shadow: var(--ring); }
button:disabled, button:disabled:hover { opacity: .5; cursor: not-allowed; background: var(--brand); border-color: var(--brand); }

/* Secondary / outline */
.button-secondary, .secondary, button.secondary, .work-pagination button, .asset-pagination button,
#extract-rerun, #extract-manual, #review-save, #review-optional, #review-discard-proposal,
#store-cancel-post, #context-cancel-revision, [data-close-item], #refresh-items, #issue-report, #work-refresh, #approval-refresh {
  background: var(--surface) !important; color: var(--ink-2) !important;
  border: 1px solid var(--line-strong) !important; box-shadow: var(--shadow-xs) !important;
}
.button-secondary:hover, .secondary:hover, .work-pagination button:hover, .asset-pagination button:hover,
#extract-rerun:hover, #extract-manual:hover, #review-save:hover, #review-optional:hover, #review-discard-proposal:hover,
#store-cancel-post:hover, #context-cancel-revision:hover, [data-close-item]:hover, #refresh-items:hover, #issue-report:hover, #work-refresh:hover, #approval-refresh:hover {
  background: var(--surface-2) !important; color: var(--ink) !important; border-color: #c2c7ce !important;
}
.button-secondary:disabled, .secondary:disabled, .work-pagination button:disabled, .asset-pagination button:disabled { background: var(--surface) !important; }
a.button-secondary { display: inline-flex; align-items: center; min-height: 32px; margin: 0; padding: 5px 12px; font-size: 12.5px; font-weight: 600; border-radius: var(--radius); text-decoration: none; }

/* Danger outline */
#extract-delete, [data-document-delete], [data-master-delete], [data-remove], .sr-remove, [data-decision="REJECTED"] {
  background: var(--surface) !important; color: var(--danger) !important; border: 1px solid var(--danger-line) !important; box-shadow: none !important;
}
#extract-delete:hover, [data-decision="REJECTED"]:hover, .sr-remove:hover, [data-remove]:hover { background: var(--danger-bg) !important; }
/* Success */
[data-decision="APPROVED"], #context-confirm, #continue-approval, .sr-approve, [data-approve], [data-release-po] {
  background: var(--success) !important; border-color: var(--success) !important; color: #fff !important; box-shadow: 0 1px 2px rgba(23, 121, 75, .25) !important;
}
[data-decision="APPROVED"]:hover, #context-confirm:hover, #continue-approval:hover, .sr-approve:hover, [data-approve]:hover, [data-release-po]:hover { background: #12643d !important; border-color: #12643d !important; }
[data-decision="RETURNED"] { background: var(--surface) !important; color: var(--warning) !important; border: 1px solid var(--warning-line) !important; box-shadow: none !important; }
[data-decision="RETURNED"]:hover { background: var(--warning-bg) !important; }

/* Text link buttons */
.link-button, button.link-button {
  min-height: 0; margin: 0; padding: 4px 6px; border: 0 !important; border-radius: 6px;
  background: transparent !important; box-shadow: none !important;
  color: var(--brand) !important; font-size: 13px; font-weight: 600;
}
.link-button:hover { background: var(--brand-50) !important; color: var(--brand-700) !important; }
.link-button:disabled { background: transparent !important; }
.link-button[data-document-delete], .link-button[data-master-delete] { color: var(--danger) !important; border: 0 !important; }

/* Compact buttons inside tables */
td button, td .button-link, td a.button-secondary {
  min-height: 30px; margin: 2px 4px 2px 0; padding: 5px 11px; font-size: 12.5px; border-radius: 7px;
}
td .link-button { min-height: 0; padding: 3px 6px; margin: 0 2px 0 0; }

/* Close buttons */
.close, .modal-close, .drawer-heading button, .asset-drawer-head button {
  display: grid; place-items: center; width: 36px; height: 36px; min-height: 0; margin: 0; padding: 0 0 2px;
  background: transparent !important; color: var(--muted) !important; border: 0 !important; border-radius: 10px;
  box-shadow: none !important; font-size: 24px; font-weight: 400; line-height: 1;
}
.close:hover, .modal-close:hover, .drawer-heading button:hover, .asset-drawer-head button:hover { background: var(--surface-3) !important; color: var(--ink) !important; }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-panel, .table-wrap, .work-table, .detail-table, .asset-table-wrap { overflow: auto; }
.panel.table-panel { overflow: visible; }
.panel > .table-wrap + .muted, .panel > p.muted + .table-wrap { margin-top: 0; }
.table-wrap, .work-table > table, .detail-table, .asset-table-wrap, #approval-list > table, .request-materials .table-panel,
.panel > .table-panel:not(.panel), .extraction-panel .table-panel, .enterprise-drawer .table-panel, .modal-box .table-panel {
  border: 1px solid var(--line); border-radius: var(--radius);
}
table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 0; font-size: 13px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); }
th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-2); color: var(--muted);
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
}
td { vertical-align: middle; color: var(--ink-2); }
td strong { color: var(--ink); }
td > a { white-space: nowrap; }
td small { color: var(--muted); }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: #fbf7f7; }
tbody tr:last-child td { border-bottom: 0; }
.panel.table-panel > table, .panel > table { border: 1px solid var(--line); border-radius: var(--radius); }
td[colspan], .empty, .asset-empty {
  padding: 36px 16px !important; text-align: center; color: var(--muted) !important; background: transparent !important;
}
td input, td select { min-height: 34px; margin: 0; padding: 6px 10px; }
td input[type=checkbox] { margin: 0; }

/* ==========================================================================
   Status pills  (tone is assigned by ui.js from the status text)
   ========================================================================== */
.status, .badge, .type-badge, .severity, .count-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 99px; white-space: nowrap;
  font-size: 11px; font-weight: 700; letter-spacing: .02em; line-height: 1.6; text-transform: uppercase;
  background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--line);
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.type-badge { text-transform: none; font-weight: 650; }
[data-tone=success] { background: var(--success-bg); color: var(--success); border-color: var(--success-line); }
[data-tone=warning] { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-line); }
[data-tone=danger] { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
[data-tone=info] { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.badge.neutral { background: var(--surface-3); }
.badge.success { background: var(--success-bg); color: var(--success); border-color: var(--success-line); }
.badge.warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-line); }
.severity { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); font-size: 10px; padding: 1px 8px; }
.count-pill { min-width: 26px; justify-content: center; padding: 2px 8px; background: var(--brand-50); color: var(--brand); border-color: var(--brand-100); }
.state { font-size: 11px; color: var(--brand); font-weight: 700; }
.file-link { display: inline-flex; align-items: center; gap: 5px; color: var(--brand); font-weight: 600; }

/* ==========================================================================
   Tabs, pagination, empty states
   ========================================================================== */
.work-tabs, .document-tabs {
  display: inline-flex; flex-wrap: wrap; gap: 4px; margin: 0 0 16px; padding: 4px;
  background: var(--surface-3); border-radius: 10px;
}
.work-tabs button, .document-tab, button.document-tab {
  min-height: 32px; margin: 0; padding: 6px 14px;
  background: transparent !important; color: var(--muted) !important; border: 0 !important; border-radius: 7px;
  box-shadow: none !important; font-size: 13px; font-weight: 600;
}
.work-tabs button:hover, .document-tab:hover { color: var(--ink) !important; }
.work-tabs button.active, .document-tab.active {
  background: var(--surface) !important; color: var(--brand) !important; box-shadow: var(--shadow-sm) !important;
}
#work-search, #approval-search { margin: 0 0 14px; max-width: 420px; }
.work-pagination, .asset-pagination {
  display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding-top: 14px;
  color: var(--muted); font-size: 12.5px;
}
.work-pagination button, .work-pagination a, .asset-pagination button { min-height: 32px; margin: 0; padding: 5px 12px; font-size: 12.5px; }
.work-pagination a { padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.work-empty, .empty-state {
  margin: 0; padding: 36px 16px; text-align: center; color: var(--muted); font-size: 13px;
}
.work-empty::before {
  content: "✓"; display: grid; place-items: center; width: 40px; height: 40px; margin: 0 auto 10px;
  border-radius: 50%; background: var(--success-bg); color: var(--success); font-size: 18px; font-weight: 700;
}

/* ==========================================================================
   Modals, drawers, toast
   ========================================================================== */
.modal, .sr-modal, .issue-modal, .asset-drawer {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px;
  background: rgba(22, 24, 29, .52); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: ui-fade .16s ease-out;
}
.modal.hidden { display: none !important; }
.modal-box, .sr-modal-card, .issue-modal-card {
  position: relative; width: min(780px, 100%); max-height: calc(100vh - 48px); overflow: auto;
  padding: 24px 26px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  animation: ui-rise .2s ease-out;
}
.modal-box > h2:first-of-type, .sr-modal-card > h2, .issue-modal-card > h2 {
  margin: -24px -26px 20px; padding: 20px 64px 18px 26px; font-size: 18px;
  border-bottom: 1px solid var(--line);
}
.modal-box .close, .sr-modal-card .modal-close, .issue-modal-card .modal-close { position: absolute; top: 14px; right: 14px; z-index: 2; }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin: 22px -26px -24px; padding: 14px 26px; background: var(--surface-2); border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}
.modal-actions button { margin: 0; }

.enterprise-drawer {
  box-sizing: border-box; width: min(560px, 100vw); max-width: 100vw; height: 100vh; max-height: 100vh;
  margin: 0 0 0 auto; padding: 0 26px 26px; border: 0; border-left: 1px solid var(--line); border-radius: 0;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
}
.enterprise-drawer[open] { animation: ui-slide .22s ease-out; }
.enterprise-drawer::backdrop { background: rgba(22, 24, 29, .45); backdrop-filter: blur(2px); }
.drawer-heading {
  position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between;
  margin: 0 -26px 8px; padding: 20px 26px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.drawer-heading h2 { margin: 2px 0 0; font-size: 19px; }
.drawer-heading .eyebrow { margin: 0; }
.drawer-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 16px 0; }
.drawer-actions button { margin: 0; }
.enterprise-drawer h3 {
  margin: 24px 0 10px; padding: 0; background: none;
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.enterprise-drawer .workspace-row {
  display: grid; grid-template-columns: minmax(130px, 1fr) 2fr; gap: 16px;
  padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px;
}
.enterprise-drawer .workspace-row span { text-transform: capitalize; color: var(--muted); }
.enterprise-drawer strong { overflow-wrap: anywhere; }
.enterprise-drawer table { min-width: 600px; }
.enterprise-drawer td { max-width: 320px; overflow-wrap: anywhere; }
.enterprise-drawer input[type=radio] { width: 16px; }
#approval-attachments a {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 8px 8px 0; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); font-size: 13px;
}
#approval-error, #review-error, #login-error { color: var(--danger); font-weight: 550; }

.notice-card {
  margin-bottom: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); transition: border-color .15s;
}
.notice-card:hover { border-color: var(--line-strong); }
.notice-card.unread { border-left: 3px solid var(--brand); background: var(--brand-50); border-color: var(--brand-100); }
.notice-card strong { font-size: 13.5px; }
.notice-card small { display: block; margin: 4px 0 0; color: var(--muted); }
.notice-card footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.notice-card footer button { min-height: 0; margin: 0; padding: 0; background: transparent !important; border: 0 !important; box-shadow: none !important; color: var(--brand) !important; font-size: 12.5px; }
.notice-card footer span { font-size: 12px; color: var(--subtle); }

#app-toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 2000; max-width: 420px;
  display: flex; align-items: center; gap: 10px; padding: 14px 18px;
  background: var(--charcoal-900); color: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  font-size: 13.5px; font-weight: 550; animation: ui-rise .2s ease-out;
}
#app-toast::before { content: ""; width: 8px; height: 8px; flex: none; border-radius: 50%; background: #4ade80; }

.timeline-row { position: relative; margin-left: 6px; padding: 0 0 18px 20px; border-left: 2px solid var(--line); font-size: 13px; }
.timeline-row::before { content: ""; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); }
.timeline-row:last-child { padding-bottom: 4px; }
.timeline-row strong, .timeline-row small { display: block; }
.timeline-row small { color: var(--muted); margin: 2px 0 6px; }

@keyframes ui-fade { from { opacity: 0; } }
@keyframes ui-rise { from { opacity: 0; transform: translateY(8px) scale(.99); } }
@keyframes ui-slide { from { transform: translateX(24px); opacity: .4; } }

/* ==========================================================================
   Detail layouts (definition lists rendered by the screens)
   ========================================================================== */
.detail-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-columns h3, .extracted-detail-box h3 { margin: 16px 0 8px; }
.detail-grid {
  display: grid; grid-template-columns: 140px 1fr; gap: 0; margin: 0; font-size: 13px;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.detail-grid dt, .detail-grid dd { margin: 0; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.detail-grid dt { font-weight: 600; color: var(--muted); background: var(--surface-2); }
.detail-grid dd { color: var(--ink); overflow-wrap: anywhere; }
.detail-grid dt:nth-last-of-type(1), .detail-grid dd:last-of-type { border-bottom: 0; }

/* ==========================================================================
   Workspace / Command center
   ========================================================================== */
.work-topline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.work-topline .eyebrow { margin: 0; }
.work-topline time {
  padding: 5px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface);
  color: var(--muted); font-size: 12.5px; font-weight: 550;
}
#work-center > h1 { margin-top: 10px; }
#work-center > .muted { margin: 6px 0 0; }
.work-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); gap: 12px; margin: 24px 0; }
.metric-tile {
  position: relative; display: block; overflow: hidden;
  padding: 18px 18px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs); color: var(--ink); text-decoration: none !important;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.metric-tile::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--brand); }
.metric-tile::after {
  content: "→"; position: absolute; right: 16px; top: 16px; color: var(--subtle); font-size: 15px; transition: transform .15s, color .15s;
}
.metric-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--brand-200); color: var(--ink); }
.metric-tile:hover::after { color: var(--brand); transform: translateX(3px); }
.metric-tile strong { display: block; margin: 0 0 4px; font-size: 30px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.metric-tile span { font-size: 12.5px; font-weight: 550; color: var(--muted); }
.work-columns { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.work-columns > aside > .panel { margin-bottom: 16px; }
.work-quick { display: grid; gap: 8px; }
.work-quick a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-2); color: var(--ink-2); font-size: 13px; font-weight: 600; text-decoration: none;
  transition: all .15s;
}
.work-quick a:hover { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }
#work-attention p { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
#work-attention p:last-child { border: 0; }
#work-limitations p { font-size: 12.5px; }

.workspace-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.workspace-card {
  position: relative; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs); color: var(--ink-2); text-decoration: none !important; transition: transform .15s, box-shadow .15s;
}
.workspace-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; border-radius: 3px 0 0 3px; background: var(--brand); }
.workspace-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.workspace-card strong { display: block; margin-bottom: 4px; font-size: 28px; color: var(--ink); }
.workspace-row { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.workspace-row:last-child { border-bottom: 0; }
.quick-links { display: flex; flex-wrap: wrap; gap: 10px; }
.quick-links a {
  padding: 10px 16px; border: 1px solid var(--brand-100); border-radius: var(--radius);
  background: var(--brand-50); color: var(--brand-700); font-weight: 600; text-decoration: none;
}
.quick-links a:hover { background: var(--brand); color: #fff; }
.activity-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border: 0; }
.activity-item b { font-size: 13px; }
.activity-item p { margin: 4px 0 0; font-size: 13.5px; }
.scope { padding-left: 20px; line-height: 2; color: var(--ink-2); font-size: 14px; }

/* ==========================================================================
   Step 1 · AI extraction
   ========================================================================== */
.extraction-screen { max-width: 1600px; }
.upload-document-form {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: end;
  margin: -18px -22px 18px; padding: 16px 22px; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.upload-document-form label, .upload-document-form button { margin: 0; }
.upload-document-form .form-result { grid-column: 1 / -1; }
.extraction-panel table { min-width: 1080px; }
.extraction-panel th, .extraction-panel td { white-space: nowrap; }
.extraction-panel td:nth-child(2), .extraction-panel td:nth-child(4) { white-space: normal; min-width: 210px; }
.extraction-panel .table-panel + .muted:not(:empty) { margin: 12px 0 0; }
.extract-action { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(300px, 1.2fr); gap: 18px; align-items: end; }
.extract-action > label { margin: 0; }
.extract-action > div:last-child { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 4px; }
.extract-action > div:last-child button { margin: 0; }
.extract-action > div:last-child .form-result { flex-basis: 100%; }
.extraction-options { flex-basis: 100%; }
.extraction-options summary { width: fit-content; cursor: pointer; color: var(--muted); padding: 6px 0; font-weight: 600; }
.extraction-options-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 8px; }
.extract-help b, .extract-help span { display: block; }
.extract-help b { color: var(--ink); }
.extract-help span { margin-top: 3px; color: var(--ink-2); }
.extracted-detail-box { width: min(1100px, 100%); }
.detail-table table { min-width: 800px; }

/* Extraction review */
#review-document .panel > h2 { margin-bottom: 8px; }
#review-summary { font-size: 13.5px; }
#review-attention { line-height: 1.7; margin: 0; }
#review-fields .status { white-space: nowrap; }
#review-fields .link-button { display: inline-flex; margin: 6px 8px 0 0; }
#review-fields td { max-width: 280px; overflow-wrap: anywhere; }
#review-fields td:nth-child(4) { min-width: 70px; }
#review-fields input, #review-fields select { min-width: 190px; width: 100%; }
#review-fields input:disabled, #review-fields select:disabled { color: var(--muted); background: var(--surface-3); }
#review-fields details { font-size: 12px; line-height: 1.5; }
#review-fields tr[data-attention="true"] td { background: #fff8f0; }
#review-fields tr[data-attention="true"] td:first-child { box-shadow: inset 3px 0 0 var(--warning); }
#review-document button:disabled { cursor: not-allowed; }
#review-confirm { width: 16px; }
#review-items input, #review-items select { min-width: 110px; }
.review-bulk-options { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 14px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.review-bulk-options label { margin: 0; }
#review-assistant { border-color: var(--info-line); background: linear-gradient(180deg, #f7fafd, var(--surface) 60%); }
#review-proposal { margin-top: 14px; padding: 14px; border: 1px dashed var(--info-line); border-radius: var(--radius); background: var(--info-bg); }
#review-proposal button { margin: 8px 8px 0 0; }

/* ==========================================================================
   Step 2 · Issue request
   ========================================================================== */
.issue-request-screen { max-width: 1600px; }
.request-panel .panel-heading { align-items: center; }
.request-panel > form > label:first-child { margin-top: 0; }
.master-summary { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); overflow: hidden; }
.master-summary-title {
  padding: 9px 14px; background: var(--brand-50); border-bottom: 1px solid var(--brand-100);
  color: var(--brand-700); font-size: 11px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase;
}
.master-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 20px; padding: 14px; }
.master-summary-grid div { display: grid; grid-template-columns: 130px 1fr; gap: 8px; font-size: 12.5px; }
.master-summary-grid b { color: var(--muted); font-weight: 600; }
.master-summary-grid span { color: var(--ink); }
.request-materials { margin-top: 22px; }
.request-materials h3 { margin: 0 0 10px; font-size: 14px; }
.request-materials table, .request-panel > .table-wrap > table { min-width: 1100px; }
.request-materials th, .request-materials td { white-space: nowrap; padding: 9px 10px; font-size: 12.5px; }
.request-materials td:nth-child(4), .request-materials td:nth-child(5) { white-space: normal; min-width: 160px; }
.request-materials .required-quantity { min-width: 110px; }
.request-transaction-fields { display: grid; grid-template-columns: 1.3fr .7fr .8fr; gap: 0 18px; margin-top: 18px; }
.request-transaction-fields label { margin: 0 0 14px; }
.request-transaction-fields .reason-field { grid-column: 2 / span 2; }
.request-detail-box { width: min(1160px, 100%); }
.request-detail-sections { display: grid; grid-template-columns: 1fr 1.25fr; gap: 22px; }
.request-detail-sections h3, .request-detail-box > h3 { margin: 16px 0 10px; font-size: 15px; }
.item-choices { border-top: 1px solid var(--line); padding-top: 10px; }
.item-choice { display: flex; align-items: end; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.item-choice label { flex: 1; margin: 0; }
.item-choice small { display: block; color: var(--muted); margin: 5px 0 0 27px; }
.item-choice .requested-qty { width: 180px; margin: 0; }

/* ==========================================================================
   Misc legacy screens (governance, price revision, activity, availability)
   ========================================================================== */
.po-grid > .panel > input, .po-grid > .panel > select { margin-top: 10px; }
.po-grid > .panel > h2 { margin-bottom: 4px; }
.panel > form[method=get] { display: flex; gap: 12px; align-items: end; margin-bottom: 16px; }
.panel > form[method=get] label { flex: 1; max-width: 420px; margin: 0; }
.panel > form[method=get] button { margin: 0; }
#availability-search { max-width: 480px; }
.install-form { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 0 16px; align-items: start; }
.install-form > h2, .install-form > label:nth-of-type(4), .install-form > button, .install-form > .form-result { grid-column: 1 / -1; }
.install-form > label { margin-top: 0; margin-bottom: 14px; }
.install-form > button { justify-self: start; margin-top: 4px; }
@media (max-width: 900px) { .install-form { grid-template-columns: 1fr; } }
section.panel > a[href="/site-requisition-material-issue"] {
  display: inline-flex; margin-top: 16px; padding: 9px 16px; border-radius: var(--radius);
  background: var(--brand); color: #fff; text-decoration: none;
}

/* ==========================================================================
   Login
   ========================================================================== */
.login-page {
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr);
  background: var(--surface);
}
.login-hero {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px 56px; color: #fff;
  background:
    radial-gradient(1200px 520px at 110% -10%, rgba(179, 34, 47, .38), transparent 60%),
    radial-gradient(700px 380px at -10% 110%, rgba(179, 34, 47, .22), transparent 60%),
    linear-gradient(160deg, #3b3b3e 0%, #2a2a2c 55%, #1f1f21 100%);
}
.login-hero::after { /* subtle grid texture */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
.login-hero > * { position: relative; z-index: 1; }
.login-mark { display: flex; flex-direction: column; gap: 9px; width: 64px; }
.login-mark i { display: block; height: 14px; border-radius: 2px; }
.login-mark i:nth-child(1) { background: var(--brand); width: 64px; height: 30px; clip-path: polygon(0 0, 100% 0, 100% 30%, 28% 30%, 28% 70%, 100% 70%, 100% 100%, 0 100%); }
.login-mark i:nth-child(2) { background: #8a8a8d; width: 64px; height: 9px; }
.login-hero h2 { max-width: 520px; margin: 0 0 16px; color: #fff; font-size: 38px; font-weight: 700; line-height: 1.15; letter-spacing: -.025em; }
.login-hero h2 em { font-style: normal; color: #ff8d97; }
.login-hero p { max-width: 470px; margin: 0; color: #c9c9cc; font-size: 15px; line-height: 1.65; }
.login-flow { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; max-width: 560px; }
.login-flow li {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 99px; background: rgba(255,255,255,.05);
  color: #e6e6e8; font-size: 12.5px; font-weight: 550;
}
.login-flow li b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 10.5px; }
.login-hero-foot { color: #9a9a9e; font-size: 12px; letter-spacing: .02em; }
.login-panel { display: grid; place-items: center; padding: 48px 24px; background: var(--bg); }
.login-page main { margin-left: 0; min-height: 0; }
.login-card {
  width: min(420px, 100%); padding: 36px 36px 30px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow-md);
}
.login-logo { display: block; width: 220px; max-width: 100%; height: auto; }
.login-subtitle {
  display: flex; align-items: center; gap: 8px; margin: 12px 0 0;
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.login-subtitle::before { content: ""; width: 18px; height: 3px; border-radius: 2px; background: var(--brand); }
.login-card h1 { margin: 30px 0 4px; font-size: 24px; }
.login-card > p { color: var(--muted); margin: 0 0 6px; }
.login-card label { margin-top: 18px; font-size: 13px; }
.login-field { position: relative; display: block; margin-top: 6px; }
.login-field input { margin: 0; }
.login-field > svg { position: absolute; left: 13px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--subtle); pointer-events: none; }
.login-field input { min-height: 46px; padding-left: 40px; font-size: 14px; }
.login-field input[type=password], .login-field input[name=password] { padding-right: 64px; }
.pw-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  padding: 5px 9px; border-radius: 6px; color: var(--muted); font-size: 12px; font-weight: 650; cursor: pointer; user-select: none;
}
.pw-toggle:hover, .pw-toggle:focus-visible { background: var(--surface-3); color: var(--ink); outline: none; }
.login-card button[type=submit] { width: 100%; min-height: 46px; margin-top: 26px; font-size: 14.5px; }
#login-error { min-height: 20px; margin: 12px 0 0; font-size: 13px; }
.login-card-foot { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 12px; text-align: center; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1200px) {
  .work-columns { grid-template-columns: minmax(0, 1fr); }
  .master-summary-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(22, 24, 29, .45); }
  main { margin-left: 0; }
  .nav-toggle { display: inline-grid !important; }
  .session-header { padding: 0 20px; }
  .page { padding: 22px 20px 48px; }
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none; }
}
@media (max-width: 900px) {
  .grid, .po-grid, .request-form, .detail-columns, .request-detail-sections, .extract-action, .upload-document-form { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr 1fr; }
  .request-transaction-fields { grid-template-columns: 1fr; }
  .request-transaction-fields .reason-field { grid-column: auto; }
  .master-summary-grid { grid-template-columns: 1fr; }
  .master-summary-grid div { grid-template-columns: 145px 1fr; }
  .section-heading { flex-wrap: wrap; }
  main header { flex-direction: column; align-items: stretch; }
}
@media (max-width: 640px) {
  .session-user-text, .topbar-divider { display: none; }
  .session-header { gap: 8px; padding: 0 14px; }
  .page { padding: 18px 14px 40px; }
  h1 { font-size: 22px; }
  .panel { padding: 16px; }
  .section-heading, .panel-heading { margin: -16px -16px 16px; padding: 14px 16px; }
  .upload-document-form { margin: -16px -16px 16px; padding: 14px 16px; }
  .cards { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid dt { border-bottom: 0; padding-bottom: 2px; }
  .modal, .sr-modal, .issue-modal { padding: 10px; }
  .modal-box, .sr-modal-card, .issue-modal-card { padding: 20px 18px; }
  .modal-box > h2:first-of-type, .sr-modal-card > h2, .issue-modal-card > h2 { margin: -20px -18px 18px; padding: 16px 56px 14px 18px; }
  .modal-actions { margin: 20px -18px -20px; padding: 12px 18px; }
  .work-metrics { grid-template-columns: repeat(2, 1fr); }
  .work-tabs, .document-tabs { display: flex; flex-wrap: nowrap; }
  .work-tabs button, .document-tab { flex: 1 1 auto; padding: 6px 8px; font-size: 12px; white-space: nowrap; }
  .grid > *, .po-grid > *, .work-columns > * { min-width: 0; }
  .item-choice { align-items: stretch; flex-direction: column; }
  .item-choice .requested-qty { width: 100%; }
  .login-card { padding: 28px 22px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.request-transaction-fields .reason-field { grid-column: 1 / -1; }

.indent-edit-banner { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 14px; padding: 12px 14px; border: 1px solid #fecdca; border-left: 3px solid #b42318; border-radius: 10px; background: #fff6f5; font-size: 13px; }
.indent-edit-banner div { display: flex; flex-direction: column; gap: 3px; }
.indent-edit-banner strong { color: #b42318; }
.indent-edit-banner button { margin: 0; }
.return-note { display: block; max-width: 260px; white-space: normal; color: #b42318; font-size: 11.5px; margin-top: 3px; }

.approval-flag { margin: 0 0 12px; padding: 10px 12px; border: 1px solid #fecdca; border-left: 3px solid #b42318; border-radius: 8px; background: #fff6f5; color: #b42318; font-size: 13px; font-weight: 600; line-height: 1.45; }
