:root {
    --bg-ink: #091320;
    --bg-soft: #f4efe8;
    --surface: rgba(255, 255, 255, 0.84);
    --surface-strong: #ffffff;
    --text-strong: #132238;
    --text-soft: #5f6d80;
    --line: rgba(19, 34, 56, 0.1);
    --primary: #132238;
    --primary-2: #2f6fed;
    --accent: #ed7a2f;
    --success: #0f9d84;
    --danger: #d9486d;
    --shadow-xl: 0 24px 60px rgba(12, 26, 48, 0.18);
    --shadow-md: 0 14px 30px rgba(12, 26, 48, 0.12);
    --radius-xl: 28px;
    --radius-lg: 20px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text-strong);
    background:
        radial-gradient(circle at top left, rgba(47, 111, 237, 0.16), transparent 34%),
        radial-gradient(circle at bottom right, rgba(237, 122, 47, 0.18), transparent 30%),
        linear-gradient(135deg, #f7f1e8 0%, #eef3fb 100%);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.guest-shell,
.app-shell {
    min-height: 100vh;
}

.auth-wrap {
    max-width: 620px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.auth-private-wrap {
    max-width: 540px;
    margin: 0 auto;
}

.auth-private-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(18px);
    border-radius: var(--radius-xl);
}

.auth-mark {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.auth-mark-badge {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: linear-gradient(135deg, #132238 0%, #2f6fed 100%);
    color: #eef4ff;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.auth-private-title {
    font-size: clamp(2.2rem, 4vw, 3.4rem);
    line-height: 0.96;
    letter-spacing: -0.04em;
}

.eyebrow-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: rgba(19, 34, 56, 0.08);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.auth-title {
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    font-size: clamp(2.5rem, 5vw, 4.3rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
}

.auth-subtitle,
.hero-text,
.page-subtitle,
.module-card p,
.showcase-card p,
.panel-card p,
.feature-row p {
    color: var(--text-soft);
}

.auth-card,
.panel-card,
.module-card,
.metric-card,
.showcase-card,
.hero-banner,
.sidebar-panel {
    border-radius: var(--radius-xl);
}

.auth-card {
    background: var(--surface);
    backdrop-filter: blur(16px);
}

.status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.is-ready {
    background: var(--success);
    box-shadow: 0 0 0 8px rgba(15, 157, 132, 0.12);
}

.status-dot.is-pending {
    background: var(--accent);
    box-shadow: 0 0 0 8px rgba(237, 122, 47, 0.16);
}

.auth-submit,
.btn-primary {
    background: linear-gradient(135deg, #132238 0%, #2f6fed 100%);
    border: 0;
    box-shadow: var(--shadow-md);
}

.form-control {
    border-radius: 16px;
    border: 1px solid rgba(19, 34, 56, 0.14);
    padding: 0.95rem 1rem;
}

.form-control:focus {
    border-color: rgba(47, 111, 237, 0.7);
    box-shadow: 0 0 0 0.25rem rgba(47, 111, 237, 0.14);
}

.searchable-select-wrap {
    display: grid;
    gap: 0.45rem;
    width: 100%;
    min-width: 0;
}

.searchable-select-wrap .form-select {
    min-width: 0;
}

.searchable-select-input {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.setup-snippet {
    display: grid;
    gap: 0.6rem;
}

.auth-privacy-note {
    padding-top: 1rem;
    border-top: 1px solid rgba(19, 34, 56, 0.1);
    color: var(--text-soft);
    font-size: 0.95rem;
}

.setup-snippet-label,
.panel-kicker,
.module-label,
.showcase-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    font-weight: 700;
}

.setup-snippet code {
    display: block;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: #0f1b2c;
    color: #eef4ff;
}

.setup-status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.setup-status-item,
.setup-panel {
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: rgba(19, 34, 56, 0.05);
}

.setup-status-item span {
    display: block;
    color: var(--text-soft);
    font-size: 0.88rem;
}

.setup-status-item strong {
    font-size: 1.15rem;
}

.showcase-panel {
    padding: 2rem;
}

.showcase-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    width: 100%;
    align-content: center;
    min-height: 100%;
}

.showcase-card {
    padding: 1.5rem;
    min-height: 220px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.94));
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.showcase-card::after {
    content: "";
    position: absolute;
    inset: auto -30px -45px auto;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(19, 34, 56, 0.08), transparent 68%);
}

.showcase-card h3 {
    max-width: 12ch;
}

.app-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: 100vh;
    gap: 1.5rem;
    padding: 1.5rem;
}

.sidebar-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
    background: linear-gradient(180deg, #0f1b2c 0%, #132238 100%);
    color: #eef4ff;
    box-shadow: var(--shadow-xl);
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.brand-badge {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, #ed7a2f 0%, #f2b14e 100%);
    color: #132238;
    font-weight: 800;
}

.brand-title {
    font-weight: 700;
}

.brand-subtitle,
.sidebar-note,
.user-chip-role {
    color: rgba(238, 244, 255, 0.7);
}

.nav-card {
    display: flex;
    align-items: center;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    color: rgba(238, 244, 255, 0.82);
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease;
}

.nav-card:hover,
.nav-card.is-active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.supplier-subnav {
    display: grid;
    gap: 0.4rem;
    max-height: 260px;
    margin: -0.1rem 0 0.65rem;
    padding: 0.7rem;
    border: 1px solid rgba(238, 244, 255, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.055);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(238, 244, 255, 0.22) transparent;
}

.supplier-subnav-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0 0.15rem 0.3rem;
    color: rgba(238, 244, 255, 0.58);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.supplier-subnav-link {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.5rem;
    min-height: 38px;
    padding: 0.42rem 0.48rem;
    border: 1px solid transparent;
    border-radius: 10px;
    color: rgba(238, 244, 255, 0.78);
    font-size: 0.82rem;
    line-height: 1.2;
    text-decoration: none !important;
}

.supplier-subnav-link:hover,
.supplier-subnav-link.is-active {
    color: #ffffff;
    border-color: rgba(238, 244, 255, 0.12);
    background: rgba(255, 255, 255, 0.105);
}

.supplier-subnav-code {
    min-width: 40px;
    padding: 0.2rem 0.38rem;
    border-radius: 8px;
    background: rgba(237, 122, 47, 0.2);
    color: #ffd18b;
    font-size: 0.68rem;
    font-weight: 800;
    text-align: center;
}

.supplier-subnav-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.content-panel {
    padding: 0.5rem 0.5rem 2rem;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-title {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.03em;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-chip {
    padding: 0.9rem 1rem;
    border-radius: 18px;
    min-width: 190px;
    color: #eef4ff;
    background: linear-gradient(135deg, #132238, #2f6fed);
    box-shadow: var(--shadow-md);
}

.user-chip-name {
    font-weight: 700;
}

.hero-banner {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.68));
    box-shadow: var(--shadow-md);
}

.hero-title {
    margin: 0.85rem 0;
    font-size: clamp(1.85rem, 4vw, 3rem);
    line-height: 1;
}

.hero-stats,
.module-score {
    display: grid;
    gap: 1rem;
    min-width: 240px;
}

.hero-stats div,
.module-score div {
    padding: 1rem 1.15rem;
    border-radius: 18px;
    background: rgba(19, 34, 56, 0.06);
}

.hero-stats span,
.module-score span,
.metric-card span {
    display: block;
    color: var(--text-soft);
    font-size: 0.9rem;
}

.hero-stats strong,
.module-score strong,
.metric-card strong {
    font-size: 1.8rem;
    line-height: 1.1;
}

.stats-grid,
.module-grid {
    display: grid;
    gap: 1rem;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.module-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-bottom: 1rem;
}

.metric-card,
.module-card,
.panel-card,
.empty-state {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow-md);
}

.tone-blue {
    border-top: 5px solid #2f6fed;
}

.tone-rose {
    border-top: 5px solid #d9486d;
}

.tone-amber {
    border-top: 5px solid #ed7a2f;
}

.tone-green {
    border-top: 5px solid #0f9d84;
}

.module-card {
    position: relative;
    overflow: hidden;
}

.module-accent {
    width: 54px;
    height: 6px;
    border-radius: 999px;
    margin-bottom: 1rem;
}

.checklist,
.feature-stack {
    display: grid;
    gap: 0.9rem;
}

.checklist div {
    padding: 0.95rem 1rem;
    border-radius: 16px;
    background: rgba(19, 34, 56, 0.05);
}

.feature-row {
    display: grid;
    grid-template-columns: 16px 1fr;
    gap: 0.9rem;
    align-items: start;
}

.feature-row p {
    margin: 0;
}

.feature-bullet {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--module-accent, var(--primary-2));
    margin-top: 0.4rem;
}

.module-hero {
    border-left: 8px solid var(--module-accent);
}

.empty-state {
    max-width: 640px;
    margin: 5rem auto;
    text-align: center;
}

.stock-table-toolbar,
.stock-table-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
    justify-content: space-between;
}

.stock-table-toolbar {
    margin-bottom: 1rem;
}

.stock-table-footer {
    margin-top: 1rem;
    align-items: center;
}

.stock-table-toolbar__group {
    display: grid;
    gap: 0.4rem;
    min-width: 260px;
    flex: 1 1 260px;
}

.stock-table-toolbar__group--compact {
    flex: 0 0 170px;
    min-width: 170px;
}

.stock-table-toolbar__label {
    font-size: 0.9rem;
    color: rgba(19, 34, 56, 0.72);
}

.stock-table-footer__info {
    color: rgba(19, 34, 56, 0.72);
}

.stock-table-footer__pages {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    justify-content: flex-end;
}

.stock-page-btn {
    min-width: 42px;
    min-height: 42px;
    padding: 0.45rem 0.8rem;
    border: 1px solid rgba(19, 34, 56, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    color: #132238;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.stock-page-btn:hover:not(:disabled) {
    border-color: rgba(19, 34, 56, 0.3);
    background: rgba(19, 34, 56, 0.06);
}

.stock-page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.stock-page-btn.is-active {
    border-color: #132238;
    background: #132238;
    color: #fff;
}

.stock-page-dots {
    padding: 0 0.15rem;
    color: rgba(19, 34, 56, 0.56);
}

@media (max-width: 1199.98px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .sidebar-panel {
        min-height: auto;
    }

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

@media (max-width: 767.98px) {
    .auth-wrap {
        padding: 2rem 1rem;
    }

    .app-layout {
        padding: 1rem;
    }

    .topbar,
    .hero-banner {
        flex-direction: column;
    }

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .stats-grid,
    .showcase-grid {
        grid-template-columns: 1fr;
    }

    .setup-status-grid {
        grid-template-columns: 1fr;
    }

    .stock-table-toolbar__group,
    .stock-table-toolbar__group--compact {
        min-width: 0;
        width: 100%;
    }
}
