/* ═══════════════════════════════════════════════════════════════════
   ANTIGRAVITY — Light Enterprise UI System
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* ── Base ── */
    --bg: #f4f6fb;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.85);
    --bg-input: #f7f8fc;
    --bg-hover: #f0f2f8;

    /* ── Primary ── */
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-50: rgba(79, 70, 229, 0.06);
    --primary-100: rgba(79, 70, 229, 0.10);

    /* ── Accent ── */
    --cyan: #06b6d4;
    --cyan-50: rgba(6, 182, 212, 0.06);
    --purple: #8b5cf6;
    --purple-50: rgba(139, 92, 246, 0.06);
    --blue: #3b82f6;
    --blue-50: rgba(59, 130, 246, 0.06);
    --green: #10b981;
    --green-50: rgba(16, 185, 129, 0.06);
    --orange: #f59e0b;
    --orange-50: rgba(245, 158, 11, 0.06);
    --red: #ef4444;
    --red-50: rgba(239, 68, 68, 0.06);
    --pink: #ec4899;
    --pink-50: rgba(236, 72, 153, 0.06);

    /* ── Text ── */
    --text-primary: #1e1e2e;
    --text-secondary: #4a4a68;
    --text-muted: #8e8ea9;

    /* ── Borders ── */
    --border: #e5e7f0;
    --border-light: #eff0f6;

    /* ── Layout ── */
    --sidebar-w: 256px;
    --sidebar-collapsed-w: 72px;
    --header-h: 62px;

    /* ── Shadows ── */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.03);
    --shadow-float: 0 4px 20px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.03);
    --shadow-float-hover: 0 12px 36px rgba(0, 0, 0, 0.1);

    /* ── Radius ── */
    --r-sm: 8px;
    --r: 10px;
    --r-md: 14px;
    --r-lg: 18px;
    --r-xl: 22px;
    --r-full: 9999px;

    /* ── Motion ── */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════
   KEYFRAMES
═══════════════════════════════════════════ */
@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dotPulse {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.3;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(60px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes glowPulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: width 0.35s var(--ease);
    box-shadow: 1px 0 4px rgba(0, 0, 0, 0.03);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-w);
}

.sidebar.collapsed .sidebar-text,
.sidebar.collapsed .sidebar-badge,
.sidebar.collapsed .sidebar-menu-label,
.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .sidebar-user-info {
    display: none;
}

.sidebar.collapsed .sidebar-item {
    justify-content: center;
    padding: 11px;
}

.sidebar.collapsed .sidebar-item-icon {
    margin: 0;
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
    padding: 1.25rem 0.5rem;
}

.sidebar.collapsed .sidebar-user {
    justify-content: center;
}

/* Brand */
.sidebar-brand {
    padding: 1.25rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-logo {
    width: 38px;
    height: 38px;
    border-radius: var(--r);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 900;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.sidebar-brand-text {
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-brand-title {
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.sidebar-brand-sub {
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Nav */
.sidebar-menu {
    flex: 1;
    padding: 0.5rem 0.75rem;
    overflow-y: auto;
}

.sidebar-menu::-webkit-scrollbar {
    width: 3px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.sidebar-menu-label {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    padding: 1.25rem 0.75rem 0.4rem;
    white-space: nowrap;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    margin: 1px 0;
    border-radius: var(--r-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-item.active {
    background: var(--primary-50);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.sidebar-item-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
    opacity: 0.65;
}

.sidebar-item.active .sidebar-item-icon {
    opacity: 1;
}

.sidebar-badge {
    margin-left: auto;
    background: var(--primary-50);
    color: var(--primary);
    font-size: 0.58rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--r-full);
    border: 1px solid var(--primary-100);
}

.sidebar-divider {
    height: 1px;
    background: var(--border-light);
    margin: 0.5rem 0.75rem;
}

.sidebar-item.danger {
    color: var(--red);
}

.sidebar-item.danger:hover {
    background: var(--red-50);
}

/* Footer */
.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--border-light);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--r-sm);
    overflow: hidden;
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    flex-shrink: 0;
}

.sidebar-user-info {
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-user-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-user-role {
    font-size: 0.6rem;
    color: var(--text-muted);
}

/* Toggle */
.sidebar-toggle {
    position: absolute;
    top: 50%;
    right: -12px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 9px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 201;
    box-shadow: var(--shadow-sm);
}

.sidebar-toggle:hover {
    background: var(--bg-hover);
    color: var(--primary);
    box-shadow: var(--shadow);
}

.sidebar.collapsed .sidebar-toggle {
    transform: translateY(-50%) rotate(180deg);
}

/* ═══════════════════════════════════════════
   MAIN WRAPPER
═══════════════════════════════════════════ */
.main-wrap {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    transition: margin-left 0.35s var(--ease);
}

.sidebar.collapsed~.main-wrap {
    margin-left: var(--sidebar-collapsed-w);
}

/* ═══════════════════════════════════════════
   HEADER
═══════════════════════════════════════════ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: var(--bg-header);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.66rem;
    color: var(--text-muted);
    font-weight: 400;
}

.header-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.header-breadcrumb a:hover {
    color: var(--primary);
}

.header-breadcrumb .sep {
    opacity: 0.3;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    transition: var(--transition);
    width: 200px;
}

.header-search:focus-within {
    border-color: var(--primary-100);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.06);
    width: 260px;
}

.header-search input {
    border: none;
    background: none;
    outline: none;
    width: 100%;
    font-size: 0.76rem;
    font-family: inherit;
    color: var(--text-primary);
}

.header-search input::placeholder {
    color: var(--text-muted);
}

.header-search .shortcut {
    font-size: 0.56rem;
    background: var(--bg-card);
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
    border: 1px solid var(--border);
}

.header-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
    position: relative;
    color: var(--text-secondary);
}

.header-icon-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary-100);
    color: var(--primary);
}

.header-icon-btn .dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    background: var(--red);
    border-radius: 50%;
    border: 1.5px solid var(--bg-card);
    animation: glowPulse 2s ease-in-out infinite;
}

/* Profile */
.header-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 10px 4px 4px;
    border-radius: var(--r-full);
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
}

.header-profile:hover {
    background: var(--bg-hover);
    border-color: var(--primary-100);
}

.header-profile-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 11px;
    flex-shrink: 0;
}

.header-profile-name {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-profile-arrow {
    font-size: 0.5rem;
    color: var(--text-muted);
    transition: transform 0.3s;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 0.4rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.2s var(--ease);
    z-index: 300;
}

.header-profile.open .profile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header-profile.open .header-profile-arrow {
    transform: rotate(180deg);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    font-family: inherit;
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.dropdown-item.danger:hover {
    background: var(--red-50);
    color: var(--red);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 0.25rem 0;
}

/* ═══════════════════════════════════════════
   CONTENT
═══════════════════════════════════════════ */
.content {
    padding: 1.5rem 1.75rem 4rem;
    max-width: 1320px;
}

/* ═══════════════════════════════════════════
   STAT CARDS
═══════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.25rem 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--ease);
    animation: floatIn 0.5s var(--ease) backwards;
    box-shadow: var(--shadow-card);
}

.stat-card:nth-child(1) {
    animation-delay: 0.05s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.15s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-float-hover);
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.stat-icon.cyan {
    background: var(--cyan-50);
    color: var(--cyan);
}

.stat-icon.purple {
    background: var(--purple-50);
    color: var(--purple);
}

.stat-icon.green {
    background: var(--green-50);
    color: var(--green);
}

.stat-icon.blue {
    background: var(--blue-50);
    color: var(--blue);
}

.stat-icon.pink {
    background: var(--pink-50);
    color: var(--pink);
}

.stat-trend {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--r-full);
    background: var(--green-50);
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, 0.12);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 3px;
}

/* ═══════════════════════════════════════════
   CARDS
═══════════════════════════════════════════ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    margin-bottom: 1.25rem;
    animation: floatIn 0.5s var(--ease) backwards;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.card-header h2 {
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.card-body {
    padding: 1.25rem 1.5rem;
}

/* ═══════════════════════════════════════════
   TABLES
═══════════════════════════════════════════ */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    white-space: nowrap;
}

td {
    font-size: 0.8rem;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
    color: var(--text-secondary);
}

tr:last-child td {
    border-bottom: none;
}

tr {
    transition: background 0.2s;
}

tr:hover td {
    background: var(--bg-hover);
}

/* ═══════════════════════════════════════════
   BADGES
═══════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-size: 0.64rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success {
    background: var(--green-50);
    color: var(--green);
}

.badge-danger {
    background: var(--red-50);
    color: var(--red);
}

.badge-warning {
    background: var(--orange-50);
    color: var(--orange);
}

.badge-info {
    background: var(--blue-50);
    color: var(--blue);
}

.badge-primary {
    background: var(--primary-50);
    color: var(--primary);
}

.badge-purple {
    background: var(--purple-50);
    color: var(--purple);
}

.badge-neutral {
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--r-sm);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    text-decoration: none;
    white-space: nowrap;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 0.72rem;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}

.btn-secondary {
    background: var(--purple);
    color: #fff;
}

.btn-success {
    background: var(--green);
    color: #fff;
}

.btn-danger-fill {
    background: var(--red);
    color: #fff;
}

.btn-danger-fill:hover {
    background: #dc2626;
}

.btn-outline {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--primary-100);
    color: var(--primary);
    background: var(--primary-50);
}

.btn-ghost {
    background: none;
    color: var(--text-muted);
    border: none;
}

.btn-ghost:hover {
    color: var(--primary);
}

/* ═══════════════════════════════════════════
   FORMS
═══════════════════════════════════════════ */
.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--bg-input);
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--primary-100);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.06);
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    width: 130px;
    font-size: 0.76rem;
    font-family: inherit;
    color: var(--text-primary);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.form-field {
    margin-bottom: 1.25rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-label .req {
    color: var(--primary);
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    font-size: 0.84rem;
    font-family: inherit;
    outline: none;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color 0.25s, box-shadow 0.25s;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.form-input.error {
    border-color: var(--red);
}

.form-input.valid {
    border-color: var(--green);
}

.form-hint {
    font-size: 0.66rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-error {
    font-size: 0.66rem;
    color: var(--red);
    margin-top: 4px;
}

/* ═══════════════════════════════════════════
   USER CELLS & GRID
═══════════════════════════════════════════ */
.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 12px;
    flex-shrink: 0;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.82rem;
}

.user-handle {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1rem;
}

.user-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s var(--ease);
    animation: floatIn 0.4s var(--ease) backwards;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.user-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-float-hover);
    border-color: var(--primary-100);
}

.user-card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.75rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.user-card-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.user-card-handle {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 0.6rem;
}

.user-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.6rem;
}

.user-card-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--r-full);
}

.user-card-status.active {
    background: var(--green-50);
    color: var(--green);
}

.user-card-status.active::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--green);
}

.user-card-status.inactive {
    background: var(--red-50);
    color: var(--red);
}

.user-card-client {
    font-size: 0.64rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 3px 10px;
    border-radius: var(--r-full);
}

/* ═══════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.25rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.empty-state h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.empty-state p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    max-width: 320px;
    margin-inline: auto;
}

/* ═══════════════════════════════════════════
   ACTIONS GRID
═══════════════════════════════════════════ */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 1.25rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.3s var(--ease);
    text-align: center;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    animation: floatIn 0.5s var(--ease) backwards;
}

.action-card:nth-child(1) {
    animation-delay: 0.05s;
}

.action-card:nth-child(2) {
    animation-delay: 0.1s;
}

.action-card:nth-child(3) {
    animation-delay: 0.15s;
}

.action-card:nth-child(4) {
    animation-delay: 0.2s;
}

.action-card:nth-child(5) {
    animation-delay: 0.25s;
}

.action-card:hover {
    border-color: var(--primary-100);
    color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.action-card.danger:hover {
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--red);
}

.action-icon {
    font-size: 1.4rem;
}

.action-label {
    font-size: 0.7rem;
    font-weight: 600;
}

/* ═══════════════════════════════════════════
   TABS
═══════════════════════════════════════════ */
.tabs {
    display: flex;
    gap: 2px;
    padding: 3px;
    background: var(--bg);
    border-radius: var(--r);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    width: max-content;
}

.tab {
    padding: 7px 18px;
    border-radius: var(--r-sm);
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    background: none;
    border: none;
    font-family: inherit;
    white-space: nowrap;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

/* ═══════════════════════════════════════════
   TOAST
═══════════════════════════════════════════ */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: var(--r);
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    pointer-events: auto;
    animation: toastIn 0.35s var(--spring);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
}

.toast-success {
    border-left: 3px solid var(--green);
}

.toast-error {
    border-left: 3px solid var(--red);
}

.toast-warning {
    border-left: 3px solid var(--orange);
}

/* ═══════════════════════════════════════════
   MODAL
═══════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 2.5rem;
    width: 400px;
    max-width: 90vw;
    box-shadow: var(--shadow-lg);
    text-align: center;
    transform: scale(0.95) translateY(12px);
    transition: transform 0.3s var(--spring);
}

.modal-overlay.visible .modal {
    transform: scale(1) translateY(0);
}

.modal-icon {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
}

.modal h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.modal p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

/* ═══════════════════════════════════════════
   PAGE LOADER
═══════════════════════════════════════════ */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s, visibility 0.4s;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-dots {
    display: flex;
    gap: 8px;
}

.loader-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    animation: dotPulse 1.2s ease-in-out infinite;
}

.loader-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.loader-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

/* ═══════════════════════════════════════════
   STATUS DOT
═══════════════════════════════════════════ */
.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 500;
}

.status-dot::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.status-dot.online::before {
    background: var(--green);
}

.status-dot.offline::before {
    background: var(--text-muted);
}

/* ═══════════════════════════════════════════
   UTILITIES
═══════════════════════════════════════════ */
.text-muted {
    color: var(--text-muted);
}

.text-sm {
    font-size: 0.76rem;
}

.fw-600 {
    font-weight: 600;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 1.25rem;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--primary);
}

/* ═══════════════════════════════════════════
   MOBILE
═══════════════════════════════════════════ */
.mobile-menu-btn {
    display: none;
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .main-wrap {
        margin-left: 0 !important;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .sidebar-toggle {
        display: none;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .actions-grid {
        grid-template-columns: 1fr 1fr;
    }

    .user-grid {
        grid-template-columns: 1fr 1fr;
    }

    .content {
        padding: 1rem;
    }

    .header {
        padding: 0 1rem;
    }

    .header-search {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .user-grid {
        grid-template-columns: 1fr;
    }

    .actions-grid {
        grid-template-columns: 1fr;
    }
}