/* MLT QMS theme: the MLT family look shared with DiDi and the edge dashboards. */
:root {
  --navy: #1F4E79;
  --mid: #2E75B6;
  --light: #D6E4F0;
  --accent: #00B4D8;
  --accent-soft: #E0F6FB;
  --success: #2ECC71;
  --warning: #F39C12;
  --danger: #E74C3C;
  --dark: #0D1B2A;
  --surface: #F4F8FB;
  --border: #CCD9E3;
  --text: #1A2B3C;
  --muted: #6B8399;
  --radius: 10px;
  --shadow: 0 1px 6px rgba(31, 78, 121, 0.08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--text); background: var(--surface); font-size: 15px; line-height: 1.45;
  display: flex; flex-direction: column; min-height: 100vh; }
a { color: var(--mid); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--navy); margin: 0 0 .5rem; letter-spacing: -0.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); }
.inline { display: inline; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: .3rem 0; border-bottom: 1px solid #EDF1F5; }
.plain-list li:last-child { border-bottom: 0; }

/* Top bar: brand, three groups of sections (you · reference · operations), notifications and the user menu */
.topbar { display: flex; align-items: stretch; gap: 1.5rem; padding: 0 1.4rem; min-height: 60px; background: #fff;
  border-bottom: 1px solid var(--border); box-shadow: 0 4px 16px -14px rgba(31, 78, 121, .35); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; align-self: center; gap: .7rem; color: var(--navy); padding: .45rem 0; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 40px; width: auto; object-fit: contain; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; color: var(--navy); font-size: .95rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand-tag { font-size: .62rem; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-weight: 600; white-space: nowrap; }
.mainnav { display: flex; align-items: stretch; gap: .1rem; }
.nav-group { display: flex; align-items: stretch; gap: .1rem; }
.mainnav a { position: relative; display: inline-flex; align-items: center; gap: .45rem; padding: 0 .85rem; font-weight: 500; color: var(--muted);
  font-size: .9rem; white-space: nowrap; border-top: 3px solid transparent; border-bottom: 3px solid transparent; transition: color .12s, background .12s; }
.nav-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.mainnav a:hover { text-decoration: none; color: var(--navy); background: var(--surface); }
.mainnav a.active { color: var(--navy); font-weight: 600; border-bottom-color: var(--accent); }
.mainnav a.active .nav-icon { opacity: 1; color: var(--mid); }
.nav-divider { display: inline-block; width: 1px; align-self: center; height: 26px; background: var(--border); margin: 0 .6rem; }
.userbox { margin-left: auto; align-self: center; display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: inline-flex; align-items: center; gap: .55rem; padding: .25rem .55rem .25rem .25rem; border-radius: 999px;
  cursor: pointer; color: var(--navy); border: 1px solid transparent; user-select: none; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover, .usermenu[open] summary { background: var(--surface); border-color: var(--border); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--navy), var(--mid)); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .05em; }
.usermenu .who { font-weight: 600; white-space: nowrap; }
.usermenu .chev { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .55; }
.usermenu .menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 250px; background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 14px 36px -14px rgba(31, 78, 121, .4); padding: .4rem; z-index: 40; display: flex; flex-direction: column; }
.usermenu .menu-head { display: flex; flex-direction: column; gap: .1rem; padding: .5rem .7rem .6rem; border-bottom: 1px solid var(--border); margin-bottom: .3rem; }
.usermenu .menu a, .usermenu .menu button { display: block; width: 100%; text-align: left; padding: .5rem .7rem; border-radius: 7px; color: var(--text);
  font: inherit; font-size: .9rem; background: none; border: 0; cursor: pointer; }
.usermenu .menu a:hover, .usermenu .menu button:hover { background: var(--surface); color: var(--navy); text-decoration: none; }
.usermenu .menu form { margin: 0; }
.link-soft { color: var(--muted); }
@media (max-width: 1240px) {
  .topbar { flex-wrap: wrap; }
  .mainnav { order: 3; flex-basis: 100%; border-top: 1px solid var(--border); margin: 0 -1.4rem; padding: 0 1rem; overflow-x: auto; }
  .brand-tag { display: none; }
}

/* Messages */
.messages { padding: .6rem 1.4rem 0; }
.msg { padding: .6rem .9rem; border-radius: 8px; margin-bottom: .5rem; background: #E8F0F8; color: var(--navy); border: 1px solid var(--light); }
.msg-success { background: #E8F8F0; color: #1A7A45; border-color: #BFEBD3; }
.msg-error, .msg-danger { background: #FDE8E8; color: #7A1A1A; border-color: #F5BDBD; }
.msg-warning { background: #FEF3CD; color: #7A5A00; border-color: #F7E0A0; }

/* Page */
.page { flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; padding: 1.3rem 1.4rem 2rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.page-head .titles { flex: 1; min-width: 240px; }
.page-head .subtitle { color: var(--muted); font-size: .9rem; }
.page-head .actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.kicker { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--mid); font-weight: 700; }

/* Filter bar */
.filters { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: .7rem .9rem; margin-bottom: 1.1rem; box-shadow: var(--shadow); }
.filters label { display: flex; flex-direction: column; gap: .15rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 600; }
.filters select, .filters input { font-size: .9rem; padding: .35rem .5rem; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text); min-width: 120px; }
.filters input[type=search] { min-width: 220px; }
.filters .summary { margin-left: auto; align-self: center; color: var(--muted); font-size: .85rem; }

/* Buttons */
.btn { display: inline-block; font: inherit; font-size: .9rem; font-weight: 600; padding: .45rem .95rem; border-radius: 7px; border: 1px solid var(--navy);
  background: var(--navy); color: #fff; cursor: pointer; line-height: 1.3; }
.btn:hover { background: var(--mid); text-decoration: none; }
.btn-primary { background: var(--mid); border-color: var(--mid); color: #fff; }
.btn-primary:hover { background: var(--navy); }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; padding: .3rem .6rem; }
.btn-ghost:hover { background: var(--surface); color: var(--navy); }
.btn-outline { background: #fff; color: var(--navy); }
.btn-outline:hover { background: var(--light); }
.btn-small { font-size: .8rem; padding: .3rem .7rem; }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #C0392B; }
.btn-success { background: #1A9E54; border-color: #1A9E54; }
.btn-success:hover { background: #157F43; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Cards and grids */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.grid > .card + .card { margin-top: 0; }   /* cards laid out by a grid are spaced by the grid gap, not stacked */
.card h2, .card h3 { margin-top: 0; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
@media (max-width: 900px) { .grid-side { grid-template-columns: 1fr; } }
.section-header { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .1em;
  margin: 1.4rem 0 .7rem; padding-bottom: .4rem; border-bottom: 1.5px solid var(--border); }
.section-header:first-child { margin-top: 0; }

/* KPI tiles: a hero number, a label above, one line of context below; state is a coloured top edge plus the text */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.kpi-card { display: block; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1.1rem; position: relative; overflow: hidden;
  box-shadow: var(--shadow); color: var(--text); }
.kpi-card:hover { text-decoration: none; border-color: var(--mid); }
.kpi-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--navy), var(--accent)); }
.kpi-card.kpi-good::before { background: var(--success); }
.kpi-card.kpi-warning::before { background: var(--warning); }
.kpi-card.kpi-serious::before { background: var(--danger); }
.kpi-label { font-size: .68rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: .3rem; }
.kpi-value { font-size: 1.5rem; font-weight: 700; color: var(--navy); line-height: 1.1; font-family: var(--mono); white-space: nowrap; }
.kpi-delta { font-size: .76rem; margin-top: .35rem; color: var(--muted); }

/* Single-series bars (quotation pipeline): thin, rounded end, labels in text ink */
.bars { display: flex; flex-direction: column; gap: .45rem; }
.bar-row { display: grid; grid-template-columns: 7rem 1fr 7rem; align-items: center; gap: .7rem; font-size: .86rem; }
.bar-label { color: var(--text); }
.bar-track { display: block; height: 10px; background: var(--surface); border-radius: 4px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--mid); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; }

/* Notification bell */
.bell { position: relative; display: inline-flex; align-items: center; color: var(--muted); padding: .2rem; }
.bell svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bell:hover { color: var(--navy); text-decoration: none; }
.bell.has-unread { color: var(--navy); }
.bell-count { position: absolute; top: -4px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff;
  font-size: .66rem; font-weight: 700; line-height: 16px; text-align: center; }
.notif-list li { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.notif-list li.unread { background: var(--accent-soft); margin: 0 -.6rem; padding: .35rem .6rem; border-radius: 6px; }

/* Tables */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .table-wrap { border: 0; box-shadow: none; }
table.data { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.data th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  background: var(--surface); padding: .55rem .7rem; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; }
table.data td { padding: .45rem .7rem; border-bottom: 1px solid #EDF1F5; vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #F8FAFC; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.actions { white-space: nowrap; }
table.data td.actions form { display: inline; }
.table-foot { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between; padding: .6rem .8rem; font-size: .85rem; color: var(--muted); }
.pager a, .pager span { display: inline-block; padding: .2rem .55rem; border-radius: 5px; border: 1px solid var(--border); margin-left: .25rem; font-size: .82rem; }
.pager span.current { background: var(--navy); color: #fff; border-color: var(--navy); }
tr.current td { background: var(--accent-soft); }

/* Badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: .72rem; font-weight: 600; letter-spacing: .04em; white-space: nowrap; }
.badge-success { background: #E8F8F0; color: #1A7A45; }
.badge-info { background: #E8F0F8; color: #1A4E7A; }
.badge-danger { background: #FDE8E8; color: #7A1A1A; }
.badge-neutral { background: #EEF1F4; color: #555; }
.badge-warning { background: #FEF3CD; color: #7A5A00; }
.badge-accent { background: var(--accent-soft); color: #0A6F86; }
.chip { display: inline-block; background: var(--light); color: var(--navy); border-radius: 20px; padding: 1px 9px; font-size: .74rem; font-weight: 600; }
.filetype { display: inline-block; min-width: 2.6rem; text-align: center; font-family: var(--mono); font-size: .68rem; font-weight: 700; text-transform: uppercase;
  padding: 1px 5px; border-radius: 4px; background: #EEF1F4; color: #555; }
.filetype-docx, .filetype-doc { background: #E3ECF7; color: #1F4E79; }
.filetype-xlsx, .filetype-xlsm, .filetype-xls, .filetype-csv { background: #E3F3E8; color: #1A6B3A; }
.filetype-pdf { background: #FBE4E1; color: #8A2A1E; }
.filetype-pptx, .filetype-ppt { background: #FCE9DA; color: #8A4A10; }

/* Forms */
.form { display: flex; flex-direction: column; gap: .8rem; }
.form label, .field label { font-size: .78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; display: block; margin-bottom: .2rem; }
.form input, .form select, .form textarea, .field input, .field select, .field textarea { width: 100%; font: inherit; padding: .5rem .65rem; border: 1px solid var(--border); border-radius: 7px; background: #fff; color: var(--text); }
.form input[type=file] { padding: .35rem; }
.form textarea { min-height: 90px; }
.form .help, .field .help { font-size: .78rem; color: var(--muted); margin-top: .2rem; }
.form .errors, .errorlist { color: var(--danger); font-size: .85rem; margin: .2rem 0 0; padding-left: 1rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; }
.form-actions { display: flex; gap: .6rem; align-items: center; margin-top: .4rem; flex-wrap: wrap; }
.checkbox { display: flex; align-items: center; gap: .45rem; text-transform: none !important; letter-spacing: 0 !important; font-weight: 500 !important; color: var(--text) !important; }
.checkbox input { width: auto; }
.form-inline { display: inline-flex; gap: .4rem; align-items: center; }
.form-inline input[type=text] { width: auto; min-width: 180px; font-size: .85rem; padding: .3rem .5rem; }

/* Auth pages */
.auth-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 2rem 2rem 1.6rem; box-shadow: 0 8px 30px rgba(31,78,121,.12); }
.auth-card .brand { justify-content: center; margin-bottom: 1rem; }
.auth-card .brand-logo { height: 90px; width: auto; }
.auth-card h1 { text-align: center; font-size: 1.25rem; }
.auth-card .lead { text-align: center; color: var(--muted); font-size: .9rem; margin-bottom: 1.2rem; }
.auth-card .btn { width: 100%; padding: .6rem; }
.auth-foot { text-align: center; margin-top: 1rem; font-size: .82rem; color: var(--muted); }
.qr { display: block; margin: .5rem auto; width: 220px; height: 220px; }

/* Definition lists */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.2rem; font-size: .9rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }

/* File tree (project and quotation folders): an explorer-style tree, folders collapsed until clicked */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.card-head h2 { margin-bottom: .5rem; }
.tree-tools { display: flex; gap: .2rem; }
.tree { font-size: .88rem; }
.tree .folder { padding: .3rem .4rem; border-radius: 6px; font-weight: 600; color: var(--navy); user-select: none; }
.tree .folder:hover { background: var(--surface); }
.tree .folder .count { font-weight: 400; color: var(--muted); font-size: .78rem; margin-left: .45rem; }
.tree .folder::before { content: ''; display: inline-block; width: 16px; height: 13px; margin: 0 .5rem -2px 0; border-radius: 2px 3px 3px 3px;
  background: #F2C94C; box-shadow: inset 0 3px 0 #E0B53A; }
.tree-children { margin-left: .55rem; padding-left: .8rem; border-left: 1px solid var(--light); }
.tree .file { display: flex; align-items: center; gap: .6rem; padding: .28rem .4rem .28rem 1.7rem; border-radius: 6px; }
.tree .file:hover { background: var(--surface); }
.tree .file .meta { margin-left: auto; color: var(--muted); font-size: .78rem; white-space: nowrap; }
.tree .file .record { color: var(--mid); font-size: .74rem; white-space: nowrap; }
.tree .file-controlled { background: var(--accent-soft); }
.tree .file-controlled:hover { background: #CFEFF7; }
.tree .file .meta a { color: var(--muted); }
.tree .file .meta a:hover { color: var(--mid); }
.tree .file .chip { font-size: .68rem; padding: 0 7px; }
details.tree-group > summary { cursor: pointer; list-style: none; display: flex; align-items: center; }
details.tree-group > summary::-webkit-details-marker { display: none; }
details.tree-group > summary::after { content: '▸'; order: -1; display: inline-block; width: 1rem; color: var(--muted); font-size: .8rem; }
details.tree-group[open] > summary::after { content: '▾'; }
@media (max-width: 640px) { .tree .file { flex-wrap: wrap; } .tree .file .meta { margin-left: 2.3rem; } }

/* Company file areas */
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.area-grid { grid-auto-rows: 1fr; }
.grid-cards.area-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.area-card { display: flex; flex-direction: column; min-height: 170px; color: var(--text); border-top: 4px solid var(--mid); }
.area-card-qms { border-top-color: var(--accent); }
.file-deleted span:nth-child(2) { color: var(--muted); }
.deleted-files > summary { color: var(--muted); }
.tree .file-retired a { color: var(--muted); text-decoration: line-through; }
.area-card:hover { text-decoration: none; box-shadow: 0 10px 24px -14px rgba(31,78,121,.5); transform: translateY(-2px); transition: all .15s ease; }
.area-card h2 { margin: .2rem 0 .4rem; }
.area-card p { flex: 1; }
.area-foot { display: flex; justify-content: space-between; align-items: center; }
.org-open { font-weight: 600; font-size: .9rem; color: var(--mid); }

/* R&D repositories */
.repo-card { display: flex; flex-direction: column; gap: .4rem; }
.repo-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.repo-name { font-weight: 700; color: var(--navy); font-family: var(--mono); font-size: .95rem; }
.repo-role { font-size: .85rem; color: var(--text); }
.repo-icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; color: var(--dark); flex: none; }
.repo-icon-roboflow { border-radius: 4px; background: #6706CE; color: #fff; font-weight: 800; font-size: .72rem; }
.repo-card .kv { grid-template-columns: 5.5rem 1fr; margin-top: .2rem; }
.repo-links { display: flex; gap: .9rem; margin-top: auto; padding-top: .5rem; border-top: 1px solid #EDF1F5; font-size: .85rem; font-weight: 600; }
.btn .repo-icon { vertical-align: -3px; margin-right: .3rem; color: inherit; }

/* Quality records */
.kv-wide { grid-template-columns: 12rem 1fr; }
.form-row-wide .field-full { grid-column: 1 / -1; }
.form-row-wide { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.field-check { align-self: end; }
.programme { display: flex; flex-wrap: wrap; gap: .5rem; }
.prog-item { display: block; min-width: 150px; max-width: 220px; padding: .45rem .6rem; border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: .85rem; border-left: 4px solid var(--muted); }
.prog-item:hover { text-decoration: none; border-color: var(--mid); }
.prog-done { border-left-color: var(--success); }
.prog-late { border-left-color: var(--danger); }
table.matrix th.rot { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; padding: .6rem .3rem; text-align: left; }
table.matrix td.lvl-cell { text-align: center; padding: .2rem; }
.lvl { display: inline-block; min-width: 26px; padding: 2px 6px; border-radius: 6px; font-size: .78rem; font-weight: 700; cursor: pointer; }
.lvl-0 { background: #EEF1F4; color: var(--muted); }
.lvl-1 { background: #FEF3CD; color: #7A5A00; }
.lvl-2 { background: #E8F8F0; color: #1A7A45; }
.lvl-3 { background: #D6F2DD; color: #0F5A2E; }
details.lvl-pop { position: relative; }
details.lvl-pop > summary { list-style: none; }
details.lvl-pop > summary::-webkit-details-marker { display: none; }
.lvl-form { position: absolute; z-index: 30; left: 0; top: 110%; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: .5rem; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: .35rem; min-width: 220px; text-align: left; }
.lvl-form select, .lvl-form input { font: inherit; font-size: .82rem; padding: .25rem .4rem; border: 1px solid var(--border); border-radius: 5px; }
tr.single-risk td:first-child { background: #FDE8E8; }
details.review-item { border-bottom: 1px solid #EDF1F5; padding: .4rem 0; }
details.review-item > summary { cursor: pointer; }

/* Timeline of revision events */
.timeline { list-style: none; margin: 0; padding: 0; font-size: .86rem; }
.timeline li { display: grid; grid-template-columns: 9rem 1fr; gap: .8rem; padding: .35rem 0; border-bottom: 1px solid #F1F4F7; }
.timeline .when { color: var(--muted); white-space: nowrap; }
.timeline .note { color: var(--muted); display: block; }

/* Footer */
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding: .8rem 1.4rem; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--border); background: #fff; }

.notice { background: var(--accent-soft); border: 1px solid #B8E8F2; color: #0A4F60; border-radius: 8px; padding: .6rem .9rem; font-size: .88rem; margin-bottom: 1rem; }
.warn { background: #FEF3CD; border: 1px solid #F7E0A0; color: #7A5A00; border-radius: 8px; padding: .6rem .9rem; font-size: .88rem; margin-bottom: 1rem; }

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: .6rem; }
  .mainnav { order: 3; width: 100%; }
  .page { padding: 1rem; }
  .filters .summary { margin-left: 0; }
  .timeline li { grid-template-columns: 1fr; gap: .1rem; }
}

/* ---- commercial chain ---- */
.subtabs { display: flex; flex-wrap: wrap; gap: .25rem; margin: -.2rem 0 1rem; border-bottom: 1px solid var(--border); }
.subtabs a { padding: .45rem .8rem; font-size: .88rem; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.subtabs a:hover { color: var(--navy); text-decoration: none; }
.subtabs a.active { color: var(--navy); border-bottom-color: var(--accent); }
.chain { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin-bottom: 1.2rem; }
.chain-step { display: flex; flex-direction: column; gap: .15rem; padding: .7rem .9rem; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); position: relative; }
.chain-step:hover { text-decoration: none; border-color: var(--mid); }
.chain-n { display: inline-block; width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 50%; background: var(--navy); color: #fff; font-size: .72rem; font-weight: 700; margin-bottom: .2rem; }
.review-table td { vertical-align: middle; }
.review-table .row-concern td { background: #FFF7F7; }
.review-table input[type=radio] { width: 16px; height: 16px; }
.cell-input { width: 100%; min-width: 160px; font: inherit; font-size: .85rem; padding: .3rem .5rem; border: 1px solid var(--border); border-radius: 5px; }
.line-form { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.line-form .field-wide { grid-column: span 2; }
.subtabs + .filters { margin-top: 0; }

/* ---- timesheets ---- */
.day-card { margin-bottom: .6rem; }
.day-card .card-head h2 { font-size: 1rem; margin-bottom: .2rem; }
.day-today { border-left: 4px solid var(--accent); }

/* ---- installed base grouped by site ---- */
.site-group { border-top: 1px solid var(--border); padding: .3rem 0; }
.site-group:first-of-type { border-top: 0; }
.site-summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; cursor: pointer; padding: .45rem .2rem; list-style: none; }
.site-name { font-weight: 600; font-size: 1rem; }
.site-group .table-wrap { margin: .2rem 0 .6rem 1.2rem; }
