/* Qila ERP — "fort" design system. Plain CSS, no build step (shared hosting).
   Navy fort walls and gateway gold from the Qila logo, on a warm sandstone ground. */
:root {
    --ink: #1c1a2e; --muted: #5f5b73; --faint: #9a96ab; --line: #e8e3d9; --line-strong: #d6cfc2;
    --bg: #f5f3ee; --panel: #fff; --panel-2: #faf8f4;
    --brand: #17508c; --brand-ink: #fff; --brand-soft: #e7eef8; --brand-deep: #0f3c6c;
    --accent: #d9a23a; --accent-soft: #fbf2de; --accent-deep: #9a6a12;
    --wall: #0b2545; --wall-2: #12355e; --wall-ink: #c6d3e6; --wall-faint: #7f96b8;
    --ok: #157f4a; --ok-soft: #e9f7ef; --bad: #c0392b; --bad-soft: #fdecea; --warn: #b26a12; --warn-soft: #fff6e6;
    --radius: 12px; --radius-sm: 8px; --sidebar: 252px;
    --shadow: 0 1px 2px rgba(29, 26, 63, .05), 0 4px 16px rgba(29, 26, 63, .05);
    --shadow-lift: 0 2px 4px rgba(29, 26, 63, .06), 0 12px 32px rgba(29, 26, 63, .10);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; line-height: 1.25; font-weight: 750; letter-spacing: -.015em; } h2 { font-size: 15px; margin: 0 0 10px; font-weight: 700; letter-spacing: -.005em; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }
.icon { flex: none; vertical-align: middle; }

/* Shell */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, var(--wall) 0%, var(--wall-2) 100%); color: var(--wall-ink); padding: 0 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; width: var(--sidebar); z-index: 25; transition: width .22s ease, box-shadow .22s ease; }
.nav a, .nav-title, .brand-name, .back-to-work, .mode-tag { white-space: nowrap; }
.sidebar-head { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 6px; margin: 0 -12px 8px; padding: 0 12px; background: var(--wall); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.sidebar-head::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: repeating-linear-gradient(90deg, var(--accent) 0 14px, transparent 14px 22px); }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 4px 14px; color: #fff; flex: 1; min-width: 0; }
.nav-collapse { flex: none; display: grid; place-items: center; width: 30px; height: 30px; margin-top: 4px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 8px; background: rgba(255, 255, 255, .04); color: var(--wall-ink); cursor: pointer; transition: transform .2s, background .12s; }
.nav-collapse:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.brand:hover { text-decoration: none; }
.brand-mark { flex: none; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35)); }
.brand-name { display: block; height: 34px; width: auto; }
.brand-name small { font-size: 10px; font-weight: 700; letter-spacing: .2em; margin-left: 6px; color: var(--wall-faint); vertical-align: middle; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--wall-ink); position: relative; }
.nav a .icon { opacity: .8; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav a.on { background: rgba(255, 255, 255, .10); color: #fff; font-weight: 600; }
.nav a.on::before { content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.nav-group { margin-top: 14px; }
.nav-group > .nav { padding-left: 4px; }
.nav-group > .nav a { padding-left: 32px; }
.nav-title { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--wall-faint); padding: 6px 10px; cursor: pointer; list-style: none; user-select: none; }
.nav-title::-webkit-details-marker { display: none; }
.nav-title .caret { margin-left: auto; transition: transform .15s; }
details.nav-group:not([open]) .caret { transform: rotate(-90deg); }
.nav a.nav-report { color: var(--wall-faint); font-size: 13px; }
.nav a.nav-report::after { content: "report"; margin-left: auto; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; opacity: .6; }
.nav a.nav-report.on, .nav a.nav-report:hover { color: #fff; }
.nav-empty { padding: 10px; color: var(--wall-faint); font-size: 13px; }
.mode-tag { display: inline-flex; align-items: center; gap: 6px; margin: 0 8px 12px; padding: 3px 10px; border-radius: 999px; background: var(--accent); color: #2b1a05; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.back-to-work { display: flex; align-items: center; gap: 8px; margin: 22px 4px 0; padding: 9px 12px; border-radius: 8px; border: 1px dashed currentColor; color: inherit; font-weight: 600; opacity: .85; }
.back-to-work:hover { opacity: 1; text-decoration: none; }

/* Collapsed menu: an icon rail that slides open while the pointer is over it */
@media (min-width: 901px) {
.nav-collapsed .shell { grid-template-columns: 60px 1fr; }
.nav-collapsed .sidebar { width: 60px; padding: 0 8px; }
.nav-collapsed .sidebar:not(:hover) .sidebar-head { margin: 0 -8px 8px; padding: 0 8px; justify-content: center; }
.nav-collapsed .sidebar:not(:hover) .brand { justify-content: center; padding: 16px 0 12px; flex: none; }
.nav-collapsed .sidebar:not(:hover) .brand-mark { width: 34px; height: auto; }
.nav-collapsed .sidebar:not(:hover) .nav a { padding: 8px 0; }
.nav-collapsed .sidebar:not(:hover) .nav a.on::before { left: -8px; }
.nav-collapsed .sidebar:not(:hover) .sidebar-foot a, .nav-collapsed .sidebar:not(:hover) .sf-version > :not(.sf-number) { display: none; }
.nav-collapsed .sidebar:not(:hover) .sidebar-foot { text-align: center; margin: auto -8px 0; padding: 10px 0; }
.nav-collapsed .sidebar:not(:hover) .sf-version { font-size: 0; }
.nav-collapsed .sidebar:not(:hover) .sf-number { font-size: 10px; }
.nav-collapsed .nav-collapse { transform: rotate(180deg); }
.nav-collapsed .sidebar:not(:hover) .brand-name, .nav-collapsed .sidebar:not(:hover) .nav-collapse, .nav-collapsed .sidebar:not(:hover) .nav-group > .nav,
.nav-collapsed .sidebar:not(:hover) .nav-title .caret, .nav-collapsed .sidebar:not(:hover) .mode-tag, .nav-collapsed .sidebar:not(:hover) .nav-empty { display: none; }
.nav-collapsed .sidebar:not(:hover) .nav a, .nav-collapsed .sidebar:not(:hover) .nav-title { justify-content: center; font-size: 0; gap: 0; }
.nav-collapsed .sidebar:not(:hover) .nav-title { padding: 8px 0; }
.nav-collapsed .sidebar:not(:hover) .back-to-work { justify-content: center; font-size: 0; border-style: solid; }
.nav-collapsed .sidebar:hover { width: var(--sidebar); box-shadow: 18px 0 40px rgba(11, 37, 69, .28); }
}
@media (max-width: 900px) { .nav-collapsed .shell { grid-template-columns: 1fr; } .nav-collapsed .sidebar { width: 84vw; } .nav-collapse { display: none; } }

/* Setup mode: sandstone walls, so it never feels like daily work */
.mode-setup .sidebar { background: linear-gradient(180deg, #f1e9dc 0%, #e9ddc9 100%); color: #3d3524; border-right: 1px solid var(--line-strong); }
.mode-setup .sidebar-head { background: #f1e9dc; border-bottom-color: rgba(11, 37, 69, .08); }
.mode-setup .sidebar-head::before { background: repeating-linear-gradient(90deg, var(--wall) 0 14px, transparent 14px 22px); }
.mode-setup .nav-collapse { color: var(--wall); border-color: rgba(11, 37, 69, .18); }
.mode-setup .brand { color: var(--wall); }
.mode-setup .brand-name small, .mode-setup .nav-title { color: #8b7e63; }
.mode-setup .nav a { color: #3d3524; }
.mode-setup .nav a:hover { background: rgba(29, 26, 63, .06); color: var(--wall); }
.mode-setup .nav a.on { background: #fff; color: var(--wall); box-shadow: var(--shadow); }
.mode-setup .nav a.on::before { background: var(--wall); }
.mode-setup .topbar { border-bottom-color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }

.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 24px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 15; }
.topbar form { margin: 0; }
.topbar-gap { flex: 1; }
.workplace { display: inline-flex; align-items: center; gap: 10px; padding: 5px 12px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink); max-width: 320px; }
.workplace:hover { border-color: var(--brand); text-decoration: none; box-shadow: var(--shadow); }
.workplace-mark, .company-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--wall); color: var(--accent); font-weight: 800; flex: none; }
.workplace-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.workplace-text strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workplace-text small { font-size: 11px; color: var(--brand); font-weight: 700; letter-spacing: .02em; }
.workplace-menu > summary.workplace { cursor: pointer; }
.workplace-menu[open] > summary.workplace { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.workplace-list { left: 0; right: auto; min-width: 260px; max-height: 70vh; overflow-y: auto; }
.workplace-list form { margin: 0; }
.menu-label { padding: 8px 10px 4px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.menu-option { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; border-radius: 7px; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.menu-option:hover { background: var(--bg); }
.menu-option.is-on { background: var(--brand-soft); color: var(--brand-deep); font-weight: 700; }
.menu-option.is-on::after { content: "✓"; margin-left: auto; }
.mini-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--wall); color: var(--accent); font-size: 11px; font-weight: 800; }
.menu-foot { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 9px !important; color: var(--brand) !important; font-weight: 600; }
.mode-switch { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-deep); font-weight: 700; font-size: 13px; }
.mode-switch:hover { text-decoration: none; background: var(--accent); color: #2b1a05; }
.user-menu summary { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 3px 4px; border-radius: 999px; }
.user-menu summary:hover { background: var(--bg); }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: 12.5px; }
.topbar .who { color: var(--muted); font-weight: 500; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-item { display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; border-radius: 6px; background: none; font: inherit; color: var(--bad); cursor: pointer; }
.menu-item:hover { background: var(--bad-soft); }
.menu-toggle, .menu-button { display: none; }
.content { padding: 26px 32px 40px; max-width: none; }

@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; z-index: 30; left: 0; top: 0; width: 84vw; max-width: 300px; transform: translateX(-100%); transition: transform .18s; }
    .menu-toggle:checked ~ .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(29, 26, 63, .45); }
    .menu-button { display: inline-flex; cursor: pointer; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); }
    .topbar { padding: 0 12px; gap: 6px; }
    .topbar .who, .workplace-text small { display: none; }
    .workplace { max-width: 44vw; padding-right: 8px; }
    .workplace > .icon, .ms-text { display: none; }
    .mode-switch { padding: 8px; }
    .topbar-gap { display: none; }
    .user-menu { margin-left: auto; }
    .content { padding: 18px 14px 32px; }
}

/* Page header */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 18px; }
.page-head .grow { flex: 1; min-width: 200px; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 3px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.crumbs a { color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 15px; border: 1px solid transparent; border-radius: 10px; background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 650; cursor: pointer; white-space: nowrap; box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 1px 2px rgba(15, 60, 108, .3); transition: background .12s, box-shadow .12s, transform .05s; }
.btn:hover { text-decoration: none; background: var(--brand-deep); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--panel); color: var(--ink); border-color: var(--line-strong); box-shadow: none; }
.btn.secondary:hover { border-color: var(--brand); color: var(--brand-deep); background: var(--panel); }
.btn.danger { background: var(--panel); color: var(--bad); border-color: #f2c4bf; box-shadow: none; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.small { padding: 5px 11px; font-size: 13px; font-weight: 550; border-radius: 8px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-row form { margin: 0; }

/* Panels and messages */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel + .panel { margin-top: 16px; }
.panel-body { padding: 18px 20px; }
.panel-head { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.panel-head h2 { margin: 0; }
.flash { padding: 11px 15px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; }
.flash.ok { background: var(--ok-soft); border-color: #bde5cd; color: var(--ok); }
.flash.bad { background: var(--bad-soft); border-color: #f2c4bf; color: var(--bad); }
.flash ul { margin: 4px 0 0; padding-left: 18px; }

/* Badges */
.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; border: 1px solid; white-space: nowrap; letter-spacing: .01em; }
.badge.draft { background: var(--panel-2); color: var(--muted); border-color: var(--line-strong); }
.badge.submitted { background: var(--ok-soft); color: var(--ok); border-color: #bde5cd; }
.badge.cancelled { background: var(--bad-soft); color: var(--bad); border-color: #f2c4bf; }
.badge.state { background: var(--brand-soft); color: var(--brand-deep); border-color: #b7e0dd; }
.count-pill { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-deep); font-size: 12px; font-weight: 800; }

/* List */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.toolbar input[type=search] { flex: 1; min-width: 180px; max-width: 360px; }
.toolbar select { width: auto; }
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: separate; border-spacing: 0; }
table.list th { text-align: left; font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--panel-2); text-transform: uppercase; letter-spacing: .05em; }
table.list thead th:first-child { border-top-left-radius: var(--radius); } table.list thead th:last-child { border-top-right-radius: var(--radius); }
table.list th a { color: var(--muted); }
table.list td { padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover { background: #fbfaf6; }
table.list td .mono { white-space: nowrap; }
table.list .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* Form */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; }
.grid .wide { grid-column: 1 / -1; }
.section-title { grid-column: 1 / -1; align-self: end; font-size: 12px; font-weight: 800; color: var(--accent-deep); text-transform: uppercase; letter-spacing: .08em; padding: 0 0 7px; margin: 14px 0 0; border-bottom: 1px solid var(--line); }
@media (max-width: 700px) { .grid { grid-template-columns: 1fr; } }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
.panel-body > label { margin-bottom: 10px; }
.field label, .field .label { display: block; font-size: 12.5px; font-weight: 650; color: var(--muted); margin-bottom: 5px; }
.field .req { color: var(--bad); }
.field .value { min-height: 22px; overflow-wrap: anywhere; color: var(--ink); }
.field .value:empty::before { content: "—"; color: var(--faint); }
.field .value pre { margin: 0; white-space: pre-wrap; font-size: 12px; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--bad); }
.field .error, td .error { color: var(--bad); font-size: 12px; margin-top: 3px; }
.field .hint { color: var(--faint); font-size: 12px; margin-top: 3px; }
input, select, textarea { width: 100%; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 9px; font: inherit; background: #fff; color: var(--ink); transition: border-color .12s, box-shadow .12s; }
label > input, label > select, label > textarea { margin-top: 5px; font-weight: 400; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(23, 80, 140, .2); }
input[type=checkbox] { width: auto; accent-color: var(--brand); margin: 0; }
input[type=color] { width: 60px; height: 34px; padding: 2px; }
textarea { min-height: 84px; resize: vertical; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.checks label, label.inline { display: inline-flex; align-items: center; gap: 7px; font-weight: 450; color: var(--ink); margin: 0; }
.pair { display: flex; gap: 8px; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--line-strong); vertical-align: -2px; }
.form-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--panel-2); border-radius: 0 0 var(--radius) var(--radius); }

/* Child tables */
table.rows { width: 100%; border-collapse: collapse; font-size: 13px; }
table.rows th { text-align: left; font-weight: 700; color: var(--muted); padding: 7px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
table.rows td { padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: top; min-width: 110px; }
table.rows td.idx, table.rows th.idx { min-width: 28px; width: 28px; color: var(--faint); }
table.rows td.remove { min-width: 0; width: 1%; white-space: nowrap; }
table.rows input, table.rows select { padding: 6px 8px; }

/* History */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 11px 20px; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .changes { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.timeline .changes del { color: var(--faint); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.card-link { display: block; padding: 15px 17px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font-weight: 650; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s, border-color .12s; }
.card-link:hover { border-color: var(--brand); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.card-link small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }
.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }
.overdue { color: var(--bad); font-weight: 650; }

/* Dashboard */
.hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; padding: 22px 24px; border-radius: 16px; color: #fff;
    background: radial-gradient(120% 140% at 100% 0%, rgba(217, 162, 58, .38) 0%, transparent 45%), linear-gradient(120deg, var(--wall) 0%, var(--wall-2) 60%, #1b4d80 100%); box-shadow: var(--shadow-lift); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.14) 0 16px, transparent 16px 26px); }
.hero h1 { font-size: 26px; color: #fff; }
.hero-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.hero-sub { color: var(--wall-ink); margin-top: 4px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hero .btn { background: var(--accent); color: #241603; box-shadow: none; }
.hero .btn:hover { background: #ecb850; }
.hero .btn.secondary { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.28); }
.hero .btn.secondary:hover { background: rgba(255,255,255,.2); color: #fff; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 12px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); box-shadow: var(--shadow); position: relative; overflow: hidden; transition: transform .12s, box-shadow .12s; }
.kpi:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line-strong); }
.kpi.tone-good::before { background: var(--ok); } .kpi.tone-bad::before { background: var(--bad); } .kpi.tone-accent::before { background: var(--accent); } .kpi.tone-plain::before { background: var(--brand); }
.kpi-icon { grid-row: 1 / span 3; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-deep); }
.kpi.tone-good .kpi-icon { background: var(--ok-soft); color: var(--ok); } .kpi.tone-bad .kpi-icon { background: var(--bad-soft); color: var(--bad); } .kpi.tone-accent .kpi-icon { background: var(--accent-soft); color: var(--accent-deep); }
.kpi-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.kpi-value { font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-hint { font-size: 12px; color: var(--faint); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 18px; align-items: start; }
@media (max-width: 500px) { .dash-grid { grid-template-columns: 1fr; } }
.colchart { display: flex; align-items: stretch; gap: 8px; height: 220px; padding: 18px 20px 12px; }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 0; }
.col-bar { width: 100%; max-width: 38px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--brand) 0%, #3f7fc4 100%); min-height: 2px; transition: filter .12s; }
.col:hover .col-bar { filter: brightness(1.1); }
.col:last-child .col-bar { background: linear-gradient(180deg, var(--accent) 0%, #f0cc7c 100%); }
.col-value { font-size: 10.5px; color: var(--muted); margin-bottom: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.col-label { font-size: 11px; color: var(--muted); margin-top: 6px; font-weight: 600; }
.task-list { list-style: none; margin: 0; padding: 4px 0; }
.task-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 20px; border-bottom: 1px solid var(--line); }
.task-list li:last-child { border-bottom: 0; }
.welcome h2 { font-size: 18px; }

/* Company picker */
.select-head { max-width: 720px; margin: 10px 0 22px; }
.select-head h1 { font-size: 28px; }
.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.company-card { display: flex; flex-direction: column; gap: 14px; padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); margin: 0; transition: box-shadow .12s, border-color .12s; }
.company-card:hover { box-shadow: var(--shadow-lift); border-color: var(--line-strong); }
.company-card.is-current { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow); }
.company-card-top { display: flex; gap: 12px; align-items: flex-start; }
.company-card-top > div { flex: 1; min-width: 0; }
.company-card-top strong { font-size: 16px; }
.company-mark { width: 44px; height: 44px; border-radius: 12px; font-size: 18px; }
.fy-pick select { margin-top: 5px; }

/* Setup */
.setup-hero { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 22px 24px; margin-bottom: 20px; border-radius: 16px; background: linear-gradient(120deg, #fbf3e6 0%, #f3e6cf 100%); border: 1px solid #ecd9b8; }
.setup-hero h1 { font-size: 26px; color: var(--wall); }
.setup-hero p { max-width: 640px; margin: 6px 0 0; }
.setup-hero .hero-kicker { color: var(--accent-deep); }
.setup-facts { display: flex; gap: 10px; }
.setup-facts span { padding: 8px 14px; border-radius: 12px; background: #fff; border: 1px solid #ecd9b8; color: var(--muted); }
.setup-facts strong { color: var(--wall); font-size: 18px; margin-right: 4px; }
.setup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.setup-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s, border-color .12s; }
.setup-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--accent); }
.setup-card strong { font-size: 15px; }
.setup-card .muted { font-size: 13px; }
.setup-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--wall); color: var(--accent); margin-bottom: 6px; }

/* Files */
.thumb { max-width: 160px; max-height: 120px; border-radius: 8px; border: 1px solid var(--line); display: block; margin-bottom: 4px; }
.file-current { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 6px; }
.file-current .thumb { margin: 0; max-height: 60px; }

/* Branch switcher */
.switcher { display: flex; gap: 6px; }
.switcher select { width: auto; max-width: 200px; padding: 6px 9px; border-radius: 999px; }
@media (max-width: 900px) { .switcher select { max-width: 120px; } }

/* Small drop-down menus (no JavaScript needed) */
details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 210px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lift); padding: 5px; }
.menu-list a { display: block; padding: 7px 10px; border-radius: 7px; color: var(--ink); white-space: nowrap; }
.menu-list a:hover { background: var(--bg); text-decoration: none; }
.menu-list form { margin: 0; }
textarea.code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; line-height: 1.5; min-height: 360px; white-space: pre; tab-size: 2; }

/* Reports */
.bars .bar { fill: var(--brand); opacity: .9; }
.bars .bar-label { font-size: 12px; fill: var(--muted); }
.bars .bar-value { font-size: 12px; fill: var(--ink); }
tr.totals td { border-top: 2px solid var(--line-strong); background: var(--panel-2); }

/* Progress bar */
.progress { height: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); }

/* Dashboards (designed widgets) */
.stat small { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { display: block; font-size: 22px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.widget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
@media (max-width: 500px) { .widget-grid { grid-template-columns: 1fr; } }

/* Bell and comments */
.bell { position: relative; display: inline-flex; align-items: center; color: var(--muted); padding: 7px; border-radius: 999px; }
.bell:hover { background: var(--bg); text-decoration: none; color: var(--ink); }
.bell-count { position: absolute; top: 0; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #241603; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
.timeline li.unread { background: var(--brand-soft); }
.comment-body { margin-top: 4px; white-space: normal; overflow-wrap: anywhere; }
.link-button { background: none; border: 0; padding: 0 4px; color: var(--faint); font: inherit; font-size: 12px; cursor: pointer; }
.link-button:hover { color: var(--bad); text-decoration: underline; }

/* Workflow diagram */
.wf-diagram { font-size: 12px; max-width: none; }
.wf-node rect { fill: var(--panel); stroke: var(--line-strong); stroke-width: 1.5; }
.wf-start rect { fill: var(--brand-soft); stroke: var(--brand); }
.wf-end rect { fill: var(--ok-soft); stroke: var(--ok); }
.wf-approval rect, .wf-task rect { stroke: var(--accent); }
.wf-parallel rect { stroke-dasharray: 5 3; }
.wf-node-label { font-weight: 600; fill: var(--ink); }
.wf-node-type { fill: var(--faint); font-size: 10px; }
.wf-edge { fill: none; stroke: var(--muted); stroke-width: 1.4; }
.wf-back { stroke-dasharray: 4 3; }
.wf-arrowhead { fill: var(--muted); }
.wf-edge-label { fill: var(--muted); font-size: 10.5px; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }

/* Qadim */
.sahayak { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .sahayak { grid-template-columns: 1fr; } }
.chat-log { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; max-height: 60vh; overflow-y: auto; }
.msg { padding: 9px 13px; border-radius: 14px; max-width: 88%; white-space: pre-wrap; line-height: 1.45; }
.msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.question { border-color: var(--accent); background: var(--accent-soft); }
.msg.tool { align-self: flex-start; font-size: 12px; color: var(--muted); padding: 2px 12px; }
.msg.working { color: var(--muted); }
.msg.error { align-self: stretch; max-width: none; background: var(--bad-soft); color: var(--bad); border: 1px solid #f2c4bf; }
.chat-input { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.chat-options { display: flex; flex-wrap: wrap; gap: 6px; }
.plan-area { padding: 12px 16px 4px; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--accent-deep); }
.plan-op { display: flex; gap: 10px; align-items: flex-start; padding: 9px 16px; border-top: 1px solid var(--line); cursor: pointer; font-weight: 400; color: var(--ink); }
.plan-op input { margin-top: 4px; width: auto; }
.plan-op.risky { background: #fff6ec; }
.plan-op.risky strong { color: var(--bad); }
.plan-op.bad { background: var(--bad-soft); }
.plan-op pre { white-space: pre-wrap; font-size: 12px; max-height: 240px; overflow: auto; }
.error-text { color: var(--bad); }
.plan-actions { display: flex; gap: 8px; }
.apply-box { border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.risky-confirm { color: var(--bad); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
pre.payload { white-space: pre-wrap; word-break: break-word; padding: 12px 16px; max-height: 70vh; overflow: auto; font-size: 12px; }

@media print {
    .sidebar, .topbar, .hero-actions, .toolbar, .btn { display: none !important; }
    .shell { display: block; } .content { padding: 0; max-width: none; } .panel { box-shadow: none; }
}

/* Setup checklist */
.checklist { margin-bottom: 20px; }
.checklist-head { display: flex; gap: 18px; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.checklist-head h2 { margin: 0 0 2px; font-size: 17px; }
.ring { --p: 0; flex: none; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
    background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line) 0); }
.ring span { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--panel); font-weight: 800; color: var(--wall); }
.next-step { margin-top: 6px; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); }
.steps-list { list-style: none; margin: 0; padding: 6px 0; columns: 2 340px; column-gap: 0; }
.steps-list li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 20px; break-inside: avoid; }
.steps-list .tick { flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--line-strong); color: #fff; font-size: 12px; font-weight: 800; }
.steps-list li.done .tick { background: var(--ok); border-color: var(--ok); }
.steps-list li.done span:not(.tick) { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.steps-list li.optional:not(.done) .tick { border-style: dashed; }
.steps-list .badge { margin-left: 6px; }

/* Activity timeline */
.activity { list-style: none; margin: 0; padding: 6px 0; }
.activity-day { padding: 12px 20px 4px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-deep); }
.activity-row { display: flex; align-items: baseline; gap: 12px; padding: 7px 20px; position: relative; }
.activity-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); transform: translateY(-1px); }
.verb-submitted .activity-dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.verb-cancelled .activity-dot, .verb-deleted .activity-dot { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.verb-created .activity-dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.activity-text { flex: 1; min-width: 0; }
.activity-time { flex: none; font-variant-numeric: tabular-nums; font-size: 12px; }

/* AI model picker */
.model-pick { display: grid; gap: 6px; margin-bottom: 12px; }
.model-pick-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--muted); }

/* Jobs and the team report */
.job-progress { display: flex; align-items: center; gap: 10px; }
.job-progress-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.job-progress-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--ok)); border-radius: inherit; transition: width .3s; }
.job-progress-label { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.task-rows { display: grid; gap: 10px; }
.task-row { display: grid; grid-template-columns: minmax(180px, 3fr) minmax(120px, 1.4fr) 150px 110px; gap: 8px; margin-bottom: 10px; }
.task-rows .task-row { margin-bottom: 0; }
.task-rows > .btn { justify-self: start; }
.two-col .task-row { grid-template-columns: 1fr 1fr; }
.two-col .task-row input[name="title"] { grid-column: 1 / -1; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.inline-form input[type="date"] { width: auto; padding: 5px 8px; }
table.list tr.selected td { background: var(--brand-soft); }
@media (max-width: 720px) { .task-row { grid-template-columns: 1fr 1fr; } .task-row input:first-child { grid-column: 1 / -1; } }

/* Designer: palette and drag-and-drop form canvas */
.designer { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.palette { position: sticky; top: 76px; max-height: calc(100vh - 96px); display: flex; flex-direction: column; }
.palette-body { padding: 4px 12px 14px; overflow-y: auto; }
.palette-body > p { margin: 6px 4px 10px; font-size: 12.5px; }
.palette-group { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 12px 4px 6px; }
.palette-item { display: flex; align-items: center; gap: 9px; padding: 7px 9px; margin-bottom: 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink); font-size: 13px; cursor: grab; transition: border-color .12s, transform .12s, box-shadow .12s; }
.palette-item:hover { text-decoration: none; border-color: var(--brand); box-shadow: var(--shadow); transform: translateX(2px); }
.palette-item:active { cursor: grabbing; }
.palette-glyph { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--brand-soft); color: var(--brand-deep); font-size: 12px; font-weight: 800; flex: none; }
.canvas { list-style: none; margin: 0; padding: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-height: 160px; }
.canvas-field { display: flex; gap: 10px; align-items: flex-start; padding: 12px 12px 12px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); cursor: grab; transition: box-shadow .15s, border-color .15s, opacity .15s, transform .15s; }
.canvas-field:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.canvas-field.wide { grid-column: 1 / -1; }
.canvas-field.dragging { opacity: .45; transform: scale(.98); }
.canvas-field.drop-before { box-shadow: inset 0 3px 0 var(--accent); }
.canvas-field.drop-after { box-shadow: inset 0 -3px 0 var(--accent); }
.drag-handle { color: var(--faint); letter-spacing: -2px; font-size: 14px; line-height: 22px; padding: 0 2px; user-select: none; }
.canvas-main { flex: 1; min-width: 0; }
.canvas-section { font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--accent-deep); margin-bottom: 4px; }
.canvas-label { font-weight: 700; color: var(--ink); }
.canvas-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; font-size: 12px; }
.type-chip { display: inline-flex; gap: 4px; padding: 1px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
.canvas-ghost-input { height: 30px; margin-top: 8px; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--panel-2); }
.canvas-field.wide .canvas-ghost-input { height: 52px; }
.canvas-tools { display: flex; gap: 2px; opacity: .35; transition: opacity .15s; }
.canvas-field:hover .canvas-tools, .canvas-field:focus-within .canvas-tools { opacity: 1; }
.icon-btn { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 0; }
.icon-btn:hover { background: var(--panel-2); border-color: var(--line); color: var(--ink); text-decoration: none; }
.icon-btn.danger:hover { color: var(--bad); background: var(--bad-soft); }
.canvas-empty { grid-column: 1 / -1; display: grid; place-items: center; min-height: 140px; border: 2px dashed var(--line-strong); border-radius: 12px; color: var(--muted); text-align: center; padding: 20px; }
.canvas.drop-end { box-shadow: inset 0 -3px 0 var(--accent); }
.canvas.palette-over .canvas-empty { border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 900px) { .designer { grid-template-columns: 1fr; } .palette { position: static; max-height: none; } .canvas { grid-template-columns: 1fr; } }

/* Sidebar footer: always at the bottom of the menu */
.sidebar > .nav, .sidebar > .nav-group, .sidebar > details { flex: none; }
.sidebar-foot { position: sticky; bottom: 0; margin: auto -12px 0; padding: 12px 16px 14px; background: linear-gradient(180deg, transparent, var(--wall-2) 30%); border-top: 1px solid rgba(255, 255, 255, .06); font-size: 11.5px; line-height: 1.5; color: var(--wall-faint); display: flex; flex-direction: column; white-space: nowrap; }
.sidebar-foot .sf-version { font-weight: 700; color: var(--wall-ink); letter-spacing: .02em; }
.sidebar-foot a { color: var(--accent); font-size: 11px; }
.mode-setup .sidebar-foot { background: linear-gradient(180deg, transparent, #e9ddc9 30%); border-top-color: rgba(11, 37, 69, .08); }
.mode-setup .sidebar-foot .sf-version { color: #3d3524; }
.mode-setup .sidebar-foot a { color: var(--accent-deep); }

/* Help and lock buttons in the top bar */
.lock-form { display: inline-flex; margin: 0; }
button.bell { border: 0; background: none; cursor: pointer; font: inherit; }
.bell:hover { background: var(--panel-2); color: var(--ink); }

/* Splash: once per browser session, five seconds */
.splash { display: none; }
.splashing .splash { display: grid; place-items: center; position: fixed; inset: 0; z-index: 1000; background: radial-gradient(80% 60% at 70% 20%, rgba(217, 162, 58, .28) 0%, transparent 55%), linear-gradient(135deg, var(--wall) 0%, var(--wall-2) 60%, #1b4d80 100%); color: #fff; transition: opacity .5s ease; }
.splashing .splash.leaving { opacity: 0; }
.splash-inner { text-align: center; padding: 24px; animation: splash-rise .9s ease both; }
.splash-inner img { width: min(360px, 78vw); height: auto; filter: drop-shadow(0 12px 30px rgba(0, 0, 0, .35)); }
.splash-tag { margin-top: 14px; color: #d8dcef; font-size: 15px; letter-spacing: .01em; }
.splash-bar { width: min(280px, 60vw); height: 4px; margin: 28px auto 0; border-radius: 999px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.splash-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #f3d48f); border-radius: inherit; animation: splash-load 5s linear forwards; }
.splash-foot { margin-top: 16px; font-size: 11.5px; color: #a9b3d6; letter-spacing: .08em; text-transform: uppercase; }
@keyframes splash-rise { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes splash-load { to { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .splash-inner, .splash-bar span { animation-duration: .01s; } }

/* Help */
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.help-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; color: var(--ink); transition: transform .12s, box-shadow .12s; }
.help-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.help-layout { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.help-index { display: flex; flex-direction: column; padding: 8px; position: sticky; top: 76px; }
.help-index a { padding: 7px 10px; border-radius: 8px; color: var(--ink); }
.help-index a.on { background: var(--brand-soft); color: var(--brand-deep); font-weight: 700; }
.help-body { padding: 8px 28px 24px; max-width: 820px; line-height: 1.7; }
.help-body h2 { margin-top: 18px; }
@media (max-width: 900px) { .help-layout { grid-template-columns: 1fr; } .help-index { position: static; } }

/* Qila Packs */
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.pack-card { display: flex; gap: 14px; padding: 18px; color: var(--ink); transition: transform .12s, box-shadow .12s; }
.pack-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.pack-icon { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 14px; background: linear-gradient(135deg, var(--wall), var(--brand)); color: var(--accent); font-size: 24px; box-shadow: inset 0 -3px 0 rgba(217, 162, 58, .55); }
.pack-icon.inline { display: inline-grid; width: 38px; height: 38px; font-size: 19px; vertical-align: middle; border-radius: 11px; }
.pack-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pack-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.pack-list { margin: 0; padding-left: 20px; line-height: 1.8; }
.pack-adds { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; margin: 0; }
.pack-adds dt { font-weight: 700; color: var(--muted); font-size: 13px; }
.pack-adds dd { margin: 0; }

/* Notifications side panel (all screen sizes) */
.offcanvas-backdrop { position: fixed; inset: 0; background: rgba(11, 37, 69, .35); z-index: 60; opacity: 0; transition: opacity .2s; }
.offcanvas-backdrop.open { opacity: 1; }
.offcanvas { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 92vw); z-index: 61; background: var(--panel); box-shadow: -18px 0 40px rgba(11, 37, 69, .22); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .22s ease; }
.offcanvas.open { transform: none; }
.offcanvas-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.offcanvas-head h2 { margin: 0; font-size: 17px; flex: 1; }
.small-link { font-size: 13px; }
.offcanvas-body { overflow-y: auto; flex: 1; }
.offcanvas-actions { padding: 10px 20px 0; }
.note-list { list-style: none; margin: 0; padding: 6px 0; }
.note-list li a { display: flex; flex-direction: column; gap: 2px; padding: 12px 20px; color: var(--ink); border-bottom: 1px solid var(--line); position: relative; }
.note-list li a:hover { background: var(--panel-2); text-decoration: none; }
.note-list li.unread a { background: var(--brand-soft); }
.note-list li.unread a::before { content: ""; position: absolute; left: 8px; top: 18px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.note-body { color: var(--muted); font-size: 13px; }
.note-time { color: var(--faint); font-size: 12px; }

/* Lock screen: a screen saver until woken, then one small field */
.lock-screen { margin: 0; min-height: 100vh; overflow: hidden; display: grid; place-items: center; color: #fff; font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: radial-gradient(70% 60% at 75% 15%, rgba(217, 162, 58, .22) 0%, transparent 60%), linear-gradient(160deg, #081a33 0%, var(--wall) 45%, #143d6b 100%); }
.lock-glow { position: fixed; width: 60vmax; height: 60vmax; left: -15vmax; bottom: -30vmax; border-radius: 50%; background: radial-gradient(circle, rgba(23, 80, 140, .45), transparent 65%); animation: lock-drift 18s ease-in-out infinite alternate; pointer-events: none; }
@keyframes lock-drift { to { transform: translate(25vmax, -12vmax); } }
.lock-logo { position: fixed; top: 28px; left: 32px; width: 150px; height: auto; opacity: .9; }
.lock-clock { text-align: center; transition: transform .45s ease, opacity .45s ease; }
.lock-time { font-size: clamp(72px, 14vw, 150px); font-weight: 200; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 0 10px 40px rgba(0, 0, 0, .35); }
.lock-date { margin-top: 10px; font-size: clamp(16px, 2.4vw, 22px); color: #cfd8ee; letter-spacing: .02em; }
.lock-hint { position: fixed; bottom: 48px; left: 0; right: 0; text-align: center; color: #a9b3d6; font-size: 13px; letter-spacing: .06em; animation: lock-pulse 2.6s ease-in-out infinite; }
@keyframes lock-pulse { 50% { opacity: .35; } }
.lock-card { position: fixed; left: 50%; top: 58%; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(300px, 86vw); transition: transform .4s ease, opacity .4s ease; }
.lock-avatar { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), #0a2342); font-weight: 800; font-size: 22px; box-shadow: 0 0 0 3px rgba(217, 162, 58, .7), 0 12px 30px rgba(0, 0, 0, .35); }
.lock-name { font-weight: 700; font-size: 16px; }
.lock-input-row { display: flex; width: 100%; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; padding: 4px; backdrop-filter: blur(10px); }
.lock-input-row input { flex: 1; min-width: 0; background: none; border: 0; color: #fff; padding: 9px 14px; font: inherit; font-size: 15px; letter-spacing: .08em; outline: none; }
.lock-input-row input::placeholder { color: #b8c2e0; letter-spacing: normal; }
.lock-input-row button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--accent); color: #241703; font-size: 18px; font-weight: 800; cursor: pointer; }
.lock-error { color: #ffc9c2; font-size: 13px; text-align: center; }
.lock-switch { position: fixed; bottom: 20px; right: 24px; }
.lock-switch button { background: none; border: 0; color: #a9b3d6; font: inherit; font-size: 13px; cursor: pointer; }
.lock-switch button:hover { color: #fff; }
.lock-screen.awake .lock-clock { transform: translateY(-16vh) scale(.62); opacity: .85; }
.lock-screen.awake .lock-hint { opacity: 0; animation: none; }
.lock-screen.awake .lock-card { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.lock-screen .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Company actions */
.company-menu .menu-list { right: 0; left: auto; min-width: 260px; }
.delete-company { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); }
.delete-company input { padding: 6px 8px; }
.menu-note { padding: 10px 12px; font-size: 12.5px; border-top: 1px solid var(--line); }

/* In-app assistant: floating button and chat window */
.ai-fab { position: fixed; right: 22px; bottom: 22px; z-index: 55; width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--wall), var(--brand)); color: var(--accent); box-shadow: 0 10px 28px rgba(11, 37, 69, .35), inset 0 -3px 0 rgba(217, 162, 58, .6); transition: transform .15s, box-shadow .15s; }
.ai-fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 34px rgba(11, 37, 69, .42), inset 0 -3px 0 rgba(217, 162, 58, .6); }
.ai-chat { position: fixed; right: 22px; bottom: 90px; z-index: 56; width: min(400px, calc(100vw - 32px)); height: min(560px, calc(100vh - 130px)); display: flex; flex-direction: column;
    background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 60px rgba(11, 37, 69, .3); overflow: hidden; animation: ai-pop .18s ease; }
@keyframes ai-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.ai-chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; background: linear-gradient(135deg, var(--wall), var(--wall-2)); color: #fff; }
.ai-chat-head small { display: block; color: #b9c4e2; font-size: 11.5px; }
.ai-chat-head .icon-btn { color: #d5ddf2; }
.ai-chat-head .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; border-color: transparent; }
.ai-chat-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(217, 162, 58, .2); color: var(--accent); }
.ai-chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.ai-msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.ai-msg p { margin: 0 0 6px; } .ai-msg p:last-child { margin-bottom: 0; }
.ai-msg table { border-collapse: collapse; font-size: 12.5px; margin: 6px 0; width: 100%; } .ai-msg th, .ai-msg td { border-bottom: 1px solid var(--line); padding: 3px 6px; text-align: left; }
.ai-msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.ai-msg.bot { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ai-msg.bad { border-color: #f2c4bf; background: var(--bad-soft); color: var(--bad); }
.ai-msg.thinking { color: var(--muted); font-style: italic; }
.ai-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ai-actions a { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
.ai-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ai-suggest button { border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--ink); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12.5px; cursor: pointer; }
.ai-suggest button:hover { border-color: var(--brand); }
.ai-chat-input { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); background: var(--panel); }
.ai-chat-input input { flex: 1; min-width: 0; border: 1px solid var(--line-strong); border-radius: 999px; padding: 8px 14px; font: inherit; }
.ai-send, .ai-mic { width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; flex: none; font-size: 15px; }
.ai-send { background: var(--brand); color: #fff; }
.ai-mic { background: var(--panel-2); border: 1px solid var(--line); }
.ai-mic.listening { background: var(--bad); color: #fff; animation: lock-pulse 1.2s infinite; }
@media print { .ai-fab, .ai-chat { display: none !important; } }

/* Qila Hub */
.hub-tag { align-self: center; margin-left: -4px; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: #2b1a05; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
@media (min-width: 901px) {
.nav-collapsed .sidebar:not(:hover) .hub-tag { display: none; }
}


/* Rows tables: the record picker gets room; headers sit right on their inputs */
table.rows th { vertical-align: bottom; }
table.rows td:nth-child(2) { min-width: 220px; }
table.rows td input[data-link-target] { min-width: 200px; }

/* Long tables keep their column headings in view while scrolling */
.table-wrap { overflow: auto; max-height: calc(100vh - 190px); }
table.list thead th, table.rows thead th { position: sticky; top: 0; z-index: 2; background: var(--panel-2); box-shadow: inset 0 -1px 0 var(--line); }
table.rows thead th { background: var(--panel); }

/* Column help: an (i) beside the heading, with a short explanation on hover or focus */
.col-help { display: inline-grid; place-items: center; width: 15px; height: 15px; margin-left: 5px; border-radius: 50%; border: 1px solid currentColor; font-size: 10px; font-weight: 800; font-style: normal; text-transform: none; letter-spacing: 0; cursor: help; position: relative; opacity: .7; vertical-align: 1px; }
.col-help:hover, .col-help:focus { opacity: 1; outline: none; }
.col-help::after { content: attr(data-tip); position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 260px; padding: 8px 10px; border-radius: 8px; background: var(--wall); color: #fff; font-size: 12px; font-weight: 500; line-height: 1.45; white-space: normal; text-align: left; box-shadow: 0 10px 24px rgba(11, 37, 69, .25); opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 20; }
.col-help:hover::after, .col-help:focus::after { opacity: 1; }

/* Scrollbars: no scrollbar in the menu; elsewhere a slim thumb without arrows */
.sidebar { scrollbar-width: none; }
.sidebar::-webkit-scrollbar { display: none; }
* { scrollbar-width: thin; scrollbar-color: rgba(23, 80, 140, .28) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(23, 80, 140, .28); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(23, 80, 140, .5); }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }

/* The menu footer covers what scrolls under it */
.sidebar-foot { background: var(--wall-2); box-shadow: 0 -10px 16px -6px rgba(11, 37, 69, .6); }
.mode-setup .sidebar-foot { background: #e9ddc9; box-shadow: 0 -10px 16px -8px rgba(61, 53, 36, .25); }

/* Sign-in: the lock screen's look, with the logo in the middle */
.login-box { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(340px, 88vw); animation: splash-rise .7s ease both; }
.login-logo { width: min(300px, 76vw); height: auto; margin-bottom: 18px; filter: drop-shadow(0 12px 30px rgba(0, 0, 0, .35)); }
.login-sub { margin: -26px 0 14px; padding: 2px 10px; border-radius: 999px; background: var(--accent); color: #2b1a05; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.login-form { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.login-form .lock-input-row input { padding: 10px 16px; }
.login-form .lock-input-row:first-of-type { padding-right: 4px; }
.login-form .pin-field { letter-spacing: .5em; }
.login-switch { color: #b8c2e0; font-size: 13px; margin-top: 4px; }
.login-switch:hover { color: #fff; }
.login-foot { position: fixed; bottom: 18px; left: 0; right: 0; text-align: center; color: #8f9bc2; font-size: 12px; }
.login-foot a { color: var(--accent); }

/* Due dates */
tr.due-soon td { background: var(--accent-soft); }
tr.due-past td { opacity: .6; }
.nowrap { white-space: nowrap; }
.extend-form { right: 0; left: auto; min-width: 230px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.due-panel { border-top: 3px solid var(--accent); }

/* Business type and per-company packs */
.business-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.business-card { display: flex; gap: 14px; padding: 18px; color: var(--ink); border: 2px solid transparent; transition: transform .12s, box-shadow .12s, border-color .12s; }
.business-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.business-card.on { border-color: var(--accent); }
.warn-box { background: var(--warn-soft); border-color: #fde68a; color: var(--warn); }
.install-panel label.inline { margin: 12px 0; }
.ws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 18px; }

/* Supplier quotations side by side */
table.compare td.best { background: var(--ok-soft); color: var(--ok); font-weight: 800; }
table.compare tr.totals td { border-top: 2px solid var(--line-strong); }

/* Guided tours */
.tour-spot { position: fixed; z-index: 900; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(8, 20, 40, .55), 0 0 0 3px var(--accent); pointer-events: none; transition: all .25s ease; }
.tour-pop { position: fixed; z-index: 901; width: min(340px, calc(100vw - 24px)); padding: 16px 18px 14px; background: var(--panel); border-radius: 14px; box-shadow: 0 20px 50px rgba(8, 20, 40, .35); transition: top .25s ease, left .25s ease; }
.tour-pop h3 { margin: 4px 0 6px; font-size: 16px; }
.tour-pop p { margin: 0 0 12px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.tour-kicker { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-deep); padding-right: 24px; }
.tour-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tour-never { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin: 0; }
.tour-btns { display: inline-flex; gap: 6px; }
.tour-x { position: absolute; top: 10px; right: 10px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; }
.tour-x:hover { color: var(--ink); }

/* ======================================================================
   Design v2: one look for Qila and Qila Hub. Everything below reads the
   theme variables, so the ten themes (further down) restyle all of it.
   ====================================================================== */
:root {
    --input-bg: #fff; --input-border: #d9d2c4; --row-hover: #faf7f1; --focus: rgba(23, 80, 140, .18);
    --hero-a: #081a33; --hero-b: #0b2545; --hero-c: #143d6b; --hero-glow: rgba(217, 162, 58, .22);
    --radius: 14px;
}
body { background: var(--bg); color: var(--ink); }

/* Boxes side by side never get the stacked-box gap */
.two-col > *, .dash-grid > *, .kpis > *, .help-grid > *, .pack-grid > *, .business-grid > * { margin-top: 0 !important; }
.panel { border-radius: var(--radius); border-color: var(--line); }
.panel-head { padding: 15px 22px; }
.panel-head h2 { font-size: 15px; }
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 24px; }

/* Inputs */
input, select, textarea { min-height: 40px; padding: 9px 12px; border: 1px solid var(--input-border); border-radius: 10px; background: var(--input-bg); color: var(--ink); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--input-border)); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--focus); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type=checkbox], input[type=radio] { min-height: 0; }
select { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
select[multiple] { background-image: none; padding-right: 12px; }
.field label, .field .label { font-size: 12.5px; font-weight: 650; color: var(--muted); margin-bottom: 6px; letter-spacing: .01em; }

/* Record forms: sections on a 12-column grid */
.form-section { padding: 22px 24px 24px; }
.form-section + .form-section { border-top: 1px solid var(--line); }
.form-section-title { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.form-section-title::before { content: ""; width: 4px; height: 16px; border-radius: 4px; background: var(--accent); }
.grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px 20px; }
.grid > .field, .grid > div:not(.section-title) { grid-column: span 4; }
.grid > .field.span-3 { grid-column: span 3; }
.grid > .field.span-6 { grid-column: span 6; }
.grid > .wide, .grid > .field.wide, .grid > .section-title { grid-column: 1 / -1; }
@media (max-width: 1280px) { .grid > .field, .grid > div:not(.section-title) { grid-column: span 6; } .grid > .field.span-3 { grid-column: span 4; } }
@media (max-width: 760px) { .grid > .field, .grid > .field.span-3, .grid > div:not(.section-title) { grid-column: 1 / -1; } }
.field.is-readonly .value { min-height: 40px; padding: 9px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); display: flex; align-items: center; }
.field.is-readonly .value.faint { font-style: italic; }
/* Yes/no fields as switches */
.field.is-check { display: flex; align-items: center; gap: 12px; padding-top: 26px; }
.field.is-check label { order: 2; margin: 0; font-size: 13.5px; color: var(--ink); font-weight: 600; cursor: pointer; }
.field.is-check .hint { order: 3; margin: 0; }
.field.is-check input[type=checkbox], label.inline input[type=checkbox] { appearance: none; width: 40px; height: 22px; flex: none; border-radius: 999px; background: var(--line-strong); position: relative; cursor: pointer; transition: background .15s; border: 0; }
.field.is-check input[type=checkbox]::after, label.inline input[type=checkbox]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.field.is-check input[type=checkbox]:checked, label.inline input[type=checkbox]:checked { background: var(--brand); }
.field.is-check input[type=checkbox]:checked::after, label.inline input[type=checkbox]:checked::after { transform: translateX(18px); }
label.inline { display: flex; align-items: center; gap: 10px; margin: 8px 0; color: var(--ink); font-weight: 600; }
/* The save bar stays in reach on long forms */
.form-foot { position: sticky; bottom: 0; z-index: 4; padding: 14px 24px; background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
/* Simple forms (labels around inputs, in side panels) */
.panel-body > label, form.panel .panel-body label:not(.inline) { margin-bottom: 14px; }

/* Buttons */
.btn { min-height: 38px; border-radius: 10px; font-weight: 650; }
.btn.small { min-height: 30px; border-radius: 8px; }

/* Tables fit their box; long text wraps instead of pushing the box wider */
table.list td { padding: 12px 16px; overflow-wrap: anywhere; }
table.list tbody tr:hover td { background: var(--row-hover); }
table.list td .btn-row, td.btn-row { flex-wrap: wrap; }
table.list td .wrap, .wrap { white-space: normal !important; overflow-wrap: anywhere; }
.badge { border-color: color-mix(in srgb, currentColor 28%, transparent) !important; }
.flash.ok, .flash.bad, .warn-box { border-color: color-mix(in srgb, currentColor 25%, transparent); }
.mode-setup .nav a.on { background: var(--panel); }

/* Sign-in, lock screen and installer share the theme's gradient */
.lock-screen { background: radial-gradient(70% 60% at 75% 15%, var(--hero-glow) 0%, transparent 60%), linear-gradient(160deg, var(--hero-a) 0%, var(--hero-b) 45%, var(--hero-c) 100%); }
.field.is-check > label.inline { order: 1; margin: 0; gap: 0; font-size: 0; }
.field.is-check > label:not(.inline) { order: 2; }

/* Calendar */
.calendar-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .calendar-layout { grid-template-columns: 1fr; } }
.calendar-layout > * { margin-top: 0 !important; }
.calendar { padding: 14px; overflow: visible; }
.cal-legend { display: flex; gap: 14px; align-items: center; padding: 0 4px 12px; font-size: 12.5px; color: var(--muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 4px 8px; }
.cal-day { position: relative; min-height: 104px; padding: 8px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; outline: none; }
.cal-day.other { opacity: .45; }
.cal-day.past .cal-num { color: var(--faint); }
.cal-day.today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.cal-day.today .cal-num { background: var(--brand); color: var(--brand-ink); }
.cal-day.busy { cursor: default; }
.cal-num { align-self: flex-start; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.cal-chip { display: block; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip.filing { background: var(--accent-soft); color: var(--accent-deep); }
.cal-chip.task { background: var(--brand-soft); color: var(--brand-deep); }
.cal-chip.job { background: var(--ok-soft); color: var(--ok); }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 4px; }
.cal-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 5px; }
.cal-dot.filing { background: var(--accent); } .cal-dot.task { background: var(--brand); } .cal-dot.job { background: var(--ok); }
.cal-legend .cal-dot { margin: 0 2px 0 6px; }
.cal-pop { display: none; position: absolute; z-index: 30; top: calc(100% - 6px); left: 50%; transform: translateX(-50%); width: 290px; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-lift); }
.cal-day:hover .cal-pop, .cal-day:focus-within .cal-pop { display: block; }
.cal-grid > .cal-day:nth-child(7n + 1) .cal-pop { left: 0; transform: none; }
.cal-grid > .cal-day:nth-child(7n) .cal-pop { left: auto; right: 0; transform: none; }
.cal-pop-date { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.cal-item { display: flex; gap: 9px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.cal-item:first-of-type { border-top: 0; }
.cal-extend summary { font-size: 12px; color: var(--brand); cursor: pointer; margin-top: 4px; }
.cal-extend form { display: flex; gap: 6px; margin-top: 6px; }
.cal-extend input { min-height: 32px; padding: 4px 8px; }
@media (max-width: 760px) { .cal-day { min-height: 64px; } .cal-chip { font-size: 0; height: 6px; padding: 0; } }
.cal-grid > .cal-day:nth-last-child(-n+7) .cal-pop { top: auto; bottom: calc(100% - 6px); }

/* ======================================================================
   Themes (My account, Appearance). Light: classic, teal, rose, sage,
   lavender. Dark: midnight, charcoal, forest, plum, ocean.
   ====================================================================== */
html[data-theme="teal"] { --brand: #0f766e; --brand-deep: #0b5953; --brand-soft: #e4f4f1; --accent: #f59e0b; --accent-soft: #fef3dc; --accent-deep: #a3620a;
    --wall: #0b3b3a; --wall-2: #115e59; --wall-ink: #c9e7e3; --wall-faint: #7fb5ae; --bg: #f4f7f6; --panel-2: #f7faf9; --line: #e0e9e7; --line-strong: #cbd9d6; --input-border: #cbd9d6; --row-hover: #f1f8f6; --focus: rgba(15, 118, 110, .2);
    --hero-a: #052826; --hero-b: #0b3b3a; --hero-c: #11655f; --hero-glow: rgba(245, 158, 11, .2); }
html[data-theme="rose"] { --brand: #be185d; --brand-deep: #9d174d; --brand-soft: #fce7f1; --accent: #e9a23b; --accent-soft: #fdf1df; --accent-deep: #9a5f0f;
    --wall: #4a1631; --wall-2: #6b1d45; --wall-ink: #f3d3e2; --wall-faint: #c48aa6; --bg: #fbf6f7; --panel-2: #fdf9fa; --line: #f0e3e8; --line-strong: #e2ccd5; --input-border: #e2ccd5; --row-hover: #fcf3f6; --focus: rgba(190, 24, 93, .18);
    --hero-a: #2d0b1d; --hero-b: #4a1631; --hero-c: #7a2150; --hero-glow: rgba(233, 162, 59, .22); }
html[data-theme="sage"] { --brand: #4d7c0f; --brand-deep: #3f6212; --brand-soft: #eef5e3; --accent: #ca8a04; --accent-soft: #fbf3d9; --accent-deep: #8a5e05;
    --wall: #1f3a24; --wall-2: #2e5233; --wall-ink: #d3e5cf; --wall-faint: #93b38c; --bg: #f5f7f1; --panel-2: #f9faf6; --line: #e3e8da; --line-strong: #cfd8c3; --input-border: #cfd8c3; --row-hover: #f3f7ec; --focus: rgba(77, 124, 15, .2);
    --hero-a: #12241a; --hero-b: #1f3a24; --hero-c: #355e30; --hero-glow: rgba(202, 138, 4, .22); }
html[data-theme="lavender"] { --brand: #6d28d9; --brand-deep: #5b21b6; --brand-soft: #efe9fd; --accent: #db2777; --accent-soft: #fce7f1; --accent-deep: #9d174d;
    --wall: #2e1065; --wall-2: #4c1d95; --wall-ink: #ddd3fa; --wall-faint: #a693d9; --bg: #f7f6fb; --panel-2: #faf9fd; --line: #e7e4f2; --line-strong: #d4cfe8; --input-border: #d4cfe8; --row-hover: #f5f2fd; --focus: rgba(109, 40, 217, .18);
    --hero-a: #1a0740; --hero-b: #2e1065; --hero-c: #55209e; --hero-glow: rgba(219, 39, 119, .22); }

/* Dark themes share their surfaces; each sets its own colours */
html[data-mode="dark"] { color-scheme: dark; --brand-ink: #071226; --wall-ink: #c9d4ea; --wall-faint: #7f8fb0;
    --ok: #4ade80; --ok-soft: rgba(74, 222, 128, .12); --bad: #f87171; --bad-soft: rgba(248, 113, 113, .12); --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .12);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25); --shadow-lift: 0 4px 10px rgba(0, 0, 0, .35), 0 18px 40px rgba(0, 0, 0, .35); }
html[data-theme="midnight"] { --bg: #0b1220; --panel: #111a2e; --panel-2: #0e1628; --ink: #e6ebf5; --muted: #9aa7c0; --faint: #6c7894; --line: #1f2a44; --line-strong: #2b3858;
    --brand: #5b9bf0; --brand-deep: #8ab8f5; --brand-soft: rgba(91, 155, 240, .14); --accent: #e0b35a; --accent-soft: rgba(224, 179, 90, .14); --accent-deep: #f0cd85;
    --wall: #070d18; --wall-2: #0d1a30; --input-bg: #0c1424; --input-border: #2b3858; --row-hover: #14203a; --focus: rgba(91, 155, 240, .25);
    --hero-a: #04080f; --hero-b: #0a1426; --hero-c: #13284a; --hero-glow: rgba(224, 179, 90, .16); }
html[data-theme="charcoal"] { --bg: #111112; --panel: #1b1b1d; --panel-2: #161618; --ink: #ececec; --muted: #a3a3a8; --faint: #6f6f75; --line: #2a2a2e; --line-strong: #3a3a40;
    --brand: #e0b35a; --brand-deep: #f5d58a; --brand-soft: rgba(224, 179, 90, .14); --accent: #f5d58a; --accent-soft: rgba(245, 213, 138, .12); --accent-deep: #f5d58a; --brand-ink: #1b1305;
    --wall: #0a0a0b; --wall-2: #18181b; --input-bg: #141416; --input-border: #3a3a40; --row-hover: #222226; --focus: rgba(224, 179, 90, .25);
    --hero-a: #050505; --hero-b: #121214; --hero-c: #26221a; --hero-glow: rgba(224, 179, 90, .2); }
html[data-theme="forest"] { --bg: #0b1310; --panel: #121e19; --panel-2: #0f1915; --ink: #e3efe9; --muted: #98b0a5; --faint: #64796f; --line: #1d2e27; --line-strong: #2a4037;
    --brand: #34d399; --brand-deep: #6ee7b7; --brand-soft: rgba(52, 211, 153, .13); --accent: #fbbf24; --accent-soft: rgba(251, 191, 36, .12); --accent-deep: #fcd34d; --brand-ink: #04170f;
    --wall: #07100c; --wall-2: #0f1f18; --input-bg: #0d1813; --input-border: #2a4037; --row-hover: #16261f; --focus: rgba(52, 211, 153, .22);
    --hero-a: #030806; --hero-b: #0a1712; --hero-c: #133325; --hero-glow: rgba(251, 191, 36, .14); }
html[data-theme="plum"] { --bg: #120c19; --panel: #1b1325; --panel-2: #170f20; --ink: #ede6f6; --muted: #ab9cc0; --faint: #74678a; --line: #2a1f38; --line-strong: #3b2d4e;
    --brand: #c084fc; --brand-deep: #d8b4fe; --brand-soft: rgba(192, 132, 252, .14); --accent: #f472b6; --accent-soft: rgba(244, 114, 182, .13); --accent-deep: #f9a8d4; --brand-ink: #1a0b2a;
    --wall: #0c0713; --wall-2: #1d1229; --input-bg: #150e1e; --input-border: #3b2d4e; --row-hover: #231831; --focus: rgba(192, 132, 252, .25);
    --hero-a: #07040b; --hero-b: #140b20; --hero-c: #2c1745; --hero-glow: rgba(244, 114, 182, .16); }
html[data-theme="ocean"] { --bg: #06161f; --panel: #0c212c; --panel-2: #091c26; --ink: #e2f1f7; --muted: #94b3c2; --faint: #5f7d8b; --line: #16313f; --line-strong: #224456;
    --brand: #38bdf8; --brand-deep: #7dd3fc; --brand-soft: rgba(56, 189, 248, .13); --accent: #fbbf24; --accent-soft: rgba(251, 191, 36, .12); --accent-deep: #fcd34d; --brand-ink: #03141c;
    --wall: #031017; --wall-2: #082230; --input-bg: #081b24; --input-border: #224456; --row-hover: #102a37; --focus: rgba(56, 189, 248, .22);
    --hero-a: #020a0f; --hero-b: #061a25; --hero-c: #0c3346; --hero-glow: rgba(251, 191, 36, .14); }

/* In dark themes Setup keeps the dark menu, and light-only details follow the surfaces */
html[data-mode="dark"] .mode-setup .sidebar { background: linear-gradient(180deg, var(--wall) 0%, var(--wall-2) 100%); color: var(--wall-ink); border-right-color: var(--line); }
html[data-mode="dark"] .mode-setup .sidebar-head, html[data-mode="dark"] .mode-setup .sidebar-foot { background: var(--wall); }
html[data-mode="dark"] .mode-setup .nav a { color: var(--wall-ink); }
html[data-mode="dark"] .mode-setup .nav a.on { background: rgba(255, 255, 255, .08); color: #fff; box-shadow: none; }
html[data-mode="dark"] .mode-setup .brand-name small, html[data-mode="dark"] .mode-setup .nav-title { color: var(--wall-faint); }
html[data-mode="dark"] .topbar { background: color-mix(in srgb, var(--panel) 92%, transparent); border-bottom-color: var(--line); }
html[data-mode="dark"] .setup-facts span { background: var(--panel); border-color: var(--line); }
html[data-mode="dark"] .plan-op.risky { background: var(--warn-soft); }
html[data-mode="dark"] .field.is-check input[type=checkbox]::after, html[data-mode="dark"] label.inline input[type=checkbox]::after { background: var(--ink); }

/* The theme picker */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.theme-option { position: relative; display: block; cursor: pointer; }
.theme-option input { position: absolute; opacity: 0; }
.theme-card { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel-2); transition: border-color .12s, transform .12s; }
.theme-option:hover .theme-card { transform: translateY(-1px); }
.theme-option input:checked + .theme-card { border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus); }
.theme-option input:focus-visible + .theme-card { outline: 2px solid var(--brand); }
.theme-swatch { height: 46px; border-radius: 8px; }
.theme-name { font-size: 13px; font-weight: 700; color: var(--ink); display: flex; justify-content: space-between; align-items: center; }
.theme-name small { font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.topbar { background: color-mix(in srgb, var(--panel) 92%, transparent); }
.lock-glow { background: radial-gradient(circle, color-mix(in srgb, var(--brand) 40%, transparent), transparent 65%); }
.lock-input-row button, .login-form button { background: var(--accent); }

/* Company printing settings */
.choice-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--panel-2); cursor: pointer; margin: 0; }
.choice:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus); }
.choice input { width: auto; min-height: 0; margin-top: 3px; accent-color: var(--brand); }
.choice span { display: flex; flex-direction: column; gap: 3px; color: var(--ink); }
.choice small { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.strip-preview { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.strip-preview img { max-width: 100%; max-height: 60px; border-radius: 6px; border: 1px solid var(--line); background: #fff; }

/* Danger zone */
.danger-panel { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.danger-panel .panel-head h2 { color: var(--bad); }
.btn.danger { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.danger.small { background: var(--panel); color: var(--bad); }
.nav a.danger-link { color: color-mix(in srgb, var(--bad) 70%, var(--wall-ink)); }
.mode-setup .nav a.danger-link { color: var(--bad); }

/* Automation rules */
.auto-action { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px 16px; margin: 0 0 14px; }
.auto-action legend { padding: 0 6px; font-weight: 600; color: var(--muted); font-size: 13px; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--panel-2, var(--bg)); border: 1px solid var(--line); font-size: 12px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 6px 0 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.test-actions { margin: 0; padding-left: 20px; }
details.panel > summary { cursor: pointer; list-style: none; }
details.panel > summary::-webkit-details-marker { display: none; }

/* Guide (Qila Hub) */
.guide { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: start; }
.guide-toc { position: sticky; top: 76px; }
.guide-toc .panel-body { display: flex; flex-direction: column; gap: 6px; }
.guide-toc a { color: var(--muted); text-decoration: none; font-size: 13.5px; }
.guide-toc a:hover { color: var(--ink); }
.guide-body { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.guide-body section { scroll-margin-top: 80px; }
.guide-body h3 { margin: 16px 0 6px; font-size: 14px; }
.guide-body ol { padding-left: 20px; line-height: 1.7; }
pre.cmd { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; font-size: 12.5px; line-height: 1.6; white-space: pre; }
@media (max-width: 900px) { .guide { grid-template-columns: 1fr; } .guide-toc { position: static; } }

/* ======================================================================
   Design v3: SAP Fiori "Horizon" look for Qila and Qila Hub.
   A full-width shell bar, a light side navigation, grey page ground,
   white cards, Fiori buttons, fields, tables, object status and tiles.
   Every rule reads the theme variables, so all ten themes still apply.
   ====================================================================== */
:root {
    --shellbar-h: 52px; --sidebar: 256px; --radius: 12px; --radius-sm: 8px;
    --shell-bg: #fff; --shell-ink: #1d2d3e; --side-bg: #fff; --side-ink: #1d2d3e; --side-faint: #556b82;
    --card-shadow: 0 0 .125rem rgba(34, 53, 72, .12), 0 .125rem .5rem rgba(34, 53, 72, .10);
    --card-shadow-hover: 0 0 .125rem rgba(34, 53, 72, .15), 0 .5rem 1rem rgba(34, 53, 72, .15);
    --field-border: #8396a8; --field-bg: #fff; --label: #556b82; --row-hover: #eaecee; --selected: #ebf8ff;
}
/* The default theme is Horizon: SAP blue on grey, orange accent. */
html[data-theme="classic"] {
    --brand: #0070f2; --brand-deep: #0058c2; --brand-soft: #e5f2ff; --brand-ink: #fff;
    --accent: #e76500; --accent-soft: #fff3e6; --accent-deep: #a94a00;
    --ink: #1d2d3e; --muted: #556b82; --faint: #8396a8; --bg: #f5f6f7; --panel: #fff; --panel-2: #f5f6f7;
    --line: #e5e5e5; --line-strong: #d9d9d9; --input-border: #8396a8; --focus: rgba(0, 112, 242, .25);
    --ok: #256f3a; --ok-soft: #f5fae5; --bad: #aa0808; --bad-soft: #ffeaf4; --warn: #e76500; --warn-soft: #fff8d6;
    --hero-a: #002a86; --hero-b: #0040b0; --hero-c: #0070f2; --hero-glow: rgba(231, 101, 0, .2);
}
html[data-mode="dark"] { --shell-bg: var(--panel); --shell-ink: var(--ink); --side-bg: var(--panel); --side-ink: var(--ink); --side-faint: var(--muted);
    --field-bg: var(--panel-2); --field-border: var(--line-strong); --label: var(--muted); --row-hover: rgba(255, 255, 255, .05); --selected: rgba(255, 255, 255, .07);
    --card-shadow: 0 0 0 1px var(--line), 0 .125rem .5rem rgba(0, 0, 0, .35); --card-shadow-hover: 0 0 0 1px var(--line-strong), 0 .5rem 1rem rgba(0, 0, 0, .45); }
body { font-family: "72", "Segoe UI", "Inter", system-ui, -apple-system, Roboto, "Noto Sans", sans-serif; font-size: 14px; background: var(--bg); color: var(--ink); }

/* Shell bar: one bar across the top */
.shellbar.topbar { position: fixed; top: 0; left: 0; right: 0; height: var(--shellbar-h); padding: 0 12px 0 8px; gap: 8px; z-index: 40;
    background: var(--shell-bg); color: var(--shell-ink); border-bottom: 0; backdrop-filter: none; box-shadow: 0 0 .125rem rgba(34, 53, 72, .15), 0 .125rem .5rem rgba(34, 53, 72, .12); }
.shell-menu { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; color: var(--shell-ink); cursor: pointer; flex: none; }
.shell-menu:hover { background: var(--row-hover); }
.shell-brand { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 8px; color: var(--shell-ink); flex: none; }
.shell-brand:hover { background: var(--row-hover); text-decoration: none; }
.shell-title { font-size: 16px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.shell-mode { padding: 1px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-deep); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.shellbar .workplace { border-radius: 8px; padding: 3px 10px 3px 4px; background: transparent; border-color: transparent; }
.shellbar .workplace:hover { background: var(--row-hover); border-color: transparent; box-shadow: none; }
.shellbar .workplace-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); }
.shell-search { position: relative; flex: 1; max-width: 460px; margin: 0 auto; }
.shell-search input { height: 36px; padding: 0 12px 0 36px; border-radius: 18px; border: 1px solid transparent; background: var(--panel-2); color: var(--ink); box-shadow: none; }
.shell-search input:hover { border-color: var(--line-strong); }
.shell-search input:focus { background: var(--panel); border-color: var(--brand); box-shadow: 0 0 0 2px var(--focus); }
.shell-search-icon { position: absolute; left: 12px; top: 10px; color: var(--muted); pointer-events: none; }
.shell-search-results { position: absolute; top: 42px; left: 0; right: 0; background: var(--panel); border-radius: 12px; box-shadow: var(--card-shadow-hover); padding: 6px; z-index: 50; }
.shell-search-results a { display: flex; align-items: baseline; gap: 10px; padding: 8px 12px; border-radius: 8px; color: var(--ink); }
.shell-search-results a small { margin-left: auto; color: var(--muted); font-size: 12px; }
.shell-search-results a:hover, .shell-search-results a.is-active { background: var(--selected); text-decoration: none; color: var(--brand); }
.shell-search-empty { padding: 10px 12px; color: var(--muted); }
.shellbar .topbar-gap { flex: 0; }
.shellbar .bell { width: 36px; height: 36px; border-radius: 8px; color: var(--shell-ink); }
.shellbar .bell:hover { background: var(--row-hover); }
.shellbar .mode-switch { border-radius: 8px; padding: 7px 12px; }
.shellbar .avatar { background: var(--brand); color: var(--brand-ink); }
.shellbar .user-menu summary:hover { background: var(--row-hover); }

/* Side navigation: light, below the shell bar */
.shell { padding-top: var(--shellbar-h); }
.sidebar { top: var(--shellbar-h); height: calc(100vh - var(--shellbar-h)); background: var(--side-bg); color: var(--side-ink); border-right: 1px solid var(--line); padding: 8px 8px 0; box-shadow: none; }
.sidebar-head { display: none; }
.nav a { color: var(--side-ink); padding: 0 12px; min-height: 40px; border-radius: 8px; font-size: 14px; }
.nav a .icon { opacity: 1; color: var(--side-faint); }
.nav a:hover { background: var(--row-hover); color: var(--side-ink); }
.nav a.on { background: var(--selected); color: var(--brand); font-weight: 600; }
.nav a.on .icon { color: var(--brand); }
.nav a.on::before { left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav-group { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 6px; }
.nav-title { color: var(--side-faint); font-size: 12px; letter-spacing: .04em; text-transform: none; font-weight: 700; padding: 8px 12px; }
.nav-group > .nav a { padding-left: 36px; min-height: 36px; font-size: 13.5px; }
.nav a.nav-report { color: var(--side-faint); }
.nav a.nav-report.on, .nav a.nav-report:hover { color: var(--brand); }
.nav-empty { color: var(--side-faint); }
.sidebar-foot { background: var(--side-bg); color: var(--side-faint); border-top: 1px solid var(--line); }
.sidebar-foot a { color: var(--side-faint); }
.back-to-work { color: var(--brand); border-color: var(--line-strong); }
.mode-tag { display: none; }
/* Setup is set apart by a warm side navigation and the orange "Setup" tag in the shell bar. */
body.mode-setup .sidebar { background: color-mix(in srgb, var(--accent) 6%, var(--side-bg)); }
body.mode-setup .nav a.on { background: color-mix(in srgb, var(--accent) 14%, var(--side-bg)); color: var(--accent-deep); }
body.mode-setup .nav a.on::before { background: var(--accent); }
body.mode-setup .nav a.on .icon { color: var(--accent-deep); }
/* Collapsed: an icon rail */
@media (min-width: 901px) {
.nav-collapsed .shell { grid-template-columns: 56px 1fr; }
.nav-collapsed .sidebar { width: 56px; padding: 8px 6px 0; }
}

/* Page: header strip and content on the grey ground */
.content { padding: 20px 28px 48px; }
.page-head { margin: -20px -28px 20px; padding: 16px 28px 14px; background: var(--panel); box-shadow: 0 .125rem .25rem rgba(34, 53, 72, .06); }
html[data-mode="dark"] .page-head { box-shadow: 0 1px 0 var(--line); }
.page-head h1 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.crumbs { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 13px; margin-bottom: 4px; }
.crumbs a { color: var(--brand); }

/* Cards (panels) */
.panel { background: var(--panel); border: 0; border-radius: var(--radius); box-shadow: var(--card-shadow); }
.panel-head { padding: 14px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 16px; font-weight: 700; }
.panel-body { padding: 16px 20px; }

/* Buttons: emphasized (blue), default (outlined), negative */
.btn { min-height: 36px; padding: 0 14px; border-radius: 8px; font-weight: 600; font-size: 14px; box-shadow: none; background: var(--brand); color: var(--brand-ink); border: 1px solid var(--brand); }
.btn:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn.secondary { background: var(--panel); color: var(--brand); border-color: var(--line-strong); }
.btn.secondary:hover { background: var(--selected); color: var(--brand-deep); border-color: var(--brand); }
.btn.danger { background: var(--panel); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.small { min-height: 28px; padding: 0 10px; font-size: 13px; border-radius: 6px; }

/* Fields: label above, 36px inputs, blue focus ring */
.field label, .field .label { font-size: 13px; font-weight: 400; color: var(--label); margin-bottom: 4px; }
input, select, textarea { min-height: 36px; padding: 6px 10px; border: 1px solid var(--field-border); border-radius: 6px; background: var(--field-bg); color: var(--ink); font-size: 14px; }
textarea { min-height: 72px; }
input:hover, select:hover, textarea:hover { border-color: var(--brand); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 2px var(--focus); outline: none; }
input[readonly], textarea[readonly] { background: var(--panel-2); border-style: dashed; }
.field .value { font-size: 14px; }

/* Tables: Fiori list */
table.list th { background: var(--panel); color: var(--muted); font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0; padding: 10px 16px; border-bottom: 1px solid var(--line-strong); }
table.list td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tbody tr:hover { background: var(--row-hover); }

/* Object status (badges): coloured text on a soft background */
.badge { border: 0; border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600; letter-spacing: 0; }
.badge.submitted { background: var(--ok-soft); color: var(--ok); }
.badge.cancelled { background: var(--bad-soft); color: var(--bad); }
.badge.draft { background: var(--panel-2); color: var(--muted); }
.badge.state { background: var(--brand-soft); color: var(--brand-deep); }

/* Messages (Fiori message strips) */
.flash { border-radius: 8px; border: 1px solid var(--line-strong); border-left-width: 4px; }
.flash.ok { border-color: var(--ok); }
.flash.bad { border-color: var(--bad); }

/* Launchpad: greeting, quick actions, tiles in groups */
.launchpad-head { margin: -20px -28px 22px; padding: 22px 28px 20px; background: var(--panel); box-shadow: 0 .125rem .25rem rgba(34, 53, 72, .06); display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 20px; }
html[data-mode="dark"] .launchpad-head { box-shadow: 0 1px 0 var(--line); }
.launchpad-head h1 { font-size: 24px; }
.launchpad-head .lp-date { color: var(--muted); font-size: 13px; margin-bottom: 2px; }
.launchpad-head .lp-sub { color: var(--muted); margin-top: 4px; }
.launchpad-head .lp-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.lp-section { margin: 26px 0 10px; display: flex; align-items: baseline; gap: 10px; }
.lp-section h2 { margin: 0; font-size: 18px; font-weight: 700; }
.lp-section .muted { font-size: 13px; }
.tiles { display: flex; flex-wrap: wrap; gap: 16px; }
.tile { display: flex; flex-direction: column; width: 176px; height: 176px; padding: 16px; border-radius: 16px; background: var(--panel); color: var(--ink); box-shadow: var(--card-shadow); transition: box-shadow .15s, transform .15s; position: relative; }
.tile:hover { box-shadow: var(--card-shadow-hover); text-decoration: none; transform: translateY(-1px); }
.tile:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.tile-title { font-size: 14px; font-weight: 700; line-height: 1.3; }
.tile-sub { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.3; }
.tile-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; }
.tile-icon { color: var(--brand); }
.tile-value { font-size: 26px; font-weight: 300; line-height: 1; letter-spacing: -.02em; color: var(--ink); white-space: nowrap; }
.tile-foot .tile-value { max-width: 118px; overflow: hidden; text-overflow: ellipsis; }
.tile.tone-good .tile-value { color: var(--ok); } .tile.tone-bad .tile-value { color: var(--bad); } .tile.tone-accent .tile-value { color: var(--accent-deep); }
.tile.is-link { width: 176px; height: 88px; padding: 14px 16px; }
.tile.is-link .tile-foot { position: absolute; right: 14px; bottom: 12px; }
.lp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; margin-top: 8px; }
.lp-cards > * { margin-top: 0 !important; }

@media (max-width: 900px) {
    /* The menu slides out over the page here, so a "collapsed" menu remembered from a wide screen takes no column. */
    .shell, .nav-collapsed .shell { grid-template-columns: 1fr; }
    .sidebar { top: var(--shellbar-h); height: calc(100vh - var(--shellbar-h)); }
    .shell-menu { display: none; }
    .shellbar .menu-button { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; background: none; color: var(--shell-ink); }
    .shell-title { display: none; }
    .shell-search { max-width: none; }
    .content { padding: 16px 14px 32px; }
    .page-head, .launchpad-head { margin: -16px -14px 16px; padding: 14px; }
    .tile { width: calc(50% - 8px); height: 150px; }
    .tile.is-link { width: calc(50% - 8px); }
}
@media (max-width: 560px) { .shell-search { display: none; } .shellbar .workplace-text strong { max-width: 30vw; } }

/* Fiori list report: header with a filter bar and status tabs, table card with a toolbar */
.list-head { flex-direction: column; align-items: stretch; gap: 12px; padding-bottom: 0; }
.list-head > .grow { min-width: 0; }
.filterbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.fb-field { display: flex; flex-direction: column; gap: 4px; width: 200px; }
.fb-field.fb-search { width: 280px; }
.fb-field label { font-size: 13px; color: var(--label); }
.fb-actions { display: flex; gap: 8px; margin-left: auto; }
.status-tabs { display: flex; gap: 4px; margin: 0 -4px; overflow-x: auto; }
.status-tabs a { display: flex; flex-direction: column; align-items: flex-start; padding: 6px 14px 10px; color: var(--muted); border-bottom: 3px solid transparent; min-width: 84px; }
.status-tabs a:hover { text-decoration: none; color: var(--ink); }
.status-tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.st-count { font-size: 20px; font-weight: 300; line-height: 1.2; color: var(--ink); }
.status-tabs a.tone-1 .st-count { color: var(--ok); } .status-tabs a.tone-2 .st-count { color: var(--bad); } .status-tabs a.tone-0 .st-count { color: var(--muted); }
.st-label { font-size: 13px; }
.list-head:not(:has(.status-tabs)) { padding-bottom: 16px; }

.list-card { overflow: hidden; }
.table-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.table-toolbar h2 { margin: 0; font-size: 16px; font-weight: 700; }
.tt-count { color: var(--muted); font-weight: 400; }
.tt-gap { flex: 1; }
.fiori-table tbody tr[data-href] { cursor: pointer; }
.fiori-table td.identifier { min-width: 180px; }
.id-title { display: block; font-weight: 700; color: var(--ink); }
.id-number { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.fiori-table tbody tr:hover .id-title { color: var(--brand); }
.fiori-table .nav-col { width: 28px; color: var(--faint); font-size: 18px; text-align: right; padding-left: 0; }
.list-card .pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 20px; border-top: 1px solid var(--line); }
.list-card .empty { padding: 40px 20px; text-align: center; color: var(--muted); }
@media (max-width: 760px) { .fb-field, .fb-field.fb-search { width: 100%; } .fb-actions { margin-left: 0; } }

/* ======================================================================
   Fiori launchpad, classic style ("spaces and pages"): a dark shell bar,
   navigation tabs along the top with drop-down pages, Quartz tiles.
   ====================================================================== */
html[data-theme="classic"] { --shell-bg: #354a5f; --shell-ink: #fff; }
html:not([data-theme="classic"]) { --shell-bg: var(--wall); --shell-ink: #fff; }
.shellbar.topbar { box-shadow: none; }
.shellbar .shell-brand:hover, .shellbar .shell-menu:hover, .shellbar .bell:hover, .shellbar .workplace:hover, .shellbar .user-menu summary:hover { background: rgba(255, 255, 255, .12); }
.shellbar .workplace-text strong { color: #fff; }
.shellbar .workplace-text small { color: rgba(255, 255, 255, .7); }
.shellbar .workplace > .icon { color: rgba(255, 255, 255, .8); }
.shellbar .workplace-mark { background: rgba(255, 255, 255, .16); color: #fff; }
.shellbar .who { color: rgba(255, 255, 255, .9); }
.shell-search input { background: rgba(255, 255, 255, .12); color: #fff; border-color: transparent; }
.shell-search input::placeholder { color: rgba(255, 255, 255, .7); }
.shell-search input:hover { border-color: rgba(255, 255, 255, .35); }
.shell-search input:focus { background: var(--panel); color: var(--ink); }
.shell-search input:focus::placeholder { color: var(--faint); }
.shell-search-icon { color: rgba(255, 255, 255, .75); }
.shell-search:focus-within .shell-search-icon { color: var(--muted); }
.shellbar .bell-count { box-shadow: 0 0 0 2px var(--shell-bg); }

/* Quartz tiles: small corners, regular-weight titles, large light numbers */
.tile { border-radius: 4px; box-shadow: 0 0 0 1px rgba(34, 53, 72, .12), 0 1px 3px rgba(34, 53, 72, .12); transform: none !important; }
.tile:hover { box-shadow: 0 0 0 1px rgba(34, 53, 72, .18), 0 2px 8px rgba(34, 53, 72, .2); }
html[data-mode="dark"] .tile { box-shadow: 0 0 0 1px var(--line), 0 1px 3px rgba(0, 0, 0, .4); }
.tile-title { font-size: 16px; font-weight: 400; line-height: 1.25; color: var(--ink); }
.tile-sub { font-size: 13px; }
.tile-value { font-size: 36px; font-weight: 300; }
.tile-value small, .tile-unit { font-size: 14px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.tile.is-link { width: auto; min-width: 176px; height: auto; padding: 8px 12px; flex-direction: row; align-items: center; gap: 8px; }
.tile.is-link .tile-title { font-size: 14px; color: var(--brand); }
.tile.is-link .tile-sub { margin: 0; }
.tile.is-wide { width: 368px; }
.lp-section h2 { font-size: 20px; font-weight: 400; }
.tiles + .tiles { margin-top: 12px; }
/* Comparison micro chart: label and value over a thin bar */
.micro-bars { display: flex; flex-direction: column; gap: 6px; margin-top: auto; font-size: 12px; }
.mb-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 6px; }
.mb-row .mb-label { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-row .mb-value { font-weight: 600; }
.mb-row .mb-track { grid-column: 1 / -1; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.mb-row .mb-fill { display: block; height: 100%; }
.mb-row.tone-ok .mb-fill { background: var(--ok); } .mb-row.tone-ok .mb-value { color: var(--ok); }
.mb-row.tone-bad .mb-fill { background: var(--bad); } .mb-row.tone-bad .mb-value { color: var(--bad); }
.mb-row.tone-warn .mb-fill { background: var(--warn); } .mb-row.tone-warn .mb-value { color: var(--warn); }
/* Column micro chart */
.micro-cols { display: flex; align-items: flex-end; gap: 4px; height: 56px; }
.micro-cols .mc { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; flex: 1; height: 100%; min-width: 0; }
.micro-cols .mc-bar { width: 100%; background: color-mix(in srgb, var(--brand) 70%, transparent); border-radius: 1px; min-height: 2px; }
.micro-cols .mc.is-last .mc-bar { background: var(--muted); }
.micro-cols .mc-label { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.tile-wide-body { display: flex; align-items: flex-end; gap: 16px; margin-top: auto; }
.tile-wide-body .tile-figure { flex: none; }
.tile-wide-body .micro-cols { flex: 1; }
.tile-caption { font-size: 13px; color: var(--muted); margin-top: 4px; }

@media (min-width: 901px) {
    :root { --topnav-h: 44px; }
    .shell, .nav-collapsed .shell { grid-template-columns: 1fr; padding-top: calc(var(--shellbar-h) + var(--topnav-h)); }
    .shell-menu { display: none; }
    /* The menu becomes the navigation bar below the shell bar. */
    .sidebar, .nav-collapsed .sidebar { position: fixed; top: var(--shellbar-h); left: 0; right: 0; width: auto; height: var(--topnav-h); display: flex; flex-direction: row; align-items: stretch;
        gap: 2px; padding: 0 20px; margin: 0; overflow: visible; background: var(--shell-bg); border: 0; border-top: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); z-index: 39; }
    body.mode-setup .sidebar { background: var(--shell-bg); }
    .sidebar > .nav { display: flex; align-items: stretch; }
    .sidebar > .nav > a, .nav-group > .nav-title { height: var(--topnav-h); min-height: 0; display: flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 0; background: none;
        color: rgba(255, 255, 255, .85); font-size: 14px; font-weight: 400; letter-spacing: 0; text-transform: none; border-bottom: 3px solid transparent; white-space: nowrap; cursor: pointer; }
    .sidebar > .nav > a:hover, .nav-group:hover > .nav-title, .nav-group:focus-within > .nav-title { color: #fff; background: rgba(255, 255, 255, .08); text-decoration: none; }
    .sidebar > .nav > a.on, .nav-group:has(a.on) > .nav-title { color: #fff; border-bottom-color: #fff; background: none; font-weight: 400; }
    body.mode-setup .sidebar > .nav > a.on, body.mode-setup .nav-group:has(a.on) > .nav-title { border-bottom-color: var(--accent); }
    .sidebar > .nav > a::before, .sidebar > .nav > a .icon, .nav-group > .nav-title > .icon:not(.caret) { display: none; }
    .nav-title .caret { transform: none !important; margin-left: 0; opacity: .8; }
    .nav-group, details.nav-group { position: relative; margin: 0; padding: 0; border: 0; }
    /* Drop-down pages: shown on hover or keyboard focus (works without JavaScript; the open/closed state does not matter here). */
    .nav-group > .nav { display: none !important; position: absolute; top: 100%; left: 0; min-width: 240px; max-height: 70vh; overflow-y: auto; padding: 4px 0;
        background: var(--panel); border-radius: 0 0 4px 4px; box-shadow: 0 4px 16px rgba(0, 0, 0, .18), 0 0 0 1px rgba(0, 0, 0, .06); z-index: 41; }
    .nav-group:hover > .nav, .nav-group:focus-within > .nav { display: block !important; }
    .nav-group > .nav a, body.mode-setup .nav-group > .nav a { display: flex; color: var(--ink); min-height: 36px; padding: 0 16px; border-radius: 0; font-size: 14px; font-weight: 400; background: none; }
    .nav-group > .nav a:hover { background: var(--row-hover); text-decoration: none; }
    .nav-group > .nav a.on, body.mode-setup .nav-group > .nav a.on { background: var(--selected); color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); font-weight: 400; }
    .nav-group > .nav a.on::before { display: none; }
    .nav-group > .nav a.nav-report::after { color: var(--muted); }
    .sidebar > .nav-group:nth-last-of-type(-n+2) > .nav { left: auto; right: 0; }
    .sidebar-foot, .back-to-work, .nav-empty, .mode-tag { display: none; }
    .menu-toggle:checked ~ .sidebar { transform: none; box-shadow: none; }
}
@media (min-width: 901px) {
    /* The old collapsed-menu setting does not apply to the top navigation. */
    .nav-collapsed .sidebar:not(:hover) .nav a, .nav-collapsed .sidebar:not(:hover) .nav-title { font-size: 14px; gap: 6px; padding: 0 12px; justify-content: flex-start; }
    .nav-collapsed .sidebar:not(:hover) .nav-group > .nav a { padding: 0 16px; }
    .nav-collapsed .sidebar:not(:hover) .nav-title .caret { display: inline-block; }
    .nav-collapsed .sidebar:hover { width: auto; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
    .nav-collapsed .sidebar:not(:hover) .nav-group > .nav { display: none !important; }
    .nav-collapsed .sidebar .nav-group:hover > .nav, .nav-collapsed .sidebar .nav-group:focus-within > .nav { display: block !important; }
}
.tile-figure { display: block; } .tile-figure .tile-caption { display: block; }

/* Fiori object page: header with key facts, pinned section tabs, sections as cards, footer toolbar */
.object-head { flex-wrap: wrap; align-items: flex-start; }
.object-head h1 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 22px; }
.object-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.object-actions { margin-left: auto; }
.key-facts { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 10px 0 0; padding: 0; }
.key-facts .kf { min-width: 120px; }
.key-facts dt { font-size: 13px; color: var(--label); margin: 0 0 2px; }
.key-facts dd { margin: 0; font-size: 14px; color: var(--ink); font-weight: 600; }
.key-facts .kf-big dd { font-size: 22px; font-weight: 300; }
.object-head:has(+ .anchor-bar) { margin-bottom: 0; box-shadow: none; padding-bottom: 12px; }
.anchor-bar { position: sticky; top: calc(var(--shellbar-h) + var(--topnav-h, 0px)); z-index: 20; display: flex; gap: 4px; overflow-x: auto; margin: 0 -28px 20px; padding: 0 22px; background: var(--panel);
    border-top: 1px solid var(--line); box-shadow: 0 .125rem .25rem rgba(34, 53, 72, .08); }
html[data-mode="dark"] .anchor-bar { box-shadow: 0 1px 0 var(--line); }
.anchor-bar a { padding: 12px 10px 10px; color: var(--ink); white-space: nowrap; border-bottom: 3px solid transparent; font-size: 14px; }
.anchor-bar a:hover { text-decoration: none; color: var(--brand); }
.anchor-bar a.on { color: var(--brand); border-bottom-color: var(--brand); }
.object-sections { display: flex; flex-direction: column; gap: 16px; }
.object-sections > form { display: flex; flex-direction: column; gap: 16px; }
.form-section.panel { margin: 0; padding: 18px 20px 20px; scroll-margin-top: calc(var(--shellbar-h) + var(--topnav-h, 0px) + 60px); }
.form-section.panel .form-section-title { margin: 0 0 16px; padding: 0; border: 0; font-size: 16px; font-weight: 700; color: var(--ink); text-transform: none; letter-spacing: 0; }
#tasks, #comments, #files, #history { scroll-margin-top: calc(var(--shellbar-h) + var(--topnav-h, 0px) + 60px); }
/* Aligned columns: every field one column of 240–320px; long text two columns; tables the full width */
.form-section .grid.form-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px 24px; max-width: 1600px; }
.form-section .grid.form-grid > .field, .form-section .grid.form-grid > .field.span-3, .form-section .grid.form-grid > div:not(.section-title) { grid-column: auto; min-width: 0; }
.form-section .grid.form-grid > .field.span-2 { grid-column: span 2; }
.form-section .grid.form-grid > .field.wide, .form-section .grid.form-grid > .wide { grid-column: 1 / -1; }
.form-section .grid.form-grid > .field:not(.wide):not(.span-2) input:not([type=checkbox]),
.form-section .grid.form-grid > .field:not(.wide):not(.span-2) select { max-width: 360px; }
.field.is-check { padding-top: 22px; }
/* Display mode: values as text, not boxes */
.field.is-readonly .value { padding: 0; min-height: 22px; background: none; border: 0; box-shadow: none; font-size: 14px; color: var(--ink); }
.field.is-readonly .value.faint { color: var(--faint); font-size: 13px; font-style: italic; }
/* Footer toolbar while editing */
.object-footer { position: sticky; bottom: 0; z-index: 15; display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 20px; border-radius: 12px 12px 0 0;
    background: var(--panel); border: 0; border-top: 1px solid var(--line); box-shadow: 0 -.125rem .5rem rgba(34, 53, 72, .12); }
.object-footer .of-gap { flex: 1; }
.object-footer .of-msg { display: inline-flex; align-items: center; gap: 6px; color: var(--bad); font-weight: 600; font-size: 13px; }
@media (max-width: 900px) {
    .anchor-bar { margin: 0 -14px 16px; padding: 0 8px; top: var(--shellbar-h); }
    .form-section .grid.form-grid > .field.span-2 { grid-column: 1 / -1; }
    .object-actions { margin-left: 0; }
}
.form-section.panel .form-section-title::before, .form-section.panel .form-section-title::after { display: none; } .form-section.panel .form-section-title { padding-left: 0; }

/* Fiori side panel: facts beside the form (party dues, credit left, the balance after submitting, stock, leave left) */
.object-layout.has-context { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.context-panel { position: sticky; top: calc(var(--shellbar-h) + var(--topnav-h, 0px) + 64px); display: flex; flex-direction: column; gap: 12px; transition: opacity .15s; }
.context-panel.is-loading { opacity: .55; }
.ctx-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--card-shadow, var(--shadow)); padding: 14px 16px; }
.ctx-head { margin-bottom: 8px; }
.ctx-kicker { display: block; font-size: 12px; color: var(--label, var(--muted)); text-transform: uppercase; letter-spacing: .05em; }
.ctx-head h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.ctx-rows { margin: 0; }
.ctx-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.ctx-row:first-child { border-top: 0; }
.ctx-row dt { color: var(--label, var(--muted)); margin: 0; }
.ctx-row dd { margin: 0; color: var(--ink); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.ctx-row.is-strong dd { font-size: 16px; }
.ctx-row.tone-bad dd { color: var(--bad); }
.ctx-row.tone-warn dd { color: var(--warn); }
.ctx-row.tone-good dd { color: var(--ok); }
.ctx-meter { margin-top: 10px; }
.ctx-meter-bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.ctx-meter-bar span { display: block; height: 100%; background: var(--ok); }
.ctx-meter.tone-warn .ctx-meter-bar span { background: var(--warn); }
.ctx-meter.tone-bad .ctx-meter-bar span { background: var(--bad); }
.ctx-meter p { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.ctx-meter.tone-bad p { color: var(--bad); font-weight: 600; }
.ctx-note { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.ctx-empty { color: var(--muted); font-size: 13px; }
@media (max-width: 1200px) {
    .object-layout.has-context { grid-template-columns: minmax(0, 1fr); }
    .context-panel { position: static; order: -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

/* Lock screen: stays in Qila's own navy and gold on the Horizon and Quartz themes; it does not take the SAP colours. */
html[data-theme="classic"] .lock-screen, html[data-theme="horizon_dark"] .lock-screen, html[data-theme="quartz"] .lock-screen, html[data-theme="quartz_dark"] .lock-screen {
    --hero-a: #081a33; --hero-b: #0b2545; --hero-c: #143d6b; --hero-glow: rgba(217, 162, 58, .22); --brand: #17508c; --accent: #d9a23a;
}
