/* ==========================================================================
   Purchase Orders — Osteon Medical
   Direction B: dark slate sidebar, light content, one brand blue.
   Hand-written, no framework. Light theme only by design.
   ========================================================================== */

/* --- Brand type: Montserrat, self-hosted (CSP forbids Google Fonts) ------ */

@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("/static/fonts/montserrat-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("/static/fonts/montserrat-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- Tokens --------------------------------------------------------------- */

:root {
    color-scheme: light;

    --bg:            #f4f6f9;
    --surface:       #ffffff;
    --surface-alt:   #f7f9fb;
    --border:        #e3e8ef;
    --border-strong: #dbe1e8;
    --divider:       #eef1f5;

    --text:          #1f2733;
    --text-2:        #3a4553;
    --text-muted:    #5d6b7a;
    --text-faint:    #8b97a5;

    --brand:         #147bd1;
    --brand-hover:   #1169b5;
    --brand-soft:    #e8f1fb;
    --brand-tint:    #f3f8fd;
    --brand-line:    #bcd7f2;

    --side-bg:       #1f2733;
    --side-text:     #b9c2cd;
    --side-faint:    #8b97a5;
    --side-on:       rgba(255, 255, 255, .10);
    --side-line:     rgba(255, 255, 255, .08);

    --ok:            #1a7f5a;  --ok-soft:     #e3f5ec;
    --warn:          #9a6700;  --warn-soft:   #fdf3dc;  --warn-line: #f3e2b3;
    --info:          #b4560f;  --info-soft:   #fdebdc;
    --violet:        #5b4fcf;  --violet-soft: #ebe9fb;
    --danger:        #b3261e;  --danger-soft: #fde8e6;  --danger-line: #f1c9c5;

    --radius:        12px;
    --radius-sm:     8px;
    --shadow:        0 1px 2px rgba(31, 39, 51, .04), 0 4px 16px rgba(31, 39, 51, .05);
    --shadow-brand:  0 1px 2px rgba(20, 123, 209, .30);

    --side-w:        248px;
    --maxw:          1180px;

    --font: "Montserrat", "Segoe UI", system-ui, Arial, sans-serif;
}

/* --- Base ----------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg); }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 600; }
h1 { font-size: 26px; letter-spacing: -.01em; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p  { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); text-decoration: underline; }

svg { flex-shrink: 0; }

/* --- App shell ------------------------------------------------------------ */

.shell {
    display: grid;
    grid-template-columns: var(--side-w) minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    background: var(--side-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 24px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px;
    color: #fff;
}
.brand:hover { text-decoration: none; color: #fff; }
.brand img { width: 34px; height: 34px; border-radius: 50%; display: block; }
.brand span { display: flex; flex-direction: column; line-height: 1.2; }
.brand strong { font-weight: 600; font-size: 15px; }
.brand small { font-size: 12px; color: var(--side-faint); }

.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 42px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    color: var(--side-text);
    font-weight: 500;
    font-size: 14px;
}
.side-nav a:hover { background: var(--side-line); color: #fff; text-decoration: none; }
.side-nav a[aria-current="page"] { background: var(--side-on); color: #fff; font-weight: 600; }
.side-nav .badge {
    margin-left: auto;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    padding: 1px 8px;
}

.side-user {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 8px 0;
    border-top: 1px solid var(--side-line);
}
.side-user div { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.side-user strong { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user form { margin: 0; }
.side-user button {
    font: inherit; font-size: 12px; color: var(--side-faint);
    background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
}
.side-user button:hover { color: #fff; }

.content { min-width: 0; }
main {
    max-width: var(--maxw);
    padding: 40px 48px 64px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
main.bare { max-width: none; padding: 0; display: block; }

/* --- Page head ------------------------------------------------------------ */

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.page-head > div { display: flex; flex-direction: column; gap: 4px; }
.page-head p { color: var(--text-muted); margin: 0; }
.page-head .row { gap: 12px; }
.ref-title { font-size: 24px; letter-spacing: .01em; }
.item-title { font-size: 17px; font-weight: 500; color: var(--text); }

.back {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text-muted); font-weight: 500; font-size: 13px;
}
.back:hover { color: var(--text); text-decoration: none; }

/* --- Avatars -------------------------------------------------------------- */

.avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: .02em;
}
.avatar--grey { background: #63656a; }
.avatar--sm { width: 28px; height: 28px; font-size: 11px; }
.who { display: flex; align-items: center; gap: 10px; }
.who div { line-height: 1.3; }
.who strong { font-weight: 500; display: block; }

/* --- Cards ---------------------------------------------------------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card__header {
    padding: 14px 22px;
    border-bottom: 1px solid var(--divider);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card__header .note { font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.card__body { padding: 22px; }
.card__body.prose { color: var(--text-2); white-space: pre-line; }

.card--finance { border-color: var(--brand-line); }
.card--finance .card__header {
    background: var(--brand-tint);
    border-bottom-color: #dce9f6;
    border-radius: var(--radius) var(--radius) 0 0;
    color: var(--brand-hover);
}

/* --- Buttons -------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.btn:hover { background: var(--surface-alt); text-decoration: none; color: var(--text); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }
.btn--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn--danger { color: var(--danger); border-color: var(--danger-line); }
.btn--danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--text-muted); }
.btn--ghost:hover { background: var(--surface-alt); color: var(--text); }
.btn--sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn--block { width: 100%; height: 44px; font-size: 15px; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }

/* --- Forms ---------------------------------------------------------------- */

.field { margin-bottom: 16px; display: flex; flex-direction: column; }
.field:last-child { margin-bottom: 0; }

label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}
label .faint { font-weight: 500; }

.hint { font-size: 12.5px; color: var(--text-faint); margin: 6px 0 0; }

input[type="text"], input[type="email"], input[type="url"], input[type="date"],
input[type="number"], input[type="search"], select, textarea {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    font: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
}
textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
select {
    appearance: none;
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none' stroke='%238b97a5' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }

.field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.field-row .field { margin-bottom: 0; }
.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.item-grid .field { margin-bottom: 0; }

.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio {
    display: inline-flex; align-items: center; gap: 8px;
    height: 38px; padding: 0 14px; margin: 0;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--surface); cursor: pointer; font-weight: 500; font-size: 13.5px; color: var(--text);
}
.radio:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-hover); font-weight: 600; }
.radio input { margin: 0; accent-color: var(--brand); }

/* --- Tables --------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }

table.data { width: 100%; border-collapse: collapse; }
table.data th {
    text-align: left;
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-faint);
    font-weight: 600;
    padding: 14px 20px;
    border-bottom: 1px solid #e9edf2;
    white-space: nowrap;
}
table.data td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--divider);
    vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--surface-alt); }
table.data tbody tr:first-child:hover td:first-child { border-top-left-radius: 0; }

.num { text-align: right; white-space: nowrap; }
table.data th.num { text-align: right; }
.row--muted td, .row--muted .ref { color: var(--text-faint); }

.ref { font-weight: 600; letter-spacing: .02em; color: var(--text); white-space: nowrap; }
.ref:hover { color: var(--brand); text-decoration: none; }
.table-link { color: var(--text); font-weight: 500; }
.table-link:hover { color: var(--brand); text-decoration: none; }

table.data form.row { gap: 8px; flex-wrap: nowrap; }
table.data form.row select, table.data form.row input[type="text"] { min-width: 150px; height: 34px; font-size: 13px; }

/* --- Chips ---------------------------------------------------------------- */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.5;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.chip--new        { background: var(--brand-soft);  color: var(--brand-hover); }
.chip--in_review  { background: var(--warn-soft);   color: var(--warn); }
.chip--needs_info { background: var(--info-soft);   color: var(--info); }
.chip--approved   { background: var(--ok-soft);     color: var(--ok); }
.chip--ordered    { background: var(--violet-soft); color: var(--violet); }
.chip--received   { background: var(--ok-soft);     color: var(--ok); }
.chip--closed     { background: #eef1f5;            color: var(--text-muted); }
.chip--rejected   { background: var(--danger-soft); color: var(--danger); }
.chip--cancelled  { background: #eef1f5;            color: var(--text-faint); }

.chip--urgent { background: var(--danger-soft); color: var(--danger); }
.chip--soon   { background: var(--warn-soft);   color: var(--warn); }
.chip--role   { background: var(--brand-soft);  color: var(--brand-hover); }

/* --- Filter pills (inbox) ------------------------------------------------- */

.filters { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
    display: inline-flex; align-items: center; gap: 8px;
    height: 34px; padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-muted);
    font-weight: 500; font-size: 13px; white-space: nowrap;
}
.pill:hover { color: var(--text); text-decoration: none; border-color: var(--text-faint); }
.pill[aria-current="true"] { background: var(--text); border-color: var(--text); color: #fff; font-weight: 600; }
.pill b { font-weight: 600; opacity: .7; }

.filters__controls { display: flex; gap: 10px; flex-wrap: wrap; }
.filters__controls select, .filters__controls input { height: 38px; font-size: 13px; font-weight: 500; width: auto; }
.filters__controls input[type="search"] { width: 250px; font-weight: 400; }

/* --- Key/value ------------------------------------------------------------ */

.kv { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px 20px; margin: 0; }
.kv dt { color: var(--text-faint); font-size: 13px; }
.kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.kv--side { grid-template-columns: 110px minmax(0, 1fr); }

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

/* --- Timeline ------------------------------------------------------------- */

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.timeline__item { display: grid; grid-template-columns: 24px 1fr; gap: 14px; font-size: 14px; }
.timeline__item::before {
    content: ""; width: 10px; height: 10px; border-radius: 50%;
    margin: 6px 7px; background: #c9d1db;
}
.timeline__item--status::before   { background: var(--brand); }
.timeline__item--created::before  { background: var(--ok); }
.timeline__item--assigned::before { background: var(--violet); }
.timeline__when { font-size: 12.5px; color: var(--text-faint); margin-top: 2px; }
.timeline__what .chip { vertical-align: 1px; }

/* --- Comments & activity -------------------------------------------------- */

.timeline__item--comment::before { background: var(--text-faint); }
.timeline__item--internal::before { background: var(--warn); }
.timeline__item--attachment::before { background: #c9d1db; }

.comment {
    background: var(--surface-alt);
    border: 1px solid var(--divider);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex; flex-direction: column; gap: 10px;
}
.timeline__item--internal .comment { background: #fffaf0; border-color: var(--warn-line); }
.comment__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.comment__head .timeline__when { margin: 0 0 0 auto; }
.comment__body { white-space: pre-line; color: var(--text-2); overflow-wrap: anywhere; }
.chip--internal { background: var(--warn-soft); color: var(--warn); }
.chip--internal::before { display: none; }

.composer { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--divider); }
.composer__box { border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.composer__box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.composer textarea { border: 0; border-radius: 0; box-shadow: none; min-height: 84px; resize: vertical; }
.composer textarea:focus { box-shadow: none; }
.composer__bar { display: flex; align-items: center; gap: 14px; padding: 8px 10px 8px 12px; border-top: 1px solid var(--divider); background: var(--surface-alt); flex-wrap: wrap; }

.check { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; font-size: 13px; color: var(--text-muted); cursor: pointer; }
.check input { margin: 0; accent-color: var(--brand); width: 15px; height: 15px; }

/* --- Attachments ---------------------------------------------------------- */

.files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.file {
    display: grid; grid-template-columns: 26px minmax(0, 1fr) auto 28px;
    align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: var(--radius-sm);
    background: var(--surface); border: 1px solid var(--divider);
}
.comment .file { background: var(--surface); }
.file__icon { color: var(--text-faint); display: inline-flex; }
.file--image .file__icon { color: var(--violet); } .file--pdf .file__icon { color: var(--danger); } .file--sheet .file__icon { color: var(--ok); }
.file__name { font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file__name:hover { color: var(--brand); text-decoration: none; }
.file__meta { color: var(--text-faint); font-size: 12.5px; white-space: nowrap; }
.file form { margin: 0; display: flex; }
.file__remove { background: none; border: 0; padding: 4px; border-radius: 6px; color: var(--text-faint); cursor: pointer; display: inline-flex; }
.file__remove:hover { background: var(--danger-soft); color: var(--danger); }

.file-pick { cursor: pointer; }
.file-pick--text { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; color: var(--text-muted); margin: 0; }
.file-pick--text:hover { color: var(--brand); }

.dropzone {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 18px; margin: 0;
    border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
    background: var(--surface-alt); color: var(--text-muted); cursor: pointer; font-weight: 400;
}
.dropzone:hover { border-color: var(--brand); color: var(--brand-hover); background: var(--brand-tint); }
.dropzone > span { display: flex; flex-direction: column; gap: 2px; }
.dropzone strong { color: var(--text); font-weight: 600; font-size: 14px; }
.dropzone.has-files { border-style: solid; border-color: var(--brand); background: var(--brand-tint); }

/* --- Notices -------------------------------------------------------------- */

.notice {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 14px;
}
.notice > div { flex: 1; }
.notice strong { font-weight: 600; }
.notice--info  { background: var(--brand-tint);  border-color: var(--brand-line); color: var(--brand-hover); }
.notice--warn  { background: var(--warn-soft);   border-color: var(--warn-line);  color: #7a5200; }
.notice--error { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.notice__action { font-weight: 600; color: inherit; white-space: nowrap; }
.notice__action:hover { color: inherit; }
.text-danger { color: var(--danger); }

/* --- Tabs (admin) --------------------------------------------------------- */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs a {
    padding: 10px 14px; color: var(--text-muted); font-weight: 500; font-size: 14px;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--brand-hover); border-bottom-color: var(--brand); font-weight: 600; }

/* --- Empty state ---------------------------------------------------------- */

.empty { text-align: center; padding: 64px 24px; color: var(--text-muted); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.empty h3 { color: var(--text); font-size: 16px; }
.empty p { margin: 0; max-width: 420px; }
.empty .btn { margin-top: 10px; }

/* --- Sign-in -------------------------------------------------------------- */

.login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login__card { width: 100%; max-width: 440px; }
.login__card .card__body { padding: 40px 36px; display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.login__logo { height: 34px; width: auto; display: block; margin-bottom: 8px; }
.login__card h1 { font-size: 24px; }
.login__card .btn--block { margin-top: 6px; }
.login__foot { text-align: center; color: var(--text-faint); font-size: 12.5px; margin-top: 18px; }

/* --- Utilities ------------------------------------------------------------ */

.stack   { display: flex; flex-direction: column; gap: 24px; }
.stack--tight { gap: 14px; }
.row     { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--end { justify-content: flex-end; }
.grow    { flex: 1; }
.mt      { margin-top: 18px; }
.mt-sm   { margin-top: 8px; }
.muted   { color: var(--text-muted); }
.faint   { color: var(--text-faint); font-size: 13px; }
.small   { font-size: 13px; }
.nowrap  { white-space: nowrap; }

/* htmx: includeIndicatorStyles is off (CSP), so the indicator rules live here. */
.htmx-indicator { opacity: 0; transition: opacity .15s ease-in; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.htmx-request .btn { opacity: .65; pointer-events: none; }

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 960px) {
    .detail-grid { grid-template-columns: 1fr; }
    main { padding: 28px 24px 56px; }
}

@media (max-width: 800px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar {
        position: static; height: auto;
        flex-direction: row; align-items: center; gap: 16px;
        padding: 12px 16px; overflow-x: auto;
    }
    .brand small { display: none; }
    .side-nav { flex-direction: row; gap: 2px; }
    .side-nav a { height: 36px; padding: 0 10px; font-size: 13px; }
    .side-nav a svg { display: none; }
    .side-user { margin-top: 0; margin-left: auto; border-top: 0; padding: 0; }
    .side-user div { display: none; }
    main { padding: 20px 16px 48px; gap: 18px; }
}
