:root {
  --navy: #12364d;
  --navy-2: #0d4966;
  --teal: #008c86;
  --teal-dark: #006f6a;
  --orange: #f39c4a;
  --ink: #17313f;
  --muted: #687b86;
  --line: #d7e1e6;
  --bg: #f4f7f9;
  --white: #fff;
  --pale-blue: #eaf4f8;
  --pale-teal: #e9f7f5;
  --pale-orange: #fff4e6;
  --danger: #c93d3d;
  --shadow: 0 12px 36px rgba(15, 43, 59, .08);
  --sidebar: 252px;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font-family: Arial, Helvetica, sans-serif; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.activation-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(380px, 540px) minmax(360px, 1fr);
  background: linear-gradient(135deg, #f7fbfc 0%, #eef6f7 48%, #dcebed 100%);
}
.activation-card { padding: clamp(42px, 7vw, 88px); display: flex; flex-direction: column; justify-content: center; }
.brand-lockup { display: flex; align-items: center; gap: 12px; color: var(--white); }
.brand-lockup.large { color: var(--navy); margin-bottom: 64px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; background: var(--teal); color: #fff; font-weight: 800; letter-spacing: -.04em; box-shadow: 0 8px 20px rgba(0, 140, 134, .24); }
.brand-lockup.large .brand-mark { width: 52px; height: 52px; font-size: 19px; }
.brand-lockup strong, .brand-lockup small { display: block; }
.brand-lockup strong { font-size: 13px; letter-spacing: .06em; }
.brand-lockup small { color: rgba(255,255,255,.66); font-size: 11px; margin-top: 3px; }
.brand-lockup.large strong { font-size: 15px; }
.brand-lockup.large small { color: var(--muted); font-size: 12px; }
.activation-copy h1 { margin: 8px 0 14px; font-size: clamp(32px, 4vw, 50px); line-height: 1.06; letter-spacing: -.045em; color: var(--navy); }
.activation-copy p { color: var(--muted); line-height: 1.6; font-size: 15px; max-width: 480px; }
.eyebrow { display: inline-block; color: var(--teal); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.stack-form { margin-top: 26px; display: grid; gap: 12px; }
label { color: #405662; font-size: 12px; font-weight: 700; }
input, select { width: 100%; margin-top: 7px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); padding: 11px 12px; outline: none; }
input:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0, 140, 134, .12); }
.stack-form input { padding: 15px 16px; font-size: 16px; letter-spacing: .08em; text-transform: uppercase; }
.button { border: 0; border-radius: 8px; padding: 12px 18px; font-weight: 750; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--teal); color: #fff; box-shadow: 0 7px 16px rgba(0,140,134,.18); }
.button.primary:hover { background: var(--teal-dark); }
.button.secondary { background: var(--pale-blue); color: var(--navy-2); border: 1px solid #c5dce5; }
.button.ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.button.compact { padding: 9px 13px; font-size: 12px; }
.button.full { width: 100%; margin-top: 16px; }
.form-message { min-height: 22px; margin: 12px 0 0; font-size: 13px; color: var(--danger); }
.activation-note { margin-top: 14px; font-size: 12px; color: var(--muted); background: rgba(255,255,255,.8); border: 1px dashed #bfd2da; padding: 11px 13px; border-radius: 8px; }
.activation-visual { position: relative; overflow: hidden; display: grid; place-items: center; background: linear-gradient(150deg, var(--navy), #0d526b 60%, #087b77); }
.activation-visual::before, .activation-visual::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.05); }
.activation-visual::before { width: 460px; height: 460px; top: -180px; right: -110px; }
.activation-visual::after { width: 360px; height: 360px; bottom: -170px; left: -90px; }
.visual-sheet { width: min(73%, 720px); aspect-ratio: 1.2; background: #fff; border-radius: 15px; padding: 18px; transform: rotate(-3deg); box-shadow: 0 40px 90px rgba(0,0,0,.28); }
.visual-toolbar { height: 38px; border-radius: 8px; background: var(--navy); margin-bottom: 16px; }
.visual-kpis { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 14px; }
.visual-kpis i { height: 56px; border-radius: 8px; background: var(--pale-teal); border-left: 5px solid var(--teal); }
.visual-grid { height: calc(100% - 124px); background: repeating-linear-gradient(0deg, transparent 0 25px, #dce5e9 26px), repeating-linear-gradient(90deg, transparent 0 98px, #dce5e9 99px); border: 1px solid #dce5e9; }
.floating-chip { position: absolute; z-index: 2; background: #fff; color: var(--navy); border-radius: 999px; padding: 11px 16px; font-size: 12px; font-weight: 800; box-shadow: var(--shadow); }
.chip-one { left: 10%; top: 22%; }
.chip-two { right: 8%; bottom: 24%; }

.app-shell { min-height: 100vh; background: var(--bg); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar); background: var(--navy); padding: 24px 18px; display: flex; flex-direction: column; box-shadow: 7px 0 24px rgba(15, 43, 59, .06); }
.main-nav { display: grid; gap: 7px; margin-top: 42px; }
.nav-item { width: 100%; border: 0; background: transparent; color: rgba(255,255,255,.7); display: flex; align-items: center; gap: 12px; padding: 12px 13px; border-radius: 9px; text-align: left; font-size: 13px; font-weight: 700; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--teal); color: #fff; box-shadow: 0 9px 20px rgba(0,0,0,.14); }
.nav-icon { font-size: 9px; border: 1px solid currentColor; border-radius: 4px; padding: 3px 4px; opacity: .8; }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding-top: 18px; }
.license-mini { display: flex; align-items: center; gap: 10px; color: #fff; }
.license-mini b, .license-mini small { display: block; }
.license-mini b { font-size: 11px; }
.license-mini small { color: rgba(255,255,255,.62); font-size: 10px; margin-top: 3px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #39d18c; box-shadow: 0 0 0 5px rgba(57,209,140,.12); }
.text-button { border: 0; padding: 0; background: transparent; color: var(--teal); font-weight: 800; font-size: 12px; }
.sidebar .text-button { color: rgba(255,255,255,.68); margin: 15px 0 0 19px; }

.main-content { margin-left: var(--sidebar); min-height: 100vh; }
.topbar { height: 72px; background: #fff; border-bottom: 1px solid var(--line); padding: 0 30px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; }
.project-heading { min-width: 0; flex: 1; }
.project-heading .crumb { display: block; font-size: 9px; letter-spacing: .12em; font-weight: 800; color: var(--muted); }
.project-heading input { border: 0; padding: 2px 0; margin: 4px 0 0; font-size: 15px; font-weight: 800; color: var(--navy); max-width: 500px; border-radius: 0; }
.project-heading input:focus { box-shadow: none; border-bottom: 1px solid var(--teal); }
.top-actions, .page-actions { display: flex; align-items: center; gap: 9px; }
.save-state { color: var(--muted); font-size: 11px; margin-right: 8px; }
.icon-button { border: 0; background: #f0f5f7; color: var(--navy); width: 36px; height: 36px; border-radius: 8px; font-size: 22px; display: grid; place-items: center; }
.menu-button { display: none; margin-right: 10px; }

.view { display: none; padding: 31px 34px 46px; max-width: 1700px; margin: 0 auto; }
.view.active { display: block; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 23px; }
.page-head h1 { margin: 5px 0 6px; font-size: clamp(25px, 2.6vw, 36px); line-height: 1.14; letter-spacing: -.035em; color: var(--navy); }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.province-badge { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--teal); padding: 12px 16px; border-radius: 9px; min-width: 180px; }
.province-badge span, .province-badge small { display: block; }
.province-badge span { font-weight: 800; color: var(--navy); }
.province-badge small { margin-top: 4px; color: var(--muted); font-size: 10px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 16px; }
.kpi-card { position: relative; overflow: hidden; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--navy-2); border-radius: 11px; padding: 18px; box-shadow: 0 4px 12px rgba(15,43,59,.035); }
.kpi-card.teal { border-top-color: var(--teal); }
.kpi-card.orange { border-top-color: var(--orange); }
.kpi-card.danger { border-top-color: var(--danger); background: #fffafa; }
.kpi-card span, .kpi-card small { display: block; }
.kpi-card span { color: var(--muted); font-size: 11px; font-weight: 750; }
.kpi-card strong { display: block; margin: 11px 0 8px; color: var(--navy); font-size: clamp(20px, 2vw, 28px); letter-spacing: -.04em; }
.kpi-card small { color: #82919a; font-size: 10px; line-height: 1.4; }

.dashboard-grid { display: grid; grid-template-columns: 1.3fr 1fr .8fr; gap: 16px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 20px; box-shadow: 0 4px 13px rgba(15,43,59,.035); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 18px; }
.panel-head h2 { margin: 0 0 4px; color: var(--navy); font-size: 17px; }
.panel-head p { margin: 0; color: var(--muted); font-size: 11px; }
.cost-bars { min-height: 198px; display: grid; align-content: center; gap: 12px; }
.cost-bars.empty-state { color: var(--muted); font-size: 13px; background: repeating-linear-gradient(135deg,#fafcfd 0 10px,#f5f8fa 10px 20px); border: 1px dashed #c8d5db; border-radius: 8px; place-items: center; }
.bar-row { display: grid; grid-template-columns: 180px 1fr 126px; align-items: center; gap: 12px; font-size: 11px; }
.bar-row label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; background: #e9eff2; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--teal); }
.bar-row strong { text-align: right; color: var(--navy); }
.check-list { margin: 2px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.check-list li { position: relative; padding: 12px 12px 12px 38px; background: #f8fafb; border-radius: 8px; color: #425a67; font-size: 12px; line-height: 1.45; }
.check-list li::before { content: attr(data-index); position: absolute; left: 11px; top: 12px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--pale-orange); color: #a65f17; font-size: 9px; font-weight: 800; }
.quick-bridge { background: linear-gradient(100deg,var(--navy),#0d536a); color: #fff; display: grid; grid-template-columns: minmax(260px,.85fr) 1.5fr; align-items: center; gap: 28px; }
.quick-bridge h2 { margin: 7px 0 0; max-width: 470px; font-size: 19px; line-height: 1.35; }
.quick-bridge .eyebrow { color: #74ddd6; }
.bridge-steps { display: grid; grid-template-columns: repeat(4,1fr); gap: 11px; }
.bridge-steps span { display: flex; align-items: center; gap: 8px; font-size: 11px; line-height: 1.3; color: rgba(255,255,255,.8); }
.bridge-steps b { flex: 0 0 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; background: rgba(255,255,255,.12); color: #fff; }

.workbench.two-col { display: grid; grid-template-columns: minmax(400px,.88fr) minmax(430px,1.12fr); gap: 17px; align-items: start; }
.input-panel { border-top: 3px solid var(--orange); }
.results-panel { border-top: 3px solid var(--teal); }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px 13px; }
.form-grid input, .form-grid select { background: #fff9ef; border-color: #ead7bb; }
.info-strip { margin-top: 17px; padding: 12px 14px; background: var(--pale-blue); border-left: 4px solid var(--navy-2); border-radius: 7px; color: #49616e; font-size: 11px; line-height: 1.5; }
.result-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.result-cards > div { padding: 15px 12px; border: 1px solid var(--line); border-radius: 9px; text-align: center; background: #fafcfd; }
.result-cards > div.featured { background: var(--pale-teal); border-color: #abd9d4; transform: translateY(-3px); }
.result-cards span, .result-cards small { display: block; }
.result-cards span { font-size: 10px; color: var(--muted); font-weight: 800; }
.result-cards strong { display: block; font-size: clamp(16px,1.65vw,23px); color: var(--navy); margin: 10px 0 6px; }
.result-cards small { color: var(--teal-dark); font-size: 10px; }
.clean-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.clean-table th, .clean-table td { padding: 10px 2px; border-bottom: 1px solid #e4ebee; font-size: 12px; }
.clean-table th { text-align: left; color: #506670; font-weight: 600; }
.clean-table td { text-align: right; color: var(--navy); font-weight: 800; }
.clean-table .total-row th, .clean-table .total-row td { border-top: 2px solid var(--navy); color: var(--navy); font-size: 13px; }
.caption { color: var(--muted); font-size: 10px; line-height: 1.5; margin: 13px 0 0; }

.table-page-head { align-items: center; }
.table-panel { padding: 0; overflow: hidden; }
.table-panel > .panel-head { padding: 20px 20px 0; }
.table-toolbar, .lookup-filters { display: flex; align-items: end; gap: 12px; padding: 15px 17px; border-bottom: 1px solid var(--line); background: #fbfcfd; }
.table-toolbar { justify-content: space-between; }
.segmented { background: #eaf0f3; border-radius: 8px; padding: 3px; display: flex; }
.segmented button { border: 0; background: transparent; color: var(--muted); padding: 8px 11px; border-radius: 6px; font-size: 11px; font-weight: 800; }
.segmented button.active { background: #fff; color: var(--navy); box-shadow: 0 2px 7px rgba(15,43,59,.1); }
.inline-field { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.inline-field input { width: 230px; margin: 0; padding: 8px 10px; background: #fff; }
.table-scroll { width: 100%; overflow: auto; }
.estimate-table, .lookup-table, .summary-table { width: 100%; border-collapse: collapse; min-width: 1120px; }
.estimate-table th, .lookup-table th, .summary-table th { position: sticky; top: 0; z-index: 2; background: var(--navy); color: #fff; padding: 11px 9px; font-size: 10px; text-align: center; white-space: nowrap; }
.estimate-table td, .lookup-table td, .summary-table td { border-bottom: 1px solid #e1e8ec; padding: 9px; font-size: 11px; vertical-align: top; }
.estimate-table tbody tr:nth-child(even), .lookup-table tbody tr:nth-child(even), .summary-table tbody tr:nth-child(even) { background: #f8fafb; }
.estimate-table td:nth-child(1), .estimate-table td:nth-child(2), .estimate-table td:nth-child(5), .lookup-table td:nth-child(1), .lookup-table td:nth-child(5) { text-align: center; }
.estimate-table td:nth-child(6), .estimate-table td:nth-child(7), .estimate-table td:nth-child(9), .lookup-table td:nth-child(6), .lookup-table td:nth-child(7), .summary-table td:nth-child(n+3) { text-align: right; }
.estimate-table input { margin: 0; padding: 7px 8px; min-width: 92px; text-align: right; background: #fff9ef; border-color: #ead7bb; }
.estimate-table input.line-text { min-width: 100px; text-align: left; }
.estimate-table input.line-title-input { font-weight: 800; color: var(--navy); margin-bottom: 5px; }
.estimate-table input.line-spec-input { color: var(--muted); font-size: 10px; }
.estimate-table input.line-unit-input { min-width: 70px; text-align: center; }
.estimate-table .line-title, .lookup-table .line-title { display: block; font-weight: 800; color: var(--navy); margin-bottom: 4px; }
.estimate-table .line-spec, .lookup-table .line-spec { color: var(--muted); line-height: 1.4; }
.estimate-table .supplier, .lookup-table .supplier { color: #49616e; line-height: 1.4; min-width: 200px; }
.delete-line { border: 0; background: #fff0f0; color: var(--danger); border-radius: 6px; width: 27px; height: 27px; }
.empty-box { margin: 20px; min-height: 180px; display: grid; place-content: center; text-align: center; border: 1px dashed #c8d5db; border-radius: 9px; color: var(--muted); background: #fafcfd; }
.empty-box strong, .empty-box span { display: block; }
.empty-box strong { color: var(--navy); margin-bottom: 7px; }
.empty-box span { font-size: 11px; max-width: 460px; line-height: 1.5; }
.table-total { display: flex; justify-content: flex-end; align-items: center; gap: 20px; padding: 18px 22px; border-top: 1px solid var(--line); background: var(--pale-teal); }
.table-total span { font-size: 12px; font-weight: 800; color: var(--muted); }
.table-total strong { font-size: 22px; color: var(--navy); }

.lookup-filters label { min-width: 180px; }
.lookup-filters .grow { flex: 1; }
.lookup-filters input, .lookup-filters select { margin-top: 5px; padding: 9px 10px; background: #fff; }
.lookup-meta { display: flex; justify-content: space-between; padding: 10px 17px; color: var(--muted); font-size: 11px; }
.lookup-meta span { color: var(--navy); font-weight: 800; }
.add-row { border: 0; border-radius: 6px; padding: 7px 9px; color: var(--teal-dark); background: var(--pale-teal); white-space: nowrap; font-size: 10px; font-weight: 800; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }

.summary-banner { display: grid; grid-template-columns: repeat(4,1fr); background: linear-gradient(100deg,var(--navy),var(--navy-2)); border-radius: 11px; margin-bottom: 16px; overflow: hidden; }
.summary-banner > div { padding: 18px 20px; border-right: 1px solid rgba(255,255,255,.13); }
.summary-banner > div:last-child { border: 0; }
.summary-banner span, .summary-banner strong { display: block; }
.summary-banner span { color: rgba(255,255,255,.66); font-size: 10px; margin-bottom: 9px; }
.summary-banner strong { color: #fff; font-size: 20px; }
.summary-table { min-width: 720px; }
.summary-table tfoot th { background: var(--pale-teal); color: var(--navy); padding: 13px 10px; text-align: right; }
.summary-table td:nth-child(2) { font-weight: 800; color: var(--navy); }
.summary-note { margin: 20px; padding: 13px 15px; background: var(--pale-orange); border-left: 4px solid var(--orange); color: #6a543c; font-size: 11px; line-height: 1.5; }

.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 22px; background: rgba(8,30,42,.6); backdrop-filter: blur(3px); }
.modal-card { width: min(1120px,96vw); height: min(780px,92vh); background: #fff; border-radius: 13px; box-shadow: 0 30px 80px rgba(0,0,0,.3); display: flex; flex-direction: column; overflow: hidden; }
.modal-head { padding: 20px 22px; display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 4px 0; color: var(--navy); font-size: 21px; }
.modal-head p { margin: 0; color: var(--muted); font-size: 11px; }
.modal-filters { padding: 12px 18px; }
.modal-list { padding: 12px 18px; overflow: auto; flex: 1; display: grid; align-content: start; gap: 8px; background: #f8fafb; }
.shortlist-item { display: grid; grid-template-columns: 70px minmax(250px,1.1fr) minmax(220px,1fr) 108px 148px 95px; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 11px; }
.shortlist-item:hover { border-color: #93c9c5; box-shadow: 0 4px 12px rgba(15,43,59,.05); }
.shortlist-item .code { text-align: center; font-weight: 800; color: var(--navy-2); background: var(--pale-blue); border-radius: 5px; padding: 6px; }
.shortlist-item .name { font-weight: 800; color: var(--navy); font-size: 12px; }
.shortlist-item .spec { color: var(--muted); font-size: 10px; line-height: 1.35; }
.shortlist-item .unit { text-align: center; color: var(--muted); font-size: 10px; }
.shortlist-item .price { text-align: right; font-weight: 800; color: var(--teal-dark); font-size: 11px; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--muted); }
.toast { position: fixed; z-index: 120; right: 24px; bottom: 24px; background: var(--navy); color: #fff; border-left: 4px solid var(--teal); border-radius: 8px; padding: 12px 16px; box-shadow: 0 12px 30px rgba(0,0,0,.25); font-size: 12px; max-width: 380px; }

@media (max-width: 1120px) {
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .span-2 { grid-column: span 1; }
  .span-3 { grid-column: span 2; }
  .quick-bridge { grid-template-columns: 1fr; }
  .workbench.two-col { grid-template-columns: 1fr; }
  .shortlist-item { grid-template-columns: 62px minmax(220px,1fr) 100px 140px 88px; }
  .shortlist-item .spec { display: none; }
}

@media (max-width: 820px) {
  .activation-screen { grid-template-columns: 1fr; }
  .activation-card { padding: 38px 25px; min-height: 100vh; }
  .activation-visual { display: none; }
  .brand-lockup.large { margin-bottom: 45px; }
  .sidebar { transform: translateX(-105%); transition: .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-button { display: grid; }
  .topbar { padding: 0 15px; }
  .top-actions .save-state, .top-actions .ghost { display: none; }
  .view { padding: 24px 16px 40px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .table-page-head .page-actions { width: 100%; }
  .table-page-head .page-actions .button { flex: 1; }
  .summary-banner { grid-template-columns: repeat(2,1fr); }
  .lookup-filters { flex-wrap: wrap; }
  .lookup-filters label { min-width: calc(50% - 8px); flex: 1; }
  .lookup-filters .grow { flex-basis: 100%; }
  .shortlist-item { grid-template-columns: 58px 1fr 95px 78px; }
  .shortlist-item .unit { display: none; }
}

@media (max-width: 560px) {
  .project-heading input { font-size: 13px; }
  .top-actions .button { font-size: 0; width: 36px; height: 36px; padding: 0; }
  .top-actions .button::after { content: "Σ"; font-size: 18px; }
  .kpi-grid, .dashboard-grid, .form-grid, .result-cards { grid-template-columns: 1fr; }
  .span-3 { grid-column: span 1; }
  .kpi-card { padding: 15px; }
  .bridge-steps { grid-template-columns: 1fr 1fr; }
  .bar-row { grid-template-columns: 115px 1fr; }
  .bar-row strong { grid-column: 2; }
  .table-toolbar { align-items: stretch; flex-direction: column; }
  .inline-field { display: block; }
  .inline-field input { width: 100%; margin-top: 6px; }
  .summary-banner { grid-template-columns: 1fr; }
  .summary-banner > div { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.13); }
  .lookup-filters label { min-width: 100%; }
  .modal { padding: 0; }
  .modal-card { width: 100%; height: 100%; border-radius: 0; }
  .shortlist-item { grid-template-columns: 52px 1fr 83px; }
  .shortlist-item .price { display: none; }
}

.admin-body { background: var(--bg); }
.admin-topbar { height: 72px; padding: 0 34px; background: var(--navy); display: flex; align-items: center; justify-content: space-between; }
.admin-main { max-width: 1440px; margin: 0 auto; padding: 32px 34px 50px; }
.admin-grid { display: grid; grid-template-columns: minmax(280px,.7fr) minmax(550px,1.3fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.admin-login input { background: #fff9ef; }
.create-license .button[type=submit] { align-self: end; }
.new-key-box { grid-column: 1 / -1; margin-top: 16px; padding: 15px; border-radius: 9px; background: var(--pale-teal); border: 1px solid #abd9d4; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 12px; }
.new-key-box span, .new-key-box small { grid-column: 1 / -1; color: var(--muted); font-size: 10px; }
.new-key-box strong { color: var(--navy); font-size: 20px; letter-spacing: .08em; }
.license-panel > .panel-head { padding-right: 20px; }
.license-table { width: 100%; min-width: 1050px; border-collapse: collapse; }
.license-table th { background: var(--navy); color: #fff; padding: 11px 9px; font-size: 10px; }
.license-table td { padding: 11px 9px; border-bottom: 1px solid var(--line); font-size: 11px; vertical-align: top; }
.license-table td strong, .license-table td small { display: block; }
.license-table td small { color: var(--muted); margin-top: 4px; max-width: 250px; }
.license-table code { color: var(--navy-2); background: var(--pale-blue); padding: 5px 7px; border-radius: 5px; }
.status-pill { display: inline-block; border-radius: 999px; padding: 5px 8px; font-weight: 800; font-size: 9px; }
.status-pill.green { background: #e5f6ec; color: #16784a; }
.status-pill.orange { background: var(--pale-orange); color: #a65f17; }
.status-pill.red { background: #fff0f0; color: var(--danger); }
.row-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.row-actions button { border: 1px solid var(--line); background: #fff; color: var(--navy); border-radius: 5px; padding: 5px 7px; font-size: 9px; font-weight: 800; }
.row-actions .danger-action { color: var(--danger); border-color: #efcaca; }
.admin-empty { text-align: center; color: var(--muted); padding: 30px !important; }

@media (max-width: 820px) {
  .admin-main { padding: 24px 16px 40px; }
  .admin-topbar { padding: 0 16px; }
  .admin-grid { grid-template-columns: 1fr; }
}

@media print {
  .sidebar, .topbar, .page-actions, #view-dashboard, #view-quick, #view-detail, #view-lookup { display: none !important; }
  .main-content { margin: 0; }
  #view-summary { display: block !important; padding: 0; }
  body { background: #fff; }
  .summary-banner { break-inside: avoid; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .panel { box-shadow: none; border-color: #aaa; }
  .summary-table { min-width: 0; }
}

@media print {
  .sidebar, .topbar, .page-actions, .pager, .toast { display: none !important; }
  .main-content { margin: 0; }
  .view { display: none !important; padding: 0; }
  #view-summary { display: block !important; }
  body { background: #fff; }
  .panel, .summary-banner { box-shadow: none; break-inside: avoid; }
  .table-scroll { overflow: visible; }
  .summary-table { min-width: 0; }
}
