/* ============================================
   LOCKER ULTIMATE - MODERN DESIGN SYSTEM
   ============================================ */

/* ============ CSS VARIABLES ============ */
:root {
    /* Primary Colors */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;

    /* Success */
    --success-50: #f0fdf4;
    --success-500: #22c55e;
    --success-600: #16a34a;

    /* Warning */
    --warning-50: #fffbeb;
    --warning-500: #f59e0b;
    --warning-600: #d97706;

    /* Danger */
    --danger-50: #fef2f2;
    --danger-500: #ef4444;
    --danger-600: #dc2626;

    /* Info */
    --info-50: #ecfeff;
    --info-500: #06b6d4;
    --info-600: #0891b2;

    /* Neutral */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --header-height: 60px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
    --transition-slow: 300ms ease;

    /* Background/Text for theming */
    --bg-primary: #ffffff;
    --bg-secondary: var(--gray-100);
    --bg-tertiary: var(--gray-50);
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --border-color: var(--gray-200);
}

/* ============ DARK THEME ============ */
[data-theme="dark"] {
    /* Core grays - inverted */
    --gray-50: #0d1117;
    --gray-100: #161b22;
    --gray-200: #21262d;
    --gray-300: #30363d;
    --gray-400: #484f58;
    --gray-500: #6e7681;
    --gray-600: #8b949e;
    --gray-700: #c9d1d9;
    --gray-800: #e6edf3;
    --gray-900: #f0f6fc;

    /* Primary for dark */
    --primary-50: #0d1d31;
    --primary-100: #1a3a5c;

    /* Backgrounds */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --border-color: #30363d;

    /* Shadows for dark - more subtle */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.4);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
}

/* Dark mode specific overrides */
[data-theme="dark"] body {
    background-color: #0d1117;
    color: #e6edf3;
}

[data-theme="dark"] .card {
    background: #161b22;
    border-color: #30363d;
}

[data-theme="dark"] .card-header {
    background: #21262d;
    border-color: #30363d;
}

[data-theme="dark"] .table thead {
    background: #21262d;
}

[data-theme="dark"] .table tbody tr {
    border-color: #30363d;
}

[data-theme="dark"] .table tbody tr:hover {
    background: #21262d;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-control:focus {
    background-color: #0d1117;
    border-color: #30363d;
    color: #e6edf3;
}

[data-theme="dark"] .form-control::placeholder {
    color: #6e7681;
}

[data-theme="dark"] .btn-secondary {
    background: #21262d;
    border-color: #30363d;
    color: #c9d1d9;
}

[data-theme="dark"] .btn-secondary:hover {
    background: #30363d;
}

[data-theme="dark"] .stat-card {
    background: #161b22;
    border-color: #30363d;
}

[data-theme="dark"] .dropdown-menu {
    background: #161b22;
    border-color: #30363d;
}

[data-theme="dark"] .dropdown-item {
    color: #e6edf3;
    border-color: #30363d;
}

[data-theme="dark"] .dropdown-item:hover {
    background: #21262d;
}

[data-theme="dark"] .main-content {
    background: #0d1117;
}

[data-theme="dark"] .top-header {
    background: #161b22;
    border-color: #30363d;
}

[data-theme="dark"] .client-selector {
    background: #21262d;
    border-color: #30363d;
    color: #e6edf3;
}

[data-theme="dark"] .client-selector:hover {
    background: #30363d;
    border-color: #484f58;
}

[data-theme="dark"] .badge {
    background: #238636;
}

[data-theme="dark"] .page-title {
    color: #e6edf3;
}

[data-theme="dark"] .text-muted {
    color: #8b949e !important;
}

/* Keep sidebar dark in dark mode (slightly deeper) */
[data-theme="dark"] .sidebar {
    background: linear-gradient(180deg, #010409 0%, #0d1117 100%);
}

[data-theme="dark"] .sidebar-header {
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .nav-item.active {
    background: rgba(56, 139, 253, 0.15);
}

/* ============ BASE STYLES ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.5;
    min-height: 100vh;
}

/* ============ LAYOUT STRUCTURE ============ */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--gray-900) 0%, var(--gray-800) 100%);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: width var(--transition-slow);
    overflow-x: hidden;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-logo span {
    font-weight: 300;
    opacity: 0.8;
}

.sidebar-logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
}

.nav-item {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--gray-300);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
    font-size: 0.9rem;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-500);
    border-left-color: var(--primary-500);
}

.nav-item i {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--danger-500);
    color: white;
    font-size: 0.65rem;
    padding: 0.2em 0.5em;
    border-radius: 10px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--border-radius-sm);
    transition: background var(--transition-fast);
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.05);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-600);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* ============ MAIN CONTENT ============ */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Header */
.top-header {
    background: white;
    padding: 0 1.5rem;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-200);
    background: white;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    border-color: var(--primary-500);
    color: var(--primary-600);
    background: var(--gray-50);
}

[data-theme="dark"] .theme-toggle {
    background: #21262d;
    border-color: #30363d;
    color: #f0c14b;
}

[data-theme="dark"] .theme-toggle:hover {
    background: #30363d;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.breadcrumb a {
    color: var(--gray-500);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--primary-600);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.client-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--gray-100);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
    font-size: 0.875rem;
}

.client-selector:hover {
    background: var(--gray-200);
}

.client-selector i {
    color: var(--gray-500);
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 1.5rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Client Selector Dropdown */
.dropdown {
    position: relative;
}

.client-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--gray-200);
    background: white;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
    font-weight: 500;
}

.client-selector:hover {
    border-color: var(--primary-500);
    background: var(--gray-50);
}

.client-selector i:last-child {
    margin-left: 0.5rem;
    transition: transform var(--transition-fast);
}

.dropdown.open .client-selector i:last-child {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 280px;
    max-height: 300px;
    overflow-y: auto;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
    padding: 0.5rem 0;
}

.dropdown.open .dropdown-menu {
    display: block;
    animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: transparent;
    color: var(--gray-700);
    font-size: 0.875rem;
    border: none;
}

.dropdown-item:hover {
    background: var(--primary-50);
    color: var(--primary-700);
}

.dropdown-item.active {
    background: var(--primary-100);
    font-weight: 600;
}

/* ============ PAGE HEADER ============ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-title i {
    color: var(--primary-600);
}

.page-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ============ CARDS ============ */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--gray-50);
}

.card-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* ============ STAT CARDS ============ */
.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.primary {
    background: var(--primary-100);
    color: var(--primary-600);
}

.stat-icon.success {
    background: var(--success-50);
    color: var(--success-600);
}

.stat-icon.warning {
    background: var(--warning-50);
    color: var(--warning-600);
}

.stat-icon.danger {
    background: var(--danger-50);
    color: var(--danger-600);
}

.stat-icon.info {
    background: var(--info-50);
    color: var(--info-600);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* ============ TABLES ============ */
.table-wrapper {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    padding: 0.875rem 1rem;
    text-align: left;
    background: var(--gray-50);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
}

.table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
    font-size: 0.875rem;
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table-striped tbody tr:nth-child(even) {
    background: var(--gray-50);
}

.table-striped tbody tr:nth-child(even):hover {
    background: var(--gray-100);
}

/* ============ SEARCH & FILTERS ============ */
.search-filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-box input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-box i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.filter-select {
    padding: 0.625rem 2rem 0.625rem 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    background: white url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") right 0.5rem center/1.5em no-repeat;
    appearance: none;
    cursor: pointer;
    min-width: 120px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-700);
}

.btn-success {
    background: var(--success-600);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #15803d;
}

.btn-danger {
    background: var(--danger-600);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

.btn-warning {
    background: var(--warning-500);
    color: var(--gray-900);
}

.btn-warning:hover:not(:disabled) {
    background: var(--warning-600);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-200);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-600);
    border: 1px solid var(--primary-600);
}

.btn-outline-primary:hover:not(:disabled) {
    background: var(--primary-50);
}

.btn-outline-success {
    background: transparent;
    color: var(--success-600);
    border: 1px solid var(--success-600);
}

.btn-outline-success:hover:not(:disabled) {
    background: var(--success-50);
}

.btn-outline-danger {
    background: transparent;
    color: var(--danger-600);
    border: 1px solid var(--danger-600);
}

.btn-outline-danger:hover:not(:disabled) {
    background: var(--danger-50);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
}

.btn-icon.btn-sm {
    width: 30px;
    height: 30px;
}

/* Loading State */
.btn.loading {
    pointer-events: none;
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============ BADGES ============ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25em 0.6em;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    line-height: 1;
}

.badge-primary {
    background: var(--primary-100);
    color: var(--primary-700);
}

.badge-success {
    background: var(--success-50);
    color: var(--success-600);
}

.badge-warning {
    background: var(--warning-50);
    color: var(--warning-600);
}

.badge-danger {
    background: var(--danger-50);
    color: var(--danger-600);
}

.badge-info {
    background: var(--info-50);
    color: var(--info-600);
}

.badge-secondary {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* Solid Badges */
.badge-solid-primary {
    background: var(--primary-600);
    color: white;
}

.badge-solid-success {
    background: var(--success-600);
    color: white;
}

.badge-solid-warning {
    background: var(--warning-500);
    color: var(--gray-900);
}

.badge-solid-danger {
    background: var(--danger-600);
    color: white;
}

/* ============ FORMS ============ */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}

.form-control.is-invalid {
    border-color: var(--danger-500);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-text {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check-input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary-600);
}

/* ============ ALERTS ============ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-success {
    background: var(--success-50);
    color: var(--success-600);
    border: 1px solid #bbf7d0;
}

.alert-danger {
    background: var(--danger-50);
    color: var(--danger-600);
    border: 1px solid #fecaca;
}

.alert-warning {
    background: var(--warning-50);
    color: var(--warning-600);
    border: 1px solid #fde68a;
}

.alert-info {
    background: var(--info-50);
    color: var(--info-600);
    border: 1px solid #a5f3fc;
}

/* ============ TOAST NOTIFICATIONS ============ */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: white;
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.hide {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-success .toast-icon {
    color: var(--success-500);
}

.toast-error .toast-icon {
    color: var(--danger-500);
}

.toast-warning .toast-icon {
    color: var(--warning-500);
}

.toast-info .toast-icon {
    color: var(--info-500);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.875rem;
}

.toast-message {
    font-size: 0.8rem;
    color: var(--gray-600);
}

.toast-close {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.25rem;
}

.toast-close:hover {
    color: var(--gray-600);
}

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    font-size: 0.875rem;
}

/* ============ DROPDOWN ============ */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 0.5rem 0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
}

.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: background var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--gray-100);
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0.5rem 0;
}

/* ============ LOGIN PAGE ============ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--primary-800) 100%);
    padding: 1rem;
}

.login-card {
    background: white;
    padding: 2.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.login-header p {
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* ============ MOBILE RESPONSIVENESS ============ */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

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

    .mobile-menu-toggle {
        display: flex !important;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-filters {
        flex-direction: column;
    }

    .search-box {
        width: 100%;
    }

    .filter-select {
        width: 100%;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .table td,
    .table th {
        padding: 0.625rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* Hide mobile toggle by default */
.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-600);
}

/* ============ UTILITIES ============ */
.text-muted {
    color: var(--gray-500) !important;
}

.text-primary {
    color: var(--primary-600) !important;
}

.text-success {
    color: var(--success-600) !important;
}

.text-danger {
    color: var(--danger-600) !important;
}

.text-warning {
    color: var(--warning-600) !important;
}

.fw-semibold {
    font-weight: 600;
}

.fw-bold {
    font-weight: 700;
}

.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

.justify-content-center {
    justify-content: center;
}

.justify-content-end {
    justify-content: flex-end;
}

.justify-content-start {
    justify-content: flex-start;
}

.align-items-start {
    align-items: flex-start;
}

.align-items-end {
    align-items: flex-end;
}

.flex-column {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-grow-1 {
    flex: 1 1 auto;
}

.w-100 {
    width: 100%;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.text-end {
    text-align: right;
}

.text-center {
    text-align: center;
}

/* Grid (12-column flex system) */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.5rem;
}

.col,
[class^="col-"],
[class*=" col-"] {
    padding: 0.5rem;
}

.col {
    flex: 1 1 0%;
    min-width: 0;
}

/* Base columns (all viewport widths) */
.col-1 { flex: 0 0 8.3333%; }
.col-2 { flex: 0 0 16.6667%; }
.col-3 { flex: 0 0 25%; }
.col-4 { flex: 0 0 33.3333%; }
.col-5 { flex: 0 0 41.6667%; }
.col-6 { flex: 0 0 50%; }
.col-7 { flex: 0 0 58.3333%; }
.col-8 { flex: 0 0 66.6667%; }
.col-9 { flex: 0 0 75%; }
.col-10 { flex: 0 0 83.3333%; }
.col-11 { flex: 0 0 91.6667%; }
.col-12 { flex: 0 0 100%; }

@media (min-width: 768px) {
    .col-md-1 { flex: 0 0 8.3333%; }
    .col-md-2 { flex: 0 0 16.6667%; }
    .col-md-3 { flex: 0 0 25%; }
    .col-md-4 { flex: 0 0 33.3333%; }
    .col-md-5 { flex: 0 0 41.6667%; }
    .col-md-6 { flex: 0 0 50%; }
    .col-md-7 { flex: 0 0 58.3333%; }
    .col-md-8 { flex: 0 0 66.6667%; }
    .col-md-9 { flex: 0 0 75%; }
    .col-md-10 { flex: 0 0 83.3333%; }
    .col-md-11 { flex: 0 0 91.6667%; }
    .col-md-12 { flex: 0 0 100%; }
}

@media (min-width: 992px) {
    .col-lg-1 { flex: 0 0 8.3333%; }
    .col-lg-2 { flex: 0 0 16.6667%; }
    .col-lg-3 { flex: 0 0 25%; }
    .col-lg-4 { flex: 0 0 33.3333%; }
    .col-lg-5 { flex: 0 0 41.6667%; }
    .col-lg-6 { flex: 0 0 50%; }
    .col-lg-7 { flex: 0 0 58.3333%; }
    .col-lg-8 { flex: 0 0 66.6667%; }
    .col-lg-9 { flex: 0 0 75%; }
    .col-lg-10 { flex: 0 0 83.3333%; }
    .col-lg-11 { flex: 0 0 91.6667%; }
    .col-lg-12 { flex: 0 0 100%; }
}

/* ============ LEGACY COMPATIBILITY ============ */
/* Keep Bootstrap icons working */
.bi {
    display: inline-block;
}

/* Ensure Bootstrap components still work */
.btn-close {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em no-repeat;
    border: 0;
    width: 1em;
    height: 1em;
    padding: 0.25em;
    opacity: 0.5;
    cursor: pointer;
}

.btn-close:hover {
    opacity: 1;
}

/* ============ TOOLTIPS ============ */
.custom-tooltip {
    position: fixed;
    z-index: 10000;
    background: var(--gray-900);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    max-width: 250px;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
    animation: tooltipFadeIn 0.15s ease-out;
}

.custom-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--gray-900);
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

[data-tooltip] {
    cursor: help;
}

/* Help icon for tooltips */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 0.625rem;
    background: var(--gray-200);
    color: var(--gray-600);
    border-radius: 50%;
    margin-left: 0.25rem;
    cursor: help;
}

.help-icon:hover {
    background: var(--primary-100);
    color: var(--primary-600);
}

/* ============ PAGINATION ============ */
.pagination {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.5rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    background: white;
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-btn:hover:not(.disabled):not(.active) {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.pagination-btn.active {
    background: var(--primary-600);
    border-color: var(--primary-600);
    color: white;
}

.pagination-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-dots {
    color: var(--gray-400);
    padding: 0 0.25rem;
}

/* ============ PRINT UTILITIES ============ */
.no-print {
    /* Screen only - hidden when printing */
    display: block;
}

.print-only {
    display: none !important;
}

@media print {
    .no-print {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    /* Hide sidebar and navigation */
    .sidebar,
    .main-header,
    .toast-container {
        display: none !important;
    }

    /* Reset main wrapper */
    .main-wrapper {
        margin-left: 0 !important;
    }

    .main-content {
        padding: 0 !important;
        max-width: 100% !important;
    }

    /* Optimize cards for print */
    .card {
        box-shadow: none !important;
        border: 1px solid var(--gray-300) !important;
    }
}

/* ============ BOOTSTRAP MODAL STYLES ============ */
/* Required for modals to work as overlay popups */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1055;
    display: none;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
}

.modal.show {
    display: block;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    max-width: 500px;
    pointer-events: none;
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 3.5rem);
}

.modal-dialog-scrollable {
    height: calc(100% - 3.5rem);
}

.modal-dialog-scrollable .modal-content {
    max-height: 100%;
    overflow: hidden;
}

.modal-dialog-scrollable .modal-body {
    overflow-y: auto;
}

.modal-lg {
    max-width: 800px;
}

.modal-sm {
    max-width: 300px;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: var(--bg-primary);
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    outline: 0;
    box-shadow: var(--shadow-lg);
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    width: 100vw;
    height: 100vh;
    background-color: #000;
}

.modal-backdrop.fade {
    opacity: 0;
}

.modal-backdrop.show {
    opacity: 0.5;
}

.modal-header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    border-top-left-radius: calc(var(--border-radius) - 1px);
    border-top-right-radius: calc(var(--border-radius) - 1px);
}

.modal-header .btn-close {
    padding: 0.5rem;
    margin: -0.5rem -0.5rem -0.5rem auto;
}

.modal-title {
    margin-bottom: 0;
    line-height: 1.5;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1.25rem;
}

.modal-footer {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--gray-200);
    border-bottom-right-radius: calc(var(--border-radius) - 1px);
    border-bottom-left-radius: calc(var(--border-radius) - 1px);
    gap: 0.5rem;
}

/* Modal animations */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translate(0, -50px);
}

.modal.show .modal-dialog {
    transform: none;
}

/* Dark mode modal */
[data-theme="dark"] .modal-content {
    background-color: #161b22;
    border-color: #30363d;
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: #30363d;
}

[data-theme="dark"] .modal-backdrop.show {
    opacity: 0.7;
}

/* ============ INPUT GROUP FIXES ============ */
.input-group {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
}

.input-group>.form-control {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1;
    color: var(--gray-600);
    text-align: center;
    white-space: nowrap;
    background-color: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
}

.input-group> :not(:first-child) {
    margin-left: -1px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group> :not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group>.btn {
    position: relative;
    z-index: 2;
}

/* ============ FORM SWITCH ============ */
.form-switch {
    padding-left: 2.5rem;
}

.form-switch .form-check-input {
    width: 2rem;
    margin-left: -2.5rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280, 0, 0, 0.25%29'/%3e%3c/svg%3e");
    background-position: left center;
    border-radius: 2rem;
    transition: background-position 0.15s ease-in-out;
}

.form-switch .form-check-input:checked {
    background-position: right center;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}