:root {
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #3730a3;
    --secondary: #0ea5e9;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --dark: #1e293b;
    --light: #f8fafc;
    --body-bg: #f1f5f9;
    --card-bg: #ffffff;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito Sans', sans-serif;
    background-color: var(--body-bg);
    color: var(--text-dark);
    overflow-x: hidden;
    letter-spacing: 0.01em;
}

/* ==================== LOGIN PAGE ==================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--body-bg);
    padding: 20px;
}

.login-container {
    background: var(--card-bg);
    border-radius: 24px;
    overflow: hidden;
    width: 100%;
    max-width: 1000px;
    display: flex;
    border: 0.5px solid var(--border-color);
}

.login-illustration {
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, var(--primary-dark) 100%);
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    width: 50%;
    position: relative;
    overflow: hidden;
}

.login-illustration::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    top: -100px;
    right: -50px;
    border: 0.5px solid rgba(255, 255, 255, 0.05);
}

.login-illustration::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    bottom: -50px;
    left: -30px;
    border: 0.5px solid rgba(255, 255, 255, 0.05);
}

.login-illustration .stock-icon {
    font-size: 80px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.login-illustration h2 {
    font-weight: 800;
    font-size: 28px;
    position: relative;
    z-index: 1;
}

.login-illustration p {
    font-weight: 300;
    opacity: 0.9;
    position: relative;
    z-index: 1;
    text-align: center;
}

.login-form-section {
    padding: 60px 50px;
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-form-section h3 {
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.login-form-section .subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 35px;
}

.form-control {
    border: 0.5px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: var(--body-bg);
    font-weight: 500;
}

.form-control:focus {
    border-color: var(--primary);
    background: white;
    outline: none;
}

.form-control-sm {
    border: 0.5px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    transition: all 0.3s ease;
    background: var(--body-bg);
    font-weight: 500;
}

.form-control-sm:focus {
    border-color: var(--primary);
    background: white;
    outline: none;
}

.form-select-sm {
    border: 0.5px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    background: var(--body-bg);
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-select-sm:focus {
    border-color: var(--primary);
}

.input-group {
    border: 0.5px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: var(--body-bg);
}

.input-group:focus-within {
    border-color: var(--primary);
    background: white;
}

.input-group .form-control {
    border: none;
    background: transparent;
}

.input-group .form-control:focus {
    border: none;
    background: transparent;
}

.input-group-text {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 12px 14px;
    font-size: 14px;
}

.btn-primary {
    background: var(--primary);
    border: 0.5px solid var(--primary);
    border-radius: 10px;
    padding: 12px;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-primary.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
}

.btn-outline-primary {
    border: 0.5px solid var(--primary);
    color: var(--primary);
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 16px;
    transition: all 0.3s ease;
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    background: var(--sidebar-bg);
    min-height: 100vh;
    width: 260px;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow-y: auto;
    border-right: 0.5px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo {
    padding: 25px 20px;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo .logo-icon {
    font-size: 32px;
    color: var(--primary-light);
}

.sidebar-logo .logo-text {
    font-weight: 800;
    font-size: 22px;
    color: white;
    letter-spacing: -0.5px;
}

.sidebar-logo .logo-text span {
    color: var(--primary-light);
}

.sidebar-nav {
    padding: 15px 12px;
}

.sidebar-nav .nav-section {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    padding: 20px 12px 8px;
}

.sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 12px 16px;
    border-radius: 10px;
    margin: 2px 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    font-size: 14px;
    border: 0.5px solid transparent;
    text-decoration: none;
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: white;
    border-color: rgba(255, 255, 255, 0.05);
}

.sidebar-nav .nav-link.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
    border-color: var(--primary-light);
}

.sidebar-nav .nav-link i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-nav .badge-custom {
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 20px;
    margin-left: auto;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* ==================== TOPBAR ==================== */
.topbar {
    background: var(--card-bg);
    padding: 16px 30px;
    border-bottom: 0.5px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar .search-box {
    position: relative;
    width: 350px;
}

.topbar .search-box input {
    padding: 10px 16px 10px 42px;
    border-radius: 30px;
    border: 0.5px solid var(--border-color);
    background: var(--body-bg);
    font-size: 14px;
    width: 100%;
    transition: all 0.3s ease;
    font-weight: 500;
}

.topbar .search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
}

.topbar .search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-actions .icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 0.5px solid var(--border-color);
    background: var(--body-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    font-size: 18px;
}

.topbar-actions .icon-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.topbar-actions .icon-btn .dot {
    width: 10px;
    height: 10px;
    background: var(--danger);
    border-radius: 50%;
    position: absolute;
    top: 6px;
    right: 8px;
    border: 2px solid white;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    cursor: pointer;
    border: 0.5px solid var(--primary);
    transition: all 0.3s ease;
}

.user-avatar:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* ==================== CONTENT AREA ==================== */
.content-area {
    padding: 30px;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h4 {
    font-weight: 800;
    font-size: 24px;
}

.page-header .breadcrumb-custom {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

/* ==================== STATS CARDS ==================== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 24px;
    border: 0.5px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 18px;
}

.stat-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
}

.stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    border: 0.5px solid;
}

.stat-icon.blue {
    background: #eff6ff;
    color: #3b82f6;
    border-color: #bfdbfe;
}

.stat-icon.green {
    background: #f0fdf4;
    color: #22c55e;
    border-color: #bbf7d0;
}

.stat-icon.orange {
    background: #fff7ed;
    color: #f97316;
    border-color: #fed7aa;
}

.stat-icon.purple {
    background: #faf5ff;
    color: #a855f7;
    border-color: #e9d5ff;
}

.stat-info h3 {
    font-weight: 800;
    font-size: 28px;
    margin-bottom: 2px;
    line-height: 1;
}

.stat-info p {
    color: var(--text-muted);
    margin: 0;
    font-size: 13px;
    font-weight: 600;
}

.stat-info .trend {
    font-size: 11px;
    font-weight: 700;
}

.trend.up {
    color: var(--success);
}

.trend.down {
    color: var(--danger);
}

/* ==================== CARDS ==================== */
.card-custom {
    background: var(--card-bg);
    border-radius: 14px;
    border: 0.5px solid var(--border-color);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header-custom {
    padding: 20px 24px;
    border-bottom: 0.5px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--light);
}

.card-header-custom h5 {
    font-weight: 700;
    margin: 0;
    font-size: 16px;
}

.card-body-custom {
    padding: 24px;
}

/* ==================== DATATABLE ==================== */
.table-custom {
    width: 100%;
}

.table-custom thead th {
    background: var(--light);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 14px 16px;
    border-bottom: 0.5px solid var(--border-color);
}

.table-custom tbody td {
    padding: 14px 16px;
    border-bottom: 0.5px solid var(--border-light);
    vertical-align: middle;
    font-weight: 500;
}

.table-custom tbody tr:hover {
    background: var(--light);
}

.badge-status {
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.5px;
    border: 0.5px solid;
}

.badge-instock {
    background: #f0fdf4;
    color: #16a34a;
    border-color: #bbf7d0;
}

.badge-lowstock {
    background: #fff7ed;
    color: #ea580c;
    border-color: #fed7aa;
}

.badge-outstock {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.btn-sm-custom {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 16px;
    border: 0.5px solid var(--border-color);
    background: white;
    color: var(--text-muted);
    margin: 0 3px;
}

.btn-sm-custom:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-sm-custom.delete:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* ==================== CHART ==================== */
.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
}

/* ==================== TOM SELECT OVERRIDES ==================== */
.ts-wrapper .ts-control {
    border: 0.5px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    background: var(--body-bg);
    font-weight: 500;
}

.ts-wrapper.focus .ts-control {
    border-color: var(--primary);
    background: white;
}

.ts-wrapper .ts-dropdown {
    border: 0.5px solid var(--border-color);
    border-radius: 8px;
    margin-top: 4px;
}

.ts-wrapper .ts-dropdown .option {
    padding: 8px 12px;
    font-size: 13px;
}
/* Custom Card Styles */
.card {
    background: #ffffff;
    border: 0.5px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.card-header {
    background: #ffffff;
    border-bottom: 0.5px solid #e2e8f0;
    padding: 1rem 1.25rem;
    border-radius: 12px 12px 0 0;
    font-weight: 600;
    color: #1e293b;
}

.card-body {
    padding: 1.25rem;
    color: #475569;
}

.card-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

.card-text {
    color: #64748b;
    line-height: 1.6;
}

.card-footer {
    background: #f8fafc;
    border-top: 0.5px solid #e2e8f0;
    padding: 1rem 1.25rem;
    border-radius: 0 0 12px 12px;
}
/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

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

    .login-illustration {
        display: none;
    }

    .login-form-section {
        width: 100%;
    }

    .topbar .search-box {
        width: 200px;
    }
}