/* ============================================================
   HOLLOW CITY ACP - Design System v2.0
   Three themes: Dark, Hollow (Cyan), Light
   ============================================================ */

/* ============================================================
   1. RESET & BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

::selection {
    background: var(--primary);
    color: #fff;
}

/* ============================================================
   2. CSS VARIABLES - THEMES
   ============================================================ */

/* HOLLOW THEME (Default) - Cyan/Teal from FiveM resources */
[data-theme="hollow"], :root {
    --bg: #061923;
    --bg-secondary: #0a2332;
    --card: rgba(12, 229, 229, 0.06);
    --card-hover: rgba(12, 229, 229, 0.12);
    --card-border: rgba(12, 229, 229, 0.25);
    --text: rgba(230, 255, 255, 0.95);
    --text-secondary: rgba(147, 252, 255, 0.7);
    --text-muted: rgba(147, 252, 255, 0.45);
    --primary: #0CE5E5;
    --primary-hover: #93FCFF;
    --primary-dim: rgba(12, 229, 229, 0.15);
    --primary-glow: rgba(12, 229, 229, 0.3);
    --secondary: #8B5CF6;
    --secondary-hover: #A78BFA;
    --success: #00E5FF;
    --success-dim: rgba(0, 229, 255, 0.15);
    --danger: #FF3366;
    --danger-dim: rgba(255, 51, 102, 0.15);
    --warning: #FFAA00;
    --warning-dim: rgba(255, 170, 0, 0.15);
    --info: #067B8A;
    --info-dim: rgba(6, 123, 138, 0.15);
    --border: rgba(12, 229, 229, 0.2);
    --border-strong: rgba(12, 229, 229, 0.45);
    --sidebar-bg: #03141c;
    --sidebar-hover: rgba(12, 229, 229, 0.1);
    --sidebar-active: rgba(12, 229, 229, 0.18);
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --header-height: 0px;
    --input-bg: rgba(12, 229, 229, 0.06);
    --input-border: rgba(12, 229, 229, 0.25);
    --input-focus: #0CE5E5;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(12, 229, 229, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 9999px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* DARK THEME - Modern dark, blue accents */
[data-theme="dark"] {
    --bg: #0f1117;
    --bg-secondary: #161822;
    --card: #1a1d27;
    --card-hover: #22252f;
    --card-border: #2a2d3a;
    --text: #e4e4e7;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --primary-dim: rgba(99, 102, 241, 0.15);
    --primary-glow: rgba(99, 102, 241, 0.25);
    --secondary: #8b5cf6;
    --secondary-hover: #a78bfa;
    --success: #22c55e;
    --success-dim: rgba(34, 197, 94, 0.15);
    --danger: #ef4444;
    --danger-dim: rgba(239, 68, 68, 0.15);
    --warning: #f59e0b;
    --warning-dim: rgba(245, 158, 11, 0.15);
    --info: #3b82f6;
    --info-dim: rgba(59, 130, 246, 0.15);
    --border: #2a2d3a;
    --border-strong: #3f4254;
    --sidebar-bg: #0a0c12;
    --sidebar-hover: rgba(99, 102, 241, 0.1);
    --sidebar-active: rgba(99, 102, 241, 0.18);
    --input-bg: #161822;
    --input-border: #2a2d3a;
    --input-focus: #6366f1;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-glow: none;
}

/* LIGHT THEME - Clean, minimal */
[data-theme="light"] {
    --bg: #f1f5f9;
    --bg-secondary: #e8ecf0;
    --card: #ffffff;
    --card-hover: #f8fafc;
    --card-border: #e2e8f0;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-dim: rgba(59, 130, 246, 0.1);
    --primary-glow: rgba(59, 130, 246, 0.15);
    --secondary: #8b5cf6;
    --secondary-hover: #7c3aed;
    --success: #22c55e;
    --success-dim: rgba(34, 197, 94, 0.1);
    --danger: #ef4444;
    --danger-dim: rgba(239, 68, 68, 0.1);
    --warning: #f59e0b;
    --warning-dim: rgba(245, 158, 11, 0.1);
    --info: #06b6d4;
    --info-dim: rgba(6, 182, 212, 0.1);
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --sidebar-bg: #ffffff;
    --sidebar-hover: rgba(59, 130, 246, 0.08);
    --sidebar-active: rgba(59, 130, 246, 0.14);
    --input-bg: #f8fafc;
    --input-border: #e2e8f0;
    --input-focus: #3b82f6;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-glow: none;
}

/* ============================================================
   3. LAYOUT - SIDEBAR + CONTENT
   ============================================================ */

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

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width var(--transition), transform var(--transition);
    overflow: hidden;
}

.sidebar-header {
    padding: 20px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    min-height: 72px;
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-brand h1 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.sidebar-brand span {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 12px 4px;
    white-space: nowrap;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
    position: relative;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--text);
}

.nav-item.active {
    background: var(--sidebar-active);
    color: var(--primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--primary-dim);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid var(--border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: default;
}

.sidebar-user img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sidebar-user-info {
    overflow: hidden;
}

.sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.7rem;
    font-weight: 500;
}

.sidebar-actions {
    display: flex;
    gap: 4px;
    padding: 4px 8px;
}

.sidebar-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
}

.sidebar-action-btn:hover {
    background: var(--sidebar-hover);
    color: var(--text);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    padding: 24px 32px;
    transition: margin-left var(--transition);
    max-width: calc(100vw - var(--sidebar-width));
}

.main-content > .page-header:first-child {
    margin-bottom: 0;
}

.main-content > .card {
    display: flex;
    flex-direction: column;
}

.main-content > .card:has(.tabs) {
    flex: 1;
    min-height: 0;
}

.main-content > .card:has(.tabs) > .tab-content.active {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.main-content > .card:has(.tabs) > .tab-content.active > .table-scroll {
    flex: 1;
    overflow-y: auto;
    max-height: none;
}

.main-content > .card > .table-scroll {
    flex: 1;
    overflow-y: auto;
    max-height: none;
}

/* Sidebar Collapsed */
.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed);
}
.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed);
    max-width: calc(100vw - var(--sidebar-collapsed));
}
.sidebar-collapsed .sidebar-brand,
.sidebar-collapsed .nav-item span,
.sidebar-collapsed .nav-section-label,
.sidebar-collapsed .nav-badge,
.sidebar-collapsed .sidebar-user-info,
.sidebar-collapsed .sidebar-action-btn span {
    display: none;
}
.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 20px 8px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}
.sidebar-collapsed .sidebar-header:hover {
    background: var(--hover-bg, rgba(255,255,255,0.05));
}
.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 10px;
}
.sidebar-collapsed .sidebar-user {
    justify-content: center;
    padding: 10px;
}
.sidebar-collapsed .sidebar-action-btn {
    flex: none;
    width: 46px;
    height: 40px;
}
.sidebar-collapsed .sidebar-actions {
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.sidebar-collapsed .sidebar-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.85rem;
}
.sidebar-collapsed .sidebar-collapse-btn:hover {
    color: var(--primary);
    background: var(--hover-bg, rgba(255,255,255,0.05));
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar-open .sidebar {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 16px;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }
    .sidebar-open .sidebar-overlay {
        display: block;
    }
}

/* Top Nav Mode */
.layout-topnav .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 60px;
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--border);
    z-index: 100;
}
.layout-topnav .sidebar-header {
    border-bottom: none;
    border-right: 1px solid var(--border);
    min-height: 60px;
    padding: 0 16px;
}
.layout-topnav .sidebar-nav {
    flex-direction: row;
    padding: 0 12px;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    align-items: center;
    gap: 4px;
}
.layout-topnav .nav-section {
    margin-bottom: 0;
}
.layout-topnav .nav-section-label {
    display: none;
}
.layout-topnav .nav-item {
    padding: 8px 14px;
    margin-bottom: 0;
    font-size: 0.85rem;
}
.layout-topnav .nav-item.active::before {
    display: none;
}
.layout-topnav .nav-item.active {
    border-bottom: 2px solid var(--primary);
    border-radius: 0;
}
.layout-topnav .sidebar-footer {
    border-top: none;
    border-left: 1px solid var(--border);
    padding: 0 8px;
    display: flex;
    align-items: center;
}
.layout-topnav .sidebar-user {
    padding: 8px;
}
.layout-topnav .sidebar-user img {
    width: 28px;
    height: 28px;
}
.layout-topnav .sidebar-actions {
    padding: 0;
    align-items: center;
}
.layout-topnav .main-content {
    margin-left: 0;
    max-width: 100%;
    padding-top: 84px;
}

/* ============================================================
   4. PAGE HEADER
   ============================================================ */

.page-header {
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================================================
   5. CARDS
   ============================================================ */

.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: all var(--transition);
}

.card:hover {
    background: var(--card-hover);
    box-shadow: var(--shadow-glow);
}

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

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

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

/* Stat Cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    border-color: var(--primary);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stat-icon.primary {
    background: var(--primary-dim);
    color: var(--primary);
}
.stat-icon.success {
    background: var(--success-dim);
    color: var(--success);
}
.stat-icon.warning {
    background: var(--warning-dim);
    color: var(--warning);
}
.stat-icon.danger {
    background: var(--danger-dim);
    color: var(--danger);
}
.stat-icon.info {
    background: var(--info-dim);
    color: var(--info);
}

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

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

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

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

/* ============================================================
   6. TABLES
   ============================================================ */

.table-wrapper {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

.table-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.table-scroll {
    overflow-x: auto;
}

.table-scroll::-webkit-scrollbar {
    height: 6px;
}
.table-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

thead th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

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

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

tbody tr:hover {
    background: var(--sidebar-hover);
}

tbody td {
    padding: 12px 16px;
    color: var(--text-secondary);
    vertical-align: middle;
}

.table-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.table-empty i {
    font-size: 2rem;
    margin-bottom: 12px;
    display: block;
    opacity: 0.5;
}

/* ============================================================
   7. BUTTONS
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}

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

/* Primary */
.btn-primary {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 0 16px var(--primary-glow);
}

/* Secondary */
.btn-secondary {
    background: transparent;
    color: var(--primary);
    border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--primary-dim);
    border-color: var(--primary);
}

/* Danger */
.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
    background: #ff1a4d;
    box-shadow: 0 0 16px var(--danger-dim);
}

/* Success */
.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}
.btn-success:hover:not(:disabled) {
    background: #18c94a;
    box-shadow: 0 0 16px var(--success-dim);
}

/* Ghost */
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
    background: var(--sidebar-hover);
    color: var(--text);
}

/* Discord */
.btn-discord {
    background: #5865F2;
    color: #fff;
    border-color: #5865F2;
}
.btn-discord:hover:not(:disabled) {
    background: #4752C4;
    box-shadow: 0 0 16px rgba(88, 101, 242, 0.4);
}

/* Sizes */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}
.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}
.btn-icon.btn-sm {
    width: 30px;
    height: 30px;
}

/* Button Group */
.btn-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-group .btn,
.btn-group .btn-sm {
    flex-shrink: 0;
}

/* ============================================================
   8. FORMS & INPUTS
   ============================================================ */

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all var(--transition);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px var(--primary-dim);
}

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

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

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

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

.form-row > * {
    flex: 1;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
}

/* Search Input */
.search-input-wrapper {
    position: relative;
}

.search-input-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-pill);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all var(--transition);
    outline: none;
}

.search-input:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px var(--primary-dim);
}

/* Inline Search */
.table-search {
    max-width: 320px;
}

/* ============================================================
   9. BADGES & TAGS
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-primary {
    background: var(--primary-dim);
    color: var(--primary);
}
.badge-success {
    background: var(--success-dim);
    color: var(--success);
}
.badge-warning {
    background: var(--warning-dim);
    color: var(--warning);
}
.badge-danger {
    background: var(--danger-dim);
    color: var(--danger);
}
.badge-info {
    background: var(--info-dim);
    color: var(--info);
}
.badge-secondary {
    background: rgba(139, 92, 246, 0.15);
    color: var(--secondary);
}

/* ============================================================
   10. ALERTS
   ============================================================ */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 0.9rem;
    border: 1px solid transparent;
    animation: slideDown 0.3s ease;
}

.alerts-container:empty {
    display: none;
}

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

.alert i {
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 1rem;
}

.alert-dismiss {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.7;
    font-size: 1rem;
    padding: 0;
}
.alert-dismiss:hover {
    opacity: 1;
}

.alert-success {
    background: var(--success-dim);
    border-color: var(--success);
    color: var(--success);
}
.alert-danger {
    background: var(--danger-dim);
    border-color: var(--danger);
    color: var(--danger);
}
.alert-warning {
    background: var(--warning-dim);
    border-color: var(--warning);
    color: var(--warning);
}
.alert-info {
    background: var(--info-dim);
    border-color: var(--info);
    color: var(--info);
}

/* ============================================================
   11. MODALS
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(10px);
    transition: transform var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

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

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.modal-close:not(.btn) {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.modal-close:not(.btn):hover {
    background: var(--danger-dim);
    color: var(--danger);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* ============================================================
   12. TABS
   ============================================================ */

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab {
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
}

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

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

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

/* ============================================================
   13. PAGINATION
   ============================================================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.pagination-btn:hover {
    background: var(--primary-dim);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
    font-weight: 600;
}

.pagination-dots {
    color: var(--text-muted);
    padding: 0 4px;
}

/* ============================================================
   14. TOOLBAR
   ============================================================ */

.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.toolbar-spacer {
    flex: 1;
}

/* ============================================================
   15. TOGGLE SWITCH (Theme / Layout)
   ============================================================ */

.toggle-group {
    display: flex;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 3px;
}

.toggle-option {
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    background: transparent;
    font-family: inherit;
}

.toggle-option.active {
    background: var(--primary);
    color: #000;
}

/* ============================================================
   16. LOGIN PAGE
   ============================================================ */

.layout-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    margin-bottom: 24px;
}

.login-logo-img {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    border-radius: var(--radius-md);
}

.login-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.login-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.login-description {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.login-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.login-footer a {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.login-footer a:hover {
    color: var(--primary);
}

/* ============================================================
   17. LOADING & EMPTY STATES
   ============================================================ */

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

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

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h4 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ============================================================
   18. UTILITIES
   ============================================================ */

.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }

.flex { display: flex !important; }
.flex-center { display: flex; align-items: center; justify-content: center !important; }
.flex-between { display: flex; align-items: center; justify-content: space-between !important; }
.gap-1 { gap: 8px !important; }
.gap-2 { gap: 16px !important; }

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

.hidden { display: none !important; }

/* Scrollable Table Wrapper */
.table-scroll {
    max-height: 600px;
    overflow-y: auto;
}

.table-scroll::-webkit-scrollbar {
    width: 6px;
}
.table-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* ============================================================
   19. SCROLLBAR GLOBAL
   ============================================================ */

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

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

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

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

/* ============================================================
   20. ANIMATIONS
   ============================================================ */

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

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

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

.animate-slideUp {
    animation: slideUp 0.3s ease;
}

/* ============================================================
   21. LUA EDITOR
   ============================================================ */

.lua-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.lua-toolbar-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

.lua-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lua-path {
    font-size: 0.75rem;
    background: var(--input-bg);
    padding: 4px 8px;
    border-radius: var(--radius-sm, 6px);
    color: var(--text-secondary);
    max-width: 480px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lua-kbd-hint {
    font-size: 0.65rem;
    opacity: 0.6;
    margin-left: 6px;
    border: 1px solid currentColor;
    border-radius: 4px;
    padding: 0 4px;
}

.lua-editor {
    width: 100%;
    height: calc(100vh - 320px);
    min-height: 360px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 8px);
    overflow: hidden;
}
