/* ============================================================
   InvenTrack Enterprise Design System
   Modern glassmorphism, gradients, shadows & micro-animations
   ============================================================ */

/* ===== IMPORTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ===== CSS VARIABLES ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Brand Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.35);
    --secondary: #8b5cf6;
    --secondary-dark: #7c3aed;

    /* Status Colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;

    /* Theme Colors */
    --dark: #0f0a2a;
    --sidebar-bg: linear-gradient(180deg, #0f0a2a 0%, #1a1145 50%, #1e1b4b 100%);
    --sidebar-text: #a5b4fc;
    --sidebar-active: #6366f1;
    --bg: #f0f2f8;
    --bg-secondary: #e8ebf4;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* Design Tokens */
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 50px -10px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== BASE ===== */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===== LAYOUT ===== */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: 270px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg);
}

.page-content {
    padding: 28px;
    flex: 1;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 270px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: var(--transition);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.1), transparent);
}

.sidebar-header {
    padding: 28px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
}

.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 24px;
    right: 24px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.4), transparent);
}

.sidebar-header .logo {
    font-size: 32px;
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

.sidebar-header h2 {
    font-size: 22px;
    color: #fff;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff, #c7d2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-info {
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
}

.avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transition: var(--transition);
}

.avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.user-info strong {
    display: block;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.role-badge {
    font-size: 10px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.3));
    color: #c7d2fe;
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 3px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.nav-menu {
    list-style: none;
    padding: 16px 0;
    flex: 1;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 24px;
    color: var(--sidebar-text);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
    position: relative;
    margin: 2px 0;
}

.nav-menu li a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15), transparent);
    opacity: 0;
    transition: var(--transition);
}

.nav-menu li a:hover::before,
.nav-menu li a.active::before {
    opacity: 1;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    color: #fff;
    border-left-color: var(--primary);
    padding-left: 28px;
}

.nav-menu li a.active {
    background: rgba(99, 102, 241, 0.12);
    font-weight: 600;
}

.nav-menu li a span {
    font-size: 18px;
    position: relative;
    z-index: 1;
}

.sidebar-footer {
    padding: 18px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
}

.sidebar-footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 24px;
    right: 24px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.4), transparent);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fca5a5;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 14px;
    border-radius: 10px;
    transition: var(--transition);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    transform: translateX(4px);
}

/* ===== TOPBAR ===== */
.topbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 18px 28px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.topbar h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.5px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* ===== CARDS ===== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.5), transparent);
}

.card-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.3px;
}

.card-body {
    padding: 24px;
}

/* ===== STAT CARDS — Enterprise Animated ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 18px;
    transition: var(--transition-bounce);
    position: relative;
    overflow: hidden;
    animation: cardEntrance 0.6s ease-out both;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: var(--transition);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.08) 50%, transparent 60%);
    transition: var(--transition);
    transform: rotate(45deg) translateX(-100%);
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover::after {
    transform: rotate(45deg) translateX(100%);
    transition: transform 0.8s ease;
}

.stat-card:nth-child(1) {
    animation-delay: 0.05s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.15s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.2s;
}

.stat-card:nth-child(5) {
    animation-delay: 0.25s;
}

.stat-card:nth-child(6) {
    animation-delay: 0.3s;
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    position: relative;
    transition: var(--transition);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(-3deg);
}

.stat-icon.purple {
    background: linear-gradient(135deg, #ede9fe, #e0d6ff);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.stat-icon.green {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.stat-icon.orange {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.stat-icon.red {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.stat-icon.blue {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.stat-icon.indigo {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--dark);
    line-height: 1;
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-change {
    font-size: 12px;
    margin-top: 6px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
}

.stat-change.up {
    color: #059669;
    background: rgba(16, 185, 129, 0.1);
}

.stat-change.down {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.1);
}

/* ===== TABLES ===== */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead th {
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
    padding: 13px 18px;
    text-align: left;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
}

tbody td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    transition: var(--transition);
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.03), rgba(139, 92, 246, 0.02));
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
}

.badge-success {
    background: var(--success-light);
    color: #065f46;
}

.badge-warning {
    background: var(--warning-light);
    color: #92400e;
}

.badge-danger {
    background: var(--danger-light);
    color: #991b1b;
}

.badge-info {
    background: var(--info-light);
    color: #1e40af;
}

.badge-secondary {
    background: #f1f5f9;
    color: #475569;
}

.badge-purple {
    background: #ede9fe;
    color: #5b21b6;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: var(--transition);
    line-height: 1;
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15), transparent);
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #4338ca);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: #fff;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: #fff;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--bg);
    border-color: var(--primary-light);
    color: var(--primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-icon {
    padding: 7px 9px;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 6px;
    letter-spacing: -0.1px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    background: #fff;
    transition: var(--transition);
    outline: none;
    font-family: 'Inter', sans-serif;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control.error {
    border-color: var(--danger);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

textarea.form-control {
    min-height: 90px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%2364748b' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ===== ALERTS ===== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    animation: alertSlide 0.4s ease-out;
}

@keyframes alertSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: var(--success-light);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background: var(--danger-light);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.alert-info {
    background: var(--info-light);
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* ===== SEARCH & FILTERS ===== */
.filters-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.5), transparent);
}

.search-input {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-input input {
    padding-left: 38px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 10, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-light);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 22px 28px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.5), transparent);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.modal-close {
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 16px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 6px 10px;
    border-radius: 8px;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.modal-body {
    padding: 28px;
}

.modal-footer {
    padding: 18px 28px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: linear-gradient(0deg, rgba(248, 250, 252, 0.5), transparent);
}

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f0a2a 0%, #1a1145 30%, #312e81 60%, #4f46e5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2), transparent 70%);
    top: -200px;
    right: -200px;
    animation: loginGlow 8s ease-in-out infinite alternate;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15), transparent 70%);
    bottom: -100px;
    left: -100px;
    animation: loginGlow 6s ease-in-out infinite alternate-reverse;
}

@keyframes loginGlow {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.2);
    }
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-xl), 0 0 60px rgba(99, 102, 241, 0.1);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: cardEntrance 0.6s ease-out;
}

.login-logo {
    text-align: center;
    margin-bottom: 8px;
    font-size: 52px;
}

.login-title {
    text-align: center;
    font-size: 28px;
    font-weight: 900;
    color: var(--dark);
    margin-bottom: 4px;
    letter-spacing: -1px;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 32px;
}

.demo-accounts {
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    border-radius: var(--radius-sm);
    padding: 18px;
    margin-bottom: 28px;
    border: 1px solid var(--border-light);
}

.demo-accounts h4 {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
}

.demo-item {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
}

.demo-item:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
}

.demo-cred {
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

/* ===== CHARTS ===== */
.chart-wrapper {
    position: relative;
    height: 320px;
}

.chart-wrapper-sm {
    position: relative;
    height: 260px;
}

/* ===== QUICK ACCESS PANEL ===== */
.quick-access {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 14px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    cursor: pointer;
    transition: var(--transition-bounce);
    text-decoration: none;
    color: var(--text);
    position: relative;
    overflow: hidden;
}

.quick-btn::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transition: var(--transition);
}

.quick-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.quick-btn:hover::before {
    transform: scaleX(1);
}

.quick-btn .quick-icon {
    font-size: 28px;
    transition: var(--transition);
}

.quick-btn:hover .quick-icon {
    transform: scale(1.15);
}

.quick-btn .quick-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
}

/* ===== NOTIFICATION AREA ===== */
.notification-area {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
    cursor: default;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: rgba(99, 102, 241, 0.03);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.notification-icon.warning-bg {
    background: var(--warning-light);
}

.notification-icon.danger-bg {
    background: var(--danger-light);
}

.notification-icon.success-bg {
    background: var(--success-light);
}

.notification-icon.info-bg {
    background: var(--info-light);
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 2px;
}

.notification-text {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.notification-time {
    font-size: 11px;
    color: var(--text-light);
    white-space: nowrap;
    margin-top: 2px;
}

/* ===== REVENUE & SUMMARY WIDGETS ===== */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.summary-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.summary-card:hover {
    box-shadow: var(--shadow-md);
}

.summary-card .summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.summary-card .summary-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-card .summary-value {
    font-size: 30px;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.5px;
}

.summary-card .summary-details {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: 8px;
    font-size: 13px;
}

.summary-detail-row .label {
    color: var(--text-muted);
    font-weight: 500;
}

.summary-detail-row .value {
    font-weight: 700;
    color: var(--dark);
}

/* Gradient accent bar on summary cards */
.summary-card.revenue::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #10b981, #059669);
}

.summary-card.payment::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.summary-card.gst::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

/* ===== GST TABLE ===== */
.gst-breakdown {
    margin-top: 12px;
}

.gst-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px dashed var(--border-light);
}

.gst-row:last-child {
    border-bottom: none;
    font-weight: 700;
    padding-top: 10px;
}

.gst-row .gst-label {
    color: var(--text-muted);
}

.gst-row .gst-value {
    color: var(--dark);
    font-weight: 600;
}

/* ===== INVOICE ===== */
.invoice-wrapper {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    max-width: 800px;
    margin: 0 auto;
}

.invoice-header {
    padding: 32px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 3px solid var(--primary);
}

.invoice-logo {
    font-size: 14px;
}

.invoice-logo h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--dark);
}

.invoice-logo p {
    color: var(--text-muted);
    font-size: 13px;
}

.invoice-meta {
    text-align: right;
}

.invoice-meta h3 {
    font-size: 28px;
    font-weight: 900;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.invoice-meta p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.invoice-body {
    padding: 32px;
}

.invoice-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

.invoice-party h4 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.invoice-party p {
    font-size: 14px;
    margin: 2px 0;
}

.invoice-totals {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
}

.invoice-totals-table {
    width: 300px;
}

.invoice-totals-table .total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--border-light);
}

.invoice-totals-table .total-row.grand {
    border-bottom: none;
    border-top: 2px solid var(--dark);
    font-size: 18px;
    font-weight: 800;
    padding-top: 12px;
    color: var(--dark);
}

.invoice-footer {
    padding: 24px 32px;
    border-top: 1px solid var(--border-light);
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg);
    border-radius: 0 0 var(--radius) var(--radius);
}

@media print {

    .sidebar,
    .topbar,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .invoice-wrapper {
        box-shadow: none;
        border: none;
    }

    body {
        background: #fff;
    }
}

/* ===== GRIDS ===== */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

.grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.grid-1-2 {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

/* ===== MISC ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.5px;
}

.page-title small {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
    display: block;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-muted);
}

.fw-bold {
    font-weight: 700;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== SECTION HEADERS ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.3px;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    text-decoration: none;
    border: 1px solid var(--border);
    color: var(--text);
    transition: var(--transition);
    font-weight: 500;
}

.pagination a:hover {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.pagination .active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}

/* ===== TOOLTIP ===== */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 999;
    margin-bottom: 6px;
    box-shadow: var(--shadow-md);
    animation: tooltipIn 0.2s ease-out;
}

@keyframes tooltipIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===== STOCK INDICATORS ===== */
.qty-cell {
    font-weight: 700;
}

.qty-low {
    color: var(--warning);
}

.qty-out {
    color: var(--danger);
}

.qty-ok {
    color: var(--success);
}


/* ===== LOADING ANIMATION ===== */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s ease-in-out infinite;
}

/* ===== COUNTER ANIMATION ===== */
.count-up {
    transition: all 0.6s ease-out;
}

/* ===== SETTINGS PAGE ===== */
.settings-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 6px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    overflow-x: auto;
}

.settings-tab {
    padding: 12px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}

.settings-tab:hover {
    background: var(--bg);
    color: var(--text);
}

.settings-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 2px 8px var(--primary-glow);
}

/* ===== TOGGLE SWITCH ===== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    border-radius: 26px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: var(--shadow-xs);
}

.toggle-switch input:checked+.toggle-slider {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(20px);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}

/* ===== TEXT UTILITIES ===== */
.text-muted {
    color: var(--text-muted);
}

small.text-muted {
    font-size: 12px;
    display: block;
    margin-top: 4px;
}

/* ===== RESPONSIVE OVERLAY ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 10, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ===== RESPONSIVE — TABLET (≤1024px) ===== */
@media (max-width: 1024px) {
    .sidebar {
        width: 250px;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
    }

    .menu-toggle {
        display: inline-flex !important;
    }

    .page-content {
        padding: 20px;
    }

    .topbar {
        padding: 14px 20px;
    }

    .topbar h1 {
        font-size: 18px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px;
    }

    .stat-card {
        padding: 18px;
    }

    .stat-value {
        font-size: 22px;
    }

    .stat-icon {
        width: 46px;
        height: 46px;
        font-size: 20px;
    }

    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr 1fr;
    }

    .modal {
        max-width: 95vw;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-footer {
        padding: 14px 20px;
    }

    .card-header {
        padding: 14px 18px;
    }

    .card-body {
        padding: 18px;
    }

    .invoice-wrapper {
        padding: 20px;
    }

    .settings-tabs {
        flex-wrap: wrap;
    }
}

/* ===== RESPONSIVE — MOBILE (≤768px) ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
    }

    .page-content {
        padding: 16px;
    }

    .topbar {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .topbar h1 {
        font-size: 16px;
    }

    .topbar-actions {
        gap: 8px;
        flex-wrap: wrap;
    }

    .topbar-actions .btn {
        font-size: 12px;
        padding: 8px 12px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px;
        margin-bottom: 16px;
    }

    .stat-card {
        padding: 14px;
        gap: 12px;
    }

    .stat-card:hover {
        transform: none;
    }

    .stat-value {
        font-size: 20px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
        border-radius: 10px;
    }

    .stat-label {
        font-size: 10px;
    }

    /* Tables — Compact */
    table {
        font-size: 12px;
    }

    thead th {
        padding: 10px 10px;
        font-size: 10px;
        letter-spacing: 0.5px;
    }

    tbody td {
        padding: 10px 10px;
    }

    /* Forms */
    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-group {
        margin-bottom: 14px;
    }

    .form-control {
        padding: 9px 12px;
        font-size: 14px;
    }

    /* Modal — Full Width */
    .modal-overlay {
        padding: 10px;
        align-items: flex-end;
    }

    .modal {
        max-width: 100%;
        max-height: 85vh;
        border-radius: 16px 16px 0 0;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-header {
        padding: 14px 16px;
    }

    .modal-header h3 {
        font-size: 16px;
    }

    .modal-footer {
        padding: 12px 16px;
        flex-wrap: wrap;
    }

    .modal-footer .btn {
        flex: 1;
        justify-content: center;
    }

    /* Cards */
    .card-header {
        padding: 12px 14px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .card-header h3 {
        font-size: 14px;
    }

    .card-body {
        padding: 14px;
    }

    /* Buttons */
    .btn {
        padding: 9px 14px;
        font-size: 13px;
    }

    .btn-sm {
        padding: 5px 10px;
        font-size: 11px;
    }

    /* Filters */
    .filters-bar {
        padding: 12px 14px;
        gap: 8px;
    }

    .filters-bar .form-control {
        min-width: 0;
    }

    /* Settings Tabs */
    .settings-tabs {
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .settings-tabs::-webkit-scrollbar {
        display: none;
    }

    .settings-tab {
        white-space: nowrap;
        font-size: 12px;
        padding: 8px 14px;
    }

    /* Pipeline cards */
    .pipeline {
        gap: 6px;
    }

    .pipe-stage {
        min-width: 100px;
        padding: 10px;
    }

    .pipe-stage .count {
        font-size: 18px;
    }

    .pipe-stage .value {
        font-size: 10px;
    }

    /* Quick Access */
    .quick-access {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .quick-btn {
        padding: 14px 10px;
    }

    .quick-btn .quick-icon {
        font-size: 22px;
    }

    .quick-btn .quick-label {
        font-size: 10px;
    }

    /* Invoice */
    .invoice-wrapper {
        padding: 16px;
    }

    .invoice-header {
        flex-direction: column;
        gap: 16px;
    }

    .invoice-parties {
        flex-direction: column;
        gap: 16px;
    }

    .invoice-party[style*="text-align:right"] {
        text-align: left !important;
    }

    .invoice-totals-table {
        min-width: 0;
    }

    /* 2-column grids → 1 column */
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Alerts */
    .alert {
        font-size: 13px;
        padding: 10px 14px;
    }

    /* Login */
    .login-card {
        padding: 32px 24px;
    }

    .login-title {
        font-size: 22px;
    }
}

/* ===== RESPONSIVE — SMALL PHONE (≤480px) ===== */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    .topbar {
        padding: 10px 12px;
    }

    .page-content {
        padding: 12px;
    }

    .topbar h1 {
        font-size: 15px;
    }

    .topbar-actions .btn {
        font-size: 11px;
        padding: 6px 10px;
    }

    table {
        font-size: 11px;
    }

    thead th {
        padding: 8px 6px;
        font-size: 9px;
    }

    tbody td {
        padding: 8px 6px;
    }

    .badge {
        font-size: 9px;
        padding: 3px 8px;
    }

    .quick-access {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-wrapper {
        height: 240px;
    }

    .chart-wrapper-sm {
        height: 200px;
    }

    .sidebar-header h2 {
        font-size: 18px;
    }

    .nav-menu li a {
        padding: 10px 18px;
        font-size: 13px;
        gap: 12px;
    }

    .nav-menu li a span {
        font-size: 16px;
    }

    .empty-state {
        padding: 32px 16px;
    }

    .empty-icon {
        font-size: 36px;
    }
}