/*
 * ============================================================================
 * ROCHESTON ZELACCESS - Enterprise SSO/IAM Platform
 * Premium Design System - ZelExploits Brand Theme
 * ============================================================================
 *
 * Table of Contents:
 *   1.  Imports & Custom Properties
 *   2.  Reset & Normalize
 *   3.  Base Typography
 *   4.  Layout Shell (Sidebar, Topbar, Content)
 *   5.  Sidebar
 *   6.  Top Bar
 *   7.  Search Bar & Dropdown
 *   8.  Main Content Area
 *   9.  Cards
 *  10.  KPI Stat Cards
 *  11.  Tables
 *  12.  Forms & Inputs
 *  13.  Buttons
 *  14.  Badges & Pills
 *  15.  Modals
 *  16.  Notification Panel
 *  17.  Charts
 *  18.  Dashboard Hero
 *  19.  Progress Bars
 *  20.  Pagination
 *  21.  Alerts & Flash Messages
 *  22.  Wizard / Stepper
 *  23.  Chat Interface (AINA)
 *  24.  Loading Spinner
 *  25.  Breadcrumbs
 *  26.  Tabs
 *  27.  Login Page
 *  28.  Identity Flow Diagram
 *  29.  User Avatars
 *  30.  Empty States
 *  31.  Tooltips
 *  32.  Dropdown Menus
 *  33.  Code / Monospace Blocks
 *  34.  Profile Section
 *  35.  Grid Utilities
 *  36.  Animations & Keyframes
 *  37.  Responsive
 *
 * ============================================================================
 */

/* ============================================================================
   1. IMPORTS & CUSTOM PROPERTIES
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&family=Fira+Sans:wght@300;400;500;600;700&display=swap');

:root {
    /* -- ZelExploits Brand Palette -- */
    --bg-darkest:       #190c1e;
    --bg-dark:          #231230;
    --bg-medium:        #321a40;
    --bg-light:         #422350;
    --bg-lighter:       #573659;
    --bg-lightest:      #6e4570;

    --fg-primary:       #f5e6f0;
    --fg-secondary:     #dcc4d8;
    --fg-muted:         #b89ab2;
    --fg-dim:           #8c7088;

    --red:              #c94424;
    --red-bright:       #FB562D;
    --green:            #5a9636;
    --green-bright:     #72b848;
    --yellow:           #d4882a;
    --yellow-bright:    #FFA42E;
    --blue:             #d4882a;
    --blue-bright:      #FFA42E;
    --purple:           #a82a58;
    --purple-bright:    #D33665;
    --aqua:             #c42f62;
    --aqua-bright:      #D33665;
    --orange:           #d4882a;
    --orange-bright:    #FFA42E;

    /* -- Semantic Colors -- */
    --color-primary:    var(--blue-bright);
    --color-success:    var(--green);
    --color-danger:     var(--red-bright);
    --color-warning:    var(--yellow-bright);
    --color-info:       var(--purple-bright);
    --color-accent:     var(--purple-bright);

    /* -- Surfaces -- */
    --surface-base:     var(--bg-dark);
    --surface-raised:   var(--bg-medium);
    --surface-overlay:  var(--bg-light);
    --surface-sunken:   var(--bg-darkest);

    /* -- Borders -- */
    --border-subtle:    rgba(245, 230, 240, 0.06);
    --border-default:   rgba(245, 230, 240, 0.1);
    --border-strong:    rgba(245, 230, 240, 0.16);

    /* -- Shadows -- */
    --shadow-sm:        0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.15);
    --shadow-md:        0 4px 6px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-lg:        0 10px 25px rgba(0, 0, 0, 0.4), 0 6px 10px rgba(0, 0, 0, 0.2);
    --shadow-xl:        0 20px 40px rgba(0, 0, 0, 0.5), 0 10px 15px rgba(0, 0, 0, 0.25);
    --shadow-glow-blue: 0 0 20px rgba(255, 164, 46, 0.3);
    --shadow-glow-green:0 0 20px rgba(90, 150, 54, 0.3);
    --shadow-glow-red:  0 0 20px rgba(251, 86, 45, 0.3);

    /* -- Typography -- */
    --font-sans:        'Fira Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:        'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;

    --text-xs:          0.75rem;
    --text-sm:          0.8125rem;
    --text-base:        0.875rem;
    --text-md:          1rem;
    --text-lg:          1.125rem;
    --text-xl:          1.25rem;
    --text-2xl:         1.5rem;
    --text-3xl:         1.875rem;
    --text-4xl:         2.25rem;

    /* -- Spacing -- */
    --space-1:          0.25rem;
    --space-2:          0.5rem;
    --space-3:          0.75rem;
    --space-4:          1rem;
    --space-5:          1.25rem;
    --space-6:          1.5rem;
    --space-8:          2rem;
    --space-10:         2.5rem;
    --space-12:         3rem;
    --space-16:         4rem;

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

    /* -- Layout -- */
    --sidebar-width:    260px;
    --sidebar-collapsed-width: 60px;
    --topbar-height:    60px;
    --notification-panel-width: 380px;

    /* -- Transitions -- */
    --transition-fast:  150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base:  250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow:  400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring:400ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* -- Z-Index Scale -- */
    --z-base:           1;
    --z-dropdown:       100;
    --z-sticky:         200;
    --z-sidebar:        300;
    --z-topbar:         400;
    --z-modal-backdrop: 500;
    --z-modal:          600;
    --z-notification:   700;
    --z-tooltip:        800;
    --z-toast:          900;
}


/* ============================================================================
   2. RESET & NORMALIZE
   ============================================================================ */

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
    tab-size: 4;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: 400;
    line-height: 1.6;
    color: var(--fg-primary);
    background-color: var(--bg-dark);
    overflow-x: hidden;
    min-height: 100vh;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

input, button, textarea, select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

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

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

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--fg-primary);
}

p {
    margin-bottom: var(--space-4);
    color: var(--fg-secondary);
}

hr {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: var(--space-6) 0;
}

::selection {
    background-color: rgba(69, 133, 136, 0.4);
    color: var(--fg-primary);
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-lighter);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--fg-dim);
}


/* ============================================================================
   3. BASE TYPOGRAPHY
   ============================================================================ */

.text-xs     { font-size: var(--text-xs); }
.text-sm     { font-size: var(--text-sm); }
.text-base   { font-size: var(--text-base); }
.text-md     { font-size: var(--text-md); }
.text-lg     { font-size: var(--text-lg); }
.text-xl     { font-size: var(--text-xl); }
.text-2xl    { font-size: var(--text-2xl); }
.text-3xl    { font-size: var(--text-3xl); }
.text-4xl    { font-size: var(--text-4xl); }

.font-light  { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semi   { font-weight: 600; }
.font-bold   { font-weight: 700; }

.text-muted  { color: var(--fg-muted); }
.text-dim    { color: var(--fg-dim); }
.text-primary{ color: var(--fg-primary); }
.text-accent { color: var(--blue-bright); }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mono {
    font-family: var(--font-mono);
}


/* ============================================================================
   4. LAYOUT SHELL
   ============================================================================ */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-body {
    display: block;
    min-height: 100vh;
}


/* ============================================================================
   5. SIDEBAR
   ============================================================================ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #110118 0%, #1e0228 40%, #2a0338 75%, #380548 100%);
    border-right: 1px solid rgba(123, 10, 87, 0.55);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5), 1px 0 0 rgba(255, 164, 46, 0.06);
    z-index: var(--z-sidebar);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-base);
    overflow: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    isolation: isolate;
}

.sidebar.sidebar-collapsed {
    width: var(--sidebar-collapsed-width);
}

/* -- Logo Area -- */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-5);
    height: var(--topbar-height);
    border-bottom: 1px solid rgba(123, 10, 87, 0.3);
    flex-shrink: 0;
    overflow: hidden;
    transition: padding var(--transition-base), gap var(--transition-base);
}

.sidebar-collapsed .sidebar-logo {
    padding: var(--space-5) 0;
    justify-content: center;
    gap: 0;
}

.sidebar-logo-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #AA2E08, #FFA42E);
    border-radius: var(--radius-md);
    color: #1a0108;
    font-weight: 700;
    font-size: var(--text-sm);
    box-shadow: 0 2px 10px rgba(255, 164, 46, 0.35);
}

.sidebar-logo-text {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--fg-primary);
    white-space: nowrap;
    opacity: 1;
    width: auto;
    overflow: hidden;
    transition: opacity var(--transition-base), width var(--transition-base);
    letter-spacing: -0.01em;
}

.sidebar-logo-text span {
    color: var(--blue-bright);
}

.sidebar-collapsed .sidebar-logo-text {
    opacity: 0;
    pointer-events: none;
    width: 0;
    overflow: hidden;
}

/* -- Navigation -- */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--space-3) 0;
}

.sidebar-section {
    margin-bottom: var(--space-2);
}

.sidebar-section-label {
    display: block;
    padding: var(--space-3) var(--space-5) var(--space-1);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-dim);
    white-space: nowrap;
    opacity: 1;
    transition: opacity var(--transition-fast);
}

.sidebar-collapsed .sidebar-section-label {
    opacity: 0;
    height: 0;
    padding: 0;
    overflow: hidden;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-5);
    margin: 1px var(--space-2);
    border-radius: var(--radius-md);
    color: var(--fg-muted);
    font-size: var(--text-sm);
    font-weight: 400;
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    border-left: 3px solid transparent;
    text-decoration: none;
}

.sidebar-item:hover {
    color: #fff;
    background: rgba(123, 10, 87, 0.25);
}

.sidebar-item.active {
    color: #fff;
    background: rgba(123, 10, 87, 0.35);
    border-left-color: #FFA42E;
    font-weight: 500;
    box-shadow: inset 0 0 20px rgba(255, 164, 46, 0.05);
}

.sidebar-item.active .sidebar-item-icon {
    color: #FFA42E;
}

.sidebar-item-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fg-dim);
    transition: color var(--transition-fast);
}

.sidebar-item-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

.sidebar-item-text {
    opacity: 1;
    width: auto;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity var(--transition-base), width var(--transition-base);
}

.sidebar-collapsed .sidebar-item-text {
    opacity: 0;
    pointer-events: none;
    width: 0;
    overflow: hidden;
}

.sidebar-collapsed .sidebar-item {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    margin: 1px var(--space-1);
    border-left: none;
    gap: 0;
}

.sidebar-item-badge {
    margin-left: auto;
    background: var(--red);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.sidebar-collapsed .sidebar-item-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 14px;
    height: 14px;
    font-size: 0.6rem;
    padding: 0 3px;
}

/* -- Sidebar Footer -- */
.sidebar-footer {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid rgba(123, 10, 87, 0.3);
    flex-shrink: 0;
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: var(--space-2);
    border-radius: var(--radius-md);
    color: var(--fg-dim);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
    color: #fff;
    background: rgba(123, 10, 87, 0.25);
}

.sidebar-toggle svg {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-base);
}

.sidebar-collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}


/* ============================================================================
   6. TOP BAR
   ============================================================================ */

.topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    height: var(--topbar-height);
    background: rgba(22, 4, 30, 0.92);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid rgba(123, 10, 87, 0.4);
    z-index: var(--z-topbar);
    display: flex;
    align-items: center;
    padding: 0 var(--space-6);
    gap: var(--space-4);
    transition: left var(--transition-base);
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

body.sidebar-is-collapsed .topbar {
    left: var(--sidebar-collapsed-width);
}

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

.topbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
}

.topbar-menu-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--fg-secondary);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
    flex-shrink: 0;
}
.topbar-menu-btn:hover {
    background: rgba(255, 164, 46, 0.1);
    color: var(--fg-primary);
}

.topbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 560px;
    margin: 0 auto;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
}

/* -- Notification Bell -- */
.topbar-icon-btn {
    position: relative;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--fg-muted);
    transition: all var(--transition-fast);
}

.topbar-icon-btn:hover {
    color: var(--fg-primary);
    background: rgba(235, 219, 178, 0.06);
}

.topbar-icon-btn svg {
    width: 20px;
    height: 20px;
}

.topbar-icon-btn .badge-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--red);
    border-radius: 50%;
    border: 2px solid var(--bg-dark);
    animation: pulse 2s infinite;
}

/* -- Profile Avatar Dropdown -- */
.topbar-profile {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-2) var(--space-1) var(--space-1);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    position: relative;
    user-select: none;
}

.topbar-profile:hover {
    background: rgba(235, 219, 178, 0.06);
}

.topbar-profile-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

.topbar-profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.topbar-profile-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--fg-secondary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-profile-chevron {
    width: 14px;
    height: 14px;
    color: var(--fg-dim);
    transition: transform var(--transition-fast);
}

.topbar-profile.open .topbar-profile-chevron {
    transform: rotate(180deg);
}


/* ============================================================================
   7. SEARCH BAR & DROPDOWN
   ============================================================================ */

.search-bar {
    position: relative;
    width: 100%;
}

.search-bar-input {
    width: 100%;
    height: 40px;
    padding: 0 var(--space-4) 0 42px;
    background: rgba(235, 219, 178, 0.05);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    color: var(--fg-primary);
    font-size: var(--text-sm);
    outline: none;
    transition: all var(--transition-base);
    backdrop-filter: blur(4px);
}

.search-bar-input::placeholder {
    color: var(--fg-dim);
}

.search-bar-input:focus {
    background: rgba(235, 219, 178, 0.08);
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(69, 133, 136, 0.15), var(--shadow-sm);
}

.search-bar-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--fg-dim);
    pointer-events: none;
}

.search-bar-shortcut {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: var(--text-xs);
    font-family: var(--font-mono);
    color: var(--fg-dim);
    background: var(--bg-medium);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    pointer-events: none;
}

/* -- Search Dropdown -- */
.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-darkest);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-height: 420px;
    overflow-y: auto;
    z-index: var(--z-dropdown);
    display: none;
    animation: fadeIn var(--transition-fast) ease-out;
}

.search-dropdown.open {
    display: block;
}

.search-dropdown-section {
    padding: var(--space-3) var(--space-4) var(--space-1);
}

.search-dropdown-label {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-dim);
    margin-bottom: var(--space-2);
}

.search-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    margin: 0 var(--space-1);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.search-dropdown-item:hover,
.search-dropdown-item.highlighted {
    background: rgba(235, 219, 178, 0.06);
}

.search-dropdown-item-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: var(--bg-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fg-dim);
    flex-shrink: 0;
}

.search-dropdown-item-icon svg {
    width: 16px;
    height: 16px;
}

.search-dropdown-item-text {
    flex: 1;
    min-width: 0;
}

.search-dropdown-item-title {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--fg-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-dropdown-item-desc {
    font-size: var(--text-xs);
    color: var(--fg-dim);
}

.search-dropdown-footer {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}

.search-dropdown-footer a {
    font-size: var(--text-xs);
    color: var(--blue-bright);
}


/* ============================================================================
   8. MAIN CONTENT AREA
   ============================================================================ */

.main-content {
    margin-left: var(--sidebar-width);
    padding: calc(var(--topbar-height) + var(--space-6)) var(--space-6) var(--space-6);
    min-height: 100vh;
    max-width: 1440px;
    transition: margin-left var(--transition-base);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
    gap: var(--space-4);
    flex-wrap: wrap;
}

.page-header-left {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.page-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--fg-primary);
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: var(--text-sm);
    color: var(--fg-dim);
    margin-bottom: 0;
}

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

.content-section {
    margin-bottom: var(--space-8);
}

.section-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--fg-primary);
    margin-bottom: var(--space-4);
}

.section-subtitle {
    font-size: var(--text-sm);
    color: var(--fg-dim);
    margin-bottom: var(--space-4);
}


/* ============================================================================
   9. CARDS
   ============================================================================ */

.card {
    background: var(--surface-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-default);
    transform: translateY(-1px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-5) var(--space-3);
    border-bottom: 1px solid var(--border-subtle);
}

.card-header-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--fg-primary);
}

.card-header-subtitle {
    font-size: var(--text-xs);
    color: var(--fg-dim);
    margin-top: 2px;
}

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

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

.card-footer {
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(29, 32, 33, 0.3);
}

.card-flush .card-body {
    padding: 0;
}

.card-interactive {
    cursor: pointer;
}

.card-interactive:hover {
    border-color: var(--blue);
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(69, 133, 136, 0.1);
}

.card-highlight {
    border-color: var(--blue);
    box-shadow: var(--shadow-glow-blue);
}


/* ============================================================================
   10. KPI STAT CARDS
   ============================================================================ */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-5);
    margin-bottom: var(--space-6);
}

.kpi-card {
    background: var(--surface-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--blue);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.kpi-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.kpi-card:hover::before {
    opacity: 1;
}

.kpi-card--blue::before   { background: var(--blue); opacity: 1; }
.kpi-card--green::before  { background: var(--green); opacity: 1; }
.kpi-card--yellow::before { background: var(--yellow); opacity: 1; }
.kpi-card--red::before    { background: var(--red); opacity: 1; }
.kpi-card--purple::before { background: var(--purple); opacity: 1; }
.kpi-card--orange::before { background: var(--orange); opacity: 1; }

.kpi-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.kpi-label {
    font-size: var(--text-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-dim);
}

.kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(69, 133, 136, 0.1);
    color: var(--blue-bright);
}

.kpi-icon svg {
    width: 18px;
    height: 18px;
}

.kpi-value {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--fg-primary);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.kpi-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.kpi-trend--up {
    color: var(--green-bright);
    background: rgba(152, 151, 26, 0.12);
}

.kpi-trend--down {
    color: var(--red-bright);
    background: rgba(204, 36, 29, 0.12);
}

.kpi-trend--flat {
    color: var(--fg-dim);
    background: rgba(235, 219, 178, 0.06);
}

.kpi-trend svg {
    width: 12px;
    height: 12px;
}

.kpi-sparkline {
    height: 32px;
    flex: 1;
    max-width: 100px;
}

.kpi-sparkline canvas {
    width: 100% !important;
    height: 100% !important;
}

.kpi-period {
    font-size: var(--text-xs);
    color: var(--fg-dim);
}


/* ============================================================================
   11. TABLES
   ============================================================================ */

.table-container {
    background: var(--surface-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
    gap: var(--space-3);
    flex-wrap: wrap;
}

.table-toolbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.table-toolbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.table-filter-input {
    height: 34px;
    padding: 0 var(--space-3) 0 34px;
    background: var(--bg-dark);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--fg-primary);
    font-size: var(--text-sm);
    outline: none;
    min-width: 200px;
    transition: all var(--transition-fast);
}

.table-filter-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(69, 133, 136, 0.15);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fg-dim);
    text-align: left;
    background: var(--bg-darkest);
    border-bottom: 1px solid var(--border-default);
    position: sticky;
    top: 0;
    z-index: var(--z-base);
    white-space: nowrap;
    user-select: none;
}

thead th.sortable {
    cursor: pointer;
    transition: color var(--transition-fast);
}

thead th.sortable:hover {
    color: var(--fg-primary);
}

thead th.sorted {
    color: var(--blue-bright);
}

tbody tr {
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
}

tbody tr:nth-child(even) {
    background: rgba(29, 32, 33, 0.2);
}

tbody tr:hover {
    background: rgba(69, 133, 136, 0.06);
}

tbody td {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--fg-secondary);
    vertical-align: middle;
}

tbody tr:last-child {
    border-bottom: none;
}

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

.table-action-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--fg-dim);
    transition: all var(--transition-fast);
}

.table-action-btn:hover {
    color: var(--fg-primary);
    background: rgba(235, 219, 178, 0.08);
}

.table-action-btn--danger:hover {
    color: var(--red-bright);
    background: rgba(204, 36, 29, 0.1);
}

.table-action-btn svg {
    width: 15px;
    height: 15px;
}

.table-empty {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    color: var(--fg-dim);
}

.table-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--blue);
    cursor: pointer;
}


/* ============================================================================
   12. FORMS & INPUTS
   ============================================================================ */

.form-group {
    margin-bottom: var(--space-5);
    position: relative;
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--fg-secondary);
    margin-bottom: var(--space-2);
}

.form-label .required {
    color: var(--red-bright);
    margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
    display: block;
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-dark);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--fg-primary);
    font-size: var(--text-base);
    outline: none;
    transition: all var(--transition-fast);
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(69, 133, 136, 0.15);
    background: var(--bg-darkest);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--fg-dim);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-input--error,
.form-select--error,
.form-textarea--error {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(204, 36, 29, 0.1);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.6;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a89984' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.form-hint {
    font-size: var(--text-xs);
    color: var(--fg-dim);
    margin-top: var(--space-1);
}

.form-error {
    font-size: var(--text-xs);
    color: var(--red-bright);
    margin-top: var(--space-1);
    display: flex;
    align-items: center;
    gap: 4px;
}

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

.form-floating .form-input,
.form-floating .form-select,
.form-floating .form-textarea {
    padding-top: var(--space-5);
    padding-bottom: var(--space-2);
}

.form-floating .form-label {
    position: absolute;
    top: 50%;
    left: var(--space-4);
    transform: translateY(-50%);
    color: var(--fg-dim);
    font-size: var(--text-base);
    font-weight: 400;
    pointer-events: none;
    transition: all var(--transition-fast);
    margin-bottom: 0;
    background: transparent;
}

.form-floating .form-textarea ~ .form-label {
    top: var(--space-4);
    transform: none;
}

.form-floating .form-input:focus ~ .form-label,
.form-floating .form-input:not(:placeholder-shown) ~ .form-label,
.form-floating .form-select:focus ~ .form-label,
.form-floating .form-select:not([value=""]) ~ .form-label,
.form-floating .form-textarea:focus ~ .form-label,
.form-floating .form-textarea:not(:placeholder-shown) ~ .form-label {
    top: 8px;
    left: var(--space-4);
    transform: none;
    font-size: var(--text-xs);
    color: var(--blue-bright);
    font-weight: 500;
}

/* -- Toggle / Switch -- */
.form-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    user-select: none;
}

.form-toggle-input {
    display: none;
}

.form-toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--bg-light);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
    flex-shrink: 0;
}

.form-toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: var(--fg-dim);
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.form-toggle-input:checked + .form-toggle-slider {
    background: var(--blue);
}

.form-toggle-input:checked + .form-toggle-slider::before {
    transform: translateX(20px);
    background: #fff;
}

.form-toggle-label {
    font-size: var(--text-sm);
    color: var(--fg-secondary);
}

/* -- File Upload -- */
.form-file-upload {
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-8) var(--space-6);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: rgba(29, 32, 33, 0.3);
}

.form-file-upload:hover {
    border-color: var(--blue);
    background: rgba(69, 133, 136, 0.04);
}

.form-file-upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-3);
    color: var(--fg-dim);
}

.form-file-upload-icon svg {
    width: 100%;
    height: 100%;
}

.form-file-upload-text {
    font-size: var(--text-sm);
    color: var(--fg-dim);
    margin-bottom: 0;
}

.form-file-upload-text strong {
    color: var(--blue-bright);
    font-weight: 500;
}

.form-file-upload input[type="file"] {
    display: none;
}

/* -- Inline form row -- */
.form-row {
    display: flex;
    gap: var(--space-4);
}

.form-row .form-group {
    flex: 1;
}


/* ============================================================================
   13. BUTTONS
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-5);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.5;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
    user-select: none;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.97);
}

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

.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* -- Sizes -- */
.btn-xs {
    padding: 2px var(--space-2);
    font-size: var(--text-xs);
    border-radius: var(--radius-sm);
}

.btn-sm {
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-sm);
}

.btn-lg {
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-md);
}

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

.btn-primary:hover {
    background: var(--blue-bright);
    border-color: var(--blue-bright);
    box-shadow: var(--shadow-glow-blue);
}

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

.btn-success:hover {
    background: var(--green-bright);
    border-color: var(--green-bright);
    box-shadow: var(--shadow-glow-green);
}

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

.btn-danger:hover {
    background: var(--red-bright);
    border-color: var(--red-bright);
    box-shadow: var(--shadow-glow-red);
}

/* -- Warning -- */
.btn-warning {
    background: var(--yellow);
    color: var(--bg-darkest);
    border-color: var(--yellow);
}

.btn-warning:hover {
    background: var(--yellow-bright);
    border-color: var(--yellow-bright);
    box-shadow: 0 0 20px rgba(215, 153, 33, 0.3);
}

/* -- Ghost / Secondary -- */
.btn-ghost {
    background: transparent;
    color: var(--fg-secondary);
    border-color: var(--border-default);
}

.btn-ghost:hover {
    background: rgba(235, 219, 178, 0.06);
    color: var(--fg-primary);
    border-color: var(--border-strong);
}

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

.btn-outline-primary:hover {
    background: rgba(69, 133, 136, 0.12);
    border-color: var(--blue-bright);
}

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

.btn-outline-success:hover {
    background: rgba(152, 151, 26, 0.12);
    border-color: var(--green-bright);
}

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

.btn-outline-danger:hover {
    background: rgba(204, 36, 29, 0.12);
    border-color: var(--red-bright);
}

/* -- Icon Only -- */
.btn-icon {
    padding: var(--space-2);
    width: 36px;
    height: 36px;
}

.btn-icon.btn-sm {
    width: 30px;
    height: 30px;
    padding: var(--space-1);
}

.btn-icon.btn-lg {
    width: 44px;
    height: 44px;
}

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

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

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

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

.btn-group .btn + .btn {
    margin-left: -1px;
}


/* ============================================================================
   14. BADGES & PILLS
   ============================================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
    line-height: 1.6;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Status badges */
.badge-active,
.badge-success,
.badge-enabled,
.badge-connected,
.badge-online,
.badge-healthy {
    background: rgba(152, 151, 26, 0.15);
    color: var(--green-bright);
}

.badge-active .badge-dot,
.badge-success .badge-dot {
    background: var(--green-bright);
}

.badge-inactive,
.badge-disabled,
.badge-offline,
.badge-archived {
    background: rgba(168, 153, 132, 0.15);
    color: var(--fg-dim);
}

.badge-inactive .badge-dot {
    background: var(--fg-dim);
}

.badge-suspended,
.badge-error,
.badge-failed,
.badge-blocked,
.badge-critical {
    background: rgba(204, 36, 29, 0.15);
    color: var(--red-bright);
}

.badge-suspended .badge-dot,
.badge-error .badge-dot {
    background: var(--red-bright);
}

.badge-pending,
.badge-warning,
.badge-expiring {
    background: rgba(215, 153, 33, 0.15);
    color: var(--yellow-bright);
}

.badge-pending .badge-dot {
    background: var(--yellow-bright);
}

.badge-info,
.badge-syncing,
.badge-processing {
    background: rgba(69, 133, 136, 0.15);
    color: var(--blue-bright);
}

.badge-info .badge-dot {
    background: var(--blue-bright);
}

/* Severity badges */
.badge-low {
    background: rgba(69, 133, 136, 0.15);
    color: var(--blue-bright);
}

.badge-medium {
    background: rgba(215, 153, 33, 0.15);
    color: var(--yellow-bright);
}

.badge-high {
    background: rgba(214, 93, 14, 0.15);
    color: var(--orange-bright);
}

.badge-severity-critical {
    background: rgba(204, 36, 29, 0.18);
    color: var(--red-bright);
    animation: pulse 2s ease-in-out infinite;
}

/* Role badges */
.badge-admin {
    background: rgba(177, 98, 134, 0.15);
    color: var(--purple-bright);
}

.badge-user {
    background: rgba(104, 157, 106, 0.15);
    color: var(--aqua-bright);
}

/* Count badge (small numeric) */
.badge-count {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--red);
    color: #fff;
}


/* ============================================================================
   15. MODALS
   ============================================================================ */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: var(--z-modal-backdrop);
    display: none;
    animation: fadeIn var(--transition-fast) ease-out;
}

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

.modal {
    background: var(--bg-dark);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideInUp var(--transition-base) ease-out;
    margin: var(--space-6);
}

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

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

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

.modal-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--fg-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--fg-dim);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    color: var(--fg-primary);
    background: rgba(235, 219, 178, 0.08);
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

.modal-body {
    padding: var(--space-6);
    overflow-y: auto;
    flex: 1;
}

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

/* Confirm dialog variant */
.modal-confirm .modal-body {
    text-align: center;
    padding: var(--space-8) var(--space-6);
}

.modal-confirm-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--space-4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-confirm-icon--danger {
    background: rgba(204, 36, 29, 0.12);
    color: var(--red-bright);
}

.modal-confirm-icon--warning {
    background: rgba(215, 153, 33, 0.12);
    color: var(--yellow-bright);
}

.modal-confirm-icon svg {
    width: 28px;
    height: 28px;
}


/* ============================================================================
   16. NOTIFICATION PANEL
   ============================================================================ */

.notification-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--notification-panel-width);
    background: var(--bg-darkest);
    border-left: 1px solid var(--border-subtle);
    z-index: var(--z-notification);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition-base);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
}

.notification-panel.open {
    transform: translateX(0);
    animation: slideInRight var(--transition-base) ease-out;
}

.notification-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.notification-panel-title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--fg-primary);
}

.notification-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-2) 0;
}

.notification-item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.notification-item:hover {
    background: rgba(235, 219, 178, 0.03);
}

.notification-item.unread {
    background: rgba(69, 133, 136, 0.04);
}

.notification-item--info {
    border-left-color: var(--blue);
}

.notification-item--success {
    border-left-color: var(--green);
}

.notification-item--warning {
    border-left-color: var(--yellow);
}

.notification-item--error {
    border-left-color: var(--red);
}

.notification-item--system {
    border-left-color: var(--purple);
}

.notification-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--bg-medium);
}

.notification-item-icon svg {
    width: 16px;
    height: 16px;
}

.notification-item--info .notification-item-icon    { color: var(--blue-bright); }
.notification-item--success .notification-item-icon { color: var(--green-bright); }
.notification-item--warning .notification-item-icon { color: var(--yellow-bright); }
.notification-item--error .notification-item-icon   { color: var(--red-bright); }
.notification-item--system .notification-item-icon  { color: var(--purple-bright); }

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

.notification-item-title {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--fg-primary);
    margin-bottom: 2px;
}

.notification-item-desc {
    font-size: var(--text-xs);
    color: var(--fg-dim);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-item-time {
    font-size: var(--text-xs);
    color: var(--fg-dim);
    margin-top: 4px;
}

.notification-panel-footer {
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--border-subtle);
    text-align: center;
    flex-shrink: 0;
}

.notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12) var(--space-6);
    color: var(--fg-dim);
}

.notification-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-4);
    opacity: 0.3;
}


/* ============================================================================
   17. CHARTS
   ============================================================================ */

.chart-container {
    position: relative;
    width: 100%;
    padding: var(--space-4);
}

.chart-container canvas {
    width: 100% !important;
}

.chart-wrapper {
    background: var(--surface-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
}

.chart-wrapper-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.chart-wrapper-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--fg-primary);
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--fg-muted);
}

.chart-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
}


/* ============================================================================
   18. DASHBOARD HERO
   ============================================================================ */

.dashboard-hero {
    position: relative;
    background: linear-gradient(135deg, var(--bg-darkest) 0%, var(--bg-dark) 50%, rgba(69, 133, 136, 0.08) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-8) var(--space-8);
    margin-bottom: var(--space-6);
    overflow: hidden;
}

.dashboard-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(69, 133, 136, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.dashboard-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: 10%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(177, 98, 134, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.dashboard-hero-content {
    position: relative;
    z-index: 1;
}

.dashboard-hero-greeting {
    font-size: var(--text-sm);
    color: var(--fg-dim);
    margin-bottom: var(--space-2);
}

.dashboard-hero-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--fg-primary);
    margin-bottom: var(--space-2);
    letter-spacing: -0.02em;
}

.dashboard-hero-subtitle {
    font-size: var(--text-base);
    color: var(--fg-muted);
    margin-bottom: var(--space-6);
    max-width: 600px;
}

.dashboard-hero-stats {
    display: flex;
    gap: var(--space-8);
    flex-wrap: wrap;
}

.dashboard-hero-stat {
    text-align: left;
}

.dashboard-hero-stat-value {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--fg-primary);
    font-variant-numeric: tabular-nums;
}

.dashboard-hero-stat-label {
    font-size: var(--text-xs);
    color: var(--fg-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}


/* ============================================================================
   19. PROGRESS BARS
   ============================================================================ */

.progress {
    height: 8px;
    background: var(--bg-light);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--blue);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: progressShimmer 2s ease-in-out infinite;
}

.progress-bar--green  { background: var(--green); }
.progress-bar--yellow { background: var(--yellow); }
.progress-bar--red    { background: var(--red); }
.progress-bar--orange { background: var(--orange); }
.progress-bar--purple { background: var(--purple); }

.progress-sm { height: 4px; }
.progress-lg { height: 12px; }

.progress-labeled {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
}

.progress-labeled-text {
    font-size: var(--text-sm);
    color: var(--fg-secondary);
}

.progress-labeled-value {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--fg-primary);
    font-variant-numeric: tabular-nums;
}

/* Animated striped progress */
.progress-bar--striped {
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.08) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.08) 75%,
        transparent 75%
    );
    background-size: 20px 20px;
    animation: progressStripe 1s linear infinite;
}


/* ============================================================================
   20. PAGINATION
   ============================================================================ */

.pagination {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    justify-content: center;
    padding: var(--space-4) 0;
}

.pagination-item {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--fg-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0 var(--space-2);
}

.pagination-item:hover {
    background: rgba(235, 219, 178, 0.06);
    color: var(--fg-primary);
}

.pagination-item.active {
    background: var(--blue);
    color: #fff;
    font-weight: 600;
}

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

.pagination-item svg {
    width: 16px;
    height: 16px;
}

.pagination-ellipsis {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fg-dim);
    font-size: var(--text-sm);
}

.pagination-info {
    font-size: var(--text-sm);
    color: var(--fg-dim);
    margin-right: var(--space-4);
}


/* ============================================================================
   21. ALERTS & FLASH MESSAGES
   ============================================================================ */

.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
    margin-bottom: var(--space-4);
    animation: fadeIn var(--transition-base) ease-out;
    position: relative;
}

.alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-icon svg {
    width: 100%;
    height: 100%;
}

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

.alert-title {
    font-size: var(--text-sm);
    font-weight: 600;
    margin-bottom: 2px;
}

.alert-message {
    font-size: var(--text-sm);
    line-height: 1.5;
    margin-bottom: 0;
}

.alert-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    transition: opacity var(--transition-fast);
    flex-shrink: 0;
}

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

.alert-close svg {
    width: 14px;
    height: 14px;
}

.alert-info {
    background: rgba(69, 133, 136, 0.08);
    border-color: rgba(69, 133, 136, 0.2);
    color: var(--blue-bright);
}

.alert-success {
    background: rgba(152, 151, 26, 0.08);
    border-color: rgba(152, 151, 26, 0.2);
    color: var(--green-bright);
}

.alert-warning {
    background: rgba(215, 153, 33, 0.08);
    border-color: rgba(215, 153, 33, 0.2);
    color: var(--yellow-bright);
}

.alert-danger,
.alert-error {
    background: rgba(204, 36, 29, 0.08);
    border-color: rgba(204, 36, 29, 0.2);
    color: var(--red-bright);
    animation: fadeIn var(--transition-base) ease-out, pulse 3s ease-in-out 1;
}

/* Flash / Toast at top */
.flash-container {
    position: fixed;
    top: calc(var(--topbar-height) + var(--space-4));
    right: var(--space-6);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    max-width: 420px;
    width: 100%;
}

.flash {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-darkest);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: slideInRight var(--transition-base) ease-out;
}

.flash-success { border-left: 3px solid var(--green); }
.flash-error   { border-left: 3px solid var(--red); }
.flash-warning { border-left: 3px solid var(--yellow); }
.flash-info    { border-left: 3px solid var(--blue); }

.flash-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.flash-success .flash-icon { color: var(--green-bright); }
.flash-error .flash-icon   { color: var(--red-bright); }
.flash-warning .flash-icon { color: var(--yellow-bright); }
.flash-info .flash-icon    { color: var(--blue-bright); }

.flash-text {
    flex: 1;
    font-size: var(--text-sm);
    color: var(--fg-secondary);
}

.flash-dismiss {
    color: var(--fg-dim);
    padding: var(--space-1);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.flash-dismiss:hover {
    color: var(--fg-primary);
}


/* ============================================================================
   22. WIZARD / STEPPER
   ============================================================================ */

.wizard {
    margin-bottom: var(--space-6);
}

.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: var(--space-8);
    padding: 0 var(--space-4);
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    position: relative;
}

.wizard-step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: 600;
    border: 2px solid var(--bg-lighter);
    color: var(--fg-dim);
    background: var(--bg-dark);
    transition: all var(--transition-base);
    flex-shrink: 0;
    z-index: 1;
}

.wizard-step-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--fg-dim);
    white-space: nowrap;
    transition: color var(--transition-fast);
}

.wizard-step-connector {
    width: 60px;
    height: 2px;
    background: var(--bg-lighter);
    margin: 0 var(--space-2);
    transition: background var(--transition-base);
    flex-shrink: 0;
}

.wizard-step.active .wizard-step-number {
    border-color: var(--blue);
    color: var(--blue-bright);
    box-shadow: 0 0 0 4px rgba(69, 133, 136, 0.15);
}

.wizard-step.active .wizard-step-label {
    color: var(--fg-primary);
}

.wizard-step.completed .wizard-step-number {
    border-color: var(--green);
    background: var(--green);
    color: #fff;
}

.wizard-step.completed .wizard-step-label {
    color: var(--fg-secondary);
}

.wizard-step.completed + .wizard-step-connector,
.wizard-step.completed ~ .wizard-step-connector {
    background: var(--green);
}

.wizard-body {
    background: var(--surface-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}

.wizard-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-subtle);
    margin-top: var(--space-6);
}


/* ============================================================================
   23. CHAT INTERFACE (AINA)
   ============================================================================ */

.chat-layout {
    display: flex;
    height: calc(100vh - var(--topbar-height));
    background: var(--bg-dark);
}

/* -- Conversation Sidebar -- */
.chat-sidebar {
    width: 280px;
    background: var(--bg-darkest);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.chat-sidebar-header {
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
}

.chat-sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-2);
}

.chat-conversation-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    margin-bottom: 2px;
}

.chat-conversation-item:hover {
    background: rgba(235, 219, 178, 0.04);
}

.chat-conversation-item.active {
    background: rgba(69, 133, 136, 0.1);
}

.chat-conversation-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: var(--text-xs);
    font-weight: 600;
    flex-shrink: 0;
}

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

.chat-conversation-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--fg-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-conversation-preview {
    font-size: var(--text-xs);
    color: var(--fg-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-conversation-time {
    font-size: var(--text-xs);
    color: var(--fg-dim);
    flex-shrink: 0;
}

/* -- Chat Main Area -- */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(40, 40, 40, 0.6);
    backdrop-filter: blur(8px);
    flex-shrink: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.chat-message {
    display: flex;
    gap: var(--space-3);
    max-width: 75%;
    animation: fadeIn var(--transition-fast) ease-out;
}

.chat-message--user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message--ai {
    align-self: flex-start;
}

.chat-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 600;
    flex-shrink: 0;
}

.chat-message--user .chat-message-avatar {
    background: var(--blue);
    color: #fff;
}

.chat-message--ai .chat-message-avatar {
    background: linear-gradient(135deg, var(--purple), var(--aqua));
    color: #fff;
}

.chat-bubble {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    line-height: 1.6;
    position: relative;
}

.chat-message--user .chat-bubble {
    background: var(--blue);
    color: #fff;
    border-bottom-right-radius: var(--radius-sm);
}

.chat-message--ai .chat-bubble {
    background: var(--bg-medium);
    color: var(--fg-secondary);
    border-bottom-left-radius: var(--radius-sm);
}

.chat-bubble-time {
    font-size: var(--text-xs);
    color: var(--fg-dim);
    margin-top: var(--space-1);
    opacity: 0.7;
}

.chat-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: var(--space-3) var(--space-4);
}

.chat-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--fg-dim);
    animation: typingBounce 1.4s ease-in-out infinite;
}

.chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* -- Chat Input -- */
.chat-input-area {
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-darkest);
    flex-shrink: 0;
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: var(--space-3);
    background: var(--bg-medium);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-2) var(--space-3);
    transition: border-color var(--transition-fast);
}

.chat-input-wrapper:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(69, 133, 136, 0.12);
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--fg-primary);
    font-size: var(--text-sm);
    resize: none;
    outline: none;
    max-height: 120px;
    line-height: 1.5;
    padding: var(--space-2) 0;
}

.chat-input::placeholder {
    color: var(--fg-dim);
}

.chat-input-actions {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding-bottom: var(--space-1);
}

.chat-send-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    background: var(--blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.chat-send-btn:hover {
    background: var(--blue-bright);
    transform: scale(1.05);
}

.chat-send-btn svg {
    width: 16px;
    height: 16px;
}


/* ============================================================================
   24. LOADING SPINNER
   ============================================================================ */

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-default);
    border-top-color: var(--blue-bright);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

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

.spinner-xl {
    width: 48px;
    height: 48px;
    border-width: 3px;
}

/* Full-page loader */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(29, 32, 33, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    z-index: var(--z-toast);
    backdrop-filter: blur(4px);
}

.loading-text {
    font-size: var(--text-sm);
    color: var(--fg-muted);
    animation: pulse 2s ease-in-out infinite;
}

/* Skeleton loader */
.skeleton {
    background: linear-gradient(90deg, var(--bg-medium) 25%, var(--bg-light) 50%, var(--bg-medium) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 14px;
    margin-bottom: var(--space-2);
    width: 100%;
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-heading {
    height: 22px;
    width: 40%;
    margin-bottom: var(--space-3);
}

.skeleton-circle {
    border-radius: 50%;
}

.skeleton-card {
    height: 180px;
}


/* ============================================================================
   25. BREADCRUMBS
   ============================================================================ */

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}

.breadcrumb-item {
    color: var(--fg-dim);
    transition: color var(--transition-fast);
}

.breadcrumb-item a {
    color: var(--fg-dim);
    text-decoration: none;
}

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

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

.breadcrumb-separator {
    color: var(--fg-dim);
    opacity: 0.5;
    font-size: var(--text-xs);
    user-select: none;
}

.breadcrumb-separator svg {
    width: 12px;
    height: 12px;
}


/* ============================================================================
   26. TABS
   ============================================================================ */

.tabs {
    display: flex;
    align-items: center;
    gap: 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--space-5);
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--fg-dim);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all var(--transition-fast);
    position: relative;
    top: 1px;
}

.tab-item:hover {
    color: var(--fg-primary);
    background: rgba(235, 219, 178, 0.03);
}

.tab-item.active {
    color: var(--blue-bright);
    border-bottom-color: var(--blue-bright);
}

.tab-item svg {
    width: 16px;
    height: 16px;
}

.tab-item .badge-count {
    font-size: 0.6rem;
    min-width: 16px;
    height: 16px;
}

.tab-content {
    display: none;
    animation: fadeIn var(--transition-fast) ease-out;
}

.tab-content.active {
    display: block;
}

/* Pill-style tabs */
.tabs-pills {
    border-bottom: none;
    gap: var(--space-1);
    background: var(--bg-darkest);
    padding: var(--space-1);
    border-radius: var(--radius-md);
    display: inline-flex;
    margin-bottom: var(--space-5);
}

.tabs-pills .tab-item {
    border-bottom: none;
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-4);
    top: 0;
}

.tabs-pills .tab-item.active {
    background: var(--bg-medium);
    color: var(--fg-primary);
    box-shadow: var(--shadow-sm);
}


/* ============================================================================
   27. LOGIN PAGE
   ============================================================================ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-darkest);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 20% 50%, rgba(69, 133, 136, 0.06) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 50%, rgba(177, 98, 134, 0.04) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 0%, rgba(214, 93, 14, 0.03) 0%, transparent 40%);
    animation: loginGradient 20s ease-in-out infinite alternate;
    pointer-events: none;
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: var(--bg-dark);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-10);
    margin: var(--space-6);
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    margin-bottom: var(--space-8);
}

.login-logo-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--blue), var(--aqua));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: var(--text-lg);
}

.login-logo-text {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--fg-primary);
    letter-spacing: -0.02em;
}

.login-logo-text span {
    color: var(--blue-bright);
}

.login-title {
    text-align: center;
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--fg-primary);
    margin-bottom: var(--space-2);
}

.login-subtitle {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--fg-dim);
    margin-bottom: var(--space-6);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-6) 0;
    color: var(--fg-dim);
    font-size: var(--text-xs);
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.login-footer {
    text-align: center;
    margin-top: var(--space-6);
    font-size: var(--text-sm);
    color: var(--fg-dim);
}

.login-footer a {
    color: var(--blue-bright);
    font-weight: 500;
}

/* SSO Buttons */
.login-sso-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.btn-sso {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-medium);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--fg-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-sso:hover {
    background: var(--bg-light);
    border-color: var(--border-strong);
}

.btn-sso svg,
.btn-sso img {
    width: 18px;
    height: 18px;
}


/* ============================================================================
   28. IDENTITY FLOW DIAGRAM
   ============================================================================ */

.flow-diagram {
    background: var(--surface-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    overflow-x: auto;
    position: relative;
}

.flow-diagram-canvas {
    min-width: 600px;
    min-height: 300px;
    position: relative;
}

.flow-node {
    position: absolute;
    background: var(--bg-dark);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    min-width: 160px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    cursor: grab;
    transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
    z-index: 2;
}

.flow-node:hover {
    border-color: var(--blue);
    box-shadow: var(--shadow-md), var(--shadow-glow-blue);
}

.flow-node-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto var(--space-2);
    border-radius: var(--radius-md);
    background: rgba(69, 133, 136, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue-bright);
}

.flow-node-icon svg {
    width: 20px;
    height: 20px;
}

.flow-node-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--fg-primary);
}

.flow-node-sublabel {
    font-size: var(--text-xs);
    color: var(--fg-dim);
    margin-top: 2px;
}

.flow-node--idp {
    border-color: var(--purple);
}

.flow-node--idp .flow-node-icon {
    background: rgba(177, 98, 134, 0.1);
    color: var(--purple-bright);
}

.flow-node--app {
    border-color: var(--aqua);
}

.flow-node--app .flow-node-icon {
    background: rgba(104, 157, 106, 0.1);
    color: var(--aqua-bright);
}

.flow-connector {
    position: absolute;
    z-index: 1;
}

.flow-connector line,
.flow-connector path {
    stroke: var(--bg-lighter);
    stroke-width: 2;
    fill: none;
}

.flow-connector-label {
    font-size: var(--text-xs);
    fill: var(--fg-dim);
    text-anchor: middle;
}


/* ============================================================================
   29. USER AVATARS
   ============================================================================ */

.avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: #fff;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}

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

.avatar-xs { width: 24px; height: 24px; font-size: 0.6rem; }
.avatar-sm { width: 32px; height: 32px; font-size: var(--text-xs); }
.avatar-md { width: 40px; height: 40px; font-size: var(--text-sm); }
.avatar-lg { width: 52px; height: 52px; font-size: var(--text-md); }
.avatar-xl { width: 72px; height: 72px; font-size: var(--text-xl); }

.avatar-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--bg-dark);
}

.avatar-status--online   { background: var(--green-bright); }
.avatar-status--offline  { background: var(--fg-dim); }
.avatar-status--busy     { background: var(--red-bright); }
.avatar-status--away     { background: var(--yellow-bright); }

.avatar-lg .avatar-status,
.avatar-xl .avatar-status {
    width: 14px;
    height: 14px;
    border-width: 3px;
}

/* Avatar stack */
.avatar-stack {
    display: flex;
    align-items: center;
}

.avatar-stack .avatar {
    border: 2px solid var(--bg-dark);
    margin-left: -8px;
    transition: transform var(--transition-fast);
}

.avatar-stack .avatar:first-child {
    margin-left: 0;
}

.avatar-stack .avatar:hover {
    transform: translateY(-2px);
    z-index: 2;
}

.avatar-stack-overflow {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--fg-dim);
    margin-left: -8px;
    border: 2px solid var(--bg-dark);
}


/* ============================================================================
   30. EMPTY STATES
   ============================================================================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12) var(--space-6);
    text-align: center;
}

.empty-state-icon {
    width: 72px;
    height: 72px;
    margin-bottom: var(--space-5);
    color: var(--bg-lighter);
    opacity: 0.6;
}

.empty-state-icon svg {
    width: 100%;
    height: 100%;
    stroke-width: 1;
}

.empty-state-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--fg-secondary);
    margin-bottom: var(--space-2);
}

.empty-state-description {
    font-size: var(--text-sm);
    color: var(--fg-dim);
    max-width: 400px;
    margin-bottom: var(--space-6);
    line-height: 1.6;
}


/* ============================================================================
   31. TOOLTIPS
   ============================================================================ */

.tooltip-wrapper {
    position: relative;
    display: inline-flex;
}

.tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-darkest);
    color: var(--fg-secondary);
    font-size: var(--text-xs);
    font-weight: 400;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    transform: translateX(-50%) translateY(4px);
    z-index: var(--z-tooltip);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-default);
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--bg-darkest);
}

.tooltip-wrapper:hover .tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Bottom tooltip */
.tooltip--bottom {
    bottom: auto;
    top: calc(100% + 8px);
    transform: translateX(-50%) translateY(-4px);
}

.tooltip--bottom::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: var(--bg-darkest);
}

.tooltip-wrapper:hover .tooltip--bottom {
    transform: translateX(-50%) translateY(0);
}


/* ============================================================================
   32. DROPDOWN MENUS
   ============================================================================ */

.dropdown {
    position: relative;
    display: inline-flex;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 200px;
    background: var(--bg-darkest);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-dropdown);
    padding: var(--space-1);
    display: none;
    animation: fadeIn var(--transition-fast) ease-out;
}

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

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

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--fg-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.dropdown-item:hover {
    background: rgba(235, 219, 178, 0.06);
    color: var(--fg-primary);
}

.dropdown-item-icon {
    width: 16px;
    height: 16px;
    color: var(--fg-dim);
    flex-shrink: 0;
}

.dropdown-item-icon svg {
    width: 100%;
    height: 100%;
}

.dropdown-item--danger {
    color: var(--red-bright);
}

.dropdown-item--danger:hover {
    background: rgba(204, 36, 29, 0.08);
    color: var(--red-bright);
}

.dropdown-item--danger .dropdown-item-icon {
    color: var(--red-bright);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: var(--space-1) 0;
}

.dropdown-header {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-dim);
}


/* ============================================================================
   33. CODE / MONOSPACE BLOCKS
   ============================================================================ */

code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--bg-darkest);
    color: var(--orange-bright);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

pre {
    background: var(--bg-darkest);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    overflow-x: auto;
    margin-bottom: var(--space-4);
    position: relative;
}

pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: var(--text-sm);
    color: var(--fg-secondary);
    line-height: 1.7;
}

.code-block {
    position: relative;
}

.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-4);
    background: rgba(29, 32, 33, 0.6);
    border-bottom: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.code-block-header + pre {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    border-top: none;
}

.code-block-lang {
    font-size: var(--text-xs);
    color: var(--fg-dim);
    font-family: var(--font-mono);
}

.code-block-copy {
    font-size: var(--text-xs);
    color: var(--fg-dim);
    cursor: pointer;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.code-block-copy:hover {
    color: var(--fg-primary);
    background: rgba(235, 219, 178, 0.08);
}

/* Token display */
.token-display {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--bg-darkest);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--fg-muted);
}

.token-display-value {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.token-display-copy {
    color: var(--fg-dim);
    cursor: pointer;
    padding: var(--space-1);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    transition: color var(--transition-fast);
}

.token-display-copy:hover {
    color: var(--blue-bright);
}

/* Log viewer */
.log-viewer {
    background: var(--bg-darkest);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    line-height: 1.8;
    max-height: 400px;
    overflow-y: auto;
}

.log-line {
    display: flex;
    padding: 0 var(--space-4);
    border-bottom: 1px solid rgba(235, 219, 178, 0.02);
}

.log-line:hover {
    background: rgba(235, 219, 178, 0.02);
}

.log-line-number {
    width: 50px;
    color: var(--fg-dim);
    opacity: 0.4;
    user-select: none;
    text-align: right;
    padding-right: var(--space-3);
    flex-shrink: 0;
}

.log-line-content {
    flex: 1;
    color: var(--fg-muted);
    white-space: pre;
    overflow-x: auto;
}

.log-line--error .log-line-content { color: var(--red-bright); }
.log-line--warn .log-line-content  { color: var(--yellow-bright); }
.log-line--info .log-line-content  { color: var(--blue-bright); }
.log-line--debug .log-line-content { color: var(--fg-dim); }


/* ============================================================================
   34. PROFILE SECTION
   ============================================================================ */

.profile-header {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    padding: var(--space-6);
    background: var(--surface-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
}

.profile-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-3xl);
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    position: relative;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.profile-avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 2px solid var(--surface-raised);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast);
    color: var(--fg-dim);
}

.profile-avatar-edit:hover {
    background: var(--bg-medium);
    color: var(--fg-primary);
}

.profile-avatar-edit svg {
    width: 12px;
    height: 12px;
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--fg-primary);
    margin-bottom: 2px;
}

.profile-role {
    font-size: var(--text-sm);
    color: var(--fg-dim);
    margin-bottom: var(--space-2);
}

.profile-meta {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.profile-meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-xs);
    color: var(--fg-dim);
}

.profile-meta-item svg {
    width: 14px;
    height: 14px;
}

.profile-stats {
    display: flex;
    gap: var(--space-6);
}

.profile-stat {
    text-align: center;
}

.profile-stat-value {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--fg-primary);
}

.profile-stat-label {
    font-size: var(--text-xs);
    color: var(--fg-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}


/* ============================================================================
   35. GRID UTILITIES
   ============================================================================ */

.grid {
    display: grid;
    gap: var(--space-5);
}

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

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

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-auto-fill {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.grid-auto-fit {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Flex utilities */
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.flex-wrap    { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.items-end    { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.flex-1       { flex: 1; }
.flex-shrink-0{ flex-shrink: 0; }

/* Spacing utilities */
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

.p-0  { padding: 0; }
.p-2  { padding: var(--space-2); }
.p-4  { padding: var(--space-4); }
.p-5  { padding: var(--space-5); }
.p-6  { padding: var(--space-6); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

/* Width / display */
.w-full  { width: 100%; }
.hidden  { display: none; }
.block   { display: block; }
.inline  { display: inline; }
.relative{ position: relative; }

/* Text alignment */
.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* Visibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* ============================================================================
   36. ANIMATIONS & KEYFRAMES
   ============================================================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

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

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

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

@keyframes progressShimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

@keyframes progressStripe {
    from { background-position: 20px 0; }
    to   { background-position: 0 0; }
}

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30%           { transform: translateY(-6px); }
}

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

@keyframes loginGradient {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(-2%, -1%) rotate(1deg);
    }
    100% {
        transform: translate(1%, 2%) rotate(-0.5deg);
    }
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 8px rgba(69, 133, 136, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(69, 133, 136, 0.4);
    }
}

/* Animation utility classes */
.animate-fade-in {
    animation: fadeIn var(--transition-base) ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp var(--transition-base) ease-out;
}

.animate-slide-in-right {
    animation: slideInRight var(--transition-base) ease-out;
}

.animate-slide-in-up {
    animation: slideInUp var(--transition-base) ease-out;
}

.animate-count-up {
    animation: countUp var(--transition-base) ease-out;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-glow {
    animation: glowPulse 3s ease-in-out infinite;
}

/* Staggered children animation */
.stagger-children > * {
    animation: fadeInUp var(--transition-base) ease-out backwards;
}

.stagger-children > *:nth-child(1)  { animation-delay: 0ms; }
.stagger-children > *:nth-child(2)  { animation-delay: 50ms; }
.stagger-children > *:nth-child(3)  { animation-delay: 100ms; }
.stagger-children > *:nth-child(4)  { animation-delay: 150ms; }
.stagger-children > *:nth-child(5)  { animation-delay: 200ms; }
.stagger-children > *:nth-child(6)  { animation-delay: 250ms; }
.stagger-children > *:nth-child(7)  { animation-delay: 300ms; }
.stagger-children > *:nth-child(8)  { animation-delay: 350ms; }
.stagger-children > *:nth-child(9)  { animation-delay: 400ms; }
.stagger-children > *:nth-child(10) { animation-delay: 450ms; }
.stagger-children > *:nth-child(11) { animation-delay: 500ms; }
.stagger-children > *:nth-child(12) { animation-delay: 550ms; }


/* ============================================================================
   37. RESPONSIVE
   ============================================================================ */

@media (max-width: 1200px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-hero-stats {
        gap: var(--space-6);
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-meta {
        justify-content: center;
    }

    .profile-stats {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.sidebar-mobile-open {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.4);
    }

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

    .topbar {
        left: 0;
    }

    body.sidebar-is-collapsed .main-content {
        margin-left: 0;
    }

    body.sidebar-is-collapsed .topbar {
        left: 0;
    }

    .notification-panel {
        width: 100%;
        max-width: var(--notification-panel-width);
    }

    .chat-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    :root {
        --space-6: 1.25rem;
        --space-8: 1.5rem;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header-actions {
        width: 100%;
    }

    .main-content {
        padding: calc(var(--topbar-height) + var(--space-4)) var(--space-4) var(--space-4);
    }

    .topbar-center {
        display: none;
    }

    .topbar-profile-name {
        display: none;
    }

    .wizard-steps {
        flex-direction: column;
        align-items: flex-start;
    }

    .wizard-step-connector {
        width: 2px;
        height: 30px;
        margin: var(--space-1) 0 var(--space-1) 17px;
    }

    .login-card {
        padding: var(--space-6);
    }

    .login-sso-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .modal {
        max-width: 100%;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    .dashboard-hero {
        padding: var(--space-5);
    }

    .dashboard-hero-title {
        font-size: var(--text-2xl);
    }

    .chat-message {
        max-width: 90%;
    }

    .table-container {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    /* Horizontal scrollable table wrapper */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 0 var(--space-3);
    }

    .dashboard-hero-stats {
        flex-direction: column;
        gap: var(--space-3);
    }

    .tabs {
        gap: 0;
    }

    .tab-item {
        padding: var(--space-3) var(--space-3);
        font-size: var(--text-xs);
    }
}

/* Print styles */
@media print {
    .sidebar,
    .topbar,
    .notification-panel,
    .flash-container {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding-top: 0 !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    body {
        background: #fff;
        color: #333;
    }
}


/* ============================================================================
   AUTH / LOGIN PAGE STYLES
   ============================================================================ */

.auth-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: #190c1e;
    font-family: 'Fira Sans', sans-serif;
    color: #f5e6f0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-bg-animation {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.auth-grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 164, 46, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 164, 46, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

.auth-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    animation: authGlowFloat 20s ease-in-out infinite alternate;
}

.auth-glow-1 {
    width: 500px;
    height: 500px;
    background: #FFA42E;
    top: -10%;
    left: -5%;
    animation-duration: 18s;
}

.auth-glow-2 {
    width: 400px;
    height: 400px;
    background: #D33665;
    bottom: -10%;
    right: -5%;
    animation-duration: 22s;
    animation-delay: -5s;
}

.auth-glow-3 {
    width: 300px;
    height: 300px;
    background: #FB562D;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: 25s;
    animation-delay: -10s;
}

@keyframes authGlowFloat {
    0% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -20px) scale(1.05); }
    50% { transform: translate(-20px, 30px) scale(0.95); }
    75% { transform: translate(20px, 20px) scale(1.02); }
    100% { transform: translate(-10px, -30px) scale(1); }
}

.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    padding: 40px 24px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    justify-content: center;
}

.auth-card {
    width: 100%;
    background: rgba(50, 26, 64, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(245, 230, 240, 0.08);
    border-radius: 16px;
    padding: 40px 36px;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.4),
        0 0 80px rgba(255, 164, 46, 0.05);
    animation: fadeInUp 0.6s ease-out;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.auth-logo svg {
    filter: drop-shadow(0 0 12px rgba(255, 164, 46, 0.4));
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: #f5e6f0;
    margin: 0 0 6px;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    font-size: 14px;
    color: #8c7088;
    margin: 0;
    font-weight: 400;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-form .form-group label {
    font-size: 13px;
    font-weight: 500;
    color: #dcc4d8;
}

.auth-form .form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(25, 12, 30, 0.7);
    border: 1px solid rgba(245, 230, 240, 0.1);
    border-radius: 10px;
    color: #f5e6f0;
    font-size: 15px;
    font-family: 'Fira Sans', sans-serif;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.auth-form .form-input::placeholder {
    color: #6e4570;
}

.auth-form .form-input:focus {
    border-color: #FFA42E;
    box-shadow: 0 0 0 3px rgba(255, 164, 46, 0.15);
    background: rgba(25, 12, 30, 0.9);
}

.form-input-code {
    text-align: center;
    font-size: 24px !important;
    font-family: 'Fira Code', monospace !important;
    letter-spacing: 8px;
    padding: 16px !important;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-row-between {
    justify-content: space-between;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #8c7088;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    accent-color: #FFA42E;
    width: 16px;
    height: 16px;
}

.auth-link {
    color: #FFA42E;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.auth-link:hover {
    color: #ffb84e;
    text-decoration: underline;
}

.auth-link-center {
    display: block;
    text-align: center;
    margin-top: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-family: 'Fira Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: #FFA42E;
    color: #190c1e;
}

.btn-primary:hover {
    background: #cc8020;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 164, 46, 0.3);
}

.btn-block {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
}

.auth-info-panel {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(245, 230, 240, 0.06);
    text-align: center;
}

.auth-info-panel h3 {
    font-size: 14px;
    font-weight: 600;
    color: #dcc4d8;
    margin: 0 0 8px;
}

.auth-info-panel p {
    font-size: 13px;
    color: #8c7088;
    margin: 0 0 16px;
    line-height: 1.5;
}

.auth-app-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.auth-app-chip {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 164, 46, 0.1);
    border: 1px solid rgba(255, 164, 46, 0.15);
    border-radius: 20px;
    font-size: 12px;
    color: #FFA42E;
    font-weight: 500;
}

.auth-footer {
    margin-top: 24px;
    text-align: center;
}

.auth-footer p {
    font-size: 12px;
    color: #6e4570;
    margin: 0;
}

.auth-form-title {
    font-size: 20px;
    font-weight: 600;
    color: #f5e6f0;
    margin: 16px 0 8px;
    text-align: center;
}

.auth-form-desc {
    font-size: 14px;
    color: #8c7088;
    margin: 0 0 20px;
    text-align: center;
    line-height: 1.5;
}

.mfa-icon {
    text-align: center;
    margin-bottom: 8px;
}

.mfa-secret-display {
    background: rgba(25, 12, 30, 0.8);
    border: 1px solid rgba(245, 230, 240, 0.1);
    border-radius: 10px;
    padding: 16px;
    margin: 12px 0;
    text-align: center;
}

.mfa-secret-code {
    font-family: 'Fira Code', monospace;
    font-size: 16px;
    color: #FFA42E;
    letter-spacing: 2px;
    word-break: break-all;
}

/* Alert styles for auth pages */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    animation: fadeIn 0.3s ease;
}

.alert-danger {
    background: rgba(251, 86, 45, 0.12);
    border: 1px solid rgba(251, 86, 45, 0.2);
    color: #FB562D;
}

.alert-success {
    background: rgba(90, 150, 54, 0.12);
    border: 1px solid rgba(90, 150, 54, 0.2);
    color: #72b848;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ============================================================================
   END OF ZELACCESS DESIGN SYSTEM
   ============================================================================ */
