/* ==========================================================================
   ITAMFY Professional SaaS Design System
   ========================================================================== */

/* CSS Variables - Design Tokens */
:root {
    /* Brand Colors */
    --itamfy-primary: #0F88FF;
    --itamfy-primary-light: #4aa3ff;
    --itamfy-primary-dark: #0868cc;
    --itamfy-accent: #8b5cf6;

    /* Semantic Colors */
    --itamfy-success: #10b981;
    --itamfy-success-light: #34d399;
    --itamfy-warning: #f59e0b;
    --itamfy-warning-light: #fbbf24;
    --itamfy-danger: #ef4444;
    --itamfy-danger-light: #f87171;
    --itamfy-info: #6366f1;
    --itamfy-info-light: #818cf8;

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

    /* Text Colors */
    --text-primary: #160e27;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --text-light: #f1f1f1;

    /* Background Colors */
    --bg-body: #f5f7fa;
    --bg-card: #ffffff;
    --bg-sidebar: linear-gradient(180deg, #1e2024 0%, #16171b 100%);
    --bg-input: #ffffff;
    --bg-hover: rgba(0, 0, 0, 0.04);

    /* Border Colors */
    --border-color: #e5e7eb;
    --border-light: rgba(255, 255, 255, 0.1);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0F88FF 0%, #4aa3ff 100%);
    --gradient-primary-hover: linear-gradient(135deg, #4aa3ff 0%, #0F88FF 100%);
    --gradient-dark: linear-gradient(180deg, #1e2024 0%, #16171b 100%);
    --gradient-card: transparent;
    --gradient-glow: none;

    /* Shadows - Professional Dashboard */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --shadow-glow: none;
    --shadow-glow-strong: none;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.08);

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.25rem;
    --radius-full: 9999px;

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

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --toolbar-height: 64px;

    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-tooltip: 600;
}

/* Dark Mode Variables - Neutral Grey Theme */
body[data-theme="dark"] {
    --text-primary: #f1f1f1;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    --bg-body: #121317;
    --bg-card: #1c1d22;
    --bg-sidebar: linear-gradient(180deg, #18191e 0%, #121317 100%);
    --bg-input: #1c1d22;
    --bg-hover: rgba(255, 255, 255, 0.04);

    --border-color: #2e3038;

    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 2px 8px rgba(0, 0, 0, 0.3);

    --gradient-card: transparent;

    /* Bootstrap overrides */
    --bs-body-bg: var(--bg-body);
    --bs-body-color: var(--text-primary);
    --bs-border-color: var(--border-color);
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-slow), color var(--transition-slow);
}

/* Typography */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

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

p {
    color: var(--text-secondary);
    line-height: 1.7;
}

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

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

/* Selection */
::selection {
    background: rgba(15, 136, 255, 0.2);
    color: inherit;
}

/* ==========================================================================
   Scrollbar
   ========================================================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--itamfy-primary);
}

body[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--gray-800);
}

body[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--gray-600);
}

body[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--itamfy-primary-light);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(15, 136, 255, 0.25);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Primary Button - Clean Professional Style */
.btn-primary {
    background: var(--itamfy-primary);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--itamfy-primary-dark);
    color: #ffffff;
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    background: var(--itamfy-primary-dark);
    color: #ffffff;
}

/* Secondary Button */
.btn-secondary {
    background: var(--gray-100);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

body[data-theme="dark"] .btn-secondary {
    background: var(--gray-800);
    color: var(--text-primary);
    border-color: var(--border-color);
}

body[data-theme="dark"] .btn-secondary:hover {
    background: var(--gray-700);
    border-color: var(--gray-600);
}

/* Outline Primary */
.btn-outline-primary {
    background: transparent;
    color: var(--itamfy-primary);
    border: 1.5px solid var(--itamfy-primary);
}

.btn-outline-primary:hover {
    background: rgba(15, 136, 255, 0.08);
    color: var(--itamfy-primary);
    border-color: var(--itamfy-primary-light);
}

/* Success Button */
.btn-success {
    background: var(--itamfy-success);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.btn-success:hover {
    color: #ffffff;
    background: var(--itamfy-success-light);
}

/* Danger Button */
.btn-danger {
    background: var(--itamfy-danger);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
    color: #ffffff;
    background: var(--itamfy-danger-light);
}

/* Warning Button */
.btn-warning {
    background: var(--itamfy-warning);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.btn-warning:hover {
    color: #ffffff;
    background: var(--itamfy-warning-light);
}

/* Info Button */
.btn-info {
    background: var(--itamfy-info);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.btn-info:hover {
    color: #ffffff;
    background: var(--itamfy-info-light);
}

/* Light Button */
.btn-light {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xs);
}

.btn-light:hover {
    background: var(--gray-50);
    color: var(--text-primary);
    border-color: var(--gray-300);
}

body[data-theme="dark"] .btn-light {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

body[data-theme="dark"] .btn-light:hover {
    background: var(--gray-800);
}

/* Link Button */
.btn-link {
    background: transparent;
    color: var(--text-secondary);
    padding: var(--space-1) var(--space-2);
    border: none;
    box-shadow: none;
    text-decoration: none !important;
}

.btn-link:hover {
    color: var(--itamfy-primary);
    background: var(--bg-hover);
    text-decoration: none !important;
}

.btn-link:focus {
    box-shadow: none;
    text-decoration: none !important;
}

/* Override Bootstrap's default blue link color */
a.btn-link,
button.btn-link {
    color: var(--text-secondary);
    text-decoration: none !important;
}

a.btn-link:hover,
button.btn-link:hover {
    color: var(--itamfy-primary);
    text-decoration: none !important;
}

/* Button Sizes */
.btn-sm {
    padding: var(--space-1) var(--space-3);
    font-size: 0.8125rem;
    border-radius: var(--radius-md);
}

.btn-lg {
    padding: var(--space-3) var(--space-6);
    font-size: 1rem;
    border-radius: var(--radius-xl);
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-base);
    overflow: hidden;
}


.card-header {
    background: var(--gradient-card);
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-4) var(--space-5);
    font-weight: 600;
}

.card-body {
    padding: var(--space-5);
    background: var(--bg-card);
}

.card-footer {
    background: var(--gradient-card);
    border-top: 1px solid var(--border-color);
    padding: var(--space-4) var(--space-5);
}

.card-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
}

/* Stat Cards - Dashboard */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    box-shadow: var(--shadow-card);
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form-control {
    display: block;
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--itamfy-primary);
    box-shadow: 0 0 0 3px rgba(15, 136, 255, 0.1), var(--shadow-sm);
    background-color: var(--bg-card);
}

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

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

body[data-theme="dark"] .form-control {
    background-color: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* Help / description text is too dark against the dark background by default — lighten it. */
body[data-theme="dark"] .form-text {
    color: var(--text-secondary);
}

/* Native file input ("Choose file") is unreadable in dark mode by default — theme it. */
body[data-theme="dark"] input[type="file"] {
    color: var(--text-primary);
}

body[data-theme="dark"] input[type="file"]::file-selector-button {
    background-color: var(--gray-700);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

/* Bootstrap changes the button background when the *input* is hovered (its selector has higher
   specificity via :not():not()), and uses a light colour — override both hover triggers. */
body[data-theme="dark"] input[type="file"]:hover::file-selector-button,
body[data-theme="dark"] input[type="file"]::file-selector-button:hover {
    background-color: var(--gray-600) !important;
    color: var(--text-primary) !important;
}

body[data-theme="dark"] .form-control:focus {
    background-color: var(--bg-card);
    border-color: var(--itamfy-primary-light);
    box-shadow: 0 0 0 3px rgba(74, 163, 255, 0.15), var(--shadow-sm);
}

body[data-theme="dark"] .form-control:disabled {
    background-color: var(--gray-800);
}

/* Form Labels */
.form-label,
label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* Form Select */
.form-select {
    display: block;
    width: 100%;
    padding: var(--space-3) var(--space-8) var(--space-3) var(--space-4);
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-input);
    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='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    background-size: 16px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    appearance: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.form-select:focus {
    outline: none;
    border-color: var(--itamfy-primary);
    box-shadow: 0 0 0 3px rgba(15, 136, 255, 0.1);
}

body[data-theme="dark"] .form-select {
    background-color: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-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='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

/* Checkboxes and Radios */
.form-check-input {
    width: 1.125rem;
    height: 1.125rem;
    margin-top: 0.125rem;
    margin-right: var(--space-2);
    background-color: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(15, 136, 255, 0.15);
    border-color: var(--itamfy-primary);
}

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

.form-check-label {
    font-size: 0.9375rem;
    color: var(--text-primary);
    cursor: pointer;
}

/* Input Groups */
.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

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

.input-group-text {
    display: flex;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    background-color: var(--gray-50);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
}

body[data-theme="dark"] .input-group-text {
    background-color: var(--gray-800);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

/* Floating Labels */
.form-floating > .form-control {
    height: calc(3.5rem + 2px);
    padding: 1rem var(--space-4);
}

.form-floating > label {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 1rem var(--space-4);
    overflow: hidden;
    text-align: start;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
    border: 1px solid transparent;
    transform-origin: 0 0;
    transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    opacity: 0.65;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

/* ==========================================================================
   Tables
   ========================================================================== */

.table {
    width: 100%;
    margin-bottom: var(--space-4);
    color: var(--text-primary);
    border-collapse: separate;
    border-spacing: 0;
}

.table > :not(caption) > * > * {
    padding: var(--space-4);
    color: var(--text-primary);
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
}

.table > thead {
    background: var(--gradient-card);
}

.table > thead > tr > th {
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

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

.table > tbody > tr:hover {
    background-color: var(--bg-hover);
}

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

/* Striped Table */
.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(0, 0, 0, 0.02);
}

body[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Responsive Table */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

.table-responsive > .table {
    margin-bottom: 0;
}

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.badge.bg-primary,
.bg-primary {
    background: var(--itamfy-primary) !important;
    color: #ffffff !important;
}

.badge.bg-success,
.bg-success {
    background: var(--itamfy-success) !important;
    color: #ffffff !important;
}

.badge.bg-danger,
.bg-danger {
    background: var(--itamfy-danger) !important;
    color: #ffffff !important;
}

.badge.bg-warning,
.bg-warning {
    background: var(--itamfy-warning) !important;
    color: #ffffff !important;
}

.badge.bg-info,
.bg-info {
    background: var(--itamfy-info) !important;
    color: #ffffff !important;
}

.badge.bg-secondary,
.bg-secondary {
    background: var(--gray-500) !important;
    color: #ffffff !important;
}

.badge.bg-light,
.bg-light {
    background: var(--gray-100) !important;
    color: var(--text-primary) !important;
}

body[data-theme="dark"] .badge.bg-light,
body[data-theme="dark"] .bg-light {
    background: var(--gray-700) !important;
    color: var(--text-primary) !important;
}

/* ==========================================================================
   Alerts
   ========================================================================== */

.alert {
    position: relative;
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-4);
    border: 1px solid transparent;
    border-radius: var(--radius-xl);
    font-size: 0.9375rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--itamfy-success);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--itamfy-danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
    color: var(--itamfy-warning);
}

.alert-info {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
    color: var(--itamfy-info);
}

body[data-theme="dark"] .alert-success {
    background: rgba(16, 185, 129, 0.12);
    color: var(--itamfy-success-light);
}

body[data-theme="dark"] .alert-danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--itamfy-danger-light);
}

body[data-theme="dark"] .alert-warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--itamfy-warning-light);
}

body[data-theme="dark"] .alert-info {
    background: rgba(99, 102, 241, 0.12);
    color: var(--itamfy-info-light);
}

/* ==========================================================================
   Dropdowns
   ========================================================================== */

.dropdown-menu {
    position: absolute;
    z-index: var(--z-dropdown);
    min-width: 12rem;
    padding: var(--space-2) 0;
    margin: 0;
    font-size: 0.9375rem;
    color: var(--text-primary);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-weight: 400;
    color: var(--text-primary);
    background-color: transparent;
    border: 0;
    transition: all var(--transition-fast);
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: var(--itamfy-primary);
    background-color: var(--bg-hover);
}

.dropdown-divider {
    height: 0;
    margin: var(--space-2) 0;
    overflow: hidden;
    border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   Modals
   ========================================================================== */

.modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
}

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

.modal-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--text-primary);
}

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

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border-color);
    background: var(--gradient-card);
}

.modal-backdrop {
    background-color: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(4px);
}

/* ==========================================================================
   Progress Bars
   ========================================================================== */

.progress {
    height: 0.625rem;
    background-color: var(--gray-100);
    border-radius: var(--radius-full);
    overflow: hidden;
}

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

body[data-theme="dark"] .progress {
    background-color: var(--gray-800);
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
    display: flex;
    gap: var(--space-1);
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 var(--space-3);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.page-link:hover {
    color: var(--itamfy-primary);
    background-color: var(--bg-hover);
    border-color: var(--itamfy-primary);
}

.page-item.active .page-link {
    background: var(--itamfy-primary);
    border-color: var(--itamfy-primary);
    color: #ffffff;
}

.page-item.disabled .page-link {
    color: var(--text-muted);
    background-color: var(--gray-50);
    border-color: var(--border-color);
    cursor: not-allowed;
}

body[data-theme="dark"] .page-link {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body[data-theme="dark"] .page-item.disabled .page-link {
    background-color: var(--gray-800);
}

/* ==========================================================================
   Tabs / Nav Pills
   ========================================================================== */

.nav-tabs {
    display: flex;
    gap: var(--space-1);
    border-bottom: 2px solid var(--border-color);
    margin-bottom: var(--space-4);
}

.nav-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    border-radius: 0;
    transition: all var(--transition-fast);
}

.nav-tabs .nav-link:hover {
    color: var(--itamfy-primary);
    border-bottom-color: rgba(15, 136, 255, 0.3);
}

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

.nav-pills {
    display: flex;
    gap: var(--space-2);
}

.nav-pills .nav-link {
    padding: var(--space-2) var(--space-4);
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.nav-pills .nav-link:hover {
    color: var(--itamfy-primary);
    background: var(--bg-hover);
}

.nav-pills .nav-link.active {
    color: #ffffff;
    background: var(--itamfy-primary);
}

/* ==========================================================================
   Tooltips
   ========================================================================== */

.tooltip {
    z-index: var(--z-tooltip);
}

.tooltip-inner {
    padding: var(--space-2) var(--space-3);
    font-size: 0.8125rem;
    background-color: var(--gray-900);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.tooltip-arrow::before {
    border-top-color: var(--gray-900);
}

/* ==========================================================================
   List Groups
   ========================================================================== */

.list-group {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.list-group-item {
    position: relative;
    display: flex;
    align-items: center;
    padding: var(--space-4) var(--space-5);
    color: var(--text-primary);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-width: 0 1px 1px 1px;
    transition: all var(--transition-fast);
}

.list-group-item:first-child {
    border-top-width: 1px;
    border-top-left-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-xl);
}

.list-group-item:last-child {
    border-bottom-left-radius: var(--radius-xl);
    border-bottom-right-radius: var(--radius-xl);
}

.list-group-item:hover {
    background-color: var(--bg-hover);
}

.list-group-item.active {
    color: #ffffff;
    background: var(--itamfy-primary);
    border-color: var(--itamfy-primary);
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
    background-color: var(--gray-50);
    border-radius: var(--radius-lg);
}

.breadcrumb-item {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.breadcrumb-item + .breadcrumb-item::before {
    padding-right: var(--space-2);
    padding-left: var(--space-2);
    color: var(--text-muted);
    content: "/";
}

.breadcrumb-item a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

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

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

body[data-theme="dark"] .breadcrumb {
    background-color: var(--gray-800);
}

/* ==========================================================================
   Dividers
   ========================================================================== */

hr,
.divider {
    border: none;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--border-color),
        transparent
    );
    margin: var(--space-6) 0;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

/* Text Colors */
.text-primary { color: var(--itamfy-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--itamfy-success) !important; }
.text-danger { color: var(--itamfy-danger) !important; }
.text-warning { color: var(--itamfy-warning) !important; }
.text-info { color: var(--itamfy-info) !important; }

body[data-theme="dark"] .text-primary { color: var(--itamfy-primary-light) !important; }
body[data-theme="dark"] .text-secondary { color: var(--text-secondary) !important; }
body[data-theme="dark"] .text-muted { color: var(--text-muted) !important; }

/* Background Classes */
.bg-body { background-color: var(--bg-body) !important; }
.bg-card { background-color: var(--bg-card) !important; }

/* Border Classes */
.border { border: 1px solid var(--border-color) !important; }
.border-primary { border-color: var(--itamfy-primary) !important; }
.border-radius-lg { border-radius: var(--radius-lg) !important; }
.border-radius-xl { border-radius: var(--radius-xl) !important; }
.border-radius-2xl { border-radius: var(--radius-2xl) !important; }

/* Shadow Classes */
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-glow { box-shadow: var(--shadow-glow) !important; }

/* Text highlight - use primary color instead of gradient */
.text-gradient {
    color: var(--itamfy-primary);
}

/* ==========================================================================
   Animations
   ========================================================================== */

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

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease forwards;
}

.animate-slideIn {
    animation: slideIn 0.3s ease forwards;
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--gray-200) 25%,
        var(--gray-100) 50%,
        var(--gray-200) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

body[data-theme="dark"] .skeleton {
    background: linear-gradient(
        90deg,
        var(--gray-700) 25%,
        var(--gray-800) 50%,
        var(--gray-700) 75%
    );
    background-size: 200% 100%;
}

/* ==========================================================================
   Blazor/Blazorise Specific Overrides
   ========================================================================== */

/* Blazor Error Boundary */
.blazor-error-boundary {
    background: var(--itamfy-danger);
    padding: var(--space-4);
    color: white;
    border-radius: var(--radius-lg);
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* Form Validation */
.valid.modified:not([type=checkbox]) {
    border-color: var(--itamfy-success);
}

.invalid {
    border-color: var(--itamfy-danger);
}

.validation-message {
    color: var(--itamfy-danger);
    font-size: 0.8125rem;
    margin-top: var(--space-1);
}

/* Blazorise Field */
.field,
.fields {
    background-color: transparent !important;
}

.field-label,
.field-help {
    background-color: transparent !important;
}

/* Focus Styles */
.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.btn:focus {
    box-shadow: 0 0 0 3px rgba(15, 136, 255, 0.15);
}

h1:focus {
    outline: none;
}

/* Floating Label Fix */
.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--text-muted);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Content spacing */
.content {
    padding-top: var(--space-4);
}

/* Container utilities */
.container,
.container-fluid {
    background-color: transparent !important;
}

/* Ensure text elements are transparent bg */
body[data-theme="dark"] span,
body[data-theme="dark"] p,
body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4,
body[data-theme="dark"] h5,
body[data-theme="dark"] h6,
body[data-theme="dark"] strong,
body[data-theme="dark"] em,
body[data-theme="dark"] small,
body[data-theme="dark"] label {
    background-color: transparent !important;
}

/* ==========================================================================
   Info & Warning Banners (Reusable)
   ========================================================================== */

/* Info Banner - Primary/Info color theme */
.info-banner {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-5);
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-left: 4px solid rgba(99, 102, 241, 0.8);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
}

.info-banner .b-icon,
.info-banner svg,
.info-banner i {
    color: rgba(99, 102, 241, 0.9);
    flex-shrink: 0;
}

body[data-theme="dark"] .info-banner {
    background: rgba(99, 102, 241, 0.06);
    border-color: rgba(99, 102, 241, 0.2);
    border-left-color: rgba(99, 102, 241, 0.6);
}

/* Warning Banner - Amber color theme */
.warning-banner {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-5);
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-left: 4px solid rgba(245, 158, 11, 0.8);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
}

.warning-banner .b-icon,
.warning-banner svg,
.warning-banner i {
    color: rgba(245, 158, 11, 0.9);
    flex-shrink: 0;
}

body[data-theme="dark"] .warning-banner {
    background: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.2);
    border-left-color: rgba(245, 158, 11, 0.6);
}

/* Success Banner - Green color theme */
.success-banner {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-5);
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-left: 4px solid rgba(16, 185, 129, 0.8);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
}

.success-banner .b-icon,
.success-banner svg,
.success-banner i {
    color: rgba(16, 185, 129, 0.9);
    flex-shrink: 0;
}

body[data-theme="dark"] .success-banner {
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.2);
    border-left-color: rgba(16, 185, 129, 0.6);
}

.danger-banner {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-5);
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-left: 4px solid rgba(239, 68, 68, 0.8);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
}

.danger-banner .b-icon,
.danger-banner svg,
.danger-banner i {
    color: rgba(239, 68, 68, 0.9);
    flex-shrink: 0;
}

body[data-theme="dark"] .danger-banner {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.2);
    border-left-color: rgba(239, 68, 68, 0.6);
}

/* CardTitle consistent styling */
.card-header .card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .btn {
        padding: var(--space-2) var(--space-3);
    }

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

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

@media (max-width: 576px) {
    .btn-lg {
        padding: var(--space-2) var(--space-4);
        font-size: 0.9375rem;
    }
}

/* ==========================================================================
   Mobile Responsive (480px and below)
   ========================================================================== */

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }

    .btn {
        padding: var(--space-1) var(--space-2);
        font-size: 0.8125rem;
    }

    .btn-lg {
        padding: var(--space-2) var(--space-3);
        font-size: 0.875rem;
    }

    .card-body {
        padding: var(--space-3);
    }

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

    .modal-header {
        padding: var(--space-3) var(--space-4);
    }

    .modal-footer {
        padding: var(--space-3) var(--space-4);
        flex-wrap: wrap;
    }
}
