/*
 * Monarch Attires Design Studio — design system.
 * Every colour is a --token defined per theme; re-theming is a one-file change.
 * Themes: royal (default, light), noir (dark), emerald (light with deep green shell).
 */

:root,
[data-theme="royal"] {
    --bg: #f5f0e8;
    --surface: #ffffff;
    --surface-2: #faf6ef;
    --ink: #2a2024;
    --ink-soft: #4d4147;
    --muted: #7d6f66;
    --line: #e6dccb;
    --primary: #6d1a36;
    --primary-hover: #571329;
    --primary-ink: #ffffff;
    --primary-soft: #f3e4e9;
    --accent: #b8912f;
    --accent-soft: #f6ecd1;
    --shell: #2b0c17;
    --shell-2: #3a1322;
    --shell-ink: #efe2d0;
    --shell-muted: #b39a86;
    --shell-active: rgba(201, 162, 74, .16);
    --success: #2f7d55;
    --warning: #b7791f;
    --danger: #b3261e;
    --info: #2f6d8c;
    --shadow: 0 1px 2px rgba(43, 12, 23, .06), 0 8px 24px rgba(43, 12, 23, .07);
    --radius: 14px;
    --font-display: 'Cormorant Garamond', 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="noir"] {
    --bg: #0e0d10;
    --surface: #18161b;
    --surface-2: #201d24;
    --ink: #f1ebe0;
    --ink-soft: #d6cec1;
    --muted: #a0968a;
    --line: #2f2b34;
    --primary: #d2ad5e;
    --primary-hover: #e3c27a;
    --primary-ink: #1a1408;
    --primary-soft: #2a2417;
    --accent: #e8d5a0;
    --accent-soft: #2a2417;
    --shell: #09080a;
    --shell-2: #141217;
    --shell-ink: #ece4d6;
    --shell-muted: #8f857a;
    --shell-active: rgba(210, 173, 94, .14);
    --success: #4fbf85;
    --warning: #e0a24a;
    --danger: #ef6b62;
    --info: #63a9c9;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 28px rgba(0, 0, 0, .35);
}

[data-theme="emerald"] {
    --bg: #eff3ee;
    --surface: #ffffff;
    --surface-2: #f6f9f5;
    --ink: #14261f;
    --ink-soft: #33463e;
    --muted: #66776e;
    --line: #d9e3d8;
    --primary: #0f5c47;
    --primary-hover: #0b4636;
    --primary-ink: #ffffff;
    --primary-soft: #e0efe8;
    --accent: #ae8a3b;
    --accent-soft: #f4ecd4;
    --shell: #08302a;
    --shell-2: #0d3f37;
    --shell-ink: #e6efe6;
    --shell-muted: #92b1a4;
    --shell-active: rgba(196, 164, 92, .18);
    --success: #2f8a5b;
    --warning: #b7791f;
    --danger: #b3261e;
    --info: #2f6d8c;
    --shadow: 0 1px 2px rgba(8, 48, 42, .06), 0 8px 24px rgba(8, 48, 42, .08);
}

* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-ui);
    background: var(--bg);
    color: var(--ink);
    font-size: .94rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display { font-family: var(--font-display); font-weight: 600; letter-spacing: .01em; color: var(--ink); }
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
.text-muted, .text-body-secondary { color: var(--muted) !important; }

/* ---------- Bootstrap bridge ---------- */
.btn { border-radius: 10px; font-weight: 500; padding: .5rem 1rem; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; }
.btn-primary { --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-color: var(--primary-ink); --bs-btn-hover-bg: var(--primary-hover); --bs-btn-hover-border-color: var(--primary-hover); --bs-btn-hover-color: var(--primary-ink); --bs-btn-active-bg: var(--primary-hover); --bs-btn-active-border-color: var(--primary-hover); --bs-btn-active-color: var(--primary-ink); --bs-btn-disabled-bg: var(--primary); --bs-btn-disabled-border-color: var(--primary); --bs-btn-focus-shadow-rgb: 109, 26, 54; }
.btn-outline-primary { --bs-btn-color: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary); --bs-btn-hover-color: var(--primary-ink); --bs-btn-active-bg: var(--primary); --bs-btn-active-color: var(--primary-ink); }
.btn-outline-secondary { --bs-btn-color: var(--ink-soft); --bs-btn-border-color: var(--line); --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: var(--muted); --bs-btn-active-bg: var(--surface-2); --bs-btn-active-color: var(--ink); }
.btn-gold { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #fff)); color: #241a06; border: 0; }
.btn-gold:hover { filter: brightness(1.05); color: #241a06; }
.btn-sm { min-height: 34px; padding: .3rem .75rem; border-radius: 8px; }
.form-control, .form-select { border-radius: 10px; border-color: var(--line); background-color: var(--surface); color: var(--ink); min-height: 42px; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 .22rem color-mix(in srgb, var(--primary) 20%, transparent); background-color: var(--surface); color: var(--ink); }
.form-control::placeholder { color: var(--muted); opacity: .7; }
.form-label { font-weight: 500; font-size: .84rem; color: var(--ink-soft); margin-bottom: .3rem; }
.form-text { color: var(--muted); }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); font-weight: 600; }
.table { --bs-table-bg: transparent; --bs-table-color: var(--ink); --bs-table-border-color: var(--line); --bs-table-hover-bg: var(--surface-2); --bs-table-hover-color: var(--ink); --bs-table-striped-bg: var(--surface-2); }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 600; border-bottom-width: 1px; white-space: nowrap; }
.dropdown-menu { border-radius: 12px; border-color: var(--line); background: var(--surface); box-shadow: var(--shadow); padding: .4rem; }
.dropdown-item { border-radius: 8px; color: var(--ink); padding: .5rem .75rem; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--primary-soft); color: var(--primary); }
.dropdown-divider { border-color: var(--line); }
.modal-content { border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.modal-header, .modal-footer { border-color: var(--line); }
.nav-tabs { border-color: var(--line); }
.nav-tabs .nav-link { color: var(--muted); border: 0; border-bottom: 2px solid transparent; font-weight: 500; padding: .7rem 1rem; }
.nav-tabs .nav-link:hover { color: var(--ink); border-color: transparent transparent var(--line); }
.nav-tabs .nav-link.active { color: var(--primary); background: transparent; border-color: transparent transparent var(--primary); }
.alert { border-radius: 12px; border: 1px solid transparent; }
.badge { font-weight: 600; letter-spacing: .02em; }
.progress { background: var(--line); }
.pagination { --bs-pagination-color: var(--ink-soft); --bs-pagination-bg: var(--surface); --bs-pagination-border-color: var(--line); --bs-pagination-hover-bg: var(--primary-soft); --bs-pagination-hover-color: var(--primary); --bs-pagination-hover-border-color: var(--line); --bs-pagination-active-bg: var(--primary); --bs-pagination-active-border-color: var(--primary); --bs-pagination-active-color: var(--primary-ink); --bs-pagination-disabled-bg: var(--surface-2); --bs-pagination-disabled-border-color: var(--line); --bs-pagination-focus-color: var(--primary); --bs-pagination-focus-bg: var(--primary-soft); }
.page-link { border-radius: 8px !important; margin: 0 2px; min-width: 38px; text-align: center; }

/* ---------- Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 268px; flex: 0 0 268px; background: linear-gradient(180deg, var(--shell), var(--shell-2));
    color: var(--shell-ink); position: fixed; inset: 0 auto 0 0; z-index: 1040; display: flex; flex-direction: column;
    transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.sidebar-brand { padding: 1.35rem 1.4rem 1.1rem; display: flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--shell-ink); border-bottom: 1px solid rgba(255, 255, 255, .07); }
.sidebar-brand img, .sidebar-brand .brand-mark { width: 42px; height: 42px; flex: 0 0 42px; object-fit: contain; }
.brand-mark { width: 42px; height: 42px; flex: 0 0 42px; object-fit: contain; }
.brand-text { line-height: 1.1; }
.brand-name { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #fff; }
.brand-sub { font-size: .62rem; letter-spacing: .24em; text-transform: uppercase; color: var(--accent); margin-top: 3px; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: .75rem .8rem 1rem; scrollbar-width: thin; }
.nav-group-label { font-size: .64rem; letter-spacing: .2em; text-transform: uppercase; color: var(--shell-muted); padding: 1rem .7rem .4rem; }
.side-link { display: flex; align-items: center; gap: .8rem; padding: .62rem .8rem; border-radius: 10px; color: var(--shell-ink); text-decoration: none; font-weight: 450; margin-bottom: 2px; min-height: 44px; position: relative; opacity: .86; }
.side-link i { font-size: 1.1rem; color: var(--shell-muted); width: 22px; text-align: center; }
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; opacity: 1; }
.side-link.active { background: var(--shell-active); color: #fff; opacity: 1; }
.side-link.active i { color: var(--accent); }
.side-link.active::before { content: ''; position: absolute; left: -.8rem; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.side-cta { margin: .6rem .3rem .2rem; }
.side-cta .btn { width: 100%; }
.sidebar-user { padding: .9rem 1rem; border-top: 1px solid rgba(255, 255, 255, .07); display: flex; align-items: center; gap: .75rem; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #6d1a36)); color: #1f1505; font-weight: 700; display: grid; place-items: center; flex: 0 0 40px; font-size: .9rem; }
.sidebar-user .who { min-width: 0; flex: 1; line-height: 1.2; }
.sidebar-user .who strong { display: block; color: #fff; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .who small { color: var(--shell-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; }
.sidebar-user form button { background: transparent; border: 0; color: var(--shell-muted); font-size: 1.2rem; width: 40px; height: 40px; border-radius: 10px; }
.sidebar-user form button:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.main { flex: 1; margin-left: 268px; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 1030; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .9rem; padding: .7rem 1.6rem; min-height: 68px;
}
.topbar h1 { font-size: 1.55rem; margin: 0; line-height: 1; }
.topbar .eyebrow { display: block; font-family: var(--font-ui); font-size: .64rem; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); margin-bottom: 3px; font-weight: 600; }
.top-search { flex: 1; max-width: 440px; margin-left: auto; position: relative; }
.top-search input { padding-left: 2.5rem; border-radius: 999px; background: var(--surface); }
.top-search i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: .35rem; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--ink-soft); display: grid; place-items: center; font-size: 1.15rem; position: relative; }
.icon-btn:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .62rem; display: grid; place-items: center; padding: 0 4px; font-weight: 700; }
.content { padding: 1.6rem; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head h2 { font-size: 2rem; margin: 0; }
.page-head p { margin: .2rem 0 0; color: var(--muted); }
.orn { display: flex; align-items: center; gap: .6rem; color: var(--accent); margin: .5rem 0 1rem; }
.orn::before, .orn::after { content: ''; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, var(--accent)); opacity: .55; }
.orn::after { background: linear-gradient(270deg, transparent, var(--accent)); }
.app-footer { padding: 1rem 1.6rem 1.4rem; color: var(--muted); font-size: .78rem; text-align: center; }

.theme-swatch { width: 22px; height: 22px; border-radius: 50%; display: inline-block; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); flex: 0 0 22px; }
.theme-swatch.royal { background: linear-gradient(135deg, #6d1a36 50%, #c9a24a 50%); }
.theme-swatch.noir { background: linear-gradient(135deg, #18161b 50%, #d2ad5e 50%); }
.theme-swatch.emerald { background: linear-gradient(135deg, #0f5c47 50%, #c4a45c 50%); }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(10, 5, 8, .55); z-index: 1035; backdrop-filter: blur(2px); }

/* ---------- Components ---------- */
.stat-card { padding: 1.15rem 1.25rem; display: flex; gap: 1rem; align-items: center; height: 100%; position: relative; overflow: hidden; }
.stat-card::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, var(--accent-soft), transparent 70%); }
.stat-icon { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; background: var(--primary-soft); color: var(--primary); flex: 0 0 50px; z-index: 1; }
.stat-value { font-family: var(--font-display); font-size: 2.1rem; font-weight: 600; line-height: 1; z-index: 1; font-variant-numeric: lining-nums; }
.form-range { accent-color: var(--accent); }
.form-range::-webkit-slider-thumb { background-color: var(--accent); }
.form-range::-moz-range-thumb { background-color: var(--accent); }
.form-range:focus::-webkit-slider-thumb { box-shadow: 0 0 0 .25rem color-mix(in srgb, var(--accent) 30%, transparent); }
.stat-label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; margin-top: .2rem; z-index: 1; }

.status-pill { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 600; padding: .22rem .65rem; border-radius: 999px; letter-spacing: .02em; white-space: nowrap; }
.status-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-draft { background: color-mix(in srgb, var(--muted) 16%, transparent); color: var(--muted); }
.status-in_progress { background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning); }
.status-approved { background: color-mix(in srgb, var(--info) 18%, transparent); color: var(--info); }
.status-ready_for_production { background: color-mix(in srgb, var(--accent) 24%, transparent); color: color-mix(in srgb, var(--accent) 80%, #000); }
[data-theme="noir"] .status-ready_for_production { color: var(--accent); }
.status-completed { background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success); }

/* No overflow clipping on the card itself, otherwise the ⋯ menu is cut off; the thumbnail rounds its own corners. */
.design-card { display: flex; flex-direction: column; height: 100%; transition: transform .2s, box-shadow .2s; position: relative; }
.design-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(0, 0, 0, .05), 0 16px 34px rgba(43, 12, 23, .13); }
.design-card.menu-open { z-index: 1045; } /* above the fixed sidebar (1040) and sticky topbar (1030) while its menu is open */
.design-card .dropdown-menu { min-width: 13rem; z-index: 1055; max-height: min(70vh, 26rem); overflow-y: auto; }
.design-thumb { position: relative; aspect-ratio: 4 / 4.6; background: repeating-conic-gradient(color-mix(in srgb, var(--line) 55%, transparent) 0 25%, transparent 0 50%) 0 0 / 20px 20px, var(--surface-2); display: block; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; }
.design-thumb canvas, .design-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.design-thumb .status-pill { position: absolute; top: .7rem; left: .7rem; z-index: 2; backdrop-filter: blur(6px); background: color-mix(in srgb, var(--surface) 88%, transparent); }
.design-body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.design-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; line-height: 1.15; color: var(--ink); text-decoration: none; }
.design-title:hover { color: var(--primary); }
.design-meta { color: var(--muted); font-size: .8rem; }
.design-actions { margin-top: auto; padding-top: .7rem; display: flex; gap: .4rem; }
.design-actions .btn { flex: 1; }

.empty-state { text-align: center; padding: 3.5rem 1.5rem; color: var(--muted); }
.empty-state i { font-size: 2.8rem; color: var(--accent); display: block; margin-bottom: .6rem; }
.empty-state h4 { font-size: 1.5rem; }

.list-toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.list-toolbar .search { flex: 1 1 240px; position: relative; min-width: 200px; }
.list-toolbar .search i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.list-toolbar .search input { padding-left: 2.4rem; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-card { padding: 0; overflow: hidden; }
.table td, .table th { padding: .8rem 1rem; vertical-align: middle; }
.row-actions { white-space: nowrap; text-align: right; }

.swatch { display: inline-block; width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, .15); vertical-align: middle; }
.fabric-card canvas { width: 100%; aspect-ratio: 1; display: block; border-radius: var(--radius) var(--radius) 0 0; background: var(--surface-2); }
.measure-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.measure-item { border: 1px solid var(--line); border-radius: 12px; padding: .7rem .9rem; background: var(--surface-2); }
.measure-item small { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: .66rem; display: block; }
.measure-item strong { font-family: var(--font-display); font-size: 1.5rem; }

/* wizard */
.wizard-steps { display: flex; gap: .5rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.wizard-step { display: flex; align-items: center; gap: .55rem; padding: .5rem .95rem .5rem .5rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .82rem; font-weight: 500; }
.wizard-step .n { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; font-size: .78rem; border: 1px solid var(--line); }
.wizard-step.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.wizard-step.active .n { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.wizard-step.done .n { background: var(--success); color: #fff; border-color: var(--success); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.choice { border: 1.5px solid var(--line); background: var(--surface); border-radius: 14px; padding: 1rem .8rem; text-align: center; cursor: pointer; transition: all .15s; color: var(--ink); min-height: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; }
.choice:hover { border-color: var(--accent); transform: translateY(-2px); }
.choice.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.choice i { font-size: 1.6rem; color: var(--accent); }
.choice canvas { width: 100%; height: 92px; }
.choice strong { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.choice small { color: var(--muted); }
.sec-title { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin: 1.3rem 0 .6rem; }

/* ---------- Password toggle ---------- */
.pw-wrap { position: relative; }
.pw-wrap .form-control { padding-right: 3rem; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: transparent; color: var(--muted); border-radius: 10px; display: grid; place-items: center; font-size: 1.15rem; }
.pw-toggle:hover { color: var(--primary); background: var(--primary-soft); }
.pw-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

/* ---------- Upload zone ---------- */
.upload-zone { position: relative; border: 1.5px dashed color-mix(in srgb, var(--accent) 65%, var(--line)); background: linear-gradient(180deg, var(--surface-2), var(--surface)); border-radius: 14px; padding: 1.15rem 1.2rem; display: flex; align-items: center; gap: 1rem; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 10%, transparent); }
.upload-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.upload-zone .uz-icon { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; background: var(--primary-soft); color: var(--primary); overflow: hidden; }
.upload-zone .uz-icon img { width: 100%; height: 100%; object-fit: cover; }
.upload-zone .uz-text { min-width: 0; flex: 1; display: block; }
.upload-zone .uz-title, .upload-zone .uz-hint { display: block; }
.upload-zone .uz-title { font-weight: 600; color: var(--ink); line-height: 1.25; }
.upload-zone .uz-title u { color: var(--primary); text-decoration-thickness: 1px; }
.upload-zone .uz-hint { color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-zone .uz-btn { flex: 0 0 auto; pointer-events: none; }
.upload-zone.has-file { border-style: solid; border-color: var(--success); }
.upload-zone .uz-clear { position: relative; z-index: 2; border: 0; background: transparent; color: var(--muted); width: 34px; height: 34px; border-radius: 8px; display: none; }
.upload-zone.has-file .uz-clear { display: block; }
.upload-zone .uz-clear:hover { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.upload-zone.compact { padding: .7rem .9rem; }
.upload-zone.compact .uz-icon { width: 40px; height: 40px; flex-basis: 40px; font-size: 1.2rem; }

/* ---------- Login ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg); }
.auth-hero { position: relative; background: radial-gradient(1200px 600px at 20% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%), linear-gradient(160deg, var(--shell), var(--shell-2)); color: var(--shell-ink); padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.auth-hero::after { content: ''; position: absolute; inset: 0; background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 14px); pointer-events: none; }
.auth-hero .brand-name { font-size: 1.7rem; }
.auth-hero h2 { font-size: clamp(2.4rem, 4vw, 3.6rem); color: #fff; line-height: 1.05; margin: 0 0 1rem; }
.auth-hero h2 em { color: var(--accent); font-style: italic; }
.auth-hero p { color: var(--shell-muted); max-width: 30rem; }
.auth-points { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: .7rem; position: relative; z-index: 1; }
.auth-points li { display: flex; gap: .7rem; align-items: center; color: var(--shell-ink); }
.auth-points i { color: var(--accent); font-size: 1.1rem; }
.auth-panel { display: grid; place-items: center; padding: 2rem 1.4rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 2.3rem; margin-bottom: .2rem; }

/* ---------- Share & review ---------- */
.review-stage { background: repeating-conic-gradient(color-mix(in srgb, var(--line) 50%, transparent) 0 25%, transparent 0 50%) 0 0 / 22px 22px, var(--surface); border-radius: var(--radius); border: 1px solid var(--line); min-height: 320px; position: relative; overflow: hidden; }
.review-stage canvas { display: block; width: 100%; height: auto; max-height: 76vh; margin: 0 auto; object-fit: contain; }
.view-tabs { display: flex; gap: .4rem; flex-wrap: wrap; }
.view-tabs button { border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); padding: .4rem 1rem; border-radius: 999px; font-weight: 600; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; min-height: 38px; }
.view-tabs button.active { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.public-top { background: linear-gradient(90deg, var(--shell), var(--shell-2)); color: #fff; padding: .9rem 1.4rem; display: flex; align-items: center; gap: .8rem; }

.toast-stack { position: fixed; right: 1rem; bottom: 1rem; z-index: 2000; display: grid; gap: .5rem; max-width: min(92vw, 380px); }
.toast-lite { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: 12px; padding: .75rem 1rem; box-shadow: var(--shadow); display: flex; gap: .6rem; align-items: flex-start; animation: toast-in .25s ease; color: var(--ink); }
.toast-lite.success { border-left-color: var(--success); }
.toast-lite.danger { border-left-color: var(--danger); }
.toast-lite.warning { border-left-color: var(--warning); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.install-banner { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 2000; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .8rem 1rem; box-shadow: var(--shadow); display: none; align-items: center; gap: .8rem; max-width: 92vw; }

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
    .top-search { max-width: 320px; }
}
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); box-shadow: none; }
    .sidebar.open { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .45); }
    .sidebar-overlay.show { display: block; }
    .main { margin-left: 0; }
    .topbar { padding: .6rem 1rem; gap: .5rem; }
    .content { padding: 1.1rem 1rem; }
    .auth-page { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
}
@media (max-width: 767.98px) {
    .topbar h1 { font-size: 1.25rem; }
    .top-search { display: none; }
    .top-search.mobile-open { display: block; position: absolute; left: 1rem; right: 1rem; top: 100%; margin: .4rem 0 0; max-width: none; z-index: 5; }
    .page-head h2 { font-size: 1.65rem; }
    .btn, .form-control, .form-select, .side-link, .icon-btn { min-height: 44px; }
    .table-stack thead { display: none; }
    .table-stack tr { display: block; border-bottom: 1px solid var(--line); padding: .7rem 1rem; }
    .table-stack td { display: flex; justify-content: space-between; gap: 1rem; padding: .25rem 0; border: 0; text-align: right; }
    .table-stack td::before { content: attr(data-label); color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; text-align: left; }
    .table-stack td.row-actions { justify-content: flex-end; }
    .table-stack td.row-actions::before { display: none; }
    .upload-zone { flex-wrap: wrap; }
    .upload-zone .uz-btn { width: 100%; }
    .stat-value { font-size: 1.7rem; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Print ---------- */
@media print {
    .sidebar, .topbar, .sidebar-overlay, .app-footer, .no-print, .toast-stack, .install-banner, .list-toolbar, .pagination, .design-actions { display: none !important; }
    .main { margin: 0 !important; }
    .content { padding: 0 !important; }
    body { background: #fff !important; color: #000 !important; }
    .card { box-shadow: none !important; border-color: #ccc !important; break-inside: avoid; }
    a { color: inherit; text-decoration: none; }
}
