:root {
    --bg: #0b0b0c;
    --panel: #151517;
    --panel-2: #1c1c1f;
    --line: #333338;
    --text: #f1f1ed;
    --muted: #a9a9a2;
    --accent: #d7d7cf;
    --danger: #ff8b8b;
    --ok: #a8e6b0;
    --radius: 10px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--text); }
.site-header {
    min-height: 82px;
    padding: 14px clamp(16px, 4vw, 42px);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: #09090a;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-logo { width: 54px; height: 54px; object-fit: cover; background: #222; border-radius: 4px; }
.brand strong { display: block; letter-spacing: .14em; font-size: 15px; }
.brand small { color: var(--muted); }
nav { display: flex; gap: 8px; }
nav a, .button {
    display: inline-block;
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--text);
    padding: 9px 13px;
    border-radius: 7px;
    text-decoration: none;
    cursor: pointer;
}
nav a:hover, .button:hover { border-color: #666; }
.button.primary { background: var(--text); color: #111; border-color: var(--text); font-weight: 700; }
.page-shell { width: min(1240px, calc(100% - 32px)); margin: 28px auto 50px; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 18px; }
h1 { font-size: clamp(28px, 4vw, 46px); line-height: 1.05; margin: 0; letter-spacing: -.03em; }
h2 { margin-top: 0; }
.muted { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat { font-size: 30px; font-weight: 800; line-height: 1; margin-top: 5px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; min-width: 820px; background: var(--panel); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; background: #111113; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
form.card { max-width: 980px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 18px; }
.form-grid .wide { grid-column: 1 / -1; }
label { display: block; font-weight: 650; margin-bottom: 6px; }
.help { display: block; color: var(--muted); font-size: 13px; margin-top: 5px; }
input, select, textarea {
    width: 100%;
    background: #0e0e10;
    color: var(--text);
    border: 1px solid #414146;
    border-radius: 7px;
    padding: 10px 11px;
    font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #777; outline-offset: 1px; }
.actions { display: flex; gap: 10px; margin-top: 20px; align-items: center; }
.flash { padding: 12px 14px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.flash.ok { border-color: #365c3a; color: var(--ok); }
.flash.error { border-color: #6d3434; color: var(--danger); }
.badge { border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; font-size: 12px; white-space: nowrap; }
.stock { font-variant-numeric: tabular-nums; color: var(--muted); }
.warning { border-left: 3px solid #d0a55f; padding-left: 12px; color: #e9d4ac; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); padding: 18px 24px; text-align: center; font-size: 13px; }
@media (max-width: 760px) {
    .site-header, .page-head { align-items: flex-start; flex-direction: column; }
    .grid, .form-grid { grid-template-columns: 1fr; }
    .form-grid .wide { grid-column: auto; }
}
.subnav { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 18px; }
.subnav a { border:1px solid var(--line); background:var(--panel-2); padding:8px 12px; border-radius:7px; text-decoration:none; }
.subnav a.active { background:var(--text); color:#111; border-color:var(--text); font-weight:700; }
.stats-row { display:flex; flex-wrap:wrap; gap:12px; margin-bottom:18px; }
.compact-stat { min-width:180px; padding:14px 16px; }
.compact-stat .stat { font-size:24px; }
.report-card { text-decoration:none; display:block; }
.report-card:hover { border-color:#666; }
code { background:#0e0e10; border:1px solid var(--line); border-radius:4px; padding:1px 5px; }

/* v0.5 / 013A application areas and catalogue browsing */
.site-header {
    display: block;
    padding: 12px clamp(16px, 4vw, 42px) 0;
}
.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 12px;
}
.area-nav { display: flex; gap: 8px; }
.area-nav a.active, .section-nav a.active {
    background: var(--text);
    color: #111;
    border-color: var(--text);
    font-weight: 700;
}
.section-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 10px 0 11px;
    border-top: 1px solid var(--line);
}
.section-nav a { padding: 7px 11px; font-size: 14px; }
.entity-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}
.entity-card { text-decoration: none; min-height: 140px; display: flex; flex-direction: column; justify-content: space-between; }
.entity-card:hover { border-color: #666; }
.entity-count { display: block; font-size: 34px; line-height: 1; }
.section-heading { margin-top: 30px; }
.breadcrumbs { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.breadcrumbs a { color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.meta-list { margin: 0; }
.meta-list > div { display: grid; grid-template-columns: minmax(120px, 35%) 1fr; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.meta-list > div:last-child { border-bottom: 0; }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; }
.meta-columns { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 28px; }
.meta-columns > div { grid-template-columns: minmax(110px, 35%) 1fr; }
.stack-row { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.stack-row:last-child { border-bottom: 0; }
.stack-row .muted { text-align: right; }
.card-subheading { margin-top: 24px; }
.prose-card { max-width: 800px; }
.breakable { overflow-wrap: anywhere; }
@media (max-width: 960px) {
    .entity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .header-main { align-items: flex-start; flex-direction: column; }
    .area-nav, .section-nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 10px; }
    .area-nav a, .section-nav a { white-space: nowrap; }
    .detail-grid, .meta-columns { grid-template-columns: 1fr; }
    .entity-grid { grid-template-columns: 1fr; }
    .meta-list > div { grid-template-columns: 1fr; gap: 3px; }
}

/* v0.6 / 013B + 013C catalogue asset repository */
.asset-section-head { display:flex; justify-content:space-between; align-items:end; gap:18px; }
.asset-section-head h2 { margin-bottom:4px; }
.asset-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.asset-card { display:flex; flex-direction:column; gap:10px; }
.asset-card-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.asset-preview { display:block; aspect-ratio:1/1; background:#0e0e10; border:1px solid var(--line); border-radius:7px; overflow:hidden; }
.asset-preview img { display:block; width:100%; height:100%; object-fit:contain; }
.asset-meta { font-size:13px; }
.asset-actions { margin-top:auto; }
.path-code { display:block; overflow-wrap:anywhere; white-space:normal; padding:7px 8px; }
.section-heading-small { margin-top:22px; }
.inline-fields { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.checkbox-row label { display:flex; align-items:center; gap:9px; margin-bottom:0; }
.checkbox-row input[type="checkbox"] { width:auto; }
@media (max-width:960px) { .asset-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:760px) { .asset-section-head { align-items:flex-start; flex-direction:column; } .asset-grid { grid-template-columns:1fr; } }

/* v0.7 / 013D uploadable PIM repository */
input[type="file"] { padding: 8px; }
.asset-card .asset-actions { display:flex; gap:10px; flex-wrap:wrap; }

/* v0.9 / 014A catalogue health */
.health-summary {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:14px;
    margin-bottom:18px;
}
.health-stat { text-decoration:none; display:flex; flex-direction:column; gap:5px; min-height:132px; }
.health-stat:hover { border-color:#666; }
.health-stat > span { color:var(--muted); font-size:13px; text-transform:uppercase; letter-spacing:.06em; }
.health-stat > strong { font-size:36px; line-height:1; }
.health-stat > small { color:var(--muted); margin-top:auto; }
.health-stat.critical { border-left:3px solid #a84e4e; }
.health-stat.review { border-left:3px solid #b48a4c; }
.health-stat.info { border-left:3px solid #66798f; }
.health-stat.total { border-left:3px solid #777; }
.health-filter { max-width:none !important; display:grid; grid-template-columns:minmax(180px,1fr) minmax(180px,1fr) auto; gap:14px; align-items:end; margin-bottom:26px; }
.health-filter .actions { margin-top:0; }
.health-list-head { display:flex; justify-content:space-between; gap:18px; align-items:baseline; margin-bottom:12px; }
.health-list-head h2 { margin:0; }
.health-list { display:flex; flex-direction:column; gap:10px; }
.health-issue { display:grid; grid-template-columns:110px minmax(0,1fr) auto; gap:16px; align-items:start; padding:15px 16px; }
.health-issue.critical { border-left:3px solid #a84e4e; }
.health-issue.review { border-left:3px solid #b48a4c; }
.health-issue.info { border-left:3px solid #66798f; }
.health-issue-marker span { font-size:12px; text-transform:uppercase; letter-spacing:.06em; font-weight:750; }
.health-issue.critical .health-issue-marker span { color:#ffaaaa; }
.health-issue.review .health-issue-marker span { color:#e5c586; }
.health-issue.info .health-issue-marker span { color:#aebfd2; }
.health-issue-title { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:5px; }
.health-issue-action { white-space:nowrap; }
.health-meta { display:flex; flex-wrap:wrap; gap:7px 16px; margin-top:7px; color:var(--muted); font-size:13px; }
.health-note p:last-child { margin-bottom:0; }
@media (max-width:960px) {
    .health-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .health-issue { grid-template-columns:90px minmax(0,1fr) auto; }
}
@media (max-width:760px) {
    .health-summary { grid-template-columns:1fr; }
    .health-filter { grid-template-columns:1fr; }
    .health-filter-actions { margin-top:4px !important; }
    .health-list-head { flex-direction:column; align-items:flex-start; }
    .health-issue { grid-template-columns:1fr; gap:8px; }
    .health-issue-action { margin-top:3px; }
}
