/**
 * Aurora Design System v1.0
 * Modern CSS Framework - Bootstrap-free replacement
 * For Partner Sales System
 */

/* ============================================
   CSS VARIABLES & DESIGN TOKENS
   ============================================ */
:root {
    /* Color Palette - Aurora Theme */
    --aurora-50: #f0f9ff;
    --aurora-100: #e0f2fe;
    --aurora-200: #bae6fd;
    --aurora-300: #7dd3fc;
    --aurora-400: #38bdf8;
    --aurora-500: #0ea5e9;
    --aurora-600: #0284c7;
    --aurora-700: #0369a1;
    --aurora-800: #075985;
    --aurora-900: #0c4a6e;

    /* Accent Colors */
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-info: #06b6d4;

    /* Neutral Colors */
    --neutral-50: #fafafa;
    --neutral-100: #f4f4f5;
    --neutral-200: #e4e4e7;
    --neutral-300: #d4d4d8;
    --neutral-400: #a1a1aa;
    --neutral-500: #71717a;
    --neutral-600: #52525b;
    --neutral-700: #3f3f46;
    --neutral-800: #27272a;
    --neutral-900: #18181b;

    /* Semantic Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-dark: #0f172a;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --text-inverse: #ffffff;

    /* Gradients */
    --gradient-aurora: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-ocean: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    --gradient-sunset: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --gradient-forest: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-purple: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
    --gradient-nav: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-card-hover: 0 8px 25px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.06);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Sizing */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* 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);

    /* 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;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-secondary);
    min-height: 100vh;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1, .h1 { font-size: 2rem; }
h2, .h2 { font-size: 1.75rem; }
h3, .h3 { font-size: 1.5rem; }
h4, .h4 { font-size: 1.25rem; }
h5, .h5 { font-size: 1.125rem; }
h6, .h6 { font-size: 1rem; }

p { margin-bottom: 1rem; }

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

a:hover {
    color: var(--accent-secondary);
}

small, .small {
    font-size: 0.875rem;
}

.text-muted { color: var(--text-tertiary); }
.text-primary { color: var(--accent-primary); }
.text-success { color: var(--accent-success); }
.text-warning { color: var(--accent-warning); }
.text-danger { color: var(--accent-danger); }
.text-info { color: var(--accent-info); }
.text-secondary { color: var(--text-secondary); }
.text-end { text-align: right; }
.text-center { text-align: center; }

/* ============================================
   LAYOUT
   ============================================ */
.container-modern {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

.container-fluid {
    width: 100%;
    padding: 0 1rem;
}

/* Flexbox utilities */
.d-flex { display: flex; }
.d-none { display: none; }
.d-block { display: block; }
.d-inline-flex { display: inline-flex; }
.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-grow-1 { flex-grow: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.justify-content-end { justify-content: flex-end; }
.justify-content-start { justify-content: flex-start; }

/* Grid */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.5rem;
}

.row > * {
    padding: 0.5rem;
}

.col { flex: 1 0 0%; }
.col-auto { flex: 0 0 auto; width: auto; }
.col-1 { flex: 0 0 auto; width: 8.333333%; }
.col-2 { flex: 0 0 auto; width: 16.666667%; }
.col-3 { flex: 0 0 auto; width: 25%; }
.col-4 { flex: 0 0 auto; width: 33.333333%; }
.col-5 { flex: 0 0 auto; width: 41.666667%; }
.col-6 { flex: 0 0 auto; width: 50%; }
.col-7 { flex: 0 0 auto; width: 58.333333%; }
.col-8 { flex: 0 0 auto; width: 66.666667%; }
.col-9 { flex: 0 0 auto; width: 75%; }
.col-10 { flex: 0 0 auto; width: 83.333333%; }
.col-11 { flex: 0 0 auto; width: 91.666667%; }
.col-12 { flex: 0 0 auto; width: 100%; }

@media (min-width: 768px) {
    .col-md-1 { flex: 0 0 auto; width: 8.333333%; }
    .col-md-2 { flex: 0 0 auto; width: 16.666667%; }
    .col-md-3 { flex: 0 0 auto; width: 25%; }
    .col-md-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-md-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-md-6 { flex: 0 0 auto; width: 50%; }
    .col-md-7 { flex: 0 0 auto; width: 58.333333%; }
    .col-md-8 { flex: 0 0 auto; width: 66.666667%; }
    .col-md-9 { flex: 0 0 auto; width: 75%; }
    .col-md-10 { flex: 0 0 auto; width: 83.333333%; }
    .col-md-11 { flex: 0 0 auto; width: 91.666667%; }
    .col-md-12 { flex: 0 0 auto; width: 100%; }
}

/* Gap utilities */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }
.g-2 { gap: 0.5rem; }
.g-3 { gap: 1rem; }

/* Spacing */
.m-0 { margin: 0; }
.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-3 { margin: 1rem; }
.m-4 { margin: 1.5rem; }
.m-5 { margin: 3rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { 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: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.ms-1 { margin-left: 0.25rem; }
.ms-2 { margin-left: 0.5rem; }
.ms-3 { margin-left: 1rem; }
.ms-auto { margin-left: auto; }
.me-1 { margin-right: 0.25rem; }
.me-2 { margin-right: 0.5rem; }
.me-3 { margin-right: 1rem; }
.me-auto { margin-right: auto; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 1rem; padding-bottom: 1rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 1rem; padding-right: 1rem; }

/* ============================================
   NAVIGATION - Clean Modular Design
   ============================================ */
.navbar {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 2000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.navbar .container-fluid {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

/* Logo */
.navbar-brand {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    color: white !important;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.navbar-brand:hover {
    opacity: 0.9;
    color: white !important;
}

.navbar-brand [data-lucide],
.navbar-brand i {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
}

/* Navigation menu */
.navbar-collapse {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.navbar-nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2px;
}

.nav-item {
    flex-shrink: 0;
}

.navbar .nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.625rem;
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    background: transparent;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    margin: 0.25rem 0;
}

.navbar .nav-link i,
.navbar .nav-link [data-lucide] {
    margin-right: 0.375rem;
    font-size: 0.875rem;
    width: 0.875rem;
    height: 0.875rem;
}

.navbar .nav-link:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.15);
}

.navbar .nav-link.active {
    color: white !important;
    background: rgba(255, 255, 255, 0.25);
    font-weight: 600;
}

.navbar .nav-link.active i,
.navbar .nav-link.active [data-lucide] {
    color: #4f46e5;
}

/* User dropdown - always at the end */
.navbar-user-dropdown {
    flex-shrink: 0;
    margin-left: auto;
}

.navbar-user-dropdown .nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: rgba(255, 255, 255, 0.9) !important;
    background: transparent;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.8125rem;
    text-decoration: none;
    cursor: pointer;
    margin: 0.25rem 0;
}

.navbar-user-dropdown .nav-link:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.15);
}

.navbar-user-dropdown .nav-link [data-lucide],
.navbar-user-dropdown .nav-link i {
    width: 1rem;
    height: 1rem;
}

.navbar-user-dropdown .user-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.navbar-user-dropdown .dropdown-menu {
    right: 0;
    left: auto;
}

/* Hide mobile toggler on desktop */
.navbar-toggler {
    display: none;
}

/* Page tabs (nav-tabs) */
.nav-tabs {
    border-bottom: 1px solid var(--neutral-200);
    gap: 0.25rem;
}

.nav-tabs .nav-link {
    padding: 0.625rem 1rem;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    font-weight: 500;
    cursor: pointer;
}

.nav-tabs .nav-link:hover {
    color: var(--text-primary);
    background: var(--neutral-100);
}

.nav-tabs .nav-link.active {
    color: var(--accent-primary);
    background: transparent;
    border-bottom-color: var(--accent-primary);
}

/* Tab content */
.tab-content { width: 100%; }
.tab-pane { display: none; }
.tab-pane.show, .tab-pane.active { display: block; }
.tab-pane.show.active { display: block; }

/* Nav tabs as flex container */
.nav {
    display: flex;
    flex-wrap: wrap;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

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

.dropdown-toggle::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 0.5rem;
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-left: 0.3em solid transparent;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 12rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 0.5rem 0;
    z-index: var(--z-dropdown);
    border: 1px solid var(--neutral-200);
    animation: fadeIn var(--transition-fast);
}

.dropdown-menu-end {
    left: auto;
    right: 0;
}

.dropdown.show .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background var(--transition-fast);
}

.dropdown-item i,
.dropdown-item [data-lucide] {
    margin-right: 0.75rem;
    color: var(--text-tertiary);
    width: 1rem;
    height: 1rem;
}

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

.dropdown-item-text {
    padding: 0.625rem 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.dropdown-divider {
    height: 0;
    margin: 0.5rem 0;
    border: 0;
    border-top: 1px solid var(--neutral-200);
}

hr.dropdown-divider {
    margin: 0.5rem 0;
}

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

/* ============================================
   CARDS - Glassmorphism Style
   ============================================ */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--neutral-200);
    transition: box-shadow var(--transition-base), transform var(--transition-base);
    overflow: hidden;
}

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

.card-body {
    padding: 1.25rem;
}

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

.card-header {
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--neutral-200);
    font-weight: 600;
}

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

/* Shadow utility */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    gap: 0.5rem;
}

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

.btn i, .btn [data-lucide] {
    width: 1rem;
    height: 1rem;
}

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

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

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

.btn-primary:hover:not(:disabled) {
    background: #4f46e5;
    border-color: #4f46e5;
    box-shadow: var(--shadow-glow);
}

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

.btn-success:hover:not(:disabled) {
    background: #059669;
    border-color: #059669;
}

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

.btn-warning:hover:not(:disabled) {
    background: #d97706;
    border-color: #d97706;
}

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

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    border-color: #dc2626;
}

.btn-secondary {
    color: var(--text-primary);
    background: var(--neutral-200);
    border-color: var(--neutral-200);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--neutral-300);
    border-color: var(--neutral-300);
}

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

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

.btn-outline-secondary {
    color: var(--text-secondary);
    background: transparent;
    border-color: var(--neutral-300);
}

.btn-outline-secondary:hover:not(:disabled) {
    color: var(--text-primary);
    background: var(--neutral-100);
    border-color: var(--neutral-400);
}

.btn-close {
    padding: 0.5rem;
    background: transparent;
    border: none;
    opacity: 0.5;
    cursor: pointer;
}

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

/* ============================================
   FORMS
   ============================================ */
.form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    border-color: var(--accent-primary);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

.form-control-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.form-select {
    display: block;
    width: 100%;
    padding: 0.5rem 2.25rem 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23475569' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius-md);
    appearance: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-select:focus {
    border-color: var(--accent-primary);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-select-sm {
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.form-label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-group {
    display: flex;
    position: relative;
}

.input-group .form-control {
    flex: 1 1 auto;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group .btn {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.input-group-sm .form-control {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* ============================================
   TABLES
   ============================================ */
.table {
    width: 100%;
    margin-bottom: 1rem;
    vertical-align: top;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--neutral-200);
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    text-align: left;
    background: var(--bg-tertiary);
}

.table-sm th,
.table-sm td {
    padding: 0.5rem;
}

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

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-light {
    background: var(--bg-tertiary);
}

.sticky-top {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    color: white;
    border-radius: var(--radius-full);
}

.bg-primary { background: var(--accent-primary); }
.bg-success { background: var(--accent-success); }
.bg-warning { background: var(--accent-warning); color: white; }
.bg-danger { background: var(--accent-danger); }
.bg-info { background: var(--accent-info); }
.bg-secondary { background: var(--neutral-500); }
.bg-light { background: var(--neutral-100); color: var(--text-primary); }
.bg-dark { background: var(--neutral-800); }

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success {
    color: #065f46;
    background: #d1fae5;
    border-color: #a7f3d0;
}

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

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

.alert-info {
    color: #1e40af;
    background: #dbeafe;
    border-color: #bfdbfe;
}

/* ============================================
   MODALS
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--z-modal);
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    outline: 0;
}

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

.modal-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

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

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--neutral-200);
    gap: 0.5rem;
}

/* ============================================
   SPINNER
   ============================================ */
.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner 0.75s linear infinite;
}

.spinner-border-sm {
    width: 0.75rem;
    height: 0.75rem;
    border-width: 1.5px;
}

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

/* ============================================
   FOOTER
   ============================================ */
footer {
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

footer a {
    color: var(--text-tertiary);
}

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

/* ============================================
   UTILITY CLASSES
   ============================================ */
.w-100 { width: 100%; }
.h-100 { height: 100%; }
.rounded { border-radius: var(--radius-md); }
.border { border: 1px solid var(--neutral-200); }
.border-0 { border: 0; }
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.position-relative { position: relative; }
.position-absolute { position: absolute; }

/* Visibility */
.visible { visibility: visible; }
.invisible { visibility: hidden; }

/* Print */
@media print {
    .navbar, .navbar-toggler, .btn, .modal, footer, .d-print-none { display: none !important; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}
