/* =========================================
   1. VARIABLES & THEME CONFIGURATION
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* --- Modern Slate Palette --- */
    --color-slate-50: #f8fafc;
    --color-slate-100: #f1f5f9;
    --color-slate-200: #e2e8f0;
    --color-slate-300: #cbd5e1;
    --color-slate-400: #94a3b8;
    --color-slate-500: #64748b;
    --color-slate-600: #475569;
    --color-slate-700: #334155;
    --color-slate-800: #1e293b;
    --color-slate-900: #0f172a;
    --color-slate-950: #020617;

    /* --- Semantic Colors --- */
    --color-primary: var(--color-slate-900);
    --color-primary-light: var(--color-slate-700);
    --color-brand: #3b82f6;
    /* Added a distinct brand accent color if needed, otherwise stick to monochrome premium */

    --color-success: #10b981;
    --color-success-bg: #ecfdf5;
    --color-success-border: #a7f3d0;

    --color-warning: #f59e0b;
    --color-warning-bg: #fffbeb;
    --color-warning-border: #fde68a;

    --color-danger: #ef4444;
    --color-danger-bg: #fef2f2;
    --color-danger-border: #fecaca;

    --color-info: #0ea5e9;
    --color-info-bg: #f0f9ff;
    --color-info-border: #bae6fd;

    /* --- Surface & Text --- */
    --color-bg-body: var(--color-slate-50);
    --color-bg-surface: #ffffff;
    --color-bg-subtle: var(--color-slate-100);

    --color-text-main: var(--color-slate-900);
    --color-text-body: var(--color-slate-700);
    --color-text-muted: var(--color-slate-500);
    --color-text-light: var(--color-slate-400);

    --color-border: var(--color-slate-200);
    --color-border-hover: var(--color-slate-300);

    /* --- Spacing System (4px baseline) --- */
    --space-1: 0.25rem;
    /* 4px */
    --space-2: 0.5rem;
    /* 8px */
    --space-3: 0.75rem;
    /* 12px */
    --space-4: 1rem;
    /* 16px */
    --space-6: 1.5rem;
    /* 24px */
    --space-8: 2rem;
    /* 32px */
    --space-12: 3rem;
    /* 48px */
    --space-16: 4rem;
    /* 64px */

    /* --- Radius --- */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-2xl: 1rem;
    --radius-full: 9999px;

    /* --- Shadows (Tailwind-inspired extended) --- */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);

    /* --- Typography --- */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
}

/* =========================================
   2. GLOBAL RESET & BASE STYLES
   ========================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text-body);
    background-color: var(--color-bg-body);
    background-image: radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 0) 0, transparent 50%), radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 0.05) 0, transparent 50%), radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 0) 0, transparent 50%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    animation: fadeIn 0.5s ease-out;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

input,
button,
textarea,
select {
    font: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0 0 var(--space-4) 0;
    font-weight: 700;
    color: var(--color-text-main);
    line-height: 1.2;
    letter-spacing: -0.025em;
    /* Tightens visuals for premium feel */
}

h1 {
    font-size: var(--font-size-4xl);
}

h2 {
    font-size: var(--font-size-3xl);
}

h3 {
    font-size: var(--font-size-2xl);
}

h4 {
    font-size: var(--font-size-xl);
}

p {
    margin: 0 0 var(--space-4) 0;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.15s ease;
    font-weight: 500;
}

a:hover {
    color: var(--color-slate-700);
}

hr {
    border: 0;
    border-top: 1px solid var(--color-border);
    margin: var(--space-6) 0;
}

/* =========================================
   3. BUTTONS
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.625rem 1.25rem;
    font-size: var(--font-size-sm);
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.btn:active {
    transform: translateY(1px);
}

/* Variants */
.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2), 0 2px 4px -1px rgba(37, 99, 235, 0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #4338ca 100%);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3), 0 4px 6px -2px rgba(37, 99, 235, 0.15);
    transform: translateY(-1px);
}

.btn-secondary,
.btn-white {
    background-color: white;
    border-color: var(--color-border);
    color: var(--color-text-main);
}

.btn-secondary:hover,
.btn-white:hover {
    background-color: var(--color-slate-50);
    border-color: var(--color-slate-300);
    color: #000;
}

.btn-danger {
    background-color: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
    box-shadow: var(--shadow-md);
}

.btn-ghost {
    background-color: transparent;
    color: var(--color-text-muted);
    box-shadow: none;
}

.btn-ghost:hover {
    background-color: var(--color-slate-100);
    color: var(--color-text-main);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* =========================================
   4. FORMS
   ========================================= */
.form-group {
    margin-bottom: var(--space-4);
}

label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-main);
    margin-bottom: var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: var(--color-text-main);
    background-color: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.form-control::placeholder {
    color: var(--color-slate-400);
}

.form-control:hover {
    border-color: var(--color-slate-300);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
    /* Matches slate colors */
}

select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
    padding-right: 2.5rem;
    appearance: none;
}

/* =========================================
   5. CARDS & CONTAINERS
   ========================================= */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.card {
    background: var(--color-bg-surface);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: var(--radius-xl);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.01);
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.card-header {
    margin-bottom: var(--space-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-border);
}

/* =========================================
   6. TABLES
   ========================================= */
.table-container {
    width: 100%;
    overflow-x: auto;
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    background-color: var(--color-slate-50);
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-3) var(--space-6);
    border-bottom: 1px solid var(--color-border);
}

.data-table td {
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
    color: var(--color-text-body);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background-color: var(--color-slate-50);
}

/* =========================================
   7. BADGES
   ========================================= */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.badge-success {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid var(--color-success-border);
}

.badge-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border: 1px solid var(--color-warning-border);
}

.badge-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border: 1px solid var(--color-danger-border);
}

.badge-info {
    background: var(--color-info-bg);
    color: var(--color-info);
    border: 1px solid var(--color-info-border);
}

.badge-neutral {
    background: var(--color-slate-100);
    color: var(--color-slate-600);
    border: 1px solid var(--color-slate-200);
}

.badge-primary {
    background: #eff6ff;
    /* Blue-50 */
    color: #1d4ed8;
    /* Blue-700 */
    border: 1px solid #dbeafe;
    /* Blue-100 */
}

.badge-purple {
    background: #f5f3ff;
    /* Violet-50 */
    color: #7c3aed;
    /* Violet-600 */
    border: 1px solid #ddd6fe;
    /* Violet-100 */
}

/* =========================================
   8. NOTIFICATIONS & ALERTS
   ========================================= */
.alert {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
    margin-bottom: var(--space-4);
    font-size: 0.925rem;
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
}

.alert strong {
    font-weight: 600;
}

.alert-info {
    background: var(--color-info-bg);
    color: #0369a1;
    border-color: var(--color-info-border);
}

.alert-success {
    background: var(--color-success-bg);
    color: #047857;
    border-color: var(--color-success-border);
}

.alert-danger {
    background: var(--color-danger-bg);
    color: #b91c1c;
    border-color: var(--color-danger-border);
}

.alert-warning {
    background: var(--color-warning-bg);
    color: #b45309;
    border-color: var(--color-warning-border);
}

/* =========================================
   9. INTERACTIVE ELEMENTS (Nav, Tabs, Utils)
   ========================================= */

/* Navbar */
.navbar {
    background: var(--color-primary);
    color: white;
    padding: var(--space-3) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(8px);
    /* Glassmorphism hint if we add transparency later */
}

.navbar-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.navbar-menu {
    display: flex;
    gap: var(--space-6);
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: var(--color-slate-400);
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    color: white;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-6);
    gap: var(--space-6);
}

.tab-link {
    padding-bottom: var(--space-3);
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.tab-link:hover {
    color: var(--color-text-main);
}

.tab-link.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Toggle Switch */
.switch {
    display: inline-block;
    width: 44px;
    height: 24px;
    position: relative;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    inset: 0;
    background-color: var(--color-slate-300);
    border-radius: 99px;
    transition: .3s;
    cursor: pointer;
}

.slider:before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: .3s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
    background-color: var(--color-success);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* Avatars */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--color-slate-200);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-muted);
    border: 2px solid white;
}

.avatar-group {
    display: flex;
}

.avatar-group .avatar {
    margin-left: -12px;
    border: 2px solid white;
}

.avatar-group .avatar:hover {
    z-index: 10;
    transform: translateY(-2px);
    transition: 0.2s;
}

/* Timeline */
.timeline {
    list-style: none;
    padding: 0;
    position: relative;
    border-left: 2px solid var(--color-border);
    margin: var(--space-4) 0 0 var(--space-2);
}

.timeline-item {
    padding-left: var(--space-6);
    margin-bottom: var(--space-6);
    position: relative;
}

.timeline-marker {
    position: absolute;
    left: -8px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 2px solid white;
    box-shadow: 0 0 0 1px var(--color-border);
}

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.kpi-card {
    background: white;
    padding: var(--space-6);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.kpi-content {
    flex: 1;
}

.kpi-content p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.kpi-content h3 {
    margin: var(--space-1) 0 var(--space-1) 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text-main);
}

.kpi-content .text-sm {
    margin: 0;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* =========================================
   10. MODAL
   ========================================= */
.modal {
    background-color: rgba(15, 23, 42, 0.6);
    /* Slate 900 with opacity */
    backdrop-filter: blur(4px);
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 20px 0;
}

.modal.open {
    display: flex;
    animation: fadeIn 0.15s ease-out;
}

.modal-content {
    background: white;
    padding: var(--space-6);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 500px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    position: relative;
    animation: slideUp 0.2s ease-out;
    margin: auto;
}

.modal-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-slate-400);
    z-index: 10;
}

.modal-close:hover {
    color: var(--color-danger);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   11. UTILITIES
   ========================================= */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--color-text-muted);
}

.text-sm {
    font-size: 0.875rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: var(--space-2);
}

.gap-4 {
    gap: var(--space-4);
}

.mt-2 {
    margin-top: var(--space-2);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

.p-4 {
    padding: var(--space-4);
}

.grid-cols-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

.grid-cols-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
}

/* Additional Margin Utilities */
.mb-0 {
    margin-bottom: 0 !important;
}

.ml-auto {
    margin-left: auto;
}

.mr-auto {
    margin-right: auto;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* Font Weight */
.fw-bold {
    font-weight: 700;
}

.fw-semibold {
    font-weight: 600;
}

.fw-normal {
    font-weight: 400;
}

/* Opacity */
.opacity-80 {
    opacity: 0.8;
}

.opacity-60 {
    opacity: 0.6;
}

/* Additional Flex Utilities */
.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-start {
    justify-content: flex-start;
}

.justify-end {
    justify-content: flex-end;
}

.justify-center {
    justify-content: center;
}

.flex-wrap {
    flex-wrap: wrap;
}

/* Min Width */
.min-w-0 {
    min-width: 0;
}

/* Hide on mobile utility */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }

    .grid-cols-3,
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   12. ADVANCED COMPONENTS (Accordion, etc)
   ========================================= */

/* Accordion */
.accordion {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.accordion-item {
    border-bottom: 1px solid var(--color-border);
    background: white;
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    width: 100%;
    text-align: left;
    padding: var(--space-4);
    background: white;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-text-main);
    transition: background 0.2s;
}

.accordion-header:hover {
    background: var(--color-slate-50);
}

.accordion-header::after {
    content: "+";
    font-size: 1.25rem;
    font-weight: 400;
}

.accordion-content {
    display: none;
    padding: var(--space-4);
    border-top: 1px solid var(--color-border);
    background: var(--color-slate-50);
    color: var(--color-text-body);
    font-size: 0.875rem;
}

/* Active state usually toggled via JS class 'active' on item */
.accordion-item.active .accordion-content {
    display: block;
}

.accordion-item.active .accordion-header::after {
    content: "-";
}

/* Toast / Snackbar */
.toast-container {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    z-index: 1000;
}

.toast {
    min-width: 300px;
    background: white;
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border-left: 4px solid var(--color-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideInRight 0.3s ease;
}

.toast-success {
    border-left-color: var(--color-success);
}

.toast-error {
    border-left-color: var(--color-danger);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Tooltip (CSS only) */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 140px;
    background-color: var(--color-slate-900);
    color: #fff;
    text-align: center;
    border-radius: var(--radius-md);
    padding: 6px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -70px;
    /* Center it */
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 0.75rem;
    font-weight: 500;
    box-shadow: var(--shadow-md);
}

.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--color-slate-900) transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Stepper */
.stepper {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-8);
    position: relative;
}

.stepper::before {
    content: "";
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-slate-200);
    z-index: 0;
}

.step {
    position: relative;
    z-index: 1;
    text-align: center;
    background: var(--color-bg-body);
    /* Mask line behind */
    padding: 0 var(--space-2);
}

.step-circle {
    width: 32px;
    height: 32px;
    background: var(--color-slate-100);
    border: 2px solid var(--color-slate-300);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-2);
    font-weight: 600;
    color: var(--color-text-muted);
    transition: all 0.2s;
}

.step.active .step-circle {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    box-shadow: 0 0 0 4px var(--color-slate-100);
}

.step.completed .step-circle {
    background: var(--color-success);
    border-color: var(--color-success);
    color: white;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.step.active .step-label {
    color: var(--color-primary);
}



/* =========================================
   13. LOADING STATES & SKELETONS
   ========================================= */

/* Spinner */
.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-slate-200);
    border-bottom-color: var(--color-primary);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Skeleton Loading (Shimmer) */
.skeleton {
    background-color: var(--color-slate-200);
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
}

.skeleton::after {
    display: block;
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

.skeleton-text {
    height: 0.875rem;
    margin-bottom: 0.5rem;
    width: 100%;
    border-radius: var(--radius-sm);
}

.skeleton-text:last-child {
    margin-bottom: 0;
}

.skeleton-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-rect {
    width: 100%;
    height: 150px;
    border-radius: var(--radius-md);
}

/* =========================================
   14. NAVIGATION COMPONENTS (Breadcrumbs, Pagination)
   ========================================= */

/* Breadcrumbs */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-4) 0;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item+.breadcrumb-item::before {
    content: "›";
    margin: 0 var(--space-2);
    color: var(--color-slate-400);
}

.breadcrumb-item a {
    color: var(--color-text-muted);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--color-text-main);
    font-weight: 500;
}

/* Pagination */
.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    gap: var(--space-1);
    /* Tight gap for seamless look */
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--space-2);
    font-size: 0.875rem;
    color: var(--color-text-main);
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.2s;
}

.page-link:hover {
    background-color: var(--color-slate-50);
    border-color: var(--color-slate-300);
    color: var(--color-primary);
}

.page-item.active .page-link {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.page-item.disabled .page-link {
    color: var(--color-slate-300);
    pointer-events: none;
    background-color: var(--color-slate-50);
}

/* =========================================
   15. FILE UPLOAD
   ========================================= */
.file-upload {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    text-align: center;
    background: var(--color-slate-50);
    transition: all 0.2s;
    cursor: pointer;
    color: var(--color-text-muted);
}

.file-upload:hover {
    border-color: var(--color-primary);
    background: #fff;
    color: var(--color-primary);
}

.file-upload-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-4);
    display: block;
    color: var(--color-slate-400);
}

.file-upload:hover .file-upload-icon {
    color: var(--color-primary);
}

/* =========================================
   16. CAROUSEL (Horizontal Scroll)
   ========================================= */
.carousel-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: var(--space-4);
    padding-bottom: var(--space-4);
    -webkit-overflow-scrolling: touch;
}

.carousel-item {
    flex: 0 0 300px;
    scroll-snap-align: start;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
}

/* =========================================
   17. DROPDOWNS
   ========================================= */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    min-width: 180px;
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    z-index: 50;
    margin-top: var(--space-2);
    overflow: hidden;
    animation: fadeIn 0.1s ease-out;
}

.dropdown-content a {
    color: var(--color-text-main);
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: block;
    font-size: 0.875rem;
    transition: background 0.1s;
}

.dropdown-content a:hover {
    background-color: var(--color-slate-50);
    color: var(--color-primary);
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* =========================================
   18. MODALS
   ========================================= */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    /* Slate-900 with opacity */
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.open {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background-color: white;
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-2xl);
    position: relative;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    /* Clip children */
}

.modal-header {
    padding: var(--space-6) var(--space-8);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.modal-body {
    padding: var(--space-6) var(--space-8);
    overflow-y: auto;
    flex-grow: 1;
}

.modal-footer {
    padding: var(--space-4) var(--space-8);
    border-top: 1px solid var(--color-border);
    background-color: var(--color-slate-50);
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

body.modal-open {
    overflow: hidden;
}

.modal-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-6);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-slate-400);
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.modal-close:hover {
    color: var(--color-slate-800);
}

/* =========================================
   UTILITIES (Added for Admin UI Consistency)
   ========================================= */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.items-start {
    align-items: flex-start;
}

.flex-1 {
    flex: 1 1 0%;
}

.shrink-0 {
    flex-shrink: 0;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.w-8 {
    width: 2rem;
}

.h-8 {
    height: 2rem;
}

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.hidden {
    display: none;
}

.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-base {
    font-size: 1rem;
    line-height: 1.5rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.font-bold {
    font-weight: 700;
}

.font-medium {
    font-weight: 500;
}

.bg-white {
    background-color: #ffffff;
}

.bg-slate-50 {
    background-color: #f8fafc;
}

.bg-slate-100 {
    background-color: #f1f5f9;
}

.bg-blue-50 {
    background-color: #eff6ff;
}

.text-slate-400 {
    color: #94a3b8;
}

.text-slate-500 {
    color: #64748b;
}

.text-slate-600 {
    color: #475569;
}

.text-slate-700 {
    color: #334155;
}

.text-slate-800 {
    color: #1e293b;
}

.text-blue-600 {
    color: #2563eb;
}

.border {
    border-width: 1px;
}

.border-b {
    border-bottom-width: 1px;
}

.border-slate-100 {
    border-color: #f1f5f9;
}

.border-slate-200 {
    border-color: #e2e8f0;
}

.border-blue-100 {
    border-color: #dbeafe;
}

.border-blue-500 {
    border-color: #3b82f6;
}

.rounded {
    border-radius: 0.25rem;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-full {
    border-radius: 9999px;
}

.shadow-xl {
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.cursor-pointer {
    cursor: pointer;
}

.hover\:bg-slate-50:hover {
    background-color: #f8fafc;
}

.p-4 {
    padding: 1rem;
}

.p-3 {
    padding: 0.75rem;
}

.p-2 {
    padding: 0.5rem;
}

.px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.py-1 {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.m-0 {
    margin: 0;
}

/* Added for Premium UI Inputs */
.pl-10 {
    padding-left: 2.5rem !important;
}

.pr-2 {
    padding-right: 0.5rem;
}

.pl-3 {
    padding-left: 0.75rem;
}

.left-3 {
    left: 0.75rem;
}

.right-3 {
    right: 0.75rem;
}

.top-1\/2 {
    top: 50%;
}

.transform {
    transform: translateX(0) translateY(0) rotate(0) skewX(0) skewY(0) scaleX(1) scaleY(1);
}

.translate-y-centered {
    transform: translateY(-50%);
}

.focus\:ring-2:focus {
    box-shadow: 0 0 0 2px #eff6ff, 0 0 0 4px #3b82f6;
    outline: none;
    border-color: #3b82f6;
}

.focus\:border-blue-500:focus {
    border-color: #3b82f6;
}

.focus-within\:ring-2:focus-within {
    box-shadow: 0 0 0 2px #eff6ff, 0 0 0 4px #3b82f6;
    outline: none;
    border-color: #3b82f6;
}

.focus-within\:border-blue-500:focus-within {
    border-color: #3b82f6;
}

.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.duration-300 {
    transition-duration: 300ms;
}

/* Width Utilities */
.w-16 {
    width: 4rem;
}

.w-20 {
    width: 5rem;
}

.w-24 {
    width: 6rem;
}

.w-32 {
    width: 8rem;
}

.w-40 {
    width: 10rem;
}

.w-auto {
    width: auto;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.peer:checked~.bg-blue-600 {
    background-color: #2563eb;
}

.peer:checked~.translate-x-6 {
    transform: translateX(1.5rem);
}