/* ===============================================
   SAHE SMS - Modern Design System
   Clean, minimal, and professional UI Framework
   Palette: Navy #1e3a5f + White
   =============================================== */

/* ===== CSS VARIABLES ===== */
:root {
    /* Brand Colors - Navy + White */
    --primary: #1e3a5f;
    --primary-dark: #152a47;
    --primary-light: #2a4a73;
    --primary-50: #f0f4f8;
    --primary-100: #d9e2ec;
    
    /* Accent - Navy tones (no orange) */
    --accent: #1e3a5f;
    --accent-dark: #152a47;
    --accent-light: #2a4a73;
    --accent-50: #f0f4f8;
    
    /* Status Colors - Muted, professional */
    --success: #16a34a;
    --success-light: #f0fdf4;
    --success-dark: #15803d;
    --warning: #ca8a04;
    --warning-light: #fefce8;
    --warning-dark: #a16207;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --danger-dark: #b91c1c;
    --info: #1e3a5f;
    --info-light: #f0f4f8;
    --info-dark: #152a47;
    
    /* Neutral Palette */
    --white: #ffffff;
    --gray-25: #fcfcfd;
    --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;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    
    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    
    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.25rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    
    /* Z-Index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-tooltip: 1060;
}

/* ===== BASE RESET ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-y: scroll; /* Always show scrollbar to prevent layout shift */
}

/* Styled scrollbar for consistent UI */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--gray-300) var(--gray-100);
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: 1.6;
    color: var(--gray-700);
    background-color: #f8f9fb;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-semibold);
    line-height: 1.3;
    color: var(--gray-900);
    margin-bottom: var(--space-3);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-base); font-weight: var(--font-medium); }
h6 { font-size: var(--text-sm); font-weight: var(--font-medium); }

p {
    margin-bottom: var(--space-4);
    color: var(--gray-600);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* ===== LAYOUT ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
    background: var(--gray-50);
}

.main-content {
    flex: 1;
    min-width: 0;
    margin-left: 260px;
    transition: margin-left var(--transition-base);
    min-height: 100vh;
}

html.sidebar-collapsed .main-content {
    margin-left: 72px;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-6) var(--space-8);
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.page-header-content {
    flex: 1;
    min-width: 200px;
}

.page-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    margin: 0 0 var(--space-1);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.page-title i {
    color: var(--primary);
    font-size: var(--text-xl);
}

.page-subtitle {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin: 0;
}

.page-header-actions {
    display: flex;
    gap: var(--space-3);
    align-items: center;
}

/* ===== CARDS ===== */
.card,
.content-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    margin-bottom: var(--space-6);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.card-header,
.content-card-header {
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    background: var(--white);
}

.card-title,
.content-card-title {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.card-title i,
.content-card-title i {
    color: var(--primary);
    font-size: var(--text-sm);
}

.card-subtitle {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin: var(--space-1) 0 0;
}

.card-body,
.content-card-body {
    padding: var(--space-6);
}

.card-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}

.card-actions,
.content-card-actions {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

/* ===== PANELS (data container variant) ===== */
.panel {
    background: var(--white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    margin-bottom: var(--space-6);
}

.panel.compact .panel-body {
    padding: var(--space-4);
}

.panel.full-width {
    margin-top: var(--space-5);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--gray-100);
}

.panel-title {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.panel-title i {
    color: var(--primary);
    font-size: var(--text-sm);
}

.panel-count {
    background: var(--primary);
    color: var(--white);
    font-size: 0.6875rem;
    font-weight: var(--font-semibold);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    min-width: 24px;
    text-align: center;
}

.panel-body {
    padding: var(--space-5);
}

.panel-body.no-padding {
    padding: 0;
}

.panel-footer {
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}

/* ===== METRICS GRID ===== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.metrics-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.metrics-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.metrics-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }

.metric-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-4) var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    border: 1px solid var(--gray-200);
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
    box-shadow: var(--shadow-xs);
}

.metric-card:hover {
    border-color: var(--primary-100);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.metric-card.large {
    padding: var(--space-5);
}

.metric-card.highlight-warning {
    border-color: var(--warning);
    background: var(--warning-light);
}

.metric-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    flex-shrink: 0;
    background: var(--primary-50);
    color: var(--primary);
}

.metric-icon.primary { background: var(--primary-50); color: var(--primary); }
.metric-icon.success { background: var(--success-light); color: var(--success); }
.metric-icon.warning { background: var(--warning-light); color: var(--warning-dark); }
.metric-icon.danger { background: var(--danger-light); color: var(--danger); }
.metric-icon.info { background: var(--info-light); color: var(--info-dark); }

.metric-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.metric-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--gray-900);
    line-height: 1.2;
}

.metric-label {
    font-size: var(--text-xs);
    color: var(--gray-500);
    font-weight: var(--font-medium);
}

.metric-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--warning);
    color: var(--white);
    font-size: 10px;
    font-weight: var(--font-semibold);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

/* ===== FILTER BAR ===== */
.filter-bar {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-xs);
}

.filter-form {
    display: flex;
    align-items: flex-end;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    flex: 1;
    min-width: 140px;
}

.filter-group label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-actions {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: var(--space-1);
    padding: var(--space-3) var(--space-5);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}

.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 6px 14px;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--gray-500);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.filter-tab:hover {
    color: var(--gray-700);
    background: var(--gray-100);
}

.filter-tab.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.tab-count {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 1px 6px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.2);
}

.filter-tab.active .tab-count {
    background: rgba(255, 255, 255, 0.25);
}

/* ===== DASHBOARD CONTENT LAYOUT ===== */
.dashboard-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: var(--space-5);
    margin-bottom: var(--space-5);
}

.dashboard-primary,
.dashboard-secondary {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* ===== ATTENTION LIST ===== */
.attention-list {
    display: flex;
    flex-direction: column;
}

.attention-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--gray-50);
    transition: background var(--transition-fast);
}

.attention-item:last-child {
    border-bottom: none;
}

.attention-item:hover {
    background: var(--gray-50);
}

.attention-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-semibold);
    font-size: var(--text-xs);
    text-transform: uppercase;
    flex-shrink: 0;
    background: var(--primary-50);
    color: var(--primary);
}

.attention-avatar.warning { background: var(--warning-light); color: var(--warning-dark); }
.attention-avatar.info { background: var(--info-light); color: var(--info-dark); }
.attention-avatar.success { background: var(--success-light); color: var(--success); }
.attention-avatar.danger { background: var(--danger-light); color: var(--danger); }

.attention-info {
    flex: 1;
    min-width: 0;
}

.attention-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: 2px;
}

.attention-name {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
}

.attention-name a {
    color: inherit;
    text-decoration: none;
}

.attention-name a:hover {
    color: var(--primary);
}

.attention-course {
    font-size: var(--text-sm);
    color: var(--gray-600);
    margin: 0 0 var(--space-1);
}

.attention-meta {
    display: flex;
    gap: var(--space-3);
    font-size: var(--text-xs);
    color: var(--gray-400);
}

.attention-meta i {
    margin-right: 3px;
}

.attention-actions {
    display: flex;
    gap: var(--space-1);
    flex-shrink: 0;
}

/* ===== PROGRESS BAR ===== */
.progress {
    height: 8px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--primary);
    transition: width var(--transition-slow);
}

.progress-bar.bg-success { background: var(--success); }
.progress-bar.bg-info { background: var(--primary); }
.progress-bar.bg-warning { background: var(--warning); }
.progress-bar.bg-danger { background: var(--danger); }
.progress-bar.bg-secondary { background: var(--gray-400); }

/* ===== QUICK LINKS ===== */
.quick-links {
    display: flex;
    flex-direction: column;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    color: var(--gray-700);
    text-decoration: none;
    border-bottom: 1px solid var(--gray-50);
    transition: all var(--transition-fast);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

.quick-link:last-child {
    border-bottom: none;
}

.quick-link:hover {
    background: var(--primary-50);
    color: var(--primary);
    padding-left: var(--space-5);
}

.quick-link i {
    width: 20px;
    text-align: center;
    color: var(--gray-400);
    transition: color var(--transition-fast);
}

.quick-link:hover i {
    color: var(--primary);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    line-height: 1.5;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    position: relative;
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn i {
    font-size: 0.8em;
}

.btn-sm {
    padding: 4px 10px;
    font-size: var(--text-xs);
    gap: 4px;
    border-radius: 6px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: var(--text-base);
    border-radius: var(--radius-lg);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 1px 2px rgba(30, 58, 95, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--white);
    box-shadow: 0 2px 6px rgba(30, 58, 95, 0.3);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(30, 58, 95, 0.2);
}

.btn-accent {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
}

.btn-accent:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: var(--white);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border-color: var(--gray-300);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-800);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.btn-success {
    background: var(--success);
    color: var(--white);
    border-color: var(--success);
    box-shadow: 0 1px 2px rgba(22, 163, 74, 0.2);
}

.btn-success:hover {
    background: var(--success-dark);
    border-color: var(--success-dark);
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.3);
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--warning);
    color: var(--white);
    border-color: var(--warning);
}

.btn-warning:hover {
    background: var(--warning-dark);
    border-color: var(--warning-dark);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
    border-color: var(--danger);
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.2);
}

.btn-danger:hover {
    background: var(--danger-dark);
    border-color: var(--danger-dark);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
    transform: translateY(-1px);
}

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

.btn-outline-primary:hover {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 2px 6px rgba(30, 58, 95, 0.25);
    transform: translateY(-1px);
}

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

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

.btn-outline,
.btn-outline-secondary {
    background: var(--white);
    color: var(--gray-700);
    border-color: var(--gray-300);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-outline:hover,
.btn-outline-secondary:hover {
    background: var(--gray-50);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
}

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

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

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

/* ===== FORMS ===== */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--gray-700);
    margin-bottom: var(--space-2);
}

.form-label.required::after {
    content: '*';
    color: var(--danger);
    margin-left: var(--space-1);
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="url"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 9px 14px;
    font-size: var(--text-sm);
    font-family: var(--font-sans);
    color: var(--gray-800);
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    appearance: none;
    height: 40px;
    line-height: 1.5;
}

.form-control:hover,
input:hover,
select:hover,
textarea:hover {
    border-color: var(--gray-400);
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
    background: var(--white);
}

.form-control:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--gray-400);
}

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

.form-control.is-invalid:focus,
input.is-invalid:focus,
select.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

select {
    background-image: 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 8 4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

textarea {
    min-height: 100px;
    resize: vertical;
    height: auto;
}

.form-text {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: var(--space-1);
}

.invalid-feedback {
    font-size: var(--text-xs);
    color: var(--danger);
    margin-top: var(--space-1);
}

/* Form row layout */
.form-row {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Input group */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control,
.input-group input {
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.input-group-append {
    display: flex;
}

.input-group-append .btn {
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    border-left: none;
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.form-check-input {
    width: 1rem;
    height: 1rem;
    border: 1.5px solid var(--gray-400);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.form-check-input[type="radio"] {
    border-radius: var(--radius-full);
}

.form-check-input:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.form-check-label {
    font-size: var(--text-sm);
    color: var(--gray-700);
    cursor: pointer;
}

/* Form sections */
.form-section {
    margin-bottom: var(--space-8);
}

.form-section-title {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    margin: 0 0 var(--space-1);
}

.form-section-subtitle {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin: 0 0 var(--space-5);
}

/* Form inline / horizontal */
.form-inline {
    display: flex;
    align-items: flex-end;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.form-inline .form-group {
    margin-bottom: 0;
}

/* ===== TABLES ===== */
.table-container,
.table-wrapper,
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    -webkit-overflow-scrolling: touch;
}

.table,
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--text-sm);
}

.table th,
.data-table th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-size: 0.6875rem;
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.table td,
.data-table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    vertical-align: middle;
    line-height: 1.5;
}

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

.table tbody tr:hover,
.data-table tbody tr:hover {
    background: #f0f4f8;
}

.table tbody tr:last-child td,
.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tfoot td {
    padding: var(--space-3) var(--space-4);
    font-weight: var(--font-semibold);
    background: var(--gray-50);
    border-top: 2px solid var(--gray-200);
    color: var(--gray-800);
}

.table-actions,
.action-buttons {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    align-items: center;
}

/* Action icon buttons in tables */
.action-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    background: transparent;
    border: 1px solid transparent;
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
    text-decoration: none;
    cursor: pointer;
}

.action-btn:hover {
    background: var(--primary-50);
    color: var(--primary);
    border-color: var(--primary-100);
}

.action-btn.edit:hover { background: var(--primary-50); color: var(--primary); }
.action-btn.view:hover { background: var(--info-light); color: var(--info); }
.action-btn.success:hover { background: var(--success-light); color: var(--success); }
.action-btn.delete:hover,
.action-btn.danger:hover { background: var(--danger-light); color: var(--danger); border-color: transparent; }
.action-btn.warning:hover { background: var(--warning-light); color: var(--warning-dark); }

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 3px 10px;
    font-size: 0.6875rem;
    font-weight: var(--font-semibold);
    border-radius: var(--radius-full);
    line-height: 1.4;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

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

.badge-success {
    background: var(--success-light);
    color: var(--success-dark);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger-dark);
}

.badge-info {
    background: var(--info-light);
    color: var(--info-dark);
}

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

/* Status Badges (with dot indicator) */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    font-size: 0.6875rem;
    font-weight: var(--font-semibold);
    border-radius: var(--radius-full);
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background: currentColor;
    flex-shrink: 0;
}

.status-active, .status-badge.active {
    background: var(--success-light);
    color: var(--success-dark);
}

.status-inactive, .status-badge.inactive {
    background: var(--gray-100);
    color: var(--gray-500);
}

.status-pending, .status-badge.pending {
    background: var(--warning-light);
    color: var(--warning-dark);
}

/* Status Chips (compact, no dot) */
.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 0.6875rem;
    font-weight: var(--font-semibold);
    border-radius: var(--radius-full);
    text-transform: capitalize;
    background: var(--gray-100);
    color: var(--gray-600);
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.status-chip.warning, .status-chip.status-warning, .status-chip.pending, .status-chip.new { 
    background: var(--warning-light); 
    color: var(--warning-dark); 
}
.status-chip.info, .status-chip.status-info, .status-chip.inreview, .status-chip.submitted, .status-chip.in_review { 
    background: var(--info-light); 
    color: var(--info-dark); 
}
.status-chip.success, .status-chip.status-success, .status-chip.accepted, .status-chip.active, .status-chip.paid {
    background: var(--success-light); 
    color: var(--success-dark); 
}
.status-chip.danger, .status-chip.status-danger, .status-chip.rejected, .status-chip.suspended, .status-chip.overdue { 
    background: var(--danger-light); 
    color: var(--danger); 
}
.status-chip.inactive, .status-chip.status-neutral, .status-chip.withdrawn { 
    background: var(--gray-100); 
    color: var(--gray-500); 
}
.status-chip.partial {
    background: #fef3c7;
    color: #92400e;
}

/* Code badges (monospace) */
.code-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    color: var(--gray-700);
    letter-spacing: -0.01em;
}

.code-badge.primary { background: var(--primary-50); color: var(--primary); }

/* ===== ALERTS ===== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    font-size: var(--text-sm);
}

.alert i {
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-success {
    background: var(--success-light);
    color: var(--success-dark);
    border: 1px solid var(--success);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning-dark);
    border: 1px solid var(--warning);
}

.alert-danger {
    background: var(--danger-light);
    color: var(--danger-dark);
    border: 1px solid var(--danger);
}

.alert-info {
    background: var(--info-light);
    color: var(--info-dark);
    border: 1px solid var(--info);
}

/* ===== STATS CARDS ===== */
.stats-overview,
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    padding: var(--space-5);
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    box-shadow: var(--shadow-xs);
    transition: all var(--transition-fast);
}

.stat-card:hover {
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: var(--text-lg);
}

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

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

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

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

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

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--gray-900);
    line-height: 1.2;
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-top: var(--space-1);
}

/* ===== SEARCH BOX ===== */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: var(--space-3);
    color: var(--gray-400);
    font-size: var(--text-sm);
    pointer-events: none;
}

.search-input {
    padding: 8px 12px 8px 36px;
    font-size: var(--text-sm);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background: var(--gray-50);
    min-width: 220px;
    transition: all var(--transition-fast);
    height: 38px;
}

.search-input:focus {
    outline: none;
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

/* ===== MOBILE HEADER ===== */
.mobile-header {
    display: none;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: var(--white);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--gray-200);
    align-items: center;
    gap: var(--space-3);
}

.mobile-menu-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    color: var(--gray-700);
    font-size: var(--text-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
    background: var(--gray-200);
}

.mobile-header-brand {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.mobile-header-brand img {
    height: 28px;
    width: auto;
}

.mobile-header-brand span {
    font-weight: var(--font-semibold);
    color: var(--primary);
}

/* ===== EMPTY STATES ===== */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-6);
    border-radius: var(--radius-full);
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
}

.empty-icon i {
    font-size: var(--text-3xl);
}

.empty-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin: 0 0 var(--space-2);
}

.empty-description {
    color: var(--gray-500);
    margin: 0 0 var(--space-6);
    font-size: var(--text-sm);
}

/* ===== UTILITY CLASSES ===== */
.text-primary { color: var(--primary) !important; }
.text-accent { color: var(--accent) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--gray-500) !important; }

.bg-primary { background-color: var(--primary) !important; }
.bg-accent { background-color: var(--accent) !important; }
.bg-success { background-color: var(--success) !important; }
.bg-warning { background-color: var(--warning) !important; }
.bg-danger { background-color: var(--danger) !important; }

.text-sm { font-size: var(--text-sm) !important; }
.text-xs { font-size: var(--text-xs) !important; }
.text-lg { font-size: var(--text-lg) !important; }

.font-medium { font-weight: var(--font-medium) !important; }
.font-semibold { font-weight: var(--font-semibold) !important; }
.font-bold { font-weight: var(--font-bold) !important; }

.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: var(--space-2) !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }
.mb-6 { margin-bottom: var(--space-6) !important; }
.mb-8 { margin-bottom: var(--space-8) !important; }
.mb-xl { margin-bottom: var(--space-12) !important; }

.mt-0 { margin-top: 0 !important; }
.mt-2 { margin-top: var(--space-2) !important; }
.mt-4 { margin-top: var(--space-4) !important; }

.p-4 { padding: var(--space-4) !important; }
.p-6 { padding: var(--space-6) !important; }

.d-flex { display: flex !important; }
.d-block { display: block !important; }
.d-none { display: none !important; }

.align-items-center { align-items: center !important; }
.justify-content-between { justify-content: space-between !important; }
.gap-2 { gap: var(--space-2) !important; }
.gap-4 { gap: var(--space-4) !important; }

.w-100 { width: 100% !important; }

.grid {
    display: grid;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    margin-top: var(--space-6);
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--space-3);
    font-size: var(--text-sm);
    color: var(--gray-600);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.pagination a:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

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

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

/* ===== MODAL ===== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-modal);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--gray-500);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.modal-body {
    padding: var(--space-6);
}

.modal-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: var(--space-1);
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: var(--space-6);
}

.tab {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--gray-500);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--gray-700);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

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

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-dropdown);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-fast);
    padding: var(--space-2);
}

.dropdown.active .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(4px);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    color: var(--gray-700);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

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

.dropdown-item i {
    width: 16px;
    color: var(--gray-500);
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-100);
    margin: var(--space-2) 0;
}

/* ===== LOADING SPINNER ===== */
.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.spinner-sm {
    width: 16px;
    height: 16px;
}

.spinner-lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

/* ===== AVATAR ===== */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    overflow: hidden;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-medium);
    color: var(--gray-600);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: var(--text-xs);
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: var(--text-lg);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(10px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-up {
    animation: slideUp 0.3s ease;
}

/* ===== BOOTSTRAP-COMPAT UTILITIES ===== */
/* Margin-end (right) & margin-start (left) */
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.me-3 { margin-right: 1rem !important; }
.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }

/* Additional margin */
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-3 { margin-top: 1rem !important; }

/* Padding shortcuts */
.p-0 { padding: 0 !important; }
.p-3 { padding: 1rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }

/* Font weight aliases */
.fw-bold { font-weight: 700 !important; }
.fw-medium { font-weight: 500 !important; }

/* Font size shortcuts */
.fs-4 { font-size: 1.5rem !important; }
.fs-5 { font-size: 1.25rem !important; }
.fs-6 { font-size: 1rem !important; }

/* Text alignment */
.text-end { text-align: right !important; }

/* Display */
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }

/* Flex */
.flex-grow-1 { flex-grow: 1 !important; }
.flex-wrap { flex-wrap: wrap !important; }

/* Border */
.border-top { border-top: 1px solid var(--border) !important; }

/* ===== BOOTSTRAP-COMPAT GRID ===== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.row.g-3 {
    gap: 1rem;
    margin-left: 0;
    margin-right: 0;
}

[class*="col-"] {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    flex-shrink: 0;
}

.col-auto { width: auto; flex: 0 0 auto; }
.col { flex: 1 1 0%; }
.col-md-2 { width: 16.666%; }
.col-md-3 { width: 25%; }
.col-md-4 { width: 33.333%; }
.col-md-6 { width: 50%; }
.col-lg-4 { width: 33.333%; }
.col-lg-6 { width: 50%; }
.col-lg-8 { width: 66.666%; }

/* ===== BOOTSTRAP-COMPAT COMPONENTS ===== */

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

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.form-check-input {
    width: 1rem;
    height: 1rem;
    margin-top: 0.25rem;
    cursor: pointer;
    accent-color: var(--primary);
}

.form-check-label {
    cursor: pointer;
    font-size: 0.875rem;
}

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

.form-select {
    appearance: auto;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-info {
    background: var(--info-light);
    border-color: rgba(30, 58, 95, 0.15);
    color: var(--info-dark);
}

.alert-warning {
    background: var(--warning-light);
    border-color: rgba(202, 138, 4, 0.15);
    color: var(--warning-dark);
}

.alert-danger {
    background: var(--danger-light);
    border-color: rgba(220, 38, 38, 0.15);
    color: var(--danger-dark);
}

.alert-success {
    background: var(--success-light);
    border-color: rgba(22, 163, 74, 0.15);
    color: var(--success-dark);
}

.alert-heading {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Badge bg-* variants (Bootstrap compat) */
.badge.bg-secondary { background: var(--gray-100) !important; color: var(--gray-600) !important; }
.badge.bg-info { background: var(--info-light) !important; color: var(--info-dark) !important; }
.badge.bg-success { background: var(--success-light) !important; color: var(--success-dark) !important; }
.badge.bg-warning { background: var(--warning-light) !important; color: var(--warning-dark) !important; }
.badge.bg-danger { background: var(--danger-light) !important; color: var(--danger-dark) !important; }
.badge.bg-primary { background: var(--primary-50) !important; color: var(--primary) !important; }
.badge.bg-dark { background: var(--gray-700) !important; color: white !important; }
.badge.bg-light { background: var(--gray-100) !important; color: var(--gray-600) !important; }
.text-dark { color: var(--gray-800) !important; }

/* bg-*-subtle (Bootstrap 5.3 compat) */
.bg-primary-subtle { background: var(--primary-50) !important; }
.bg-success-subtle { background: var(--success-light) !important; }
.bg-warning-subtle { background: var(--warning-light) !important; }
.bg-info-subtle { background: var(--info-light) !important; }
.bg-secondary-subtle { background: var(--gray-100) !important; }
.bg-light { background: var(--gray-50) !important; }
.bg-opacity-10 { --bg-opacity: 0.1; }
.bg-warning.bg-opacity-10 { background: rgba(202, 138, 4, 0.1) !important; }
.bg-success.bg-opacity-10 { background: rgba(22, 163, 74, 0.1) !important; }

/* Progress bars */
.progress {
    height: 8px;
    background: var(--gray-100);
    border-radius: var(--radius);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: var(--radius);
    transition: width 0.3s ease;
}

.progress-bar.bg-success { background: var(--success); }
.progress-bar.bg-warning { background: var(--warning); }
.progress-bar.bg-danger { background: var(--danger); }
.progress-bar.bg-info { background: var(--info); }

/* List group */
.list-group {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-group-flush .list-group-item {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
}

.list-group-item {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.list-group-item:last-child {
    border-bottom: 0;
}

/* Button group */
.btn-group {
    display: inline-flex;
    gap: 0;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: var(--radius) 0 0 var(--radius);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--radius) var(--radius) 0;
}

.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
}

/* Additional button outline variants */
.btn-outline-info {
    color: var(--info);
    border: 1px solid var(--gray-200);
    background: transparent;
}

.btn-outline-info:hover {
    background: var(--info-light);
    color: var(--info-dark);
    border-color: var(--info);
}

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

.btn-outline-success:hover {
    background: var(--success-light);
    color: var(--success-dark);
    border-color: var(--success);
}

.btn-outline-warning {
    color: var(--warning-dark);
    border: 1px solid var(--gray-200);
    background: transparent;
}

.btn-outline-warning:hover {
    background: var(--warning-light);
    color: var(--warning-dark);
    border-color: var(--warning);
}

/* Additional utilities */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    content: "";
}

.cursor-pointer { cursor: pointer; }
.rounded-circle { border-radius: 50% !important; }
.rounded { border-radius: var(--radius) !important; }
.border { border: 1px solid var(--border) !important; }
.h-100 { height: 100% !important; }

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

.avatar-lg {
    width: 48px;
    height: 48px;
    font-size: 1rem;
}

.text-white { color: white !important; }
.text-info { color: var(--info) !important; }
.text-decoration-none { text-decoration: none !important; }

.sticky-top {
    position: sticky;
    top: 1rem;
}

/* Definition list styling */
dl {
    margin: 0;
}

dt {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-500);
    margin-bottom: 0.125rem;
}

dd {
    font-size: 0.9375rem;
    color: var(--gray-800);
    margin-bottom: 0.75rem;
    margin-left: 0;
}

/* Pagination compat */
.page-item {
    list-style: none;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--space-3);
    font-size: var(--text-sm);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    color: var(--gray-600);
    background: white;
    text-decoration: none;
}

.page-item.disabled .page-link {
    color: var(--gray-400);
    pointer-events: none;
}

.page-link:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

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

/* Modal base styling */
.modal-content {
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--gray-100);
}

.modal-body {
    padding: var(--space-6);
}

.modal-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
}

.modal-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
    }
    
    html.sidebar-collapsed .main-content {
        margin-left: 0;
    }
    
    .mobile-header {
        display: flex;
    }
    
    .container {
        padding: var(--space-4) var(--space-4);
    }
    
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-content {
        grid-template-columns: 1fr;
    }
    
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: var(--space-4);
    }
    
    .page-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .stats-overview,
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }
    
    .card-actions {
        width: 100%;
    }
    
    .search-input {
        width: 100%;
    }
    
    .filter-tabs {
        flex-wrap: wrap;
    }
    
    .form-row {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .btn {
        padding: var(--space-2) var(--space-3);
    }
    
    .table th,
    .data-table th,
    .table td,
    .data-table td {
        padding: var(--space-2) var(--space-3);
    }
    
    .panel {
        border-radius: var(--radius-lg);
    }
    
    .metric-card {
        padding: var(--space-4);
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .sidebar,
    .mobile-header,
    .page-header-actions,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .card {
        border: 1px solid #ddd;
        box-shadow: none;
    }
}

/* ===== ENVIRONMENT BANNER ===== */
.environment-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.environment-banner {
    background-color: #dc2626;
    color: #ffffff;
}

.environment-banner i {
    font-size: 0.875rem;
}

/* Adjust app layout when environment banner is present */
body:has(.environment-banner) .app-layout {
    padding-top: 2rem;
}

body:has(.environment-banner) .auth-page {
    padding-top: 2rem;
}

body:has(.environment-banner) .sidebar {
    top: 2rem;
    height: calc(100vh - 2rem);
}

body:has(.environment-banner) .mobile-header {
    top: 2rem;
}

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