:root {
    --bg: #f5f2ec;
    --ink: #111;
    --muted: rgba(0,0,0,0.56);
    --line: rgba(0,0,0,0.1);
    --accent: #b89c66;
    --dark: #191713;
    --paper: #fffdf8;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        linear-gradient(rgba(255,255,255,0.52) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.52) 1px, transparent 1px),
        radial-gradient(circle at 90% 10%, rgba(184,156,102,0.2), transparent 30%),
        linear-gradient(135deg, #fff, var(--bg));
    background-size: 42px 42px, 42px 42px, auto, auto;
}

button, input, textarea, select {
    font: inherit;
}

.shell {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 36px 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 28px;
}

.app-topbar {
    position: sticky;
    top: 18px;
    z-index: 20;
    padding: 16px 18px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 24px;
    background: rgba(255,253,248,0.8);
    box-shadow: 0 22px 70px rgba(0,0,0,0.08);
    backdrop-filter: blur(18px);
}

.brand-kicker {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.brand h1 {
    margin: 0;
    font-family: Georgia, serif;
    font-style: italic;
    font-size: clamp(38px, 6vw, 72px);
    line-height: 0.95;
}

.brand p {
    margin: 10px 0 0;
    color: var(--muted);
}

.card {
    background: rgba(255,253,248,0.88);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.08);
    backdrop-filter: blur(14px);
}

.auth-card {
    max-width: 520px;
    padding: 34px;
    margin-top: 70px;
}

.auth-card h2,
.panel h2 {
    margin: 0 0 10px;
    font-family: Georgia, serif;
    font-size: clamp(30px, 4vw, 46px);
    font-style: italic;
    line-height: 0.98;
}

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

.panel {
    padding: 24px;
}

.panel-head {
    margin-bottom: 18px;
}

.demo-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 22px 0;
    padding: 18px 20px;
    border: 1px solid rgba(184,156,102,0.28);
    border-radius: 20px;
    background:
        radial-gradient(circle at 10% 20%, rgba(184,156,102,0.18), transparent 38%),
        rgba(255,253,248,0.92);
    box-shadow: 0 24px 70px rgba(90,71,34,0.12);
}

.demo-banner strong,
.demo-banner span {
    display: block;
}

.demo-banner span {
    margin-top: 4px;
    color: var(--muted);
}

.metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-card {
    min-height: 118px;
    padding: 18px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 20px;
    background:
        linear-gradient(145deg, rgba(255,255,255,0.98), rgba(245,239,226,0.82));
    box-shadow: 0 20px 54px rgba(0,0,0,0.07);
    animation: cardIn 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.metric-card.alert {
    background:
        radial-gradient(circle at 100% 0%, rgba(109,25,25,0.14), transparent 45%),
        linear-gradient(145deg, rgba(255,255,255,0.98), rgba(245,239,226,0.82));
}

.metric-card span {
    color: rgba(0,0,0,0.46);
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.metric-card strong {
    display: block;
    margin-top: 16px;
    font-family: Georgia, serif;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 0.9;
}

.field {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.field.two {
    grid-template-columns: 1fr 120px;
}

.field label {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(0,0,0,0.42);
}

.field input,
.field textarea,
.field select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255,255,255,0.9);
    padding: 14px 16px;
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(184,156,102,0.14);
}

.field.compact {
    margin: 0;
}

.checks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0 18px;
}

.checks label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255,255,255,0.55);
    font-weight: 800;
    font-size: 13px;
}

.btn {
    border: 0;
    border-radius: 999px;
    padding: 13px 18px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.btn:hover { transform: translateY(-1px); }
.btn.primary {
    background: var(--dark);
    color: #fff;
    box-shadow: 0 18px 42px rgba(0,0,0,0.18);
}
.btn.ghost { background: rgba(0,0,0,0.06); color: #000; }
.btn.danger { background: #6d1919; color: #fff; }
.btn.soft {
    background: linear-gradient(135deg, #191713, #6f5a32);
}
.btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    transform: none;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.status {
    min-height: 22px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 14px;
}

.hidden { display: none !important; }

.inventory-console,
.import-console {
    margin-bottom: 18px;
    padding: 18px;
}

.console-grid {
    display: grid;
    grid-template-columns: minmax(240px, 1.5fr) minmax(150px, 0.7fr) minmax(150px, 0.7fr) minmax(240px, 1fr);
    gap: 14px;
    align-items: end;
}

.bulk-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.bulk-actions span {
    flex-basis: 100%;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.bulk-row,
.import-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.import-console {
    display: grid;
    grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.2fr);
    gap: 18px;
    align-items: start;
}

.import-console h2 {
    margin: 0 0 8px;
    font-family: Georgia, serif;
    font-style: italic;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 0.98;
}

.import-console p {
    margin: 0;
    color: var(--muted);
}

.import-preview {
    display: grid;
    gap: 8px;
    grid-column: 1 / -1;
}

.import-preview article {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.62);
}

.import-preview span {
    color: var(--muted);
}

.list {
    display: grid;
    gap: 12px;
}

.art-row {
    display: grid;
    grid-template-columns: 34px 92px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255,255,255,0.68);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
    animation: rowIn 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: var(--delay, 0ms);
}

.art-row:hover {
    transform: translateY(-2px);
    border-color: rgba(184,156,102,0.38);
    box-shadow: 0 22px 50px rgba(0,0,0,0.08);
}

.art-row img {
    width: 92px;
    height: 92px;
    object-fit: cover;
    border-radius: 12px;
    background: rgba(0,0,0,0.08);
}

.art-row h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.select-box {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 9px;
    background: rgba(255,255,255,0.7);
}

.select-box input {
    width: 16px;
    height: 16px;
    accent-color: var(--dark);
}

.row-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.status-pill,
.stock-pill {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.status-pill.active { background: rgba(54,120,74,0.14); color: #26613a; }
.status-pill.draft { background: rgba(184,156,102,0.18); color: #735f35; }
.status-pill.archived { background: rgba(0,0,0,0.08); color: rgba(0,0,0,0.58); }

.badge-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.stock-pill.ok { background: rgba(54,120,74,0.12); color: #26613a; }
.stock-pill.warning { background: rgba(184,156,102,0.18); color: #735f35; }
.stock-pill.danger { background: rgba(109,25,25,0.12); color: #6d1919; }

.art-row p {
    margin: 0;
    color: var(--muted);
}

.badge {
    display: inline-flex;
    margin: 8px 6px 0 0;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(184,156,102,0.16);
    color: #735f35;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

@media (max-width: 900px) {
    .topbar, .grid { grid-template-columns: 1fr; flex-direction: column; align-items: stretch; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .demo-banner { flex-direction: column; align-items: stretch; }
    .console-grid,
    .import-console { grid-template-columns: 1fr; }
    .art-row { grid-template-columns: 34px 72px 1fr; }
    .art-row .actions { grid-column: 1 / -1; }
    .field.two { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .shell {
        width: min(100% - 20px, 1240px);
        padding: 12px 0 28px;
    }

    .app-topbar {
        position: relative;
        top: auto;
        border-radius: 18px;
    }

    .brand h1 {
        font-size: 38px;
    }

    .metrics,
    .checks {
        grid-template-columns: 1fr;
    }

    .bulk-row .btn,
    .import-controls .btn,
    .actions .btn {
        width: 100%;
    }

    .auth-card,
    .panel {
        padding: 20px;
        border-radius: 18px;
    }

    .auth-card {
        margin-top: 28px;
    }

    .art-row {
        grid-template-columns: 1fr;
    }

    .select-box {
        width: 100%;
        justify-content: start;
        padding: 8px 10px;
    }

    .art-row img {
        width: 100%;
        height: 180px;
    }
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes rowIn {
    from {
        opacity: 0;
        transform: translateY(14px);
        filter: blur(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 1ms !important;
        transition-duration: 1ms !important;
        scroll-behavior: auto !important;
    }
}
