:root {
    --bg: #f4f1ea;
    --ink: #1f2933;
    --muted: #6b7280;
    --line: #e8ddd0;
    --accent: #a64b2a;
    --sidebar: #18222d;
}

html {
    font-size: 14px;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top right, rgba(166, 75, 42, 0.16), transparent 30%),
        linear-gradient(180deg, #faf7f2 0%, var(--bg) 100%);
    min-height: 100vh;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(21, 32, 43, 0.96);
    backdrop-filter: blur(12px);
}

.mobile-brand {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
}

.mobile-menu-button {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.mobile-sidebar-shell {
    background: #18222d;
    padding: 0 1rem 1rem;
}

.mobile-sidebar-nav {
    display: grid;
    gap: 0.75rem;
}

.mobile-sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.92);
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
}

.sidebar {
    background: linear-gradient(180deg, #15202b 0%, var(--sidebar) 100%);
    color: #fff;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
}

.brand {
    color: #fff;
    font-size: 1.35rem;
    font-weight: 700;
    text-decoration: none;
}

.brand-subtitle {
    margin: 0.5rem 0 0;
    color: rgba(255, 255, 255, 0.72);
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.85);
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.content {
    padding: 2rem;
    min-width: 0;
    overflow-x: hidden;
}

.card,
.metric-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: 20px;
}

.metric-card {
    padding: 1.5rem;
    height: 100%;
}

.metric-label {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
}

.product-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fff;
}

.product-thumb-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.image-download-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background: #f3dfd2;
    color: #8a3f22;
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.image-download-link:hover,
.image-download-link:focus {
    color: #6f2e16;
    background: #edd0bd;
}

.table > :not(caption) > * > * {
    padding: 1rem;
}

.page-link {
    color: var(--accent);
}

.page-item.active .page-link {
    background-color: var(--accent);
    border-color: var(--accent);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    font-size: 0.83rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    text-align: center;
    white-space: nowrap;
}

.status-pill-stock-in {
    color: #0f5132;
    background: #d1f3df;
    border-color: #96d9b4;
}

.status-pill-stock-out {
    color: #7f1d1d;
    background: #fde2e2;
    border-color: #f5b5b5;
}

.status-pill-pending {
    color: #7a3410;
    background: #fde7c7;
    border-color: #f2c27a;
}

.status-pill-reviewed {
    color: #1d4ed8;
    background: #dbeafe;
    border-color: #93c5fd;
}

.status-pill-done {
    color: #065f46;
    background: #d1fae5;
    border-color: #86efac;
}

.status-pill-passive {
    color: #475569;
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.filters-card .card-body,
.table-toolbar {
    padding: 1.25rem;
}

.bulk-action-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
}

.bulk-status-select {
    width: 220px;
    min-height: 42px;
    padding: 0.55rem 0.85rem;
    border: 1px solid #d7c2af;
    border-radius: 12px;
    background: linear-gradient(180deg, #fffdfa 0%, #f8f1e7 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
    font-weight: 600;
    color: #2f241c;
}

.bulk-status-select:focus {
    border-color: #c46f4a;
    box-shadow: 0 0 0 0.2rem rgba(166, 75, 42, 0.15);
}

.bulk-update-button {
    min-height: 42px;
    padding: 0.55rem 0.95rem;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #a64b2a 0%, #c86a3b 100%);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(166, 75, 42, 0.16);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.bulk-update-button:hover,
.bulk-update-button:focus {
    color: #fff;
    transform: translateY(-1px);
    filter: brightness(1.02);
    box-shadow: 0 10px 22px rgba(166, 75, 42, 0.2);
}

.bulk-update-button:active {
    transform: translateY(0);
    box-shadow: 0 6px 14px rgba(166, 75, 42, 0.18);
}

.mobile-product-list {
    display: grid;
    gap: 1rem;
    padding: 1rem;
}

.mobile-product-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    padding: 1rem;
}

.mobile-product-header {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
}

.mobile-product-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #fff;
    flex-shrink: 0;
}

.mobile-product-meta {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
}

.mobile-product-name {
    font-weight: 700;
    line-height: 1.35;
}

.mobile-product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.mobile-product-item {
    padding: 0.75rem;
    border-radius: 14px;
    background: #f9f7f2;
}

.mobile-product-item .status-pill {
    width: 100%;
}

.mobile-product-label {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mobile-product-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.desktop-table {
    display: block;
}

.mobile-only {
    display: none;
}

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.login-shell {
    width: min(980px, 100%);
}

.login-panel {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1.25rem;
    align-items: stretch;
}

.login-copy,
.login-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(24, 34, 45, 0.08);
}

.login-copy {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        radial-gradient(circle at top right, rgba(166, 75, 42, 0.12), transparent 35%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 241, 231, 0.95) 100%);
}

.login-card {
    padding: 2rem;
}

.login-badge {
    display: inline-flex;
    align-self: flex-start;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: #f3dfd2;
    color: #8a3f22;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.login-title {
    margin-top: 1.25rem;
    margin-bottom: 0.85rem;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
}

.login-text {
    max-width: 32rem;
    font-size: 1rem;
    color: var(--muted);
    margin-bottom: 0;
}

@media (max-width: 991.98px) {
    .app-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .content {
        padding: 1rem;
    }

    .desktop-table {
        display: none;
    }

    .mobile-only {
        display: block;
    }

    .login-panel {
        grid-template-columns: 1fr;
    }

    .login-copy,
    .login-card {
        padding: 1.5rem;
    }
}

@media (max-width: 767.98px) {
    .bulk-action-group {
        width: 100%;
        justify-content: stretch;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .bulk-status-select {
        width: 100%;
        min-width: 0;
    }

    .mobile-product-grid {
        grid-template-columns: 1fr;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .page-link {
        border-radius: 10px;
    }
}

@media (max-width: 479.98px) {
    .bulk-action-group {
        grid-template-columns: 1fr;
    }

    .bulk-update-button {
        width: 100%;
    }
}
