/* ============================================
   DARK MODE BOOTSTRAP STYLESHEET
   Comprehensive dark-mode-first design system
   Reusable across projects
   ============================================ */

:root {
    /* ========== BOOTSTRAP OVERRIDES ========== */
    --bs-body-bg: #0f172a;
    --bs-body-color: #e2e8f0;
    --bs-border-color: #2d3a4e;
    --bs-border-color-translucent: rgba(255, 255, 255, 0.08);
    --bs-card-border-color: #2d3a4e;
    --bs-card-bg: #1e293b;
    --bs-secondary-bg: #1e293b;
    --bs-tertiary-bg: #283548;

    /* ========== BACKGROUNDS & SURFACES ========== */
    --bg-body: #0f172a;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #283548;
    --bg-quaternary: #334155;
    --bg-input: #1e293b;
    --bg-hover: #283548;
    --bg-active: #334155;
    --bg-disabled: #0c1322;
    --bg-overlay: rgba(0, 0, 0, 0.5);
    --bg-backdrop: rgba(0, 0, 0, 0.75);

    /* ========== TYPOGRAPHY COLORS ========== */
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-disabled: #475569;
    --text-inverse: #0f172a;
    --text-link: #60a5fa;
    --text-link-hover: #93c5fd;

    /* ========== THEME COLORS ========== */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-active: #1e40af;
    --primary-subtle: rgba(37, 99, 235, 0.15);
    --primary-border-subtle: rgba(37, 99, 235, 0.4);

    --accent: #7c3aed;
    --accent-hover: #6d28d9;
    --accent-subtle: rgba(124, 58, 237, 0.15);

    --secondary: #64748b;
    --secondary-hover: #475569;
    --secondary-active: #334155;
    --secondary-subtle: rgba(100, 116, 139, 0.15);
    --secondary-border-subtle: rgba(100, 116, 139, 0.4);

    --success: #10b981;
    --success-hover: #059669;
    --success-active: #047857;
    --success-subtle: rgba(16, 185, 129, 0.15);
    --success-border-subtle: rgba(16, 185, 129, 0.4);

    --warning: #f59e0b;
    --warning-hover: #fbbf24;
    --warning-active: #f59e0b;
    --warning-subtle: rgba(245, 158, 11, 0.15);
    --warning-border-subtle: rgba(245, 158, 11, 0.4);
    --warning-text: #0f172a;

    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-active: #b91c1c;
    --danger-subtle: rgba(239, 68, 68, 0.15);
    --danger-border-subtle: rgba(239, 68, 68, 0.4);

    --info: #06b6d4;
    --info-hover: #22d3ee;
    --info-active: #67e8f9;
    --info-subtle: rgba(6, 182, 212, 0.15);
    --info-border-subtle: rgba(6, 182, 212, 0.4);
    --info-text: #0f172a;

    --light: #f1f5f9;
    --light-hover: #f8fafc;
    --light-active: #f8fafc;
    --light-subtle: rgba(241, 245, 249, 0.1);

    --dark: #0f172a;
    --dark-hover: #0c1322;
    --dark-active: #0a0f1d;
    --dark-subtle: rgba(15, 23, 42, 0.5);

    /* ========== BORDERS ========== */
    --border-color: #2d3a4e;
    --border-subtle: #1e293b;
    --border-muted: #3b4c63;
    --border-strong: #475569;
    --border-radius: 0.375rem;
    --border-radius-sm: 0.25rem;
    --border-radius-lg: 0.5rem;
    --border-radius-xl: 1rem;
    --border-radius-pill: 50rem;

    /* ========== SHADOWS ========== */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.3);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.5);
    --shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.3);

    /* ========== FOCUS STATES ========== */
    --focus-ring-color: rgba(37, 99, 235, 0.5);
    --focus-ring-width: 0.25rem;

    /* ========== TRANSITIONS ========== */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* ========== Z-INDEX LAYERS ========== */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;

    /* ========== SPACING ========== */
    --spacer: 1rem;

    /* ========== LAYOUT ========== */
    --sidebar-width: 260px;
    --sidebar-minimized: 70px;
    --navbar-height: 56px;
}

/* ============================================
   BASE STYLES
   ============================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

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

.display-1 { font-size: 5rem; font-weight: 300; line-height: 1.2; }
.display-2 { font-size: 4.5rem; font-weight: 300; line-height: 1.2; }
.display-3 { font-size: 4rem; font-weight: 300; line-height: 1.2; }
.display-4 { font-size: 3.5rem; font-weight: 300; line-height: 1.2; }
.display-5 { font-size: 3rem; font-weight: 300; line-height: 1.2; }
.display-6 { font-size: 2.5rem; font-weight: 300; line-height: 1.2; }

p {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.lead {
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--text-secondary);
}

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

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

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

mark, .mark {
    background-color: var(--warning-subtle);
    color: var(--text-primary);
    padding: 0.1em 0.2em;
}

del, s {
    color: var(--text-muted);
}

u, ins {
    text-decoration-color: var(--primary);
}

strong, b {
    font-weight: 600;
}

em, i {
    font-style: italic;
}

blockquote {
    margin: 0 0 1rem;
    padding: 0.5rem 1rem;
    border-left: 4px solid var(--primary);
    background-color: var(--bg-secondary);
}

blockquote p:last-child {
    margin-bottom: 0;
}

.blockquote {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.blockquote-footer {
    color: var(--text-muted);
    font-size: 0.875em;
}

.blockquote-footer::before {
    content: "\2014\00A0";
}

code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.875em;
    color: #e685b5;
    background-color: var(--bg-tertiary);
    padding: 0.125rem 0.375rem;
    border-radius: var(--border-radius-sm);
}

pre {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.875em;
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin-bottom: 1rem;
}

pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
}

kbd {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.875em;
    color: var(--text-primary);
    background-color: var(--bg-quaternary);
    padding: 0.125rem 0.375rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

abbr[title] {
    text-decoration: underline dotted;
    cursor: help;
    border-bottom: none;
}

/* Links */
a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--text-link-hover);
    text-decoration: underline;
}

a:focus {
    outline: none;
    box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color);
    border-radius: var(--border-radius-sm);
}

/* Lists */
ul, ol {
    margin-top: 0;
    margin-bottom: 1rem;
    padding-left: 2rem;
}

ul ul, ul ol, ol ul, ol ol {
    margin-bottom: 0;
}

li {
    color: var(--text-primary);
}

.list-unstyled {
    padding-left: 0;
    list-style: none;
}

.list-inline {
    padding-left: 0;
    list-style: none;
}

.list-inline-item {
    display: inline-block;
}

.list-inline-item:not(:last-child) {
    margin-right: 0.5rem;
}

dl {
    margin-top: 0;
    margin-bottom: 1rem;
}

dt {
    font-weight: 600;
    color: var(--text-primary);
}

dd {
    margin-bottom: 0.5rem;
    margin-left: 0;
    color: var(--text-secondary);
}

/* Horizontal Rules */
hr {
    margin: 1rem 0;
    color: var(--border-color);
    background-color: currentColor;
    border: 0;
    opacity: 1;
}

hr:not([size]) {
    height: 1px;
}

/* Selection */
::selection {
    background-color: var(--primary);
    color: white;
}

::-moz-selection {
    background-color: var(--primary);
    color: white;
}

/* Figure */
figure {
    margin: 0 0 1rem;
}

figcaption {
    font-size: 0.875em;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
}

.img-fluid {
    max-width: 100%;
    height: auto;
}

.img-thumbnail {
    padding: 0.25rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    max-width: 100%;
    height: auto;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    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;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    border-radius: var(--border-radius);
    transition: color var(--transition-fast), background-color var(--transition-fast),
                border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.btn:focus,
.btn:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color);
}

.btn:disabled,
.btn.disabled {
    pointer-events: none;
    opacity: 0.65;
}

/* Button Sizes */
.btn-lg {
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    border-radius: var(--border-radius-lg);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: var(--border-radius-sm);
}

/* Primary Button */
.btn-primary {
    color: #fff;
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    color: #fff;
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-primary:focus,
.btn-primary:focus-visible {
    color: #fff;
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 0 0 var(--focus-ring-width) rgba(37, 99, 235, 0.5);
}

.btn-primary:active,
.btn-primary.active {
    color: #fff;
    background-color: var(--primary-active);
    border-color: var(--primary-active);
}

/* Secondary Button */
.btn-secondary {
    color: #fff;
    background-color: var(--secondary);
    border-color: var(--secondary);
}

.btn-secondary:hover {
    color: #fff;
    background-color: var(--secondary-hover);
    border-color: var(--secondary-hover);
}

.btn-secondary:focus,
.btn-secondary:focus-visible {
    color: #fff;
    background-color: var(--secondary-hover);
    border-color: var(--secondary-hover);
    box-shadow: 0 0 0 var(--focus-ring-width) rgba(100, 116, 139, 0.5);
}

.btn-secondary:active,
.btn-secondary.active {
    color: #fff;
    background-color: var(--secondary-active);
    border-color: var(--secondary-active);
}

/* Success Button */
.btn-success {
    color: #fff;
    background-color: var(--success);
    border-color: var(--success);
}

.btn-success:hover {
    color: #fff;
    background-color: var(--success-hover);
    border-color: var(--success-hover);
}

.btn-success:focus,
.btn-success:focus-visible {
    color: #fff;
    background-color: var(--success-hover);
    border-color: var(--success-hover);
    box-shadow: 0 0 0 var(--focus-ring-width) rgba(16, 185, 129, 0.5);
}

.btn-success:active,
.btn-success.active {
    color: #fff;
    background-color: var(--success-active);
    border-color: var(--success-active);
}

/* Danger Button */
.btn-danger {
    color: #fff;
    background-color: var(--danger);
    border-color: var(--danger);
}

.btn-danger:hover {
    color: #fff;
    background-color: var(--danger-hover);
    border-color: var(--danger-hover);
}

.btn-danger:focus,
.btn-danger:focus-visible {
    color: #fff;
    background-color: var(--danger-hover);
    border-color: var(--danger-hover);
    box-shadow: 0 0 0 var(--focus-ring-width) rgba(239, 68, 68, 0.5);
}

.btn-danger:active,
.btn-danger.active {
    color: #fff;
    background-color: var(--danger-active);
    border-color: var(--danger-active);
}

/* Warning Button */
.btn-warning {
    color: var(--warning-text);
    background-color: var(--warning);
    border-color: var(--warning);
}

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

.btn-warning:focus,
.btn-warning:focus-visible {
    color: var(--warning-text);
    background-color: var(--warning-hover);
    border-color: var(--warning-hover);
    box-shadow: 0 0 0 var(--focus-ring-width) rgba(245, 158, 11, 0.5);
}

.btn-warning:active,
.btn-warning.active {
    color: var(--warning-text);
    background-color: var(--warning-active);
    border-color: var(--warning-active);
}

/* Info Button */
.btn-info {
    color: var(--info-text);
    background-color: var(--info);
    border-color: var(--info);
}

.btn-info:hover {
    color: var(--info-text);
    background-color: var(--info-hover);
    border-color: var(--info-hover);
}

.btn-info:focus,
.btn-info:focus-visible {
    color: var(--info-text);
    background-color: var(--info-hover);
    border-color: var(--info-hover);
    box-shadow: 0 0 0 var(--focus-ring-width) rgba(6, 182, 212, 0.5);
}

.btn-info:active,
.btn-info.active {
    color: var(--info-text);
    background-color: var(--info-active);
    border-color: var(--info-active);
}

/* Light Button */
.btn-light {
    color: var(--text-inverse);
    background-color: var(--light);
    border-color: var(--light);
}

.btn-light:hover {
    color: var(--text-inverse);
    background-color: #e2e6ea;
    border-color: #dae0e5;
}

.btn-light:focus,
.btn-light:focus-visible {
    color: var(--text-inverse);
    background-color: #e2e6ea;
    border-color: #dae0e5;
    box-shadow: 0 0 0 var(--focus-ring-width) rgba(248, 249, 250, 0.5);
}

/* Dark Button */
.btn-dark {
    color: #fff;
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
}

.btn-dark:hover {
    color: #fff;
    background-color: var(--bg-quaternary);
    border-color: var(--border-muted);
}

.btn-dark:focus,
.btn-dark:focus-visible {
    color: #fff;
    background-color: var(--bg-quaternary);
    border-color: var(--border-muted);
    box-shadow: 0 0 0 var(--focus-ring-width) rgba(66, 70, 73, 0.5);
}

/* Link Button */
.btn-link {
    font-weight: 400;
    color: var(--text-link);
    background-color: transparent;
    border-color: transparent;
    text-decoration: none;
}

.btn-link:hover {
    color: var(--text-link-hover);
    text-decoration: underline;
}

.btn-link:focus,
.btn-link:focus-visible {
    text-decoration: underline;
    box-shadow: none;
}

.btn-link:disabled,
.btn-link.disabled {
    color: var(--text-disabled);
}

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

.btn-outline-primary:hover {
    color: #fff;
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:focus,
.btn-outline-primary:focus-visible {
    box-shadow: 0 0 0 var(--focus-ring-width) rgba(37, 99, 235, 0.5);
}

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

.btn-outline-secondary:hover {
    color: #fff;
    background-color: var(--secondary);
    border-color: var(--secondary);
}

.btn-outline-secondary:focus,
.btn-outline-secondary:focus-visible {
    box-shadow: 0 0 0 var(--focus-ring-width) rgba(100, 116, 139, 0.5);
}

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

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

.btn-outline-success:focus,
.btn-outline-success:focus-visible {
    box-shadow: 0 0 0 var(--focus-ring-width) rgba(16, 185, 129, 0.5);
}

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

.btn-outline-danger:hover {
    color: #fff;
    background-color: var(--danger);
    border-color: var(--danger);
}

.btn-outline-danger:focus,
.btn-outline-danger:focus-visible {
    box-shadow: 0 0 0 var(--focus-ring-width) rgba(239, 68, 68, 0.5);
}

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

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

.btn-outline-warning:focus,
.btn-outline-warning:focus-visible {
    box-shadow: 0 0 0 var(--focus-ring-width) rgba(245, 158, 11, 0.5);
}

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

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

.btn-outline-info:focus,
.btn-outline-info:focus-visible {
    box-shadow: 0 0 0 var(--focus-ring-width) rgba(6, 182, 212, 0.5);
}

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

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

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

.btn-outline-dark:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
}

/* Button Group */
.btn-group,
.btn-group-vertical {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
}

.btn-group > .btn,
.btn-group-vertical > .btn {
    position: relative;
    flex: 1 1 auto;
}

.btn-group > .btn:not(:first-child),
.btn-group > .btn-group:not(:first-child) {
    margin-left: -1px;
}

.btn-group > .btn:not(:last-child):not(.dropdown-toggle),
.btn-group > .btn-group:not(:last-child) > .btn {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.btn-group > .btn:nth-child(n+3),
.btn-group > :not(.btn-check) + .btn,
.btn-group > .btn-group:not(:first-child) > .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Close Button */
.btn-close {
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: 0.25em 0.25em;
    color: var(--text-primary);
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23e0e0e0'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border: 0;
    border-radius: var(--border-radius);
    opacity: 0.5;
    cursor: pointer;
}

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

.btn-close:focus {
    outline: 0;
    box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color);
    opacity: 1;
}

.btn-close:disabled,
.btn-close.disabled {
    pointer-events: none;
    user-select: none;
    opacity: 0.25;
}

.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ============================================
   FORM CONTROLS (Dark theme)
   ============================================ */

/* Base Form Controls */
.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-input);
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    appearance: none;
    border-radius: var(--border-radius);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    color: var(--text-primary);
    background-color: var(--bg-input);
    border-color: var(--primary);
    outline: 0;
    box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color);
}

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

.form-control:disabled,
.form-control[readonly] {
    background-color: var(--bg-disabled);
    opacity: 1;
    cursor: not-allowed;
}

/* Form Control Sizes */
.form-control-lg {
    min-height: calc(1.5em + 1rem + 2px);
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    border-radius: var(--border-radius-lg);
}

.form-control-sm {
    min-height: calc(1.5em + 0.5rem + 2px);
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: var(--border-radius-sm);
}

/* Form Control Plaintext */
.form-control-plaintext {
    display: block;
    width: 100%;
    padding: 0.375rem 0;
    margin-bottom: 0;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: transparent;
    border: solid transparent;
    border-width: 1px 0;
}

/* Form Select */
.form-select {
    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='%23aaaaaa' 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 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.25rem;
}

.form-select:disabled {
    background-color: var(--bg-disabled);
    cursor: not-allowed;
}

.form-select-lg {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    padding-left: 1rem;
    font-size: 1.25rem;
    border-radius: var(--border-radius-lg);
}

.form-select-sm {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    padding-left: 0.5rem;
    font-size: 0.875rem;
    border-radius: var(--border-radius-sm);
}

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

.col-form-label {
    padding-top: calc(0.375rem + 1px);
    padding-bottom: calc(0.375rem + 1px);
    margin-bottom: 0;
    font-size: inherit;
    line-height: 1.5;
    color: var(--text-secondary);
}

.col-form-label-lg {
    padding-top: calc(0.5rem + 1px);
    padding-bottom: calc(0.5rem + 1px);
    font-size: 1.25rem;
}

.col-form-label-sm {
    padding-top: calc(0.25rem + 1px);
    padding-bottom: calc(0.25rem + 1px);
    font-size: 0.875rem;
}

/* Form Text */
.form-text {
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: var(--text-muted);
}

/* Checkboxes & Radios */
.form-check {
    display: block;
    min-height: 1.5rem;
    padding-left: 1.5em;
    margin-bottom: 0.125rem;
}

.form-check-input {
    width: 1em;
    height: 1em;
    margin-top: 0.25em;
    margin-left: -1.5em;
    vertical-align: top;
    background-color: var(--bg-input);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    border: 1px solid var(--border-muted);
    appearance: none;
    cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-check-input[type="checkbox"] {
    border-radius: 0.25em;
}

.form-check-input[type="radio"] {
    border-radius: 50%;
}

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

.form-check-input:checked[type="checkbox"] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

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

.form-check-input:focus {
    border-color: var(--primary);
    outline: 0;
    box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color);
}

.form-check-input:disabled {
    pointer-events: none;
    filter: none;
    opacity: 0.5;
}

.form-check-input:disabled ~ .form-check-label {
    cursor: default;
    opacity: 0.5;
}

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

/* Switch */
.form-switch {
    padding-left: 2.5em;
}

.form-switch .form-check-input {
    width: 2em;
    margin-left: -2.5em;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23888888'/%3e%3c/svg%3e");
    background-position: left center;
    border-radius: 2em;
    transition: background-position var(--transition-fast);
}

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

/* Inline Form Check */
.form-check-inline {
    display: inline-block;
    margin-right: 1rem;
}

/* Range Input */
.form-range {
    width: 100%;
    height: 1.5rem;
    padding: 0;
    background-color: transparent;
    appearance: none;
}

.form-range:focus {
    outline: 0;
}

.form-range:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 1px var(--bg-body), 0 0 0 var(--focus-ring-width) var(--focus-ring-color);
}

.form-range::-webkit-slider-thumb {
    width: 1rem;
    height: 1rem;
    margin-top: -0.25rem;
    background-color: var(--primary);
    border: 0;
    border-radius: 1rem;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    appearance: none;
}

.form-range::-webkit-slider-thumb:hover {
    background-color: var(--primary-hover);
}

.form-range::-webkit-slider-runnable-track {
    width: 100%;
    height: 0.5rem;
    color: transparent;
    cursor: pointer;
    background-color: var(--bg-tertiary);
    border-color: transparent;
    border-radius: 1rem;
}

.form-range::-moz-range-thumb {
    width: 1rem;
    height: 1rem;
    background-color: var(--primary);
    border: 0;
    border-radius: 1rem;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    appearance: none;
}

.form-range::-moz-range-thumb:hover {
    background-color: var(--primary-hover);
}

.form-range::-moz-range-track {
    width: 100%;
    height: 0.5rem;
    color: transparent;
    cursor: pointer;
    background-color: var(--bg-tertiary);
    border-color: transparent;
    border-radius: 1rem;
}

.form-range:disabled {
    pointer-events: none;
}

.form-range:disabled::-webkit-slider-thumb {
    background-color: var(--text-muted);
}

.form-range:disabled::-moz-range-thumb {
    background-color: var(--text-muted);
}

/* Floating Labels */
.form-floating {
    position: relative;
}

.form-floating > .form-control,
.form-floating > .form-control-plaintext,
.form-floating > .form-select {
    height: calc(3.5rem + 2px);
    line-height: 1.25;
}

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

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

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

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

.input-group > .form-control:focus,
.input-group > .form-select:focus,
.input-group > .form-floating:focus-within {
    z-index: 5;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.input-group:not(.has-validation) > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating),
.input-group:not(.has-validation) > .dropdown-toggle:nth-last-child(n+3),
.input-group:not(.has-validation) > .form-floating:not(:last-child) > .form-control,
.input-group:not(.has-validation) > .form-floating:not(:last-child) > .form-select {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    margin-left: -1px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group-lg > .form-control,
.input-group-lg > .form-select,
.input-group-lg > .input-group-text,
.input-group-lg > .btn {
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    border-radius: var(--border-radius-lg);
}

.input-group-sm > .form-control,
.input-group-sm > .form-select,
.input-group-sm > .input-group-text,
.input-group-sm > .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: var(--border-radius-sm);
}

/* Validation States */
.was-validated .form-control:valid,
.form-control.is-valid {
    border-color: var(--success);
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.was-validated .form-control:valid:focus,
.form-control.is-valid:focus {
    border-color: var(--success);
    box-shadow: 0 0 0 var(--focus-ring-width) rgba(16, 185, 129, 0.25);
}

.was-validated .form-control:invalid,
.form-control.is-invalid {
    border-color: var(--danger);
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.was-validated .form-control:invalid:focus,
.form-control.is-invalid:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 var(--focus-ring-width) rgba(239, 68, 68, 0.25);
}

.valid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: var(--success);
}

.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: var(--danger);
}

.was-validated :valid ~ .valid-feedback,
.is-valid ~ .valid-feedback {
    display: block;
}

.was-validated :invalid ~ .invalid-feedback,
.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Textarea */
textarea.form-control {
    min-height: calc(1.5em + 0.75rem + 2px);
}

textarea.form-control-lg {
    min-height: calc(1.5em + 1rem + 2px);
}

textarea.form-control-sm {
    min-height: calc(1.5em + 0.5rem + 2px);
}

/* Color Input */
.form-control-color {
    width: 3rem;
    height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem;
}

.form-control-color:not(:disabled):not([readonly]) {
    cursor: pointer;
}

.form-control-color::-moz-color-swatch {
    border: 0;
    border-radius: var(--border-radius);
}

.form-control-color::-webkit-color-swatch {
    border: 0;
    border-radius: var(--border-radius);
}

/* ============================================
   TABLES (Dark theme)
   ============================================ */

.table {
    --bs-table-bg: transparent;
    --bs-table-accent-bg: transparent;
    --bs-table-striped-color: var(--text-primary);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
    --bs-table-active-color: var(--text-primary);
    --bs-table-active-bg: rgba(255, 255, 255, 0.05);
    --bs-table-hover-color: var(--text-primary);
    --bs-table-hover-bg: var(--bg-hover);
    width: 100%;
    margin-bottom: 1rem;
    color: var(--text-primary);
    vertical-align: top;
    border-color: var(--border-color);
}

.table > :not(caption) > * > * {
    padding: 0.5rem 0.5rem;
    background-color: var(--bs-table-bg);
    border-bottom-width: 1px;
    box-shadow: inset 0 0 0 9999px var(--bs-table-accent-bg);
}

.table > tbody {
    vertical-align: inherit;
}

.table > thead {
    vertical-align: bottom;
    background-color: var(--bg-tertiary);
}

.table > thead > tr > th {
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 0.75rem 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.table > tbody > tr {
    border-color: var(--border-color);
}

.table > tbody > tr > td {
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* Caption */
.table caption {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    color: var(--text-muted);
    text-align: left;
}

/* Table Bordered */
.table-bordered {
    border: 1px solid var(--border-color);
}

.table-bordered > :not(caption) > * {
    border-width: 1px 0;
}

.table-bordered > :not(caption) > * > * {
    border-width: 0 1px;
}

/* Table Borderless */
.table-borderless > :not(caption) > * > * {
    border-bottom-width: 0;
}

.table-borderless > :not(:first-child) {
    border-top-width: 0;
}

/* Table Striped */
.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: var(--bs-table-striped-bg);
    color: var(--bs-table-striped-color);
}

.table-striped-columns > :not(caption) > tr > :nth-child(even) {
    --bs-table-accent-bg: var(--bs-table-striped-bg);
    color: var(--bs-table-striped-color);
}

/* Table Active */
.table-active {
    --bs-table-accent-bg: var(--bs-table-active-bg);
    color: var(--bs-table-active-color);
}

/* Table Hover */
.table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: var(--bs-table-hover-bg);
    color: var(--bs-table-hover-color);
}

/* Table Primary */
.table-primary {
    --bs-table-bg: var(--primary-subtle);
    --bs-table-border-color: var(--primary-border-subtle);
    color: var(--text-primary);
}

/* Table Secondary */
.table-secondary {
    --bs-table-bg: var(--secondary-subtle);
    --bs-table-border-color: var(--secondary-border-subtle);
    color: var(--text-primary);
}

/* Table Success */
.table-success {
    --bs-table-bg: var(--success-subtle);
    --bs-table-border-color: var(--success-border-subtle);
    color: var(--text-primary);
}

/* Table Danger */
.table-danger {
    --bs-table-bg: var(--danger-subtle);
    --bs-table-border-color: var(--danger-border-subtle);
    color: var(--text-primary);
}

/* Table Warning */
.table-warning {
    --bs-table-bg: var(--warning-subtle);
    --bs-table-border-color: var(--warning-border-subtle);
    color: var(--text-primary);
}

/* Table Info */
.table-info {
    --bs-table-bg: var(--info-subtle);
    --bs-table-border-color: var(--info-border-subtle);
    color: var(--text-primary);
}

/* Table Light */
.table-light {
    --bs-table-bg: var(--light-subtle);
    --bs-table-border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Table Dark */
.table-dark {
    --bs-table-bg: var(--bg-tertiary);
    --bs-table-border-color: var(--border-color);
    color: var(--text-primary);
}

/* Table Responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive-sm,
.table-responsive-md,
.table-responsive-lg,
.table-responsive-xl,
.table-responsive-xxl {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Table Small */
.table-sm > :not(caption) > * > * {
    padding: 0.25rem 0.25rem;
}

/* Table Group Divider */
.table-group-divider {
    border-top: 2px solid var(--border-strong);
}

/* ============================================
   CARDS (Dark theme)
   ============================================ */

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: var(--bg-secondary);
    background-clip: border-box;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.card > hr {
    margin-right: 0;
    margin-left: 0;
}

.card-body {
    flex: 1 1 auto;
    padding: 1rem 1rem;
    color: var(--text-primary);
}

.card-title {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.card-subtitle {
    margin-top: -0.25rem;
    margin-bottom: 0;
    color: var(--text-secondary);
}

.card-text {
    color: var(--text-primary);
}

.card-text:last-child {
    margin-bottom: 0;
}

.card-link {
    color: var(--text-link);
}

.card-link:hover {
    color: var(--text-link-hover);
}

.card-link + .card-link {
    margin-left: 1rem;
}

.card-header {
    padding: 0.75rem 1rem;
    margin-bottom: 0;
    background-color: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.card-header:first-child {
    border-radius: calc(var(--border-radius) - 1px) calc(var(--border-radius) - 1px) 0 0;
}

.card-footer {
    padding: 0.75rem 1rem;
    background-color: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.card-footer:last-child {
    border-radius: 0 0 calc(var(--border-radius) - 1px) calc(var(--border-radius) - 1px);
}

.card-header-tabs {
    margin-right: -0.5rem;
    margin-bottom: -0.75rem;
    margin-left: -0.5rem;
    border-bottom: 0;
}

.card-header-pills {
    margin-right: -0.5rem;
    margin-left: -0.5rem;
}

.card-img-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 1rem;
    border-radius: calc(var(--border-radius) - 1px);
}

.card-img,
.card-img-top,
.card-img-bottom {
    width: 100%;
}

.card-img-top {
    border-top-left-radius: calc(var(--border-radius) - 1px);
    border-top-right-radius: calc(var(--border-radius) - 1px);
}

.card-img-bottom {
    border-bottom-right-radius: calc(var(--border-radius) - 1px);
    border-bottom-left-radius: calc(var(--border-radius) - 1px);
}

/* Card Group */
.card-group {
    display: flex;
    flex-direction: column;
}

.card-group > .card {
    margin-bottom: 0.75rem;
}

@media (min-width: 576px) {
    .card-group {
        flex-flow: row wrap;
    }
    .card-group > .card {
        flex: 1 0 0%;
        margin-bottom: 0;
    }
    .card-group > .card + .card {
        margin-left: 0;
        border-left: 0;
    }
    .card-group > .card:not(:last-child) {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }
    .card-group > .card:not(:first-child) {
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
    }
}

/* ============================================
   LIST GROUPS
   ============================================ */

.list-group {
    display: flex;
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 0;
    border-radius: var(--border-radius);
}

.list-group-numbered {
    list-style-type: none;
    counter-reset: section;
}

.list-group-numbered > .list-group-item::before {
    content: counters(section, ".") ". ";
    counter-increment: section;
}

.list-group-item {
    position: relative;
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.list-group-item:first-child {
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
}

.list-group-item:last-child {
    border-bottom-right-radius: inherit;
    border-bottom-left-radius: inherit;
}

.list-group-item:disabled,
.list-group-item.disabled {
    color: var(--text-disabled);
    pointer-events: none;
    background-color: var(--bg-disabled);
}

.list-group-item.active {
    z-index: 2;
    color: #fff;
    background-color: var(--primary);
    border-color: var(--primary);
}

.list-group-item + .list-group-item {
    border-top-width: 0;
}

.list-group-item + .list-group-item.active {
    margin-top: -1px;
    border-top-width: 1px;
}

/* List Group Horizontal */
.list-group-horizontal {
    flex-direction: row;
}

.list-group-horizontal > .list-group-item:first-child:not(:last-child) {
    border-bottom-left-radius: var(--border-radius);
    border-top-right-radius: 0;
}

.list-group-horizontal > .list-group-item:last-child:not(:first-child) {
    border-top-right-radius: var(--border-radius);
    border-bottom-left-radius: 0;
}

.list-group-horizontal > .list-group-item + .list-group-item {
    border-top-width: 1px;
    border-left-width: 0;
}

/* List Group Flush */
.list-group-flush {
    border-radius: 0;
}

.list-group-flush > .list-group-item {
    border-width: 0 0 1px;
}

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

/* List Group Item Action */
.list-group-item-action {
    width: 100%;
    color: var(--text-secondary);
    text-align: inherit;
    cursor: pointer;
}

.list-group-item-action:hover,
.list-group-item-action:focus {
    z-index: 1;
    color: var(--text-primary);
    text-decoration: none;
    background-color: var(--bg-hover);
}

.list-group-item-action:active {
    color: var(--text-primary);
    background-color: var(--bg-active);
}

/* List Group Contextual Variants */
.list-group-item-primary {
    color: var(--primary);
    background-color: var(--primary-subtle);
}

.list-group-item-primary.list-group-item-action:hover,
.list-group-item-primary.list-group-item-action:focus {
    color: var(--primary);
    background-color: rgba(37, 99, 235, 0.25);
}

.list-group-item-secondary {
    color: var(--text-secondary);
    background-color: var(--secondary-subtle);
}

.list-group-item-secondary.list-group-item-action:hover,
.list-group-item-secondary.list-group-item-action:focus {
    color: var(--text-secondary);
    background-color: rgba(100, 116, 139, 0.25);
}

.list-group-item-success {
    color: var(--success);
    background-color: var(--success-subtle);
}

.list-group-item-success.list-group-item-action:hover,
.list-group-item-success.list-group-item-action:focus {
    color: var(--success);
    background-color: rgba(16, 185, 129, 0.25);
}

.list-group-item-danger {
    color: var(--danger);
    background-color: var(--danger-subtle);
}

.list-group-item-danger.list-group-item-action:hover,
.list-group-item-danger.list-group-item-action:focus {
    color: var(--danger);
    background-color: rgba(239, 68, 68, 0.25);
}

.list-group-item-warning {
    color: var(--warning);
    background-color: var(--warning-subtle);
}

.list-group-item-warning.list-group-item-action:hover,
.list-group-item-warning.list-group-item-action:focus {
    color: var(--warning);
    background-color: rgba(245, 158, 11, 0.25);
}

.list-group-item-info {
    color: var(--info);
    background-color: var(--info-subtle);
}

.list-group-item-info.list-group-item-action:hover,
.list-group-item-info.list-group-item-action:focus {
    color: var(--info);
    background-color: rgba(6, 182, 212, 0.25);
}

.list-group-item-light {
    color: var(--text-secondary);
    background-color: var(--light-subtle);
}

.list-group-item-dark {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

/* ============================================
   MODALS
   ============================================ */

.modal {
    --bs-modal-bg: var(--bg-secondary);
    --bs-modal-border-color: var(--border-color);
    --bs-modal-header-border-color: var(--border-color);
    --bs-modal-footer-border-color: var(--border-color);
}

.modal-backdrop {
    background-color: #000;
}

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

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

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

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

.modal-title {
    margin-bottom: 0;
    line-height: 1.5;
    color: var(--text-primary);
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1rem;
    color: var(--text-primary);
}

.modal-footer {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    padding: 0.75rem;
    background-color: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    border-bottom-right-radius: calc(var(--border-radius-lg) - 1px);
    border-bottom-left-radius: calc(var(--border-radius-lg) - 1px);
}

.modal-footer > * {
    margin: 0.25rem;
}

/* Modal Sizes */
.modal-sm {
    max-width: 300px;
}

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

.modal-xl {
    max-width: 1140px;
}

.modal-fullscreen {
    width: 100vw;
    max-width: none;
    height: 100%;
    margin: 0;
}

.modal-fullscreen .modal-content {
    height: 100%;
    border: 0;
    border-radius: 0;
}

/* ============================================
   TOOLTIPS
   ============================================ */

.tooltip {
    --bs-tooltip-bg: var(--bg-quaternary);
    --bs-tooltip-color: var(--text-primary);
    position: absolute;
    z-index: var(--z-tooltip);
    display: block;
    margin: 0;
    font-family: inherit;
    font-style: normal;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
    text-decoration: none;
    text-shadow: none;
    text-transform: none;
    letter-spacing: normal;
    word-break: normal;
    white-space: normal;
    word-spacing: normal;
    line-break: auto;
    font-size: 0.875rem;
    word-wrap: break-word;
    opacity: 0;
}

.tooltip.show {
    opacity: 0.95;
}

.tooltip-inner {
    max-width: 200px;
    padding: 0.25rem 0.5rem;
    color: var(--text-primary);
    text-align: center;
    background-color: var(--bg-quaternary);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow);
}

.tooltip .tooltip-arrow {
    position: absolute;
    display: block;
    width: 0.8rem;
    height: 0.4rem;
}

.tooltip .tooltip-arrow::before {
    position: absolute;
    content: "";
    border-color: transparent;
    border-style: solid;
}

.bs-tooltip-top .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="top"] .tooltip-arrow::before {
    border-width: 0.4rem 0.4rem 0;
    border-top-color: var(--bg-quaternary);
}

.bs-tooltip-end .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="right"] .tooltip-arrow::before {
    border-width: 0.4rem 0.4rem 0.4rem 0;
    border-right-color: var(--bg-quaternary);
}

.bs-tooltip-bottom .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="bottom"] .tooltip-arrow::before {
    border-width: 0 0.4rem 0.4rem;
    border-bottom-color: var(--bg-quaternary);
}

.bs-tooltip-start .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="left"] .tooltip-arrow::before {
    border-width: 0.4rem 0 0.4rem 0.4rem;
    border-left-color: var(--bg-quaternary);
}

/* ============================================
   POPOVERS
   ============================================ */

.popover {
    --bs-popover-bg: var(--bg-secondary);
    --bs-popover-border-color: var(--border-color);
    --bs-popover-header-bg: var(--bg-tertiary);
    position: absolute;
    z-index: var(--z-popover);
    display: block;
    max-width: 276px;
    font-family: inherit;
    font-style: normal;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
    text-decoration: none;
    text-shadow: none;
    text-transform: none;
    letter-spacing: normal;
    word-break: normal;
    white-space: normal;
    word-spacing: normal;
    line-break: auto;
    font-size: 0.875rem;
    word-wrap: break-word;
    background-color: var(--bg-secondary);
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

.popover .popover-arrow {
    position: absolute;
    display: block;
    width: 1rem;
    height: 0.5rem;
}

.popover .popover-arrow::before,
.popover .popover-arrow::after {
    position: absolute;
    display: block;
    content: "";
    border-color: transparent;
    border-style: solid;
    border-width: 0;
}

.bs-popover-top > .popover-arrow::before,
.bs-popover-auto[data-popper-placement^="top"] > .popover-arrow::before {
    border-width: 0.5rem 0.5rem 0;
    border-top-color: var(--border-color);
}

.bs-popover-top > .popover-arrow::after,
.bs-popover-auto[data-popper-placement^="top"] > .popover-arrow::after {
    border-width: 0.5rem 0.5rem 0;
    border-top-color: var(--bg-secondary);
}

.popover-header {
    padding: 0.5rem 1rem;
    margin-bottom: 0;
    font-size: 1rem;
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    border-top-left-radius: calc(var(--border-radius-lg) - 1px);
    border-top-right-radius: calc(var(--border-radius-lg) - 1px);
}

.popover-header:empty {
    display: none;
}

.popover-body {
    padding: 1rem 1rem;
    color: var(--text-primary);
}

/* ============================================
   TOASTS
   ============================================ */

.toast-container {
    --bs-toast-zindex: var(--z-toast);
    position: fixed;
    z-index: var(--z-toast);
    width: max-content;
    max-width: 100%;
    pointer-events: none;
}

.toast {
    --bs-toast-bg: var(--bg-secondary);
    --bs-toast-border-color: var(--border-color);
    --bs-toast-header-bg: var(--bg-tertiary);
    --bs-toast-header-border-color: var(--border-color);
    width: 350px;
    max-width: 100%;
    font-size: 0.875rem;
    color: var(--text-primary);
    pointer-events: auto;
    background-color: var(--bg-secondary);
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius);
}

.toast.showing {
    opacity: 0;
}

.toast:not(.show) {
    display: none;
}

.toast-header {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
    background-clip: padding-box;
    border-bottom: 1px solid var(--border-color);
    border-top-left-radius: calc(var(--border-radius) - 1px);
    border-top-right-radius: calc(var(--border-radius) - 1px);
}

.toast-header .btn-close {
    margin-right: -0.375rem;
    margin-left: 0.75rem;
}

.toast-body {
    padding: 0.75rem;
    word-wrap: break-word;
}

/* ============================================
   OFFCANVAS
   ============================================ */

.offcanvas {
    --bs-offcanvas-bg: var(--bg-secondary);
    --bs-offcanvas-border-color: var(--border-color);
    position: fixed;
    bottom: 0;
    z-index: var(--z-modal);
    display: flex;
    flex-direction: column;
    max-width: 100%;
    color: var(--text-primary);
    visibility: hidden;
    background-color: var(--bg-secondary);
    background-clip: padding-box;
    outline: 0;
    transition: transform 0.3s ease-in-out;
}

.offcanvas-start {
    top: 0;
    left: 0;
    width: 400px;
    border-right: 1px solid var(--border-color);
    transform: translateX(-100%);
}

.offcanvas-end {
    top: 0;
    right: 0;
    width: 400px;
    border-left: 1px solid var(--border-color);
    transform: translateX(100%);
}

.offcanvas-top {
    top: 0;
    right: 0;
    left: 0;
    height: 30vh;
    max-height: 100%;
    border-bottom: 1px solid var(--border-color);
    transform: translateY(-100%);
}

.offcanvas-bottom {
    right: 0;
    left: 0;
    height: 30vh;
    max-height: 100%;
    border-top: 1px solid var(--border-color);
    transform: translateY(100%);
}

.offcanvas.show {
    transform: none;
}

.offcanvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.offcanvas-header .btn-close {
    padding: 0.5rem 0.5rem;
    margin-top: -0.5rem;
    margin-right: -0.5rem;
    margin-bottom: -0.5rem;
}

.offcanvas-title {
    margin-bottom: 0;
    line-height: 1.5;
    color: var(--text-primary);
}

.offcanvas-body {
    flex-grow: 1;
    padding: 1rem 1rem;
    overflow-y: auto;
}

/* ============================================
   NAVIGATION - NAVBAR
   ============================================ */

.navbar {
    --bs-navbar-padding-x: 0;
    --bs-navbar-padding-y: 0.5rem;
    --bs-navbar-color: var(--text-secondary);
    --bs-navbar-hover-color: var(--text-primary);
    --bs-navbar-active-color: var(--text-primary);
    --bs-navbar-brand-color: var(--text-primary);
    --bs-navbar-brand-hover-color: var(--text-primary);
    --bs-navbar-toggler-border-color: var(--border-color);
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: var(--bs-navbar-padding-y) var(--bs-navbar-padding-x);
}

.navbar > .container,
.navbar > .container-fluid,
.navbar > .container-sm,
.navbar > .container-md,
.navbar > .container-lg,
.navbar > .container-xl,
.navbar > .container-xxl {
    display: flex;
    flex-wrap: inherit;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    padding-top: 0.3125rem;
    padding-bottom: 0.3125rem;
    margin-right: 1rem;
    font-size: 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
}

.navbar-brand:hover,
.navbar-brand:focus {
    color: var(--text-primary);
}

.navbar-nav {
    --bs-nav-link-padding-x: 0;
    --bs-nav-link-padding-y: 0.5rem;
    --bs-nav-link-color: var(--text-secondary);
    --bs-nav-link-hover-color: var(--text-primary);
    display: flex;
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

.navbar-nav .nav-link {
    padding-right: 0;
    padding-left: 0;
    color: var(--text-secondary);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    color: var(--text-primary);
}

.navbar-nav .nav-link.active,
.navbar-nav .show > .nav-link {
    color: var(--primary);
}

.navbar-text {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    color: var(--text-secondary);
}

.navbar-collapse {
    flex-basis: 100%;
    flex-grow: 1;
    align-items: center;
}

.navbar-toggler {
    padding: 0.25rem 0.75rem;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--text-secondary);
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: box-shadow var(--transition-fast);
}

.navbar-toggler:hover {
    text-decoration: none;
}

.navbar-toggler:focus {
    text-decoration: none;
    outline: 0;
    box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color);
}

.navbar-toggler-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(170, 170, 170, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
}

/* Navbar Dark */
.navbar-dark {
    --bs-navbar-color: var(--text-secondary);
    --bs-navbar-hover-color: var(--text-primary);
    --bs-navbar-active-color: #fff;
    --bs-navbar-brand-color: #fff;
    --bs-navbar-brand-hover-color: #fff;
}

.navbar-dark .navbar-brand {
    color: #fff;
}

.navbar-dark .navbar-nav .nav-link {
    color: var(--text-secondary);
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
    color: var(--text-primary);
}

.navbar-dark .navbar-nav .nav-link.active,
.navbar-dark .navbar-nav .show > .nav-link {
    color: #fff;
}

/* Navbar Light (for dark backgrounds) */
.navbar-light {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

/* Background variants */
.bg-dark {
    background-color: var(--bg-secondary) !important;
}

.bg-light {
    background-color: var(--bg-tertiary) !important;
}

.bg-primary {
    background-color: var(--primary) !important;
}

/* ============================================
   NAVIGATION - NAV & TABS
   ============================================ */

.nav {
    --bs-nav-link-padding-x: 1rem;
    --bs-nav-link-padding-y: 0.5rem;
    --bs-nav-link-color: var(--text-secondary);
    --bs-nav-link-hover-color: var(--text-primary);
    --bs-nav-link-disabled-color: var(--text-disabled);
    display: flex;
    flex-wrap: wrap;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

.nav-link {
    display: block;
    padding: var(--bs-nav-link-padding-y) var(--bs-nav-link-padding-x);
    font-size: inherit;
    font-weight: inherit;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast);
}

.nav-link:hover,
.nav-link:focus {
    color: var(--text-primary);
}

.nav-link.disabled {
    color: var(--text-disabled);
    pointer-events: none;
    cursor: default;
}

.nav-link.active {
    color: var(--primary);
}

/* Nav Tabs */
.nav-tabs {
    --bs-nav-tabs-border-width: 1px;
    --bs-nav-tabs-border-color: var(--border-color);
    --bs-nav-tabs-border-radius: var(--border-radius);
    --bs-nav-tabs-link-hover-border-color: var(--border-subtle) var(--border-subtle) var(--border-color);
    --bs-nav-tabs-link-active-color: var(--text-primary);
    --bs-nav-tabs-link-active-bg: var(--bg-primary);
    --bs-nav-tabs-link-active-border-color: var(--border-color) var(--border-color) var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.nav-tabs .nav-link {
    margin-bottom: -1px;
    background: none;
    border: 1px solid transparent;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}

.nav-tabs .nav-link:hover,
.nav-tabs .nav-link:focus {
    border-color: var(--border-subtle) var(--border-subtle) var(--border-color);
    isolation: isolate;
}

.nav-tabs .nav-link.disabled {
    color: var(--text-disabled);
    background-color: transparent;
    border-color: transparent;
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
    color: var(--text-primary);
    background-color: var(--bg-primary);
    border-color: var(--border-color) var(--border-color) var(--bg-primary);
}

/* Nav Pills */
.nav-pills {
    --bs-nav-pills-border-radius: var(--border-radius);
    --bs-nav-pills-link-active-color: #fff;
    --bs-nav-pills-link-active-bg: var(--primary);
}

.nav-pills .nav-link {
    background: none;
    border: 0;
    border-radius: var(--border-radius);
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    color: #fff;
    background-color: var(--primary);
}

/* Nav Fill & Justified */
.nav-fill > .nav-link,
.nav-fill .nav-item {
    flex: 1 1 auto;
    text-align: center;
}

.nav-justified > .nav-link,
.nav-justified .nav-item {
    flex-basis: 0;
    flex-grow: 1;
    text-align: center;
}

/* ============================================
   BREADCRUMBS
   ============================================ */

.breadcrumb {
    --bs-breadcrumb-padding-x: 0;
    --bs-breadcrumb-padding-y: 0;
    --bs-breadcrumb-margin-bottom: 1rem;
    --bs-breadcrumb-bg: transparent;
    --bs-breadcrumb-border-radius: 0;
    --bs-breadcrumb-divider-color: var(--text-muted);
    --bs-breadcrumb-item-padding-x: 0.5rem;
    --bs-breadcrumb-item-active-color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    padding: var(--bs-breadcrumb-padding-y) var(--bs-breadcrumb-padding-x);
    margin-bottom: var(--bs-breadcrumb-margin-bottom);
    font-size: inherit;
    list-style: none;
    background-color: var(--bs-breadcrumb-bg);
    border-radius: var(--bs-breadcrumb-border-radius);
}

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

.breadcrumb-item + .breadcrumb-item {
    padding-left: var(--bs-breadcrumb-item-padding-x);
}

.breadcrumb-item + .breadcrumb-item::before {
    float: left;
    padding-right: var(--bs-breadcrumb-item-padding-x);
    color: var(--text-muted);
    content: var(--bs-breadcrumb-divider, "/");
}

.breadcrumb-item.active {
    color: var(--text-muted);
}

.breadcrumb-item a {
    color: var(--text-link);
}

.breadcrumb-item a:hover {
    color: var(--text-link-hover);
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
    --bs-pagination-padding-x: 0.75rem;
    --bs-pagination-padding-y: 0.375rem;
    --bs-pagination-font-size: 1rem;
    --bs-pagination-color: var(--text-secondary);
    --bs-pagination-bg: var(--bg-secondary);
    --bs-pagination-border-width: 1px;
    --bs-pagination-border-color: var(--border-color);
    --bs-pagination-border-radius: var(--border-radius);
    --bs-pagination-hover-color: var(--text-primary);
    --bs-pagination-hover-bg: var(--bg-hover);
    --bs-pagination-hover-border-color: var(--border-color);
    --bs-pagination-focus-color: var(--text-primary);
    --bs-pagination-focus-bg: var(--bg-hover);
    --bs-pagination-focus-box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color);
    --bs-pagination-active-color: #fff;
    --bs-pagination-active-bg: var(--primary);
    --bs-pagination-active-border-color: var(--primary);
    --bs-pagination-disabled-color: var(--text-disabled);
    --bs-pagination-disabled-bg: var(--bg-disabled);
    --bs-pagination-disabled-border-color: var(--border-color);
    display: flex;
    padding-left: 0;
    list-style: none;
}

.page-link {
    position: relative;
    display: block;
    padding: var(--bs-pagination-padding-y) var(--bs-pagination-padding-x);
    font-size: var(--bs-pagination-font-size);
    color: var(--bs-pagination-color);
    text-decoration: none;
    background-color: var(--bs-pagination-bg);
    border: var(--bs-pagination-border-width) solid var(--bs-pagination-border-color);
    transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.page-link:hover {
    z-index: 2;
    color: var(--bs-pagination-hover-color);
    background-color: var(--bs-pagination-hover-bg);
    border-color: var(--bs-pagination-hover-border-color);
}

.page-link:focus {
    z-index: 3;
    color: var(--bs-pagination-focus-color);
    background-color: var(--bs-pagination-focus-bg);
    outline: 0;
    box-shadow: var(--bs-pagination-focus-box-shadow);
}

.page-item:not(:first-child) .page-link {
    margin-left: -1px;
}

.page-item:first-child .page-link {
    border-top-left-radius: var(--bs-pagination-border-radius);
    border-bottom-left-radius: var(--bs-pagination-border-radius);
}

.page-item:last-child .page-link {
    border-top-right-radius: var(--bs-pagination-border-radius);
    border-bottom-right-radius: var(--bs-pagination-border-radius);
}

.page-item.active .page-link {
    z-index: 3;
    color: var(--bs-pagination-active-color);
    background-color: var(--bs-pagination-active-bg);
    border-color: var(--bs-pagination-active-border-color);
}

.page-item.disabled .page-link {
    color: var(--bs-pagination-disabled-color);
    pointer-events: none;
    background-color: var(--bs-pagination-disabled-bg);
    border-color: var(--bs-pagination-disabled-border-color);
}

/* Pagination Sizes */
.pagination-lg {
    --bs-pagination-padding-x: 1.5rem;
    --bs-pagination-padding-y: 0.75rem;
    --bs-pagination-font-size: 1.25rem;
    --bs-pagination-border-radius: var(--border-radius-lg);
}

.pagination-sm {
    --bs-pagination-padding-x: 0.5rem;
    --bs-pagination-padding-y: 0.25rem;
    --bs-pagination-font-size: 0.875rem;
    --bs-pagination-border-radius: var(--border-radius-sm);
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    --bs-alert-bg: transparent;
    --bs-alert-padding-x: 1rem;
    --bs-alert-padding-y: 1rem;
    --bs-alert-margin-bottom: 1rem;
    --bs-alert-color: inherit;
    --bs-alert-border-color: transparent;
    --bs-alert-border: 1px solid var(--bs-alert-border-color);
    --bs-alert-border-radius: var(--border-radius);
    position: relative;
    padding: var(--bs-alert-padding-y) var(--bs-alert-padding-x);
    margin-bottom: var(--bs-alert-margin-bottom);
    color: var(--bs-alert-color);
    background-color: var(--bs-alert-bg);
    border: var(--bs-alert-border);
    border-radius: var(--bs-alert-border-radius);
}

.alert-heading {
    color: inherit;
}

.alert-link {
    font-weight: 600;
}

.alert-dismissible {
    padding-right: 3rem;
}

.alert-dismissible .btn-close {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    padding: 1.25rem 1rem;
}

/* Alert Variants */
.alert-primary {
    --bs-alert-color: var(--primary);
    --bs-alert-bg: var(--primary-subtle);
    --bs-alert-border-color: var(--primary-border-subtle);
}

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

.alert-secondary {
    --bs-alert-color: var(--text-secondary);
    --bs-alert-bg: var(--secondary-subtle);
    --bs-alert-border-color: var(--secondary-border-subtle);
}

.alert-secondary .alert-link {
    color: var(--text-primary);
}

.alert-success {
    --bs-alert-color: var(--success);
    --bs-alert-bg: var(--success-subtle);
    --bs-alert-border-color: var(--success-border-subtle);
}

.alert-success .alert-link {
    color: var(--success-hover);
}

.alert-danger {
    --bs-alert-color: var(--danger);
    --bs-alert-bg: var(--danger-subtle);
    --bs-alert-border-color: var(--danger-border-subtle);
}

.alert-danger .alert-link {
    color: var(--danger-hover);
}

.alert-warning {
    --bs-alert-color: var(--warning);
    --bs-alert-bg: var(--warning-subtle);
    --bs-alert-border-color: var(--warning-border-subtle);
}

.alert-warning .alert-link {
    color: var(--warning-hover);
}

.alert-info {
    --bs-alert-color: var(--info);
    --bs-alert-bg: var(--info-subtle);
    --bs-alert-border-color: var(--info-border-subtle);
}

.alert-info .alert-link {
    color: var(--info-hover);
}

.alert-light {
    --bs-alert-color: var(--text-secondary);
    --bs-alert-bg: var(--light-subtle);
    --bs-alert-border-color: rgba(255, 255, 255, 0.1);
}

.alert-dark {
    --bs-alert-color: var(--text-primary);
    --bs-alert-bg: var(--bg-tertiary);
    --bs-alert-border-color: var(--border-color);
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    --bs-badge-padding-x: 0.65em;
    --bs-badge-padding-y: 0.35em;
    --bs-badge-font-size: 0.75em;
    --bs-badge-font-weight: 600;
    --bs-badge-color: #fff;
    --bs-badge-border-radius: var(--border-radius-sm);
    display: inline-block;
    padding: var(--bs-badge-padding-y) var(--bs-badge-padding-x);
    font-size: var(--bs-badge-font-size);
    font-weight: var(--bs-badge-font-weight);
    line-height: 1;
    color: var(--bs-badge-color);
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: var(--bs-badge-border-radius);
}

.badge:empty {
    display: none;
}

/* Badge Pill */
.rounded-pill {
    border-radius: var(--border-radius-pill) !important;
}

/* Badge Variants */
.bg-primary,
.badge.bg-primary {
    color: #fff !important;
    background-color: var(--primary) !important;
}

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

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

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

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

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

.text-bg-primary {
    color: #fff !important;
    background-color: var(--primary) !important;
}

.text-bg-secondary {
    color: #fff !important;
    background-color: var(--secondary) !important;
}

.text-bg-success {
    color: #fff !important;
    background-color: var(--success) !important;
}

.text-bg-danger {
    color: #fff !important;
    background-color: var(--danger) !important;
}

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

.text-bg-info {
    color: var(--info-text) !important;
    background-color: var(--info) !important;
}

.text-bg-light {
    color: var(--text-inverse) !important;
    background-color: var(--light) !important;
}

.text-bg-dark {
    color: var(--text-primary) !important;
    background-color: var(--bg-tertiary) !important;
}

/* ============================================
   PROGRESS BARS
   ============================================ */

.progress,
.progress-stacked {
    --bs-progress-height: 1rem;
    --bs-progress-font-size: 0.75rem;
    --bs-progress-bg: var(--bg-tertiary);
    --bs-progress-border-radius: var(--border-radius);
    --bs-progress-box-shadow: var(--shadow-inset);
    --bs-progress-bar-color: #fff;
    --bs-progress-bar-bg: var(--primary);
    --bs-progress-bar-transition: width 0.6s ease;
    display: flex;
    height: var(--bs-progress-height);
    overflow: hidden;
    font-size: var(--bs-progress-font-size);
    background-color: var(--bs-progress-bg);
    border-radius: var(--bs-progress-border-radius);
    box-shadow: var(--bs-progress-box-shadow);
}

.progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    color: var(--bs-progress-bar-color);
    text-align: center;
    white-space: nowrap;
    background-color: var(--bs-progress-bar-bg);
    transition: var(--bs-progress-bar-transition);
}

.progress-bar-striped {
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
    background-size: var(--bs-progress-height) var(--bs-progress-height);
}

.progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    0% {
        background-position-x: var(--bs-progress-height);
    }
}

/* Progress Bar Sizes */
.progress-sm {
    --bs-progress-height: 0.5rem;
}

.progress-lg {
    --bs-progress-height: 1.5rem;
}

/* ============================================
   SPINNERS
   ============================================ */

.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: -0.125em;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}

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

.spinner-grow {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: -0.125em;
    background-color: currentColor;
    border-radius: 50%;
    opacity: 0;
    animation: spinner-grow 0.75s linear infinite;
}

.spinner-grow-sm {
    width: 1rem;
    height: 1rem;
}

@keyframes spinner-grow {
    0% {
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: none;
    }
}

/* Spinner Colors */
.text-primary {
    color: var(--primary) !important;
}

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

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

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

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

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

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

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

.text-white {
    color: #fff !important;
}

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

/* ============================================
   ACCORDIONS
   ============================================ */

.accordion {
    --bs-accordion-color: var(--text-primary);
    --bs-accordion-bg: var(--bg-secondary);
    --bs-accordion-transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, border-radius 0.15s ease;
    --bs-accordion-border-color: var(--border-color);
    --bs-accordion-border-width: 1px;
    --bs-accordion-border-radius: var(--border-radius);
    --bs-accordion-inner-border-radius: calc(var(--border-radius) - 1px);
    --bs-accordion-btn-padding-x: 1.25rem;
    --bs-accordion-btn-padding-y: 1rem;
    --bs-accordion-btn-color: var(--text-primary);
    --bs-accordion-btn-bg: var(--bg-secondary);
    --bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23aaaaaa'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    --bs-accordion-btn-icon-width: 1.25rem;
    --bs-accordion-btn-icon-transform: rotate(-180deg);
    --bs-accordion-btn-icon-transition: transform 0.2s ease-in-out;
    --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%230d6efd'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    --bs-accordion-btn-focus-border-color: var(--primary);
    --bs-accordion-btn-focus-box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color);
    --bs-accordion-body-padding-x: 1.25rem;
    --bs-accordion-body-padding-y: 1rem;
    --bs-accordion-active-color: var(--primary);
    --bs-accordion-active-bg: var(--primary-subtle);
}

.accordion-button {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    padding: var(--bs-accordion-btn-padding-y) var(--bs-accordion-btn-padding-x);
    font-size: 1rem;
    color: var(--bs-accordion-btn-color);
    text-align: left;
    background-color: var(--bs-accordion-btn-bg);
    border: 0;
    border-radius: 0;
    overflow-anchor: none;
    transition: var(--bs-accordion-transition);
}

.accordion-button:not(.collapsed) {
    color: var(--bs-accordion-active-color);
    background-color: var(--bs-accordion-active-bg);
    box-shadow: inset 0 calc(-1 * var(--bs-accordion-border-width)) 0 var(--bs-accordion-border-color);
}

.accordion-button:not(.collapsed)::after {
    background-image: var(--bs-accordion-btn-active-icon);
    transform: var(--bs-accordion-btn-icon-transform);
}

.accordion-button::after {
    flex-shrink: 0;
    width: var(--bs-accordion-btn-icon-width);
    height: var(--bs-accordion-btn-icon-width);
    margin-left: auto;
    content: "";
    background-image: var(--bs-accordion-btn-icon);
    background-repeat: no-repeat;
    background-size: var(--bs-accordion-btn-icon-width);
    transition: var(--bs-accordion-btn-icon-transition);
}

.accordion-button:hover {
    z-index: 2;
}

.accordion-button:focus {
    z-index: 3;
    border-color: var(--bs-accordion-btn-focus-border-color);
    outline: 0;
    box-shadow: var(--bs-accordion-btn-focus-box-shadow);
}

.accordion-header {
    margin-bottom: 0;
}

.accordion-item {
    color: var(--bs-accordion-color);
    background-color: var(--bs-accordion-bg);
    border: var(--bs-accordion-border-width) solid var(--bs-accordion-border-color);
}

.accordion-item:first-of-type {
    border-top-left-radius: var(--bs-accordion-border-radius);
    border-top-right-radius: var(--bs-accordion-border-radius);
}

.accordion-item:first-of-type .accordion-button {
    border-top-left-radius: var(--bs-accordion-inner-border-radius);
    border-top-right-radius: var(--bs-accordion-inner-border-radius);
}

.accordion-item:not(:first-of-type) {
    border-top: 0;
}

.accordion-item:last-of-type {
    border-bottom-right-radius: var(--bs-accordion-border-radius);
    border-bottom-left-radius: var(--bs-accordion-border-radius);
}

.accordion-item:last-of-type .accordion-button.collapsed {
    border-bottom-right-radius: var(--bs-accordion-inner-border-radius);
    border-bottom-left-radius: var(--bs-accordion-inner-border-radius);
}

.accordion-item:last-of-type .accordion-collapse {
    border-bottom-right-radius: var(--bs-accordion-border-radius);
    border-bottom-left-radius: var(--bs-accordion-border-radius);
}

.accordion-body {
    padding: var(--bs-accordion-body-padding-y) var(--bs-accordion-body-padding-x);
}

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

.accordion-flush .accordion-item:first-child {
    border-top: 0;
}

.accordion-flush .accordion-item:last-child {
    border-bottom: 0;
}

.accordion-flush .accordion-item .accordion-button,
.accordion-flush .accordion-item .accordion-button.collapsed {
    border-radius: 0;
}

/* ============================================
   DROPDOWNS
   ============================================ */

.dropdown,
.dropup,
.dropend,
.dropstart,
.dropup-center,
.dropdown-center {
    position: relative;
}

.dropdown-toggle {
    white-space: nowrap;
}

.dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.255em;
    vertical-align: 0.255em;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

.dropdown-toggle:empty::after {
    margin-left: 0;
}

.dropdown-menu {
    --bs-dropdown-min-width: 10rem;
    --bs-dropdown-padding-x: 0;
    --bs-dropdown-padding-y: 0.5rem;
    --bs-dropdown-spacer: 0.125rem;
    --bs-dropdown-font-size: 1rem;
    --bs-dropdown-color: var(--text-primary);
    --bs-dropdown-bg: var(--bg-tertiary);
    --bs-dropdown-border-color: var(--border-color);
    --bs-dropdown-border-radius: var(--border-radius);
    --bs-dropdown-border-width: 1px;
    --bs-dropdown-inner-border-radius: calc(var(--border-radius) - 1px);
    --bs-dropdown-divider-bg: var(--border-color);
    --bs-dropdown-divider-margin-y: 0.5rem;
    --bs-dropdown-box-shadow: var(--shadow-lg);
    --bs-dropdown-link-color: var(--text-secondary);
    --bs-dropdown-link-hover-color: var(--text-primary);
    --bs-dropdown-link-hover-bg: var(--bg-hover);
    --bs-dropdown-link-active-color: #fff;
    --bs-dropdown-link-active-bg: var(--primary);
    --bs-dropdown-link-disabled-color: var(--text-disabled);
    --bs-dropdown-item-padding-x: 1rem;
    --bs-dropdown-item-padding-y: 0.25rem;
    --bs-dropdown-header-color: var(--text-muted);
    --bs-dropdown-header-padding-x: 1rem;
    --bs-dropdown-header-padding-y: 0.5rem;
    position: absolute;
    z-index: var(--z-dropdown);
    display: none;
    min-width: var(--bs-dropdown-min-width);
    padding: var(--bs-dropdown-padding-y) var(--bs-dropdown-padding-x);
    margin: 0;
    font-size: var(--bs-dropdown-font-size);
    color: var(--bs-dropdown-color);
    text-align: left;
    list-style: none;
    background-color: var(--bs-dropdown-bg);
    background-clip: padding-box;
    border: var(--bs-dropdown-border-width) solid var(--bs-dropdown-border-color);
    border-radius: var(--bs-dropdown-border-radius);
    box-shadow: var(--bs-dropdown-box-shadow);
}

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

.dropdown-menu-dark {
    --bs-dropdown-color: var(--text-secondary);
    --bs-dropdown-bg: var(--bg-tertiary);
    --bs-dropdown-border-color: var(--border-color);
    --bs-dropdown-link-color: var(--text-secondary);
    --bs-dropdown-link-hover-color: var(--text-primary);
    --bs-dropdown-link-hover-bg: var(--bg-hover);
    --bs-dropdown-link-active-color: #fff;
    --bs-dropdown-link-active-bg: var(--primary);
    --bs-dropdown-link-disabled-color: var(--text-disabled);
    --bs-dropdown-header-color: var(--text-muted);
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: var(--bs-dropdown-item-padding-y) var(--bs-dropdown-item-padding-x);
    clear: both;
    font-weight: 400;
    color: var(--bs-dropdown-link-color);
    text-align: inherit;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
}

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

.dropdown-item.active,
.dropdown-item:active {
    color: var(--bs-dropdown-link-active-color);
    text-decoration: none;
    background-color: var(--bs-dropdown-link-active-bg);
}

.dropdown-item.disabled,
.dropdown-item:disabled {
    color: var(--bs-dropdown-link-disabled-color);
    pointer-events: none;
    background-color: transparent;
}

.dropdown-divider {
    height: 0;
    margin: var(--bs-dropdown-divider-margin-y) 0;
    overflow: hidden;
    border-top: 1px solid var(--bs-dropdown-divider-bg);
    opacity: 1;
}

.dropdown-header {
    display: block;
    padding: var(--bs-dropdown-header-padding-y) var(--bs-dropdown-header-padding-x);
    margin-bottom: 0;
    font-size: 0.875rem;
    color: var(--bs-dropdown-header-color);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dropdown-item-text {
    display: block;
    padding: var(--bs-dropdown-item-padding-y) var(--bs-dropdown-item-padding-x);
    color: var(--bs-dropdown-link-color);
}

/* ============================================
   PLACEHOLDERS / SKELETONS
   ============================================ */

.placeholder {
    display: inline-block;
    min-height: 1em;
    vertical-align: middle;
    cursor: wait;
    background-color: var(--text-muted);
    opacity: 0.5;
}

.placeholder.btn::before {
    display: inline-block;
    content: "";
}

.placeholder-xs {
    min-height: 0.6em;
}

.placeholder-sm {
    min-height: 0.8em;
}

.placeholder-lg {
    min-height: 1.2em;
}

.placeholder-glow .placeholder {
    animation: placeholder-glow 2s ease-in-out infinite;
}

@keyframes placeholder-glow {
    50% {
        opacity: 0.2;
    }
}

.placeholder-wave {
    mask-image: linear-gradient(130deg, #000 55%, rgba(0, 0, 0, 0.8) 75%, #000 95%);
    mask-size: 200% 100%;
    animation: placeholder-wave 2s linear infinite;
}

@keyframes placeholder-wave {
    100% {
        mask-position: -200% 0%;
    }
}

/* ============================================
   SCROLLBARS (Dark theme)
   ============================================ */

/* Webkit scrollbars */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-quaternary);
    border-radius: 5px;
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-muted);
}

::-webkit-scrollbar-corner {
    background: var(--bg-primary);
}

/* Firefox scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--bg-quaternary) var(--bg-primary);
}

/* Thin scrollbars for specific elements */
.thin-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.thin-scrollbar::-webkit-scrollbar-thumb {
    border: 1px solid var(--bg-primary);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

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

.bg-body-secondary {
    background-color: var(--bg-secondary) !important;
}

.bg-body-tertiary {
    background-color: var(--bg-tertiary) !important;
}

.bg-transparent {
    background-color: transparent !important;
}

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

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

.border-end {
    border-right: 1px solid var(--border-color) !important;
}

.border-bottom {
    border-bottom: 1px solid var(--border-color) !important;
}

.border-start {
    border-left: 1px solid var(--border-color) !important;
}

.border-0 {
    border: 0 !important;
}

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

.border-secondary {
    border-color: var(--secondary) !important;
}

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

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

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

.border-info {
    border-color: var(--info) !important;
}

/* Shadow utilities */
.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow {
    box-shadow: var(--shadow) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

.shadow-none {
    box-shadow: none !important;
}

/* Focus ring utility */
.focus-ring:focus {
    outline: 0;
    box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color);
}

/* Visually hidden */
.visually-hidden,
.visually-hidden-focusable:not(:focus):not(:focus-within) {
    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 */
.stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    content: "";
}

/* Text truncation */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Ratio/aspect-ratio utilities */
.ratio {
    position: relative;
    width: 100%;
}

.ratio::before {
    display: block;
    padding-top: var(--bs-aspect-ratio);
    content: "";
}

.ratio > * {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.ratio-1x1 {
    --bs-aspect-ratio: 100%;
}

.ratio-4x3 {
    --bs-aspect-ratio: calc(3 / 4 * 100%);
}

.ratio-16x9 {
    --bs-aspect-ratio: calc(9 / 16 * 100%);
}

.ratio-21x9 {
    --bs-aspect-ratio: calc(9 / 21 * 100%);
}

/* Object fit utilities */
.object-fit-contain {
    object-fit: contain !important;
}

.object-fit-cover {
    object-fit: cover !important;
}

.object-fit-fill {
    object-fit: fill !important;
}

.object-fit-scale {
    object-fit: scale-down !important;
}

.object-fit-none {
    object-fit: none !important;
}

/* Overflow utilities */
.overflow-auto {
    overflow: auto !important;
}

.overflow-hidden {
    overflow: hidden !important;
}

.overflow-visible {
    overflow: visible !important;
}

.overflow-scroll {
    overflow: scroll !important;
}

.overflow-x-auto {
    overflow-x: auto !important;
}

.overflow-x-hidden {
    overflow-x: hidden !important;
}

.overflow-y-auto {
    overflow-y: auto !important;
}

.overflow-y-hidden {
    overflow-y: hidden !important;
}

/* Position utilities */
.position-static {
    position: static !important;
}

.position-relative {
    position: relative !important;
}

.position-absolute {
    position: absolute !important;
}

.position-fixed {
    position: fixed !important;
}

.position-sticky {
    position: sticky !important;
}

/* Clearfix */
.clearfix::after {
    display: block;
    clear: both;
    content: "";
}

/* User select */
.user-select-all {
    user-select: all !important;
}

.user-select-auto {
    user-select: auto !important;
}

.user-select-none {
    user-select: none !important;
}

/* Pointer events */
.pe-none {
    pointer-events: none !important;
}

.pe-auto {
    pointer-events: auto !important;
}

/* Cursor utilities */
.cursor-pointer {
    cursor: pointer !important;
}

.cursor-default {
    cursor: default !important;
}

.cursor-not-allowed {
    cursor: not-allowed !important;
}

/* Opacity utilities */
.opacity-0 {
    opacity: 0 !important;
}

.opacity-25 {
    opacity: 0.25 !important;
}

.opacity-50 {
    opacity: 0.5 !important;
}

.opacity-75 {
    opacity: 0.75 !important;
}

.opacity-100 {
    opacity: 1 !important;
}

/* ============================================
   AUTHENTICATION PAGES
   ============================================ */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.auth-card {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

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

.auth-logo {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.auth-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    margin-bottom: 0;
    color: var(--text-muted);
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    background-color: var(--bg-secondary);
    min-height: 100vh;
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    overflow: visible; /* Allow toggle button to extend outside */
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    flex-grow: 1;
    transition: margin-left 0.3s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    min-height: 57px; /* Match chat-header height */
    position: relative; /* For absolute positioned toggle button */
}

.sidebar .brand-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.sidebar .brand-link i {
    margin-right: 0.5rem;
}

.sidebar-toggle {
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
}

.sidebar-toggle:hover {
    color: var(--text-primary);
    background-color: var(--bg-hover);
}

.sidebar .nav {
    flex-grow: 1;
    padding: 0.5rem 0;
    overflow-y: auto;
}

.sidebar .nav-header {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
}

.sidebar .nav-link {
    color: var(--text-secondary) !important;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    margin: 0.15rem 0.5rem;
    display: flex;
    align-items: center;
    transition: all 0.15s ease;
}

.sidebar .nav-link:hover {
    color: var(--text-primary) !important;
    background-color: var(--bg-hover);
}

.sidebar .nav-link.active {
    color: var(--primary) !important;
    background-color: rgba(37, 99, 235, 0.1);
}

.sidebar .nav-link i {
    margin-right: 0.75rem;
    width: 1.25rem;
    text-align: center;
}

/* Sidebar submenu */
.sidebar .submenu {
    list-style: none;
    padding: 0 0 0 0.5rem;
    margin: 0;
}

.sidebar .submenu .nav-link {
    padding: 0.4rem 1rem 0.4rem 1.5rem;
    font-size: 0.875rem;
}

.sidebar .submenu .nav-link i {
    font-size: 0.85rem;
}

.sidebar .nav-link .submenu-arrow {
    margin-left: auto;
    margin-right: 0;
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.sidebar .nav-link[aria-expanded="true"] .submenu-arrow {
    transform: rotate(180deg);
}

.sidebar.minimized .submenu {
    display: none !important;
}

.sidebar.minimized .submenu-arrow {
    display: none;
}

/* ============================================
   SIDEBAR SPACES
   ============================================ */

.sidebar-spaces {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0;
}

/* Override Bootstrap text-muted in sidebar for better readability */
.sidebar-spaces .text-muted {
    color: var(--text-secondary) !important;
}

.spaces-header {
    font-size: 0.7rem;
    letter-spacing: 0.05em;
}

.spaces-header span {
    color: var(--text-secondary) !important;
}

.spaces-header .btn-link {
    color: var(--text-secondary) !important;
    text-decoration: none;
    line-height: 1;
}

.spaces-header .btn-link:hover {
    color: var(--text-primary) !important;
}

.space-list,
.dm-list {
    margin: 0;
    padding: 0;
}

.space-item {
    margin: 0.15rem 0.5rem;
}

.space-item > .space-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.space-item > .space-link:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.space-item > .space-link.active {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.space-item .space-icon {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 4px;
    background-color: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    font-size: 0.75rem;
}

.space-item .space-name {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.space-item .space-toggle {
    padding: 0.25rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.space-item.expanded .space-toggle {
    transform: rotate(90deg);
}

/* Rooms within a space */
.space-rooms {
    display: none;
    padding-left: 1rem;
}

.space-item.expanded .space-rooms {
    display: block;
}

.room-item {
    margin: 0.1rem 0;
}

.room-item > .room-link {
    display: flex;
    align-items: center;
    padding: 0.35rem 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}

.room-item > .room-link:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.room-item > .room-link.active {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.room-item .room-icon {
    margin-right: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.room-item .room-name {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-item .unread-badge {
    background-color: var(--primary);
    color: white;
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    min-width: 1.25rem;
    text-align: center;
}

/* DM list items */
.dm-item {
    margin: 0.15rem 0.5rem;
}

.dm-item > .dm-link {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.dm-item > .dm-link:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.dm-item > .dm-link.active {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.dm-item .dm-avatar {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dm-item .dm-name {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dm-item .online-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
}

/* Sidebar create forms */
.sidebar-create-form {
    background-color: var(--bg-tertiary);
    border-radius: 6px;
    margin: 0 0.5rem 0.5rem 0.5rem;
    padding: 0.75rem !important;
}

.sidebar-create-form .form-control,
.sidebar-create-form .form-select {
    background-color: var(--bg-input);
    border-color: var(--border-color);
    font-size: 0.875rem;
}

.sidebar-create-form .btn-sm {
    padding: 0.35rem 0.75rem;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.sidebar-footer .dropdown-toggle {
    color: var(--text-secondary);
    text-decoration: none;
}

.sidebar-footer .user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.sidebar-footer .user-name {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.sidebar-footer .user-role {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ============================================
   SIDEBAR MINIMIZED STATE (Desktop)
   ============================================ */

@media (min-width: 768px) {
    .sidebar.minimized {
        width: var(--sidebar-minimized);
    }

    .sidebar.minimized .brand-text,
    .sidebar.minimized .nav-text,
    .sidebar.minimized .sidebar-footer .user-info {
        display: none;
    }

    .sidebar.minimized .sidebar-brand {
        justify-content: center;
        padding: 0.75rem 0.5rem;
        min-height: 57px; /* Keep consistent with chat-header */
    }

    .sidebar.minimized .brand-link {
        margin-right: 0;
    }

    .sidebar.minimized .brand-link i {
        margin-right: 0;
    }

    .sidebar.minimized .sidebar-toggle {
        position: absolute;
        right: -12px;
        top: 50%;
        transform: translateY(-50%);
        width: 24px;
        height: 24px;
        padding: 0;
        background-color: var(--bg-tertiary);
        border: 1px solid var(--border-color);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.75rem;
        z-index: 10;
    }

    .sidebar.minimized .sidebar-toggle:hover {
        background-color: var(--primary);
        color: white;
    }

    .sidebar.minimized .nav-link {
        justify-content: center;
        padding: 0.75rem;
    }

    .sidebar.minimized .nav-link i {
        margin-right: 0;
        font-size: 1.25rem;
    }

    .sidebar.minimized + .main-content,
    body:has(.sidebar.minimized) .main-content {
        margin-left: var(--sidebar-minimized);
    }

    .sidebar.minimized ~ .chat-container,
    body:has(.sidebar.minimized) .chat-container {
        margin-left: calc(-1 * var(--sidebar-minimized));
        padding-left: var(--sidebar-minimized);
    }

    .sidebar.minimized .sidebar-footer .dropdown-toggle {
        justify-content: center;
    }

    .sidebar.minimized .sidebar-footer .dropdown-toggle i {
        margin-right: 0;
    }

    /* Toggle icon rotation */
    .sidebar-toggle i {
        transition: transform 0.3s ease;
    }

    .sidebar.minimized .sidebar-toggle i {
        transform: rotate(180deg);
    }
}

/* ============================================
   CHAT LAYOUT
   ============================================ */

.chat-container {
    display: flex;
    height: 100vh;
    margin-left: calc(-1 * var(--sidebar-width));
    padding-left: var(--sidebar-width);
}

/* Sidebar room list (in sidebar-spaces) */
.sidebar-spaces .room-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Chat room list panel (not used currently) */
.chat-room-list {
    width: 280px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.room-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.room-list-header h5 {
    margin: 0;
}

.room-list-search {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.room-list-items {
    flex-grow: 1;
    overflow-y: auto;
}

.chat-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-primary);
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    min-height: 57px; /* Match sidebar-brand height */
}

.chat-header-info h5 {
    margin: 0;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
}

.chat-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
}

.chat-input {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

/* Message styles */
.message {
    margin-bottom: 1rem;
    display: flex;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 0.75rem;
    background-color: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.message-content {
    flex-grow: 1;
}

.message-header {
    display: flex;
    align-items: baseline;
    margin-bottom: 0.25rem;
}

.message-sender {
    font-weight: 500;
    margin-right: 0.5rem;
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.message-body {
    color: var(--text-primary);
    line-height: 1.4;
}

/* ============================================
   DROPDOWN MENU (Dark theme)
   ============================================ */

.dropdown-menu-dark {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
}

.dropdown-menu-dark .dropdown-item {
    color: var(--text-secondary);
}

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

.dropdown-menu-dark .dropdown-header {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dropdown-menu-dark .dropdown-divider {
    border-color: var(--border-color);
}

/* Dropup positioning for sidebar footer */
.sidebar-footer .dropup .dropdown-menu {
    min-width: 220px;
    max-height: 70vh;
    overflow-y: auto;
}

/* ============================================
   METRIC CARDS (Dashboard)
   ============================================ */

.metric-card {
    background-color: var(--bg-secondary);
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
    border-left: 5px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow);
}

.metric-card .card-body {
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.metric-card .metric-value,
.metric-card h2,
.metric-card h5 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0;
}

.metric-card .metric-label,
.metric-card p.text-muted {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #aaa;
    margin-top: 8px;
    margin-bottom: 0;
}

/* Metric card with colored left accent */
.metric-card.border-start {
    border-left-style: solid !important;
}

.metric-card.border-primary { border-left-color: var(--primary) !important; }
.metric-card.border-success { border-left-color: var(--success) !important; }
.metric-card.border-warning { border-left-color: var(--warning) !important; }
.metric-card.border-danger { border-left-color: var(--danger) !important; }
.metric-card.border-info { border-left-color: var(--info) !important; }
.metric-card.border-secondary { border-left-color: var(--secondary) !important; }

/* ============================================
   RESPONSIVE - Mobile First
   ============================================ */

/* Mobile base (default) */
@media (max-width: 767.98px) {
    .sidebar {
        width: 100%;
        height: 100vh;
        position: fixed;
        top: 0;
        left: -100%;
        border-right: 1px solid var(--border-color);
        z-index: 1050;
        transition: left 0.3s ease;
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1040;
    }

    .sidebar.mobile-open + .sidebar-overlay,
    body.sidebar-open .sidebar-overlay {
        display: block;
    }

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

    .chat-container {
        margin-left: 0;
        padding-left: 0;
        flex-direction: column;
        height: 100vh;
    }

    /* Mobile header bar */
    .mobile-header {
        display: flex;
        align-items: center;
        padding: 0.75rem 1rem;
        background-color: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .mobile-header .menu-toggle {
        background: none;
        border: none;
        color: var(--text-secondary);
        font-size: 1.5rem;
        padding: 0.25rem;
        margin-right: 0.75rem;
    }

    .mobile-header .page-title {
        flex-grow: 1;
        margin: 0;
        font-size: 1.1rem;
    }

    /* Admin pages container padding */
    .container-fluid {
        padding-bottom: 20px;
    }
}

/* Tablet and up - show sidebar */
@media (min-width: 768px) {
    .mobile-header {
        display: none;
    }

    .sidebar-overlay {
        display: none !important;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 991.98px) {
    .sidebar {
        width: var(--sidebar-width);
    }

    .main-content {
        margin-left: var(--sidebar-width);
    }

    .chat-container {
        margin-left: calc(-1 * var(--sidebar-width));
        padding-left: var(--sidebar-width);
    }
}

/* Desktop */
@media (min-width: 992px) {
    .sidebar {
        width: var(--sidebar-width);
    }

    .main-content {
        margin-left: var(--sidebar-width);
    }
}
