@import url('https://fonts.googleapis.com/css2?family=Titillium+Web:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-soft: #eef3f2;
    --border: #d9e0e4;
    --text: #172026;
    --muted: #66737c;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --blue: #2563eb;
    --amber: #b7791f;
    --green: #15803d;
    --red: #b42318;
    --shadow: 0 18px 45px rgba(23, 32, 38, 0.08);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Titillium Web', sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

select,
textarea {
    font: inherit;
}

.app-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: #182126;
    color: #edf4f3;
    padding: 22px 16px;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.app-logo strong,
.app-logo small {
    display: block;
}

.app-logo small {
    color: #aebdc2;
    font-size: 12px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: var(--radius);
    background: var(--primary);
    color: #ffffff;
    font-weight: 800;
}

.brand-mark.small {
    width: 38px;
    height: 38px;
    font-size: 13px;
}

.nav-list {
    display: grid;
    gap: 5px;
    padding-top: 18px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    border-radius: var(--radius);
    padding: 9px 10px;
    color: #cdd9dc;
}

.nav-item:hover,
.nav-item.is-active {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.nav-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #bbf7d0;
    font-size: 11px;
    font-weight: 800;
}

.main-panel {
    min-width: 0;
    padding: 0 28px 36px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    min-height: 78px;
    background: rgba(244, 246, 248, 0.94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    max-width: 560px;
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 0 14px;
    color: var(--muted);
}

.search-box span {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.topbar-actions,
.heading-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.user-chip span {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1e40af;
    font-weight: 800;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 0 14px;
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.btn-ghost {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
}

.btn.full {
    width: 100%;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 18px;
    margin: 28px 0 20px;
}

.page-heading h1,
.panel-heading h2,
.panel-title h2 {
    margin: 0;
}

.page-heading h1 {
    font-size: 30px;
    line-height: 1.15;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

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

.metric-card,
.panel,
.login-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.metric-card {
    padding: 18px;
}

.metric-card span,
.metric-card small,
.mini-row small,
.item-cell small,
.muted {
    color: var(--muted);
}

.metric-card span {
    display: block;
    font-weight: 700;
}

.metric-card strong {
    display: block;
    margin: 8px 0 2px;
    font-size: 28px;
    line-height: 1.15;
}

.dashboard-grid,
.module-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 360px;
    gap: 18px;
    align-items: start;
}

.span-2 {
    grid-column: span 2;
}

.panel {
    min-width: 0;
    padding: 18px;
}

.panel-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.panel-title h2 {
    font-size: 18px;
}

.panel-title a {
    color: var(--blue);
    font-size: 13px;
    font-weight: 800;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

td {
    color: #24313a;
}

.item-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.thumb {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 6px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 800;
}

.status,
.stock-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 0 9px;
    font-size: 12px;
    font-weight: 800;
}

.status.active,
.status.paid,
.status.completed,
.stock-pill {
    background: #dcfce7;
    color: var(--green);
}

.status.draft,
.status.pending,
.status.processing,
.status.sent,
.status.suspended {
    background: #fef3c7;
    color: var(--amber);
}

.status.cancelled,
.stock-pill.is-low {
    background: #fee2e2;
    color: var(--red);
}

.status.archived {
    background: #e5e7eb;
    color: #4b5563;
}

.stack-list {
    display: grid;
    gap: 10px;
}

.mini-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fbfcfd;
}

.mini-row strong,
.mini-row small,
.item-cell strong,
.item-cell small {
    display: block;
}

.product-focus {
    position: sticky;
    top: 96px;
}

.product-photo {
    display: grid;
    place-items: center;
    height: 170px;
    margin-bottom: 16px;
    border: 1px dashed #a7b5bb;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #eef3f2, #ffffff);
    color: var(--muted);
    font-weight: 800;
}

.detail-list {
    display: grid;
    gap: 10px;
    margin: 0 0 16px;
}

.detail-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.detail-list dt {
    color: var(--muted);
    font-weight: 700;
}

.detail-list dd {
    margin: 0;
    text-align: right;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.feature-item {
    min-height: 150px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    background: #fbfcfd;
}

.feature-item strong {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

.feature-item p {
    margin: 0;
    color: var(--muted);
}

.check-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.check-list li {
    position: relative;
    padding: 10px 10px 10px 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fbfcfd;
}

.check-list li::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 17px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}

.empty-cell,
.empty-note {
    color: var(--muted);
    text-align: center;
}

.empty-note {
    margin: 12px 0;
}

.alert {
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 16px;
    font-weight: 700;
}

.alert-error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: var(--red);
}

.alert-warning {
    border: 1px solid #fde68a;
    background: #fffbeb;
    color: var(--amber);
}

.alert-success {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: var(--green);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-grid label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-weight: 700;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #ffffff;
    padding: 0 12px;
    outline: 0;
    color: var(--text);
}

.form-grid textarea {
    min-height: 120px;
    padding-top: 11px;
    resize: vertical;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.full-row,
.form-actions {
    grid-column: 1 / -1;
}

.small {
    font-size: 13px;
}

.auth-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
    background:
        linear-gradient(130deg, rgba(15, 118, 110, 0.16), transparent 42%),
        linear-gradient(320deg, rgba(37, 99, 235, 0.13), transparent 42%),
        var(--bg);
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    width: min(1040px, 100%);
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.auth-brand {
    padding: 56px;
    background: #182126;
    color: #ffffff;
}

.auth-brand h1 {
    margin: 14px 0 10px;
    font-size: 42px;
    line-height: 1.1;
}

.auth-copy {
    max-width: 520px;
    color: #c8d4d7;
    font-size: 17px;
}

.auth-modules {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
}

.auth-modules span {
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 7px 11px;
    color: #d8e7e6;
    font-size: 13px;
    font-weight: 700;
}

.login-panel {
    box-shadow: none;
    border: 0;
    border-left: 1px solid var(--border);
    padding: 42px;
}

.panel-heading {
    margin-bottom: 24px;
}

.panel-heading h2 {
    font-size: 28px;
}

.form-stack {
    display: grid;
    gap: 16px;
}

.form-stack label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-weight: 700;
}

.form-stack input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 12px;
    outline: 0;
    color: var(--text);
}

.form-stack input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.form-stack + .muted {
    margin-top: 18px;
}

@media (max-width: 1120px) {
    .app-shell {
        grid-template-columns: 86px minmax(0, 1fr);
    }

    .app-logo span:last-child,
    .nav-item span:last-child {
        display: none;
    }

    .sidebar {
        padding-inline: 14px;
    }

    .app-logo {
        justify-content: center;
        padding-inline: 0;
    }

    .nav-item {
        justify-content: center;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid,
    .module-layout {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: span 1;
    }

    .product-focus {
        position: static;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .nav-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nav-item span:last-child,
    .app-logo span:last-child {
        display: block;
    }

    .main-panel {
        padding: 0 16px 28px;
    }

    .topbar,
    .page-heading,
    .topbar-actions,
    .heading-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .search-box,
    .btn,
    .user-chip {
        width: 100%;
    }

    .metric-grid,
    .auth-shell,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .auth-brand,
    .login-panel {
        padding: 30px;
    }

    .login-panel {
        border-left: 0;
        border-top: 1px solid var(--border);
    }
}

/* Stockvixo visual refresh matching the approved dashboard mockup */
:root {
    --bg: #f6f8fb;
    --surface: #ffffff;
    --border: #e3e8ef;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #007c8f;
    --primary-dark: #006274;
    --sidebar-a: #083344;
    --sidebar-b: #022c3a;
    --cyan-soft: #e6f7f7;
    --green-soft: #dcfce7;
    --blue-soft: #dbeafe;
    --purple-soft: #f3e8ff;
    --amber-soft: #fff3d8;
    --red-soft: #ffe4e6;
    --shadow: 0 14px 35px rgba(15, 23, 42, 0.06);
    --radius: 7px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}

.app-shell {
    grid-template-columns: 236px minmax(0, 1fr);
}

.sidebar {
    background:
        radial-gradient(circle at 30% 25%, rgba(15, 118, 110, 0.26), transparent 24%),
        linear-gradient(180deg, var(--sidebar-a), var(--sidebar-b));
    padding: 18px 12px;
}

.app-logo {
    gap: 10px;
    padding: 0 8px 24px;
    border-bottom: 0;
}

.logo-mark {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 34px;
    transform: rotate(30deg);
}

.logo-mark::before,
.logo-mark::after {
    content: "";
    position: absolute;
    border-radius: 4px;
    background: linear-gradient(135deg, #14b8a6, #0891b2);
}

.logo-mark::before {
    inset: 4px 11px 4px 2px;
}

.logo-mark::after {
    inset: 16px 2px 4px 12px;
    background: linear-gradient(135deg, #22d3ee, #0f766e);
}

.logo-text strong {
    color: #ffffff;
    font-size: 25px;
    letter-spacing: 0;
}

.nav-list {
    gap: 6px;
    padding-top: 4px;
}

.nav-item {
    position: relative;
    min-height: 44px;
    padding: 0 12px;
    color: #e3f3f5;
    border-radius: 7px;
    font-size: 15px;
}

.nav-item:hover,
.nav-item.is-active {
    background: linear-gradient(90deg, #007c8f, #006a7a);
    color: #ffffff;
}

.nav-icon {
    width: 23px;
    height: 23px;
    border-radius: 0;
    background: transparent;
    color: currentColor;
    font-size: 17px;
    font-weight: 400;
}

.nav-badge {
    margin-left: auto;
    min-width: 23px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #1684ff;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    line-height: 22px;
    text-align: center;
}

.main-panel {
    min-height: 100vh;
    padding: 0;
    background: var(--bg);
}

.topbar {
    display: grid;
    grid-template-columns: 44px minmax(360px, 680px) 1fr;
    min-height: 72px;
    padding: 0 28px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
}

.topbar-actions {
    justify-content: flex-end;
}

.search-box {
    max-width: 680px;
    min-height: 42px;
    border-color: #d8dee8;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.search-box span {
    text-transform: none;
}

.search-box kbd {
    flex: 0 0 auto;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    background: #f1f5f9;
    color: #475569;
    padding: 2px 7px;
    font-size: 12px;
    font-weight: 700;
}

.search-icon {
    color: #334155;
    font-size: 18px;
}

.top-icon {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #0f172a;
    cursor: pointer;
    font-size: 17px;
}

.top-icon:hover {
    background: #f1f5f9;
}

.top-icon.has-alert::after {
    content: "8";
    position: absolute;
    top: 1px;
    right: 1px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    line-height: 17px;
}

.menu-toggle {
    color: #334155;
}

.close-session {
    font-size: 24px;
}

.user-chip {
    width: 42px;
    min-height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #12b8ad;
    justify-content: center;
}

.user-chip span {
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
    color: #ffffff;
}

.btn {
    min-height: 42px;
    border-radius: 6px;
    padding: 0 16px;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(180deg, #008aa1, #006f82);
    box-shadow: 0 8px 18px rgba(0, 124, 143, 0.18);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #007c8f, #005f70);
}

.stockvixo-dashboard {
    display: grid;
    grid-template-columns: minmax(920px, 1fr) 380px;
    gap: 0;
    min-height: calc(100vh - 72px);
}

.dashboard-content {
    min-width: 0;
    padding: 24px 22px;
}

.product-editor {
    min-width: 0;
    background: #ffffff;
    border-left: 1px solid var(--border);
    box-shadow: -10px 0 25px rgba(15, 23, 42, 0.03);
}

.product-editor-header {
    display: flex;
    align-items: center;
    min-height: 58px;
    padding: 0 28px;
    border-bottom: 1px solid var(--border);
}

.product-editor-header h2 {
    margin: 0;
    font-size: 18px;
}

.editor-tabs {
    display: flex;
    height: 50px;
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
}

.editor-tabs button,
.tab {
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #475569;
    cursor: pointer;
    padding: 0 18px;
    font-weight: 700;
}

.editor-tabs button.is-active,
.tab.is-active {
    border-bottom-color: var(--primary);
    color: var(--primary);
}

.metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.sv-card,
.metric-card,
.panel {
    border-color: var(--border);
    border-radius: 7px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.metric-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px;
    column-gap: 14px;
    min-height: 122px;
    padding: 20px 20px;
    overflow: hidden;
}

.metric-main {
    min-width: 0;
}

.metric-card span {
    color: #1f2937;
    font-weight: 600;
}

.metric-card strong {
    display: block;
    margin: 8px 0 10px;
    max-width: 100%;
    color: #0f172a;
    font-size: clamp(22px, 1.6vw, 29px);
    line-height: 1.05;
    letter-spacing: 0;
    white-space: nowrap;
}

.metric-card small {
    color: #64748b;
}

.metric-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
}

.metric-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
}

.metric-icon.money {
    background: var(--cyan-soft);
    color: #008aa1;
}

.metric-icon.cart {
    background: var(--green-soft);
    color: #16a34a;
}

.metric-icon.chart {
    background: var(--blue-soft);
    color: #2563eb;
}

.metric-icon.users {
    background: var(--purple-soft);
    color: #7c3aed;
}

.trend.up {
    color: #16a34a;
    font-weight: 800;
}

.insight-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(330px, 1.2fr);
    gap: 14px;
    margin-bottom: 14px;
}

.panel {
    min-width: 0;
    padding: 20px;
}

.panel-title.compact {
    align-items: center;
    margin-bottom: 18px;
}

.panel-title.compact h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #111827;
    font-size: 16px;
    font-weight: 800;
}

.panel-title.compact a {
    color: #334155;
    font-size: 13px;
    font-weight: 500;
}

.warning-mark {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f59e0b;
    color: #ffffff;
    font-size: 14px;
    line-height: 20px;
}

.dense-list {
    gap: 11px;
}

.mini-row.flat {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
}

.book-line {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
}

.book-line > div {
    min-width: 0;
}

.book-line strong,
.catalogue-table strong {
    display: block;
    overflow: hidden;
    max-width: 100%;
    color: #111827;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-line small,
.catalogue-table small {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 12px;
}

.book-cover {
    position: relative;
    display: inline-block;
    flex: 0 0 auto;
    width: 32px;
    height: 43px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 3px;
    background: #f8fafc;
    box-shadow: 0 4px 8px rgba(15, 23, 42, 0.12);
}

.book-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.95;
}

.book-cover::after {
    content: "";
    position: absolute;
    left: 5px;
    right: 5px;
    bottom: 6px;
    height: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.65);
    box-shadow: 0 -6px 0 rgba(255, 255, 255, 0.45);
}

.cover-prince::before {
    background:
        radial-gradient(circle at 70% 26%, #f4d35e 0 7%, transparent 8%),
        radial-gradient(circle at 54% 60%, #a8a29e 0 22%, transparent 23%),
        linear-gradient(180deg, #f8fbff, #eef2f7);
}

.cover-1984::before {
    background:
        linear-gradient(90deg, transparent 42%, rgba(255, 255, 255, 0.08) 42% 48%, transparent 48%),
        linear-gradient(180deg, #101827, #be123c);
}

.cover-harry::before {
    background:
        radial-gradient(circle at 50% 22%, #facc15 0 13%, transparent 14%),
        linear-gradient(160deg, #171717, #78350f 55%, #111827);
}

.cover-atomic::before {
    background:
        repeating-linear-gradient(0deg, rgba(15, 23, 42, 0.12) 0 2px, transparent 2px 6px),
        linear-gradient(180deg, #f5e9d7, #fff7ed);
}

.cover-alchimiste::before {
    background:
        radial-gradient(circle at 48% 30%, #fcd34d 0 16%, transparent 17%),
        linear-gradient(180deg, #b91c1c, #f97316);
}

.cover-pragmatic::before {
    background:
        radial-gradient(circle at 52% 38%, #6b7280 0 13%, transparent 14%),
        linear-gradient(180deg, #030712, #334155);
}

.cover-sapiens::before {
    background:
        repeating-linear-gradient(45deg, rgba(146, 64, 14, 0.14) 0 3px, transparent 3px 9px),
        linear-gradient(180deg, #fff7ed, #fed7aa);
}

.cover-pages::before,
.cover-open::before {
    background:
        repeating-linear-gradient(90deg, rgba(100, 116, 139, 0.15) 0 1px, transparent 1px 7px),
        linear-gradient(180deg, #fefce8, #f8fafc);
}

.cover-open::before {
    background:
        linear-gradient(90deg, rgba(100, 116, 139, 0.3) 49%, rgba(30, 41, 59, 0.16) 50%, rgba(100, 116, 139, 0.3) 51%),
        repeating-linear-gradient(0deg, rgba(100, 116, 139, 0.15) 0 1px, transparent 1px 7px),
        #fefce8;
}

.rank-row {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) 82px;
    align-items: center;
}

.rank-row > small {
    text-align: right;
    white-space: nowrap;
}

.rank {
    color: #475569;
    font-weight: 700;
}

.order-list {
    display: grid;
}

.order-row {
    display: grid;
    grid-template-columns: minmax(92px, 1fr) minmax(80px, 1fr) 72px 102px;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    border-bottom: 1px solid var(--border);
    color: #475569;
    font-size: 13px;
}

.order-row > span,
.order-row > strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-row:last-child {
    border-bottom: 0;
}

.order-row strong {
    color: #111827;
    text-align: right;
}

.status {
    justify-content: center;
    min-width: 78px;
    min-height: 26px;
    border-radius: 5px;
    padding: 0 8px;
    font-size: 12px;
}

.status.active,
.status.paid,
.status.completed,
.status.shipped {
    background: var(--green-soft);
    color: #047857;
}

.status.low,
.status.pending,
.status.draft,
.status.sent {
    background: var(--amber-soft);
    color: #c2410c;
}

.status.processing {
    background: var(--blue-soft);
    color: #2563eb;
}

.status.critical,
.status.cancelled {
    background: var(--red-soft);
    color: #e11d48;
}

.catalogue-panel {
    padding: 0;
}

.catalogue-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 62px;
    padding: 0 18px 0 10px;
    border-bottom: 1px solid var(--border);
}

.tabs {
    display: flex;
    align-items: stretch;
    height: 62px;
}

.tab {
    height: 62px;
    font-size: 14px;
}

.table-actions {
    display: flex;
    gap: 9px;
}

.icon-button,
.rows-button,
.pagination button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    min-width: 36px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
    font-weight: 700;
}

.icon-button.with-label {
    gap: 7px;
    padding: 0 13px;
}

.catalogue-table th,
.catalogue-table td {
    height: 58px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
}

.catalogue-table th {
    color: #334155;
    font-size: 12px;
    text-transform: none;
}

.catalogue-table td {
    color: #334155;
    font-size: 13px;
}

.catalogue-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.table-cover {
    width: 38px;
    height: 48px;
}

.stock-number.warn {
    color: #ef4444;
}

.stock-number.ok {
    color: #16a34a;
}

.row-menu {
    border: 0;
    background: transparent;
    color: #0f172a;
    cursor: pointer;
    font-size: 21px;
}

.table-footer {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 16px;
    min-height: 58px;
    padding: 0 20px;
    color: #64748b;
    font-size: 13px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination button.is-active {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
}

.rows-button {
    gap: 10px;
    padding: 0 12px;
}

.product-summary {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 16px;
    padding: 18px 22px 12px;
}

.large-book-cover {
    position: relative;
    display: grid;
    place-items: start center;
    height: 205px;
    border: 1px solid var(--border);
    border-radius: 5px;
    overflow: hidden;
    padding-top: 18px;
    color: #0e7490;
    font-family: Georgia, serif;
    font-size: 19px;
}

.large-book-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 72% 38%, #facc15 0 4%, transparent 4.4%),
        radial-gradient(circle at 57% 67%, #a8a29e 0 23%, transparent 23.4%),
        radial-gradient(circle at 26% 35%, rgba(148, 163, 184, 0.35) 0 2%, transparent 2.3%),
        linear-gradient(180deg, #ffffff, #f4f7fb);
}

.large-book-cover span {
    position: relative;
}

.product-summary h3 {
    margin: 0 0 3px;
    font-size: 16px;
}

.product-summary p {
    margin: 0 0 16px;
    color: #64748b;
}

.summary-list {
    margin: 0;
}

.summary-list dt {
    color: #64748b;
    font-size: 13px;
}

.summary-list dd {
    margin: 0 0 10px;
    color: #1f2937;
}

.editor-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
    padding: 0 22px 18px;
}

.editor-form label,
.publish-status {
    display: grid;
    gap: 7px;
    color: #0f172a;
    font-size: 13px;
    font-weight: 800;
}

.editor-form input,
.editor-form select,
.editor-form textarea,
.publish-status select {
    width: 100%;
    min-height: 38px;
    border: 1px solid #d8dee8;
    border-radius: 6px;
    background: #ffffff;
    padding: 0 12px;
    color: #334155;
    outline: 0;
}

.editor-form textarea {
    min-height: 76px;
    padding-top: 10px;
    resize: none;
}

.field-money {
    display: flex;
    align-items: center;
    border: 1px solid #d8dee8;
    border-radius: 6px;
    overflow: hidden;
}

.field-money input {
    border: 0;
}

.field-money span {
    padding-right: 12px;
    color: #64748b;
}

.char-count {
    color: #64748b;
    font-weight: 500;
    text-align: right;
}

.image-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 0 22px 18px;
}

.image-strip .book-cover {
    width: 100%;
    height: 82px;
}

.image-strip button {
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #64748b;
    cursor: pointer;
    font-size: 28px;
}

.variant-block {
    padding: 0 22px 16px;
}

.variant-block table {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.variant-block th,
.variant-block td {
    height: 36px;
    padding: 7px 8px;
    font-size: 12px;
}

.radio-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 1px solid #94a3b8;
    border-radius: 50%;
}

.radio-dot.is-on {
    border: 4px solid var(--primary);
}

.publish-status {
    padding: 0 22px 20px;
}

.publish-status select {
    background:
        linear-gradient(90deg, #dcfce7 0 96px, transparent 96px),
        #ffffff;
    color: #047857;
}

.editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border);
    padding: 20px 22px;
}

@media (max-width: 1380px) {
    .stockvixo-dashboard {
        grid-template-columns: minmax(780px, 1fr) 360px;
    }

    .metric-card {
        min-height: 118px;
        padding: 18px 16px;
    }

    .metric-card strong {
        font-size: clamp(20px, 1.5vw, 25px);
    }

    .metric-icon {
        width: 42px;
        height: 42px;
    }

    .insight-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(300px, 1.1fr);
    }
}

@media (max-width: 1180px) {
    .stockvixo-dashboard {
        display: block;
    }

    .product-editor {
        border-left: 0;
        border-top: 1px solid var(--border);
    }

    .insight-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 82px minmax(0, 1fr);
    }

    .logo-text,
    .nav-item span:not(.nav-icon):not(.nav-badge) {
        display: none;
    }

    .topbar {
        grid-template-columns: 38px 1fr;
        padding: 10px 14px;
    }

    .topbar-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
        overflow-x: auto;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .nav-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .logo-text,
    .nav-item span:not(.nav-icon):not(.nav-badge) {
        display: inline;
    }

    .metric-grid,
    .editor-form,
    .product-summary,
    .table-footer {
        grid-template-columns: 1fr;
    }

    .dashboard-content {
        padding: 16px;
    }
}

/* Product management module */
.products-module {
    display: grid;
    grid-template-columns: minmax(900px, 1fr) 400px;
    min-height: calc(100vh - 72px);
}

.products-workspace {
    min-width: 0;
    padding: 24px 22px;
}

.products-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.products-heading h1 {
    margin: 0;
    color: #0f172a;
    font-size: 28px;
    line-height: 1.1;
}

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

.product-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 74px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #ffffff;
    box-shadow: var(--shadow);
    padding: 14px 16px;
}

.product-stat span {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.product-stat strong {
    color: #0f172a;
    font-size: 24px;
    line-height: 1;
}

.product-stat.warning strong {
    color: #c2410c;
}

.product-list-panel {
    padding: 0;
    overflow: hidden;
}

.product-tabs {
    display: flex;
    align-items: stretch;
    height: 56px;
    padding: 0 14px;
    border-bottom: 1px solid var(--border);
}

.product-tabs .tab {
    height: 56px;
    padding: 0 16px;
}

.product-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr)) minmax(220px, 1.4fr);
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: #fbfdff;
}

.product-filters label {
    display: grid;
    gap: 6px;
    min-width: 0;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.product-filters select,
.product-filters input {
    width: 100%;
    min-height: 38px;
    border: 1px solid #d8dee8;
    border-radius: 6px;
    background: #ffffff;
    color: #334155;
    padding: 0 11px;
    outline: 0;
}

.product-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    color: #64748b;
    font-size: 13px;
}

.product-management-table th,
.product-management-table td {
    height: 62px;
    padding-inline: 12px;
}

.product-management-table th:nth-child(3),
.product-management-table td:nth-child(3) {
    min-width: 220px;
}

.product-management-table th:nth-child(4),
.product-management-table td:nth-child(4) {
    min-width: 150px;
}

.product-management-table th:nth-child(5),
.product-management-table td:nth-child(5) {
    min-width: 130px;
}

.product-empty-state {
    height: 180px;
    color: #64748b;
    font-size: 15px;
    font-weight: 700;
}

.product-module-editor {
    display: flex;
    flex-direction: column;
}

.product-create-form {
    display: contents;
}

.product-module-editor .product-editor-header {
    justify-content: space-between;
}

.product-upload-area {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 14px;
    align-items: end;
    padding: 18px 22px;
}

.product-upload-area .large-book-cover {
    width: 128px;
    height: 170px;
    font-size: 16px;
}

.product-upload-area button {
    min-height: 38px;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    background: #f8fafc;
    color: #007c8f;
    cursor: pointer;
    font-weight: 800;
}

.file-drop {
    display: grid;
    gap: 8px;
    min-height: 72px;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    background: #f8fafc;
    color: #007c8f;
    padding: 12px;
    cursor: pointer;
    font-weight: 800;
}

.file-drop input,
.image-add-button input {
    width: 100%;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.large-book-cover img,
.product-real-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.large-book-cover img {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.image-add-button {
    display: grid;
    place-items: center;
    min-height: 70px;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #64748b;
    cursor: pointer;
    font-size: 28px;
}

.product-edit-form {
    gap: 12px 14px;
}

.module-image-strip .book-cover {
    height: 70px;
}

.product-module-editor .editor-tabs button {
    padding-inline: 12px;
}

.product-module-editor .editor-actions {
    margin-top: auto;
}

@media (max-width: 1380px) {
    .products-module {
        grid-template-columns: minmax(760px, 1fr) 360px;
    }

    .product-stat-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .product-filters {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .filter-search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1120px) {
    .products-module {
        display: block;
    }

    .product-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-module-editor {
        border-left: 0;
        border-top: 1px solid var(--border);
    }
}

@media (max-width: 640px) {
    .products-workspace {
        padding: 16px;
    }

    .products-heading,
    .product-table-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .product-stat-grid,
    .product-filters,
    .product-upload-area {
        grid-template-columns: 1fr;
    }
}
