:root {
    --app-bg: #e8eef5;
    --surface: #ffffff;
    --surface-soft: #f4f8fc;
    --text-main: #1f2937;
    --text-muted: #64748b;
    --border: #d7e2ee;
    --primary: #0f766e;
    --primary-strong: #115e59;
    --accent: #f59e0b;
    --shadow-sm: 0 8px 18px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 14px 28px rgba(15, 23, 42, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at 10% 0%, rgba(15, 118, 110, 0.16), transparent 35%),
        radial-gradient(circle at 90% 100%, rgba(245, 158, 11, 0.14), transparent 35%),
        var(--app-bg);
}

.app-navbar {
    background: linear-gradient(120deg, #0f172a 0%, #1e293b 45%, #134e4a 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1035;
}

.app-brand {
    color: #f8fafc;
    letter-spacing: 0.2px;
}

.app-brand:hover {
    color: #ffffff;
}

.user-pill {
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #eef2ff;
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.08);
}

.wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 270px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #111827 0%, #1f2937 100%);
    color: #e5e7eb;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.menu-label {
    letter-spacing: 0.08em;
    color: #9ca3af !important;
}

.sidebar a {
    color: rgba(229, 231, 235, 0.88);
    text-decoration: none;
    padding: 12px 20px;
    display: block;
    border-left: 4px solid transparent;
    transition: all 0.18s ease;
}

.sidebar a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transform: translateX(2px);
}

.sidebar a.active {
    background: linear-gradient(90deg, rgba(15, 118, 110, 0.96), rgba(13, 148, 136, 0.96));
    border-left-color: #f8fafc;
    color: #ffffff;
}

.app-sidebar-footer {
    background: rgba(0, 0, 0, 0.14);
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.card,
.modal-content {
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    background: var(--surface);
}

.card-header {
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.kpi-card {
    background: linear-gradient(135deg, #ffffff 0%, #eefdf9 100%);
}

.kpi-value {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--primary-strong);
    margin-top: 0.25rem;
}

.form-control,
.form-select,
.input-group-text {
    border-color: #cbd5e1;
}

.form-control:focus,
.form-select:focus {
    border-color: #14b8a6;
    box-shadow: 0 0 0 0.2rem rgba(20, 184, 166, 0.2);
}

.btn {
    border-radius: 10px;
}

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

.btn-primary:hover {
    background-color: var(--primary-strong);
    border-color: var(--primary-strong);
}

.table thead th {
    font-size: 0.88rem;
    color: #334155;
}

.table tbody td {
    vertical-align: middle;
}

.badge {
    border-radius: 8px;
}

.product-grid {
    max-height: 72vh;
    overflow-y: auto;
}

.product-card {
    cursor: pointer;
    border: 1px solid #d9e5f2;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(15, 118, 110, 0.5);
}

.cart-table th,
.cart-table td {
    vertical-align: middle;
}

.qty-input {
    width: 64px;
    text-align: center;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    gap: 10px;
    align-items: center;
}

.summary-total {
    font-size: 1.35rem;
    font-weight: 700;
}

.scanner-card {
    border-color: #bfe6df;
}

.nav-tabs .nav-link {
    color: #475569;
}

.nav-tabs .nav-link.active {
    color: var(--primary-strong);
    font-weight: 600;
}

.login-wrap {
    min-height: calc(100vh - 170px);
    background:
        radial-gradient(circle at 20% 15%, rgba(15, 118, 110, 0.14), transparent 42%),
        radial-gradient(circle at 85% 90%, rgba(245, 158, 11, 0.12), transparent 40%),
        linear-gradient(140deg, #f8fbff 0%, #eaf3fa 100%);
    border: 1px solid #dce8f3;
    border-radius: 20px;
    padding: 24px;
}

.login-card {
    max-width: 420px;
    border-radius: 16px;
    border: 1px solid #d2e0ed;
    box-shadow: var(--shadow-md);
}

@media (max-width: 992px) {
    .wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
        align-items: center;
    }

    .menu-label {
        display: none;
    }

    .sidebar a {
        border-left: 0;
        border-bottom: 3px solid transparent;
        padding: 12px 14px;
    }

    .sidebar a:hover {
        transform: none;
    }

    .sidebar a.active {
        border-left: 0;
        border-bottom-color: #ffffff;
    }

    .app-sidebar-footer {
        margin-left: auto;
        border-top: 0 !important;
        background: transparent;
    }

    .main-content {
        padding: 16px;
    }

    .login-wrap {
        min-height: auto;
        padding: 16px;
        border-radius: 14px;
    }
}
