/* ── DataTables: increase font size ── */
table.dataTable tbody td,
table.dataTable thead th,
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    font-size: 16px !important;  /* ← change this value to adjust DataTable font size */
}

/* ── Action column icons: bigger ── */
.btn-sm i.fas, .btn-sm i.far, .btn-sm i.fab {
    font-size: 15px !important;
}

/* ── DataTables: widen the length select box; hide "Show"/"entries" labels ── */
.dataTables_length select {
    min-width: 75px !important;
    width: auto !important;
    display: inline-block !important;
    padding-right: 28px !important;
}
/* The label wraps "Show _MENU_ entries" – when using _MENU_ alone
   the label is just the select, so no extra text fix needed.
   Belt-and-suspenders: hide any stray text nodes by making label flex. */
.dataTables_length label {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-weight: 500;
}

    :root {
        --primary: #2563eb;
        --primary-light: #3b82f6;
        --primary-dark: #1e40af;
        --secondary: #10b981;
        --danger: #ef4444;
        --warning: #f59e0b;
        --info: #06b6d4;
        --success: #10b981;
        --dark-bg: #0f172a;
        --light-bg: #f9fafb;
        --card-bg: #ffffff;
        --text-primary: #1f2937;
        --text-secondary: #6b7280;
        --border: #e5e7eb;
        --sidebar-width: 280px;
    }

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

    html, body {
        height: 100%;
    }

    body {
        font-family: 'Inter', sans-serif;
        background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
        color: var(--text-primary);
        line-height: 1.6;
    }

    /* ============ SIDEBAR ============ */
    #sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: var(--sidebar-width);
        height: 100vh;
        background: linear-gradient(180deg, var(--dark-bg) 0%, #1a2847 100%);
        padding: 0;
        overflow-y: auto;
        z-index: 1030;
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
        transition: left 0.3s ease;
    }

    #sidebar.hide {
        left: -280px;
    }

    .sidebar-header {
        padding: 24px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        text-align: center;
    }

    .sidebar-logo {
        font-size: 26px;
        font-weight: 700;
        background: linear-gradient(135deg, #3b82f6, #10b981);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    .brand-logo {
        display: inline-block;
        height: auto;
        max-width: 100%;
        object-fit: contain;
    }
    .brand-logo--login {
        display: block;
        width: auto;
        height: 56px;
        max-width: 260px;
        margin: 0 auto 10px;
        object-fit: contain;
    }
    .brand-logo--topbar {
        width: 28px;
        height: 28px;
        border-radius: 6px;
    }

    .sidebar-list {
        list-style: none;
        padding: 16px 8px;
    }

    .nav-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        color: rgba(255, 255, 255, 0.7);
        text-decoration: none;
        border-radius: 8px;
        margin-bottom: 4px;
        transition: all 0.3s ease;
        font-size: 14px;
        font-weight: 500;
    }

    .nav-item:hover {
        background: rgba(255, 255, 255, 0.1);
        color: white;
        padding-left: 20px;
    }

    .nav-item.active {
        background: linear-gradient(135deg, #3b82f6, #2563eb);
        color: white;
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    }

    .nav-item i {
        width: 20px;
        text-align: center;
        font-size: 16px;
    }

    .nav-divider {
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin: 12px 0;
    }

    /* ============ MAIN CONTENT ============ */
    #view-panel {
        margin-left: var(--sidebar-width);
        padding: 30px;
        transition: margin-left 0.3s ease;
        min-height: 100vh;
    }

    #view-panel.sidebar-hidden {
        margin-left: 0;
    }

    .topbar {
        background: white;
        padding: 16px 24px;
        border-radius: 12px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 30px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .topbar-left {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .topbar-right {
        display: flex;
        align-items: center;
        gap: 20px;
        margin-left: auto;
    }

    .sidebar-toggle-btn {
        background: none;
        border: none;
        color: var(--text-primary);
        font-size: 20px;
        cursor: pointer;
        padding: 8px;
    }

    .user-profile {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .user-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: linear-gradient(135deg, #3b82f6, #10b981);
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-weight: 600;
        font-size: 14px;
    }

    /* Backup Button Styling */
    .btn-backup {
        background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
        color: white;
        border: none;
        padding: 8px 14px;
        border-radius: 6px;
        font-weight: 600;
        font-size: 13px;
        transition: all 0.3s ease;
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
    }

    .btn-backup:hover {
        background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
        color: white;
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
        transform: translateY(-2px);
    }

    .btn-backup:active {
        transform: translateY(0);
    }

    /* ============ CARDS ============ */
    .card {
        border: none;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        transition: all 0.3s ease;
        overflow: hidden;
    }

    .card:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    }

    .card-header {
        background: linear-gradient(135deg, #3b82f6, #2563eb);
        color: white;
        border: none;
        padding: 20px 24px;
        font-weight: 600;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .card-header i {
        margin-right: 8px;
    }

    .card-body {
        padding: 24px;
    }

    /* ============ BUTTONS ============ */
    .btn {
        border: none;
        border-radius: 8px;
        padding: 10px 18px;
        font-weight: 500;
        font-size: 14px;
        transition: all 0.3s ease;
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    .btn-primary {
        background: linear-gradient(135deg, #3b82f6, #2563eb);
        color: white;
    }

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
        color: white;
        text-decoration: none;
    }

    .btn-success {
        background: linear-gradient(135deg, #10b981, #059669);
        color: white;
    }

    .btn-success:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 16px rgba(16, 185, 129, 0.3);
        color: white;
        text-decoration: none;
    }

    .btn-danger {
        background: linear-gradient(135deg, #ef4444, #dc2626);
        color: white;
    }

    .btn-danger:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 16px rgba(239, 68, 68, 0.3);
        color: white;
        text-decoration: none;
    }

    .btn-warning {
        background: linear-gradient(135deg, #f59e0b, #d97706);
        color: white;
    }

    .btn-outline-primary {
        border: 2px solid #3b82f6;
        color: #3b82f6;
        background: transparent;
    }

    .btn-outline-primary:hover {
        background: #3b82f6;
        color: white;
    }

    .btn-sm {
        padding: 6px 12px;
        font-size: 12px;
    }

    /* ============ TABLES ============ */
    .table {
        margin-bottom: 0;
    }

    .table thead th {
        background: #f9fafb;
        border: 1px solid var(--border);
        color: var(--text-primary);
        font-weight: 600;
        padding: 14px;
        font-size: 13px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .table tbody tr {
        border-bottom: 1px solid var(--border);
        transition: all 0.3s ease;
    }

    .table tbody tr:hover {
        background: #f9fafb;
    }

    .table td {
        padding: 14px;
        vertical-align: middle;
        border: 1px solid var(--border);
    }

    /* ============ FORMS ============ */
    .form-label {
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 8px;
        font-size: 14px;
    }

    .form-control, .form-select {
        border: 2px solid var(--border);
        border-radius: 8px;
        padding: 10px 12px;
        font-size: 14px;
        transition: all 0.3s ease;
    }

    .form-control:focus, .form-select:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

    .form-group {
        margin-bottom: 20px;
    }

    /* ============ MODALS ============ */
    .modal-content {
        border: none;
        border-radius: 12px;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    }

    .modal-header {
        background: linear-gradient(135deg, #3b82f6, #2563eb);
        color: white;
        border: none;
        padding: 20px 24px;
        border-radius: 12px 12px 0 0;
    }

    .modal-header .btn-close {
        filter: invert(1);
    }

    /* ============ ALERTS ============ */
    .alert {
        border: none;
        border-radius: 8px;
        padding: 14px 16px;
    }

    .alert-success {
        background: #dcfce7;
        color: #166534;
    }

    .alert-danger {
        background: #fee2e2;
        color: #991b1b;
    }

    .alert-warning {
        background: #fef3c7;
        color: #92400e;
    }

    .alert-info {
        background: #cffafe;
        color: #164e63;
    }

    /* ============ BADGES ============ */
    .badge {
        padding: 6px 12px;
        border-radius: 6px;
        font-weight: 500;
        font-size: 12px;
    }

    .badge-success {
        background: #dcfce7;
        color: #166534;
    }

    .badge-danger {
        background: #fee2e2;
        color: #991b1b;
    }

    .badge-warning {
        background: #fef3c7;
        color: #92400e;
    }

    .badge-primary {
        background: #dbeafe;
        color: #1e3a8a;
    }

    /* ============ STAT CARDS ============ */
    .stat-card {
        background: white;
        border-radius: 12px;
        padding: 24px;
        text-align: center;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        transition: all 0.3s ease;
        border-left: 4px solid #3b82f6;
    }

    .stat-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    }

    .stat-value {
        font-size: 32px;
        font-weight: 700;
        margin: 12px 0;
    }

    .stat-label {
        color: var(--text-secondary);
        font-size: 13px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* ============ TOAST ============ */
    .toast {
        position: fixed;
        bottom: 20px;
        right: 20px;
        border-radius: 8px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        z-index: 2000;
        min-width: 300px;
    }

    .toast-body {
        padding: 16px;
    }

    /* ============ RESPONSIVE ============ */
    @media (max-width: 768px) {
        #sidebar {
            left: -280px;
        }

        #sidebar.show {
            left: 0;
        }

        #view-panel {
            margin-left: 0;
            padding: 8px;
        }

        .topbar {
            padding: 10px 12px;
            margin-bottom: 12px;
            border-radius: 8px;
        }

        /* Reduce white card inner padding on mobile */
        .stockr-card {
            padding: 12px !important;
        }
    }

    /* ============ UTILITIES ============ */
    .text-muted {
        color: var(--text-secondary);
    }

    .shadow-lg {
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    }

    .rounded-lg {
        border-radius: 12px;
    }

    .gradient-primary {
        background: linear-gradient(135deg, #3b82f6, #2563eb);
        color: white;
    }

    .text-primary {
        color: #2563eb !important;
    }

    .table-responsive {
        border-radius: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .preloader {
        display: none;
    }

    .back-to-top {
        position: fixed;
        bottom: 20px;
        right: 20px;
        background: linear-gradient(135deg, #3b82f6, #2563eb);
        color: white;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: none;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        z-index: 999;
        transition: all 0.3s ease;
    }

    .back-to-top:hover {
        transform: translateY(-3px);
    }

    .back-to-top.show {
        display: flex;
    }
