/* public_html/css/components.css - Premium Enterprise Design System */

/* ============================================
   TABLE OF CONTENTS
   1. CSS Variables & Design Tokens
   2. Reset & Base Styles
   3. Typography
   4. Sidebar Navigation
   5. Header Bar
   6. Cards & Containers
   7. Buttons & Actions
   8. Forms & Inputs
   9. Tables & Data Display
   10. Badges & Status Indicators
   11. Modals & Overlays
   12. Toast Notifications
   13. Grid System
   14. Utility Classes
   15. Auth Pages
   16. Dashboard Components
   17. Animations & Transitions
   18. Responsive Design
   19. Accessibility
   20. Print Styles
   ============================================ */

/* ============================================
   1. CSS VARIABLES & DESIGN TOKENS
   ============================================ */
:root {
    /* Primary Brand Colors */
    --primary-50: #EEF2FF;
    --primary-100: #E0E7FF;
    --primary-200: #C7D2FE;
    --primary-300: #A5B4FC;
    --primary-400: #818CF8;
    --primary-500: #6366F1;
    --primary-600: #4F46E5;
    --primary-700: #4338CA;
    --primary-800: #3730A3;
    --primary-900: #312E81;
    --primary-950: #1E1B4B;
    
    /* Semantic Colors */
    --success-50: #ECFDF5;
    --success-100: #D1FAE5;
    --success-500: #10B981;
    --success-600: #059669;
    --success-700: #047857;
    
    --warning-50: #FFFBEB;
    --warning-100: #FEF3C7;
    --warning-500: #F59E0B;
    --warning-600: #D97706;
    --warning-700: #B45309;
    
    --danger-50: #FEF2F2;
    --danger-100: #FEE2E2;
    --danger-500: #EF4444;
    --danger-600: #DC2626;
    --danger-700: #B91C1C;
    
    --info-50: #EFF6FF;
    --info-100: #DBEAFE;
    --info-500: #3B82F6;
    --info-600: #2563EB;
    --info-700: #1D4ED8;
    
    /* Neutral Colors */
    --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;
    --gray-950: #030712;
    
    /* Layout */
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 72px;
    --header-height: 72px;
    --content-max-width: 1440px;
    --border-radius-sm: 6px;
    --border-radius-md: 10px;
    --border-radius-lg: 14px;
    --border-radius-xl: 20px;
    --border-radius-2xl: 24px;
    --border-radius-full: 9999px;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.1), 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 4px 8px -2px rgba(16, 24, 40, 0.1), 0 2px 4px -2px rgba(16, 24, 40, 0.06);
    --shadow-lg: 0 12px 16px -4px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03);
    --shadow-xl: 0 20px 24px -4px rgba(16, 24, 40, 0.08), 0 8px 8px -4px rgba(16, 24, 40, 0.03);
    --shadow-2xl: 0 24px 48px -12px rgba(16, 24, 40, 0.18);
    --shadow-3xl: 0 32px 64px -12px rgba(16, 24, 40, 0.14);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
    
    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
}

/* ============================================
   2. RESET & BASE STYLES
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--gray-900);
    background-color: var(--gray-50);
    overflow-x: hidden;
    min-height: 100vh;
}

img,
svg,
video {
    display: block;
    max-width: 100%;
    height: auto;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

button {
    cursor: pointer;
}

a {
    color: var(--primary-600);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-700);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--border-radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ============================================
   3. TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    color: var(--gray-900);
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* ============================================
   4. SIDEBAR NAVIGATION
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--gray-900) 0%, var(--gray-950) 100%);
    color: var(--gray-300);
    z-index: var(--z-fixed);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--transition-base), width var(--transition-base);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: var(--header-height);
}

.sidebar-logo {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: var(--border-radius-lg);
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.sidebar-title {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: white;
    white-space: nowrap;
}

.sidebar-subtitle {
    font-size: 0.75rem;
    color: var(--gray-500);
    white-space: nowrap;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
}

.nav-section {
    padding: 0.5rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-500);
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--gray-400);
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    gap: 0.75rem;
    border-radius: var(--border-radius-md);
    margin-bottom: 0.25rem;
    position: relative;
    white-space: nowrap;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--gray-200);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--primary-400);
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

.nav-item i {
    width: 1.25rem;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.nav-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-badge {
    background: var(--danger-500);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: var(--border-radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
    min-width: 1.25rem;
    text-align: center;
}

/* ============================================
   5. HEADER BAR
   ============================================ */
.header {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    z-index: var(--z-sticky);
    transition: left var(--transition-base);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--gray-600);
    padding: 0.5rem;
    border-radius: var(--border-radius-md);
    transition: background var(--transition-fast);
}

.menu-toggle:hover {
    background: var(--gray-100);
}

.header-search {
    flex: 1;
    max-width: 24rem;
    position: relative;
}

.header-search input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.75rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-full);
    outline: none;
    transition: all var(--transition-fast);
    background: var(--gray-50);
    font-size: 0.875rem;
}

.header-search input:focus {
    border-color: var(--primary-400);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: white;
}

.header-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.header-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--gray-600);
    padding: 0.625rem;
    border-radius: var(--border-radius-full);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-btn:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.header-btn .badge-dot {
    position: absolute;
    top: 0.375rem;
    right: 0.375rem;
    width: 0.5rem;
    height: 0.5rem;
    background: var(--danger-500);
    border-radius: 50%;
    border: 2px solid white;
}

.user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
}

.user-avatar:hover {
    border-color: var(--primary-400);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.user-avatar-sm {
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
}

.user-avatar-lg {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.25rem;
}

/* ============================================
   6. CARDS & CONTAINERS
   ============================================ */
.card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--gray-100);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   7. BUTTONS & ACTIONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--border-radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--primary-600);
    color: white;
    box-shadow: 0 1px 2px rgba(79, 70, 229, 0.4);
}

.btn-primary:hover {
    background: var(--primary-700);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border-color: var(--gray-300);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-success {
    background: var(--success-600);
    color: white;
    box-shadow: 0 1px 2px rgba(5, 150, 105, 0.4);
}

.btn-success:hover {
    background: var(--success-700);
}

.btn-danger {
    background: var(--danger-600);
    color: white;
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.4);
}

.btn-danger:hover {
    background: var(--danger-700);
}

.btn-warning {
    background: var(--warning-500);
    color: white;
    box-shadow: 0 1px 2px rgba(245, 158, 11, 0.4);
}

.btn-warning:hover {
    background: var(--warning-600);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
}

.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    padding: 0.625rem;
    border-radius: var(--border-radius-full);
}

/* ============================================
   8. FORMS & INPUTS
   ============================================ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.form-required {
    color: var(--danger-500);
    margin-left: 0.25rem;
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-md);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    outline: none;
    background: white;
    color: var(--gray-900);
}

.form-control:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-control.error {
    border-color: var(--danger-500);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-control:disabled {
    background: var(--gray-50);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-error {
    color: var(--danger-600);
    font-size: 0.75rem;
    margin-top: 0.375rem;
    font-weight: 500;
}

.form-help {
    color: var(--gray-500);
    font-size: 0.75rem;
    margin-top: 0.375rem;
}

.form-textarea {
    min-height: 6rem;
    resize: vertical;
}

.form-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    border-radius: var(--border-radius-sm);
    border: 2px solid var(--gray-300);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.form-checkbox input[type="checkbox"]:checked {
    background-color: var(--primary-600);
    border-color: var(--primary-600);
}

/* ============================================
   9. TABLES & DATA DISPLAY
   ============================================ */
.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--gray-200);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table th {
    background: var(--gray-50);
    padding: 0.875rem 1rem;
    text-align: left;
    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);
    white-space: nowrap;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-striped tbody tr:nth-child(even) {
    background: var(--gray-50);
}

/* ============================================
   10. BADGES & STATUS INDICATORS
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.25rem;
    white-space: nowrap;
}

.badge-success {
    background: var(--success-100);
    color: var(--success-700);
}

.badge-warning {
    background: var(--warning-100);
    color: var(--warning-700);
}

.badge-danger {
    background: var(--danger-100);
    color: var(--danger-700);
}

.badge-info {
    background: var(--info-100);
    color: var(--info-700);
}

.badge-primary {
    background: var(--primary-100);
    color: var(--primary-700);
}

.badge-neutral {
    background: var(--gray-100);
    color: var(--gray-700);
}

/* Status Dot */
.status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    display: inline-block;
}

.status-dot-success { background: var(--success-500); }
.status-dot-warning { background: var(--warning-500); }
.status-dot-danger { background: var(--danger-500); }
.status-dot-info { background: var(--info-500); }

/* ============================================
   11. MODALS & OVERLAYS
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    animation: fadeIn 0.2s ease;
    padding: 1rem;
}

.modal {
    background: white;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-2xl);
    max-width: 32rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-lg {
    max-width: 48rem;
}

.modal-xl {
    max-width: 64rem;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-400);
    transition: all var(--transition-fast);
    padding: 0.25rem;
    border-radius: var(--border-radius-sm);
    line-height: 1;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ============================================
   12. TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 24rem;
}

.toast {
    min-width: 20rem;
    max-width: 24rem;
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--gray-200);
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
}

.toast-success::before { background: var(--success-500); }
.toast-error::before { background: var(--danger-500); }
.toast-warning::before { background: var(--warning-500); }
.toast-info::before { background: var(--info-500); }

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.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;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.toast-message {
    color: var(--gray-600);
    font-size: 0.875rem;
    word-wrap: break-word;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    font-size: 1.25rem;
    padding: 0.25rem;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    line-height: 1;
}

.toast-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

/* ============================================
   13. GRID SYSTEM
   ============================================ */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
.grid-cols-6 { grid-template-columns: repeat(6, 1fr); }

/* ============================================
   14. UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }

.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

.gap-0 { gap: 0; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

.w-full { width: 100%; }
.w-auto { width: auto; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* ============================================
   15. AUTH PAGES
   ============================================ */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-900) 100%);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

/* Decorative background elements */
.auth-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
}

.auth-container::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    animation: float 25s ease-in-out infinite reverse;
}

.auth-card {
    background: white;
    border-radius: var(--border-radius-2xl);
    box-shadow: var(--shadow-2xl);
    width: 100%;
    max-width: 26rem;
    padding: 2.5rem;
    position: relative;
    z-index: 1;
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-card-lg {
    max-width: 34rem;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
    border-radius: var(--border-radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.auth-logo h1 {
    font-size: 1.5rem;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.auth-logo p {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* ============================================
   16. DASHBOARD COMPONENTS
   ============================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--gray-900);
}

.page-header p {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--transition-base);
    cursor: pointer;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    min-width: 3rem;
    border-radius: var(--border-radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    position: relative;
}

.stat-icon-primary {
    background: var(--primary-50);
    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-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--gray-900);
    line-height: 1;
}

.stat-info p {
    color: var(--gray-500);
    font-size: 0.75rem;
    font-weight: 500;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.stat-change-positive { color: var(--success-600); }
.stat-change-negative { color: var(--danger-600); }

/* Chart Container */
.chart-container {
    position: relative;
    height: 18rem;
    width: 100%;
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 1rem;
}

/* Loading Animation */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
    font-size: 0.875rem;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--gray-200);
    border-top-color: var(--primary-600);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* Table Toolbar */
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.table-search {
    flex: 1;
    max-width: 20rem;
    position: relative;
}

.table-search input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-full);
    outline: none;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
}

.table-search input:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.table-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
    gap: 1rem;
    flex-wrap: wrap;
}

.table-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-info {
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* Sortable table headers */
.sortable {
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-fast);
}

.sortable:hover {
    background: var(--gray-100);
}

.sortable i {
    font-size: 0.75rem;
    margin-left: 0.375rem;
    opacity: 0.5;
}

.sortable.sorted-asc i {
    opacity: 1;
    transform: rotate(180deg);
}

.sortable.sorted-desc i {
    opacity: 1;
}

/* ============================================
   17. ANIMATIONS & TRANSITIONS
   ============================================ */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(10%, 10%) rotate(180deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-fade-in {
    animation: fadeIn var(--transition-base);
}

.animate-slide-up {
    animation: slideUp var(--transition-base);
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ============================================
   18. RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1200px) {
    .grid-cols-6 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
    .grid-cols-4,
    .grid-cols-5 { grid-template-columns: repeat(2, 1fr); }
    
    .grid-cols-6 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
        --header-height: 64px;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-base);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .header {
        left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4,
    .grid-cols-5,
    .grid-cols-6 {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .modal {
        max-width: 100%;
        margin: 0.5rem;
        max-height: 95vh;
    }
    
    .toast-container {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
    
    .toast {
        min-width: 0;
        max-width: none;
        width: 100%;
    }
    
    .auth-card {
        padding: 1.5rem;
    }
    
    .header-search {
        max-width: none;
    }
}

@media (max-width: 480px) {
    :root {
        --sidebar-width: 100%;
    }
    
    .header {
        padding: 0 1rem;
    }
    
    .header-search {
        display: none;
    }
    
    .card {
        padding: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        width: 2.5rem;
        height: 2.5rem;
        min-width: 2.5rem;
        font-size: 1.25rem;
    }
    
    .stat-info h3 {
        font-size: 1.25rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 0.75rem;
    }
}

/* ============================================
   19. ACCESSIBILITY
   ============================================ */
:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================
   20. PRINT STYLES
   ============================================ */
@media print {
    .sidebar,
    .header,
    .toast-container,
    .modal-overlay,
    .btn,
    .menu-toggle {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .page-content {
        padding: 0 !important;
        margin-top: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }
    
    body {
        background: white !important;
    }
}