@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --blue: #2563EB;
    --blue-light: #EFF6FF;
    --blue-dark: #1D4ED8;
    --navy: #0F172A;
    --navy-2: #1E293B;
    --slate: #334155;
    --muted: #64748B;
    --border: #E2E8F0;
    --bg: #F8FAFC;
    --white: #FFFFFF;
    --green: #10B981;
    --amber: #F59E0B;
    --red: #EF4444;
    --purple: #8B5CF6;
}

html, body {
    font-family: 'Plus Jakarta Sans', 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
    background: var(--bg);
    color: var(--navy);
    height: 100%;
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
}

button {
    font-family: 'Plus Jakarta Sans', 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--blue);
    }

/* ========== LOGIN ========== */
.login-wrap {
    min-height: 100vh;
    background: linear-gradient(145deg, #0F172A 0%, #1E3A5F 60%, #2563EB 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

    .login-wrap::before {
        content: '';
        position: absolute;
        width: 500px;
        height: 500px;
        background: radial-gradient(circle, rgba(37,99,235,0.2) 0%, transparent 65%);
        top: -150px;
        right: -100px;
        border-radius: 50%;
    }

    .login-wrap::after {
        content: '';
        position: absolute;
        width: 300px;
        height: 300px;
        background: radial-gradient(circle, rgba(16,185,129,0.1) 0%, transparent 65%);
        bottom: -80px;
        left: -80px;
        border-radius: 50%;
    }

.login-card {
    background: rgba(255,255,255,0.98);
    border-radius: 20px;
    padding: 44px 40px;
    width: 400px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.1);
    position: relative;
    z-index: 1;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 20px rgba(37,99,235,0.35);
    font-size: 28px;
}

.login-title {
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 4px;
}

.login-sub {
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 32px;
}

.field-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--slate);
    margin-bottom: 6px;
    display: block;
}

.field-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-family: 'Plus Jakarta Sans', 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
    font-size: 14px;
    color: var(--navy);
    background: var(--bg);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 16px;
    display: block;
    box-sizing: border-box;
}

    .field-input:focus {
        border-color: var(--blue);
        box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
        background: white;
    }

.btn-primary {
    width: 100%;
    padding: 13px;
    background: var(--blue);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: 'Plus Jakarta Sans', 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
    box-shadow: 0 4px 14px rgba(37,99,235,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .btn-primary:hover {
        background: var(--blue-dark);
        transform: translateY(-1px);
        box-shadow: 0 6px 20px rgba(37,99,235,0.4);
    }

    .btn-primary:disabled {
        opacity: 0.7;
        cursor: not-allowed;
        transform: none;
    }

.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: var(--muted);
}

.login-error {
    background: #FEE2E2;
    border: 1px solid #FECACA;
    color: #B91C1C;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ========== MAIN LAYOUT ========== */
.layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: 240px;
    background: var(--navy);
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    background: var(--blue);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar-brand {
    font-size: 14px;
    font-weight: 800;
    color: white;
    line-height: 1.2;
}

    .sidebar-brand span {
        font-size: 11px;
        font-weight: 400;
        color: #64748B;
        display: block;
    }

.nav-section {
    padding: 20px 12px 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #334155;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    margin: 1px 4px;
    color: #94A3B8;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

    .nav-item:hover {
        background: rgba(255,255,255,0.05);
        color: white;
    }

    .nav-item.active {
        background: var(--blue);
        color: white;
        box-shadow: 0 2px 10px rgba(37,99,235,0.35);
    }

    .nav-item .icon {
        font-size: 16px;
        width: 20px;
        text-align: center;
        flex-shrink: 0;
    }

.sidebar-bottom {
    margin-top: auto;
    padding: 14px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.02);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    cursor: pointer;
    transition: background 0.15s;
}

    .user-card:hover {
        background: rgba(255,255,255,0.08);
    }

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--blue), #7C3AED);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 12.5px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: #64748B;
}

.logout-btn {
    width: 100%;
    height: 46px;
    margin-top: 12px;
    border: none;
    outline: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all .2s ease;
}

    .logout-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(239,68,68,.35);
    }

    .logout-btn:active {
        transform: scale(.98);
    }

/* ========== TOPBAR ========== */
.topbar {
    height: 56px;
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    flex-shrink: 0;
}

.topbar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--navy);
    flex: 1;
}

.topbar-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #DCFCE7;
    color: #15803D;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.topbar-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.15s;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

    .topbar-btn:hover {
        background: var(--bg);
        border-color: var(--blue);
    }

    .topbar-btn.danger {
        width: auto;
        padding: 0 12px;
        font-size: 12px;
        font-weight: 600;
        background: #FEE2E2;
        border-color: #FECACA;
        color: #B91C1C;
    }

        .topbar-btn.danger:hover {
            background: var(--red);
            color: white;
            border-color: var(--red);
        }

/* ========== MAIN ========== */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: var(--bg);
}

/* ========== STATS ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat {
    background: white;
    border-radius: 14px;
    padding: 20px;
    border: 1px solid var(--border);
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

    .stat:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    }

.stat-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
}

.stat-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

    .stat-icon-wrap.blue {
        background: #EFF6FF;
    }

    .stat-icon-wrap.green {
        background: #ECFDF5;
    }

    .stat-icon-wrap.amber {
        background: #FFFBEB;
    }

    .stat-icon-wrap.purple {
        background: #F5F3FF;
    }

    .stat-icon-wrap.red {
        background: #FEE2E2;
    }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

.stat-change {
    font-size: 11.5px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
}

    .stat-change.up {
        background: #DCFCE7;
        color: #16A34A;
    }

    .stat-change.down {
        background: #FEE2E2;
        color: #DC2626;
    }

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--navy);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12.5px;
    color: var(--muted);
    font-weight: 500;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

/* ========== CARDS ========== */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
}

.card {
    background: white;
    border-radius: 14px;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card-danger {
    border: 1.5px solid #FECACA !important;
    background: #FFF5F5 !important;
}

.card-warning {
    border: 1.5px solid #FDE68A !important;
    background: #FFFBEB !important;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--navy);
}

.card-action {
    font-size: 12px;
    color: var(--blue);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

/* ========== TABLE ========== */
.table {
    width: 100%;
    border-collapse: collapse;
}

    .table th {
        padding: 11px 16px;
        text-align: right;
        font-size: 11px;
        font-weight: 700;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
    }

    .table td {
        padding: 13px 16px;
        font-size: 13.5px;
        color: var(--slate);
        border-bottom: 1px solid #F1F5F9;
    }

    .table tr:last-child td {
        border-bottom: none;
    }

    .table tr:hover td {
        background: #F8FAFC;
    }

.table-empty {
    text-align: center;
    padding: 40px;
    color: var(--muted);
}

.table-cell-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--navy);
}

.table-icon {
    font-size: 18px;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

/* ========== BADGES ========== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
}

    .badge.green {
        background: #DCFCE7;
        color: #15803D;
    }

    .badge.blue {
        background: #DBEAFE;
        color: #1D4ED8;
    }

    .badge.amber {
        background: #FEF3C7;
        color: #92400E;
    }

    .badge.red {
        background: #FEE2E2;
        color: #B91C1C;
    }

    .badge.purple {
        background: #F5F3FF;
        color: #6D28D9;
    }

/* ========== BUTTONS ========== */
.btn-primary {
    background: var(--blue);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Plus Jakarta Sans', 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

    .btn-primary:hover {
        background: var(--blue-dark);
    }

.btn-secondary {
    flex: 1;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

    .btn-secondary:hover {
        background: var(--bg);
    }

.btn-danger {
    flex: 1;
    padding: 11px;
    border: none;
    border-radius: 10px;
    background: #EF4444;
    color: white;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn-icon {
    padding: 5px 10px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

    .btn-icon.btn-danger {
        background: #FEE2E2;
        color: #B91C1C;
        border: 1px solid #FECACA;
        flex: unset;
        padding: 5px 10px;
    }

.action-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

/* ========== ALERTS ========== */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
}

.alert-success {
    background: #DCFCE7;
    color: #15803D;
    border: 1px solid #BBF7D0;
}

.alert-error {
    background: #FEE2E2;
    color: #B91C1C;
    border: 1px solid #FECACA;
}

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-card {
    background: white;
    border-radius: 16px;
    width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--muted);
    padding: 4px 8px;
    border-radius: 6px;
}

    .modal-close:hover {
        background: var(--bg);
    }

.modal-footer {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-confirm {
    background: white;
    border-radius: 16px;
    width: 420px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.confirm-icon {
    font-size: 48px;
    margin-bottom: 12px;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

.confirm-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 8px;
}

.confirm-msg {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 24px;
    line-height: 1.6;
}

.confirm-actions {
    display: flex;
    gap: 10px;
}

/* ========== FORM ========== */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-full {
    grid-column: 1 / -1;
}

/* ========== ACTIVITY ========== */
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #F1F5F9;
    transition: background 0.15s;
}

    .activity-item:hover {
        background: var(--bg);
    }

    .activity-item:last-child {
        border-bottom: none;
    }

.activity-dot {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

.activity-text {
    font-size: 13px;
    color: var(--slate);
    font-weight: 500;
    line-height: 1.4;
}

.activity-time {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 2px;
}

/* ========== POS ========== */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 0;
    height: calc(100vh - 56px);
    overflow: hidden;
}

.pos-left {
    padding: 20px;
    overflow-y: auto;
    background: var(--bg);
}

.pos-right {
    background: white;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.search-input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-family: 'Plus Jakarta Sans', 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
    font-size: 13.5px;
    background: white;
    outline: none;
    transition: border-color 0.2s;
    color: var(--navy);
}

    .search-input:focus {
        border-color: var(--blue);
    }

.barcode-btn {
    padding: 10px 16px;
    background: var(--navy);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.15s;
}

    .barcode-btn:hover {
        opacity: 0.85;
    }

.cat-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.cat-tab {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: white;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.15s;
}

    .cat-tab.active, .cat-tab:hover {
        background: var(--blue);
        color: white;
        border-color: var(--blue);
    }

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.product-card {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

    .product-card:hover {
        border-color: var(--blue);
        background: var(--blue-light);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(37,99,235,0.12);
    }

    .product-card:active {
        transform: scale(0.96);
    }

    .product-card.selected {
        border-color: #3b82f6;
        background: #eff6ff;
        box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
    }

    .product-card.disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.product-emoji {
    font-size: 28px;
    margin-bottom: 8px;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

.product-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 4px;
}

.product-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--blue);
}

/* ========== CART ========== */
.cart-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.cart-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--navy);
}

.cart-count {
    background: var(--blue);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    transition: background 0.15s;
}

    .cart-item:hover {
        background: var(--bg);
    }

.cart-item-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--blue-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--navy);
}

.cart-item-price {
    font-size: 12px;
    color: var(--muted);
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border-radius: 8px;
    padding: 4px;
    border: 1px solid #e2e8f0;
}

.qty-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1.5px solid var(--border);
    background: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    color: var(--slate);
    line-height: 1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

    .qty-btn:hover {
        background: var(--blue);
        color: white;
        border-color: var(--blue);
    }

.qty-num {
    font-size: 13px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    color: var(--navy);
}

/* ========== CART FOOTER ========== */
.cart-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 13px;
    color: var(--muted);
}

    .cart-total-row.total {
        font-size: 17px;
        font-weight: 800;
        color: var(--navy);
        padding-top: 10px;
        margin-top: 6px;
        border-top: 1.5px solid var(--border);
    }

.pay-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 14px 0;
}

.pay-method {
    padding: 9px 6px;
    border: 1.5px solid var(--border);
    border-radius: 9px;
    text-align: center;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    transition: all 0.15s;
    user-select: none;
}

    .pay-method.active {
        border-color: var(--blue);
        background: var(--blue-light);
        color: var(--blue);
    }

    .pay-method .pay-icon {
        font-size: 18px;
        display: block;
        margin-bottom: 3px;
        font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
    }

.btn-checkout {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    color: white;
    border: none;
    border-radius: 11px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37,99,235,0.3);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .btn-checkout:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 20px rgba(37,99,235,0.4);
    }

    .btn-checkout:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

/* ========== FILTER CHIPS ========== */
.filter-chip {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: white;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
}

    .filter-chip:hover, .filter-chip.active {
        background: #1e293b;
        color: white;
        border-color: #1e293b;
    }

/* ========== INVOICE CHIPS ========== */
.invoice-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: white;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

    .invoice-chip:hover {
        border-color: #3b82f6;
        background: #eff6ff;
    }

    .invoice-chip.active {
        border-color: #3b82f6;
        background: #eff6ff;
        color: #2563eb;
    }

.chip-amount {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

/* ========== SUGGESTIONS ========== */
.suggestion-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s;
}

    .suggestion-item:hover {
        background: #f8fafc;
    }

    .suggestion-item:last-child {
        border-bottom: none;
    }

/* ========== HISTORY ========== */
.history-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
}

/* ========== TEXT UTILITIES ========== */
.text-muted {
    color: var(--muted);
}

.text-green {
    color: var(--green);
}

.text-sm {
    font-size: 12px;
}

.mt-20 {
    margin-top: 20px;
}

/* ========== DASHBOARD ========== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
}

.dashboard-card-lg {
    margin-bottom: 20px;
}

.double-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.chart-wrap {
    padding: 20px;
}

.top-products-wrap {
    padding: 10px 0;
}

.top-product-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #F1F5F9;
    transition: .15s;
}

    .top-product-item:hover {
        background: #F8FAFC;
    }

    .top-product-item:last-child {
        border-bottom: none;
    }

.top-product-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-product-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #EFF6FF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

.top-product-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--navy);
}

.top-product-sub {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

.top-product-amount {
    font-size: 14px;
    font-weight: 800;
    color: var(--green);
}

/* ========== ANALYTICS ========== */
.analytics-section {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    margin-top: 24px;
}

.analytics-card {
    grid-column: span 6;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15,23,42,0.06);
    overflow: hidden;
}

.analytics-card-wide {
    grid-column: span 8;
}

    .analytics-card-wide + .analytics-card {
        grid-column: span 4;
    }

.analytics-header {
    min-height: 74px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
}

.analytics-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--navy);
}

.analytics-subtitle {
    margin-top: 3px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
}

.analytics-badge {
    padding: 5px 10px;
    border-radius: 999px;
    background: #DBEAFE;
    color: var(--blue-dark);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

    .analytics-badge.green {
        background: #DCFCE7;
        color: #15803D;
    }

    .analytics-badge.amber {
        background: #FEF3C7;
        color: #92400E;
    }

    .analytics-badge.purple {
        background: #F5F3FF;
        color: #6D28D9;
    }

.chart-shell {
    padding: 18px 18px 22px;
    min-height: 320px;
}

    .chart-shell.donut {
        display: flex;
        align-items: center;
        justify-content: center;
    }

.analytics-card svg {
    overflow: visible;
}

.analytics-card .mud-chart-legend text, .analytics-card .mud-charts-xaxis text, .analytics-card .mud-charts-yaxis text {
    fill: var(--muted) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
}

.analytics-card .mud-charts-grid line {
    stroke: #E2E8F0 !important;
}

.analytics-card .mud-charts-axis line, .analytics-card .mud-charts-axis path {
    stroke: #CBD5E1 !important;
}

/* ========== NUMPAD ========== */
.np-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999;
}

.np-wrapper {
    position: relative;
    z-index: 1000;
    width: 100%;
}

.np-field {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 2px solid #86EFAC;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
    user-select: none;
}

    .np-field:hover {
        border-color: #34D399;
        box-shadow: 0 0 0 3px #D1FAE5;
    }

.np-open .np-field {
    border-color: #059669;
    box-shadow: 0 0 0 3px #A7F3D0;
}

.np-label {
    font-size: 11px;
    color: #6B7280;
    white-space: nowrap;
    flex-shrink: 0;
}

.np-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1px;
}

.np-val {
    font-size: 15px;
    font-weight: 700;
    color: #1E3A5F;
    direction: ltr;
}

.np-val-active {
    color: #059669;
}

.np-caret {
    font-size: 15px;
    color: transparent;
}

.np-caret-on {
    color: #059669;
    animation: np-blink 1s step-end infinite;
}

.np-chevron {
    font-size: 12px;
    color: #9CA3AF;
    transition: transform .2s;
    flex-shrink: 0;
}

.np-chevron-up {
    transform: rotate(180deg);
    color: #059669;
}

.np-pad {
    position: relative;
    width: 100%;
    background: white;
    border: 1.5px solid #E5E7EB;
    border-radius: 14px;
    padding: 10px;
    margin-top: 6px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
    box-shadow: 0 12px 40px rgba(0,0,0,.14);
    z-index: 1001;
}

.np-btn {
    padding: 14px 0;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    background: #F9FAFB;
    font-size: 17px;
    font-weight: 700;
    color: #1E3A5F;
    cursor: pointer;
    transition: background .12s, transform .1s;
    font-family: inherit;
    touch-action: manipulation;
    line-height: 1;
}

    .np-btn:active {
        transform: scale(.93);
        background: #E5E7EB;
    }

.np-del {
    background: #FEF3C7;
    border-color: #FDE68A;
    color: #92400E;
    font-size: 18px;
}

    .np-del:active {
        background: #FDE68A;
    }

.np-clr {
    background: #F3F4F6;
    border-color: #D1D5DB;
    color: #374151;
}

    .np-clr:active {
        background: #D1D5DB;
    }

.np-ok {
    background: #059669;
    border-color: #047857;
    color: white;
    font-size: 20px;
    grid-row: span 2;
    padding: 0;
}

    .np-ok:active {
        background: #047857;
    }

.np-zero {
    grid-column: span 2;
}

@keyframes np-blink {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ========== CHECKBOX ========== */
.checkbox-container {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--navy-2);
    user-select: none;
    position: relative;
    gap: 8px;
}

    .checkbox-container input {
        position: absolute;
        opacity: 0;
        cursor: pointer;
        height: 0;
        width: 0;
    }

    .checkbox-container .checkmark {
        height: 20px;
        width: 20px;
        background-color: #f1f5f9;
        border: 2px solid var(--border);
        border-radius: 6px;
        transition: all 0.2s ease;
        display: inline-block;
        position: relative;
    }

    .checkbox-container:hover input ~ .checkmark {
        background-color: #e2e8f0;
        border-color: var(--muted);
    }

    .checkbox-container input:checked ~ .checkmark {
        background-color: var(--blue);
        border-color: var(--blue);
    }

    .checkbox-container .checkmark:after {
        content: "";
        position: absolute;
        display: none;
        left: 6px;
        top: 2px;
        width: 5px;
        height: 10px;
        border: solid white;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
    }

    .checkbox-container input:checked ~ .checkmark:after {
        display: block;
    }

.checkbox-label {
    margin-top: 2px;
}

/* ========== ANIMATIONS ========== */
.animate-fade-in {
    animation: fadeInShort 0.25s ease-out forwards;
}

@keyframes fadeInShort {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== RESPONSIVE ========== */
@media(max-width:1200px) {
    .dashboard-grid, .double-grid {
        grid-template-columns: 1fr;
    }

    .analytics-card, .analytics-card-wide, .analytics-card-wide + .analytics-card {
        grid-column: span 12;
    }
}

@media(max-width:900px) {
    .stats-grid {
        grid-template-columns: repeat(2,1fr);
    }
}

@media(max-width:640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
/* هذا الكود يجبر المتصفح على قراءة الإيموجيز والرموز من الخطوط الصحيحة مباشرة */
.product-emoji, .table-icon, .confirm-icon, .stat-icon-wrap, .sidebar-logo, .avatar, .pay-icon {
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif !important;
}