/*
 * Back office design system — καθαρό CSS, χωρίς framework και χωρίς JavaScript.
 * Light/dark ακολουθεί τη ρύθμιση του λειτουργικού. Καρτέλες με radio inputs (λειτουργούν χωρίς JS).
 */
:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-2: #f3f4f6;
    --surface-3: #eceef2;
    --border: #e4e7ec;
    --border-strong: #d0d5dd;
    --text: #101828;
    --text-2: #344054;
    --muted: #667085;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-soft: #eef2ff;
    --primary-text: #ffffff;
    --danger: #d92d20;
    --warn: #b54708;
    --ok: #067647;
    --info: #175cd3;
    --ok-bg: #ecfdf3;
    --warn-bg: #fffaeb;
    --danger-bg: #fef3f2;
    --info-bg: #eff8ff;
    --sidebar-bg: #ffffff;
    --sidebar-text: #475467;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
    --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .18);
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0c0f14;
        --surface: #141820;
        --surface-2: #1a1f29;
        --surface-3: #222836;
        --border: #262d3a;
        --border-strong: #343c4c;
        --text: #eef0f4;
        --text-2: #cfd4dd;
        --muted: #98a2b3;
        --primary: #8b85ff;
        --primary-hover: #a5a0ff;
        --primary-soft: #1e1c3d;
        --primary-text: #0b0d16;
        --ok-bg: #0b2b1d;
        --warn-bg: #2d200a;
        --danger-bg: #331414;
        --info-bg: #0d2240;
        --ok: #47cd89;
        --warn: #fdb022;
        --danger: #f97066;
        --info: #84adff;
        --sidebar-bg: #10141b;
        --sidebar-text: #aab3c2;
        --shadow: none;
        --shadow-lg: 0 12px 32px -8px rgba(0, 0, 0, .6);
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.55 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .75rem; color: var(--text); letter-spacing: -.01em; }
h2 { font-size: 1.05rem; font-weight: 650; }
h3 { font-size: .98rem; margin-top: 1.1rem; font-weight: 650; }
p { margin: 0 0 .75rem; }
.mono { font-family: var(--mono); font-size: .9em; }
.small { font-size: .85em; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.break { word-break: break-all; }
.right { text-align: right; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.spacer { flex: 1; }
.inline { display: inline; }
.icon { flex: 0 0 auto; vertical-align: -3px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.sidebar {
    width: 248px; flex: 0 0 248px; background: var(--sidebar-bg); color: var(--sidebar-text);
    position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 1rem .75rem 1.5rem; border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .65rem; padding: .3rem .55rem 1.1rem; color: var(--text); font-weight: 650; font-size: 1rem; }
.brand:hover { text-decoration: none; }
.brand-lg { justify-content: center; font-size: 1.1rem; padding-bottom: 1.25rem; }
.brand-mark {
    width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 34px;
    background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff; font-weight: 700; box-shadow: 0 4px 12px -4px rgba(99, 102, 241, .6);
}
.nav-group { margin-bottom: 1.1rem; }
.nav-group-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 0 .65rem .4rem; font-weight: 600; }
.nav-link { display: flex; align-items: center; gap: .65rem; color: var(--sidebar-text); padding: .5rem .65rem; border-radius: var(--radius-sm); font-weight: 500; }
.nav-link .icon { opacity: .8; }
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.is-active { background: var(--primary-soft); color: var(--primary); }
.nav-link.is-active .icon { opacity: 1; }
.nav-scrim { display: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    display: flex; align-items: center; gap: .75rem; padding: .6rem 1.5rem; background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; min-height: 58px;
}
.topbar-search { flex: 1; max-width: 520px; position: relative; display: flex; align-items: center; }
.topbar-search .icon { position: absolute; left: .75rem; color: var(--muted); }
.topbar-search input[type=search] { padding-left: 2.4rem; background: var(--surface); border-radius: 999px; }
.topbar-right { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
.user-chip { display: inline-flex; align-items: center; gap: .5rem; color: var(--text-2); padding: .25rem .6rem .25rem .3rem; border-radius: 999px; font-weight: 500; }
.user-chip:hover { background: var(--surface-2); text-decoration: none; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 650; font-size: .82rem; }
.icon-btn { display: none; cursor: pointer; padding: .45rem; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--text-2); line-height: 0; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.always { display: inline-flex; }
.content { padding: 1.5rem; max-width: 1440px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head-text { flex: 1; min-width: 0; }
.page-title { font-size: 1.5rem; margin: 0; font-weight: 700; letter-spacing: -.02em; }
.page-subtitle { margin: .25rem 0 0; color: var(--muted); }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.breadcrumb { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-size: .85rem; margin-bottom: .35rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }

@media (max-width: 900px) {
    .sidebar { position: fixed; left: 0; top: 0; z-index: 20; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
    .nav-toggle:checked ~ .sidebar { transform: none; }
    .nav-toggle:checked ~ .nav-scrim { display: block; position: fixed; inset: 0; z-index: 15; background: rgba(16, 24, 40, .4); }
    .icon-btn { display: inline-flex; }
    .topbar { padding: .5rem .75rem; }
    .content { padding: 1rem .85rem; }
    .user-name { display: none; }
    .page-title { font-size: 1.25rem; }
}

/* ---------- Cards / layout ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem 1.4rem; margin-bottom: 1.1rem; }
.card > h2:first-child, .card-head h2 { margin-bottom: .9rem; }
.card-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .9rem; }
.card-head h2 { margin: 0; flex: 1; }
.card.narrow { max-width: 420px; width: 100%; }
.card.wide { max-width: 640px; width: 100%; }
.card-flush { padding: 0; overflow: hidden; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.1rem; align-items: start; }
@media (max-width: 1100px) { .layout-2 { grid-template-columns: 1fr; } }
.checklist { list-style: none; padding: 0; margin: 0 0 1rem; font-size: .9rem; }
.checklist li { display: flex; gap: .5rem; padding: .2rem 0; }
.checklist .ok { color: var(--ok); }
.checklist .fail { color: var(--danger); }
.form-section { margin: 1.25rem 0 .5rem; font-size: 1rem; }
.copy { word-break: break-all; font-family: var(--mono); font-size: .85rem; padding: .55rem .7rem; background: var(--surface-2); border-radius: var(--radius-sm); }
.narrow-form { max-width: 560px; }
.page-center { display: grid; place-items: center; min-height: 100vh; padding: 1rem; background: radial-gradient(1200px 600px at 10% -10%, var(--primary-soft), transparent), var(--bg); }
.auth-card { padding: 2rem; box-shadow: var(--shadow-lg); }
.auth-title { font-size: 1.3rem; text-align: center; }
.error-code { font-size: 3rem; margin: 0; color: var(--muted); }
.grid-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.1rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); display: block; color: inherit; }
a.stat:hover { border-color: var(--border-strong); text-decoration: none; }
.stat-value { font-size: 1.75rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat-label { color: var(--muted); font-size: .85rem; }
.toolbar { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.toolbar.wrap { row-gap: .5rem; }
.actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; flex-wrap: wrap; }
.actions.left { justify-content: flex-start; }
.dl { display: grid; grid-template-columns: 200px 1fr; gap: .5rem 1rem; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
@media (max-width: 600px) { .dl { grid-template-columns: 1fr; } .dl dt { margin-top: .4rem; } }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .icon { width: 36px; height: 36px; color: var(--border-strong); margin-bottom: .5rem; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem .95rem;
    border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
    font: inherit; font-weight: 550; cursor: pointer; text-decoration: none; line-height: 1.2; min-height: 38px; box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
    transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); box-shadow: 0 1px 2px rgba(79, 70, 229, .3); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-sm { padding: .3rem .65rem; min-height: 30px; font-size: .86em; }
.btn-block { width: 100%; }
.btn .icon { width: 16px; height: 16px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .25rem 1rem; }
.form-grid.cols-1 { grid-template-columns: 1fr; }
.span-2 { grid-column: 1 / -1; }
.field { margin-bottom: .9rem; }
.field > label { display: block; font-weight: 550; margin-bottom: .35rem; color: var(--text-2); font-size: .9rem; }
.req { color: var(--danger); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=date], input[type=url], select, textarea {
    width: 100%; padding: .55rem .75rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); font: inherit; min-height: 38px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 16px; height: 16px; }
.toolbar input, .toolbar select, .inline-form input, .inline-form select { width: auto; }
.toolbar input[type=search], .toolbar input[type=text] { min-width: 240px; }
.w-sm { max-width: 120px; min-width: 90px !important; }
.date-input { max-width: 11.5rem; font-variant-numeric: tabular-nums; }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); }
input[readonly] { background: var(--surface-2); color: var(--muted); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.error { color: var(--danger); font-size: .84rem; margin-top: .3rem; }
.hint { color: var(--muted); font-size: .82rem; margin-top: .3rem; }
.field-check label, label.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; cursor: pointer; }
.readonly { padding: .5rem 0; }
.inline-form { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset[disabled] { opacity: .85; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.perm-group { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .7rem .9rem; }
.perm-group legend { font-weight: 600; padding: 0 .3rem; }
.perm-group .check { padding: .2rem 0; }
.savebar {
    position: sticky; bottom: 0; z-index: 4; display: flex; gap: .5rem; justify-content: flex-end; align-items: center;
    margin: 1rem -1.4rem -1.25rem; padding: .8rem 1.4rem; background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(6px); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius);
}
.savebar .muted { margin-right: auto; }

/* ---------- Tabs (χωρίς JavaScript: radio + label) ---------- */
.tabs > input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.tab-list { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.1rem; overflow-x: auto; scrollbar-width: none; }
.tab-list label { display: inline-flex; align-items: center; gap: .45rem; padding: .65rem .9rem; cursor: pointer; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab-list label:hover { color: var(--text); }
.tab-list .count { background: var(--surface-3); color: var(--text-2); border-radius: 999px; padding: 0 .45rem; font-size: .75rem; }
.tab-panel { display: none; }
.tabs > input:nth-of-type(1):checked ~ .tab-list label:nth-of-type(1),
.tabs > input:nth-of-type(2):checked ~ .tab-list label:nth-of-type(2),
.tabs > input:nth-of-type(3):checked ~ .tab-list label:nth-of-type(3),
.tabs > input:nth-of-type(4):checked ~ .tab-list label:nth-of-type(4),
.tabs > input:nth-of-type(5):checked ~ .tab-list label:nth-of-type(5),
.tabs > input:nth-of-type(6):checked ~ .tab-list label:nth-of-type(6) { color: var(--primary); border-bottom-color: var(--primary); }
.tabs > input:nth-of-type(1):checked ~ .tab-panels > .tab-panel:nth-of-type(1),
.tabs > input:nth-of-type(2):checked ~ .tab-panels > .tab-panel:nth-of-type(2),
.tabs > input:nth-of-type(3):checked ~ .tab-panels > .tab-panel:nth-of-type(3),
.tabs > input:nth-of-type(4):checked ~ .tab-panels > .tab-panel:nth-of-type(4),
.tabs > input:nth-of-type(5):checked ~ .tab-panels > .tab-panel:nth-of-type(5),
.tabs > input:nth-of-type(6):checked ~ .tab-panels > .tab-panel:nth-of-type(6) { display: block; }
.tabs > input:focus-visible ~ .tab-list { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; padding: 0; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th, .table td { padding: .7rem 1rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table thead th { position: sticky; top: 0; background: var(--surface-2); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; white-space: nowrap; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--primary) 4%, var(--surface)); }
.table.compact th, .table.compact td { padding: .42rem .8rem; }
.table tr:last-child td { border-bottom: 0; }
.table .empty { text-align: center; color: var(--muted); padding: 2rem; }
.table tr.is-muted td { color: var(--muted); }
.table tr.is-warn td { background: var(--warn-bg); }
.table .cell-main { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.table .cell-main a { font-weight: 550; color: var(--text); }
.table .cell-main a:hover { color: var(--primary); }
.table .sub { color: var(--muted); font-size: .82rem; }
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--border); flex: 0 0 44px; display: grid; place-items: center; color: var(--border-strong); }
.diff tr.is-changed td { background: var(--warn-bg); }
.diff tr.is-muted td { color: var(--muted); }

/* ---------- Badges / alerts ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge-plain::before { display: none; }
.badge-ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.badge-info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.alert { padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1.1rem; border: 1px solid transparent; }
.alert-success { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 20%, transparent); }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 20%, transparent); }
.alert-warning { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 20%, transparent); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 20%, transparent); }

/* ---------- Misc ---------- */
.pagination { display: flex; gap: .75rem; align-items: center; justify-content: center; margin: 1.1rem 0; }
.steps { padding-left: 1.2rem; }
.steps li { margin-bottom: 1rem; }
.qr { margin: .75rem 0; }
.qr img { background: #fff; padding: 8px; border-radius: var(--radius-sm); image-rendering: pixelated; }
.secret { font-size: 1.05rem; letter-spacing: .08em; padding: .4rem .6rem; background: var(--surface-2); border-radius: var(--radius-sm); display: inline-block; margin-top: .3rem; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .35rem; list-style: none; padding: 0; font-size: 1.05rem; }
.debug { text-align: left; white-space: pre-wrap; font-size: .75rem; max-height: 60vh; overflow: auto; background: var(--surface-2); padding: .75rem; border-radius: var(--radius-sm); }
.module-row { display: flex; gap: .55rem; align-items: baseline; padding: .4rem 0; font-weight: 400; }
@media print { .sidebar, .topbar, .toolbar, .actions, .savebar { display: none !important; } .card { border: 0; box-shadow: none; } }

/* ---------- Κατάλογος ---------- */
.cat-tree { display: grid; gap: .2rem; max-height: 300px; overflow: auto; padding: .55rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: .8rem; }
.cat-tree label { display: flex; gap: .5rem; align-items: center; font-weight: 400; padding: .1rem 0; }
.depth-1 { padding-left: 1.25rem; } .depth-2 { padding-left: 2.5rem; } .depth-3 { padding-left: 3.75rem; } .depth-4 { padding-left: 5rem; } .depth-5, .depth-6 { padding-left: 6.25rem; }
td.depth-1, td.depth-2, td.depth-3, td.depth-4, td.depth-5, td.depth-6 { padding-left: calc(1rem + var(--indent, 0px)); }
.locale-block { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .55rem .95rem; margin: .65rem 0; background: var(--surface); }
.locale-block > summary { cursor: pointer; font-weight: 600; padding: .25rem 0; }
.locale-block[open] > summary { margin-bottom: .6rem; }
.variants-table td { vertical-align: top; }
.variants-table input[type=text] { width: auto; min-width: 0; padding: .38rem .5rem; font-size: .86rem; min-height: 34px; }
.variants-table input.money { text-align: right; width: 7rem; font-variant-numeric: tabular-nums; }
.variants-table .stack { display: grid; gap: .35rem; min-width: 10rem; }
.variants-table .sale-cell label { display: flex; gap: .35rem; align-items: center; font-weight: 400; white-space: nowrap; color: var(--muted); }
.variants-table tr.has-error td { background: var(--danger-bg); }
.row-actions { display: flex; gap: .2rem; margin-top: .4rem; flex-wrap: wrap; }
.variant-name { font-weight: 600; }
.price-sale { color: var(--danger); }
.option-pick { margin: .7rem 0; }
.option-pick legend { font-weight: 600; margin-bottom: .35rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; margin: 0 .35rem .4rem 0; border: 1px solid var(--border-strong); border-radius: 999px; font-weight: 500; cursor: pointer; background: var(--surface); }
.chip input { display: none; }
.chip:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.swatch { display: inline-block; vertical-align: middle; border-radius: 4px; }
.side-card h2 { font-size: .95rem; }
.card-head.padded { padding: 1.1rem 1.4rem 0; flex-wrap: wrap; }
.savebar-card { padding: 0; position: sticky; bottom: .75rem; z-index: 4; box-shadow: var(--shadow-lg); }
.savebar-card .savebar { margin: 0; position: static; border-top: 0; border-radius: var(--radius); }
.savebar.flat { position: static; margin: 0; border-radius: 0 0 var(--radius) var(--radius); }
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .35rem; }
.stat-icon { color: var(--primary); background: var(--primary-soft); border-radius: 8px; padding: 5px; width: 30px; height: 30px; }
.padded-x { padding: 0 1.4rem 1rem; }
.dropzone { display: grid; place-items: center; gap: .35rem; padding: 1.75rem 1rem; border: 2px dashed var(--border-strong); border-radius: var(--radius); text-align: center; cursor: pointer; background: var(--surface-2); }
.dropzone:hover { border-color: var(--primary); }
.dropzone .icon { width: 28px; height: 28px; color: var(--primary); }
.dropzone input[type=file] { max-width: 100%; margin-top: .5rem; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.media-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.media-card img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; }
.media-main { position: absolute; top: .6rem; left: .6rem; }
.media-meta { display: grid; gap: .45rem; padding: .75rem; }
.media-meta label { display: flex; align-items: center; gap: .4rem; font-weight: 400; color: var(--muted); }
.media-meta select, .media-meta input[type=text] { min-height: 32px; padding: .3rem .5rem; font-size: .85rem; }
.danger-check { color: var(--danger) !important; }
