/* ═══════════════════════════════════════════════════════════════════════════
   SkyDrift Dashboard — Premium Dark Glassmorphism Theme
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ───────────────────────────────────────────────── */
:root {
    /* Background tones */
    --bg-deep:        #04080f;
    --bg-base:        #070d18;
    --bg-surface:     #0b1221;
    --bg-elevated:    #101a2e;
    --bg-hover:       #152038;

    /* Glass effect */
    --glass-bg:       rgba(8, 14, 28, 0.72);
    --glass-border:   rgba(255, 255, 255, 0.07);
    --glass-blur:     28px;
    --glass-glow-top: rgba(0, 224, 255, 0.08);

    /* Accent gradients — Aurora Neon */
    --accent:         #00c8ff;
    --accent-mid:     #6366f1;
    --accent-end:     #a855f7;
    --gradient:       linear-gradient(135deg, var(--accent) 0%, var(--accent-mid) 50%, var(--accent-end) 100%);

    /* Status colors */
    --success:        #10b981;
    --success-bg:     rgba(16, 185, 129, 0.12);
    --warning:        #f59e0b;
    --warning-bg:     rgba(245, 158, 11, 0.12);
    --error:          #ef4444;
    --error-bg:       rgba(239, 68, 68, 0.12);
    --info:           #38bdf8;
    --info-bg:        rgba(56, 189, 248, 0.12);

    /* Category colors */
    --cat-firmware:   #38bdf8;
    --cat-hardware:   #f59e0b;
    --cat-software:   #c084fc;

    /* Text */
    --text-primary:   #f0f4f8;
    --text-secondary: #94a3b8;
    --text-muted:     #64748b;
    --text-on-accent: #ffffff;

    /* Borders */
    --border:         rgba(255, 255, 255, 0.06);
    --border-focus:   rgba(0, 200, 255, 0.45);

    /* Sizing */
    --sidebar-width:  260px;
    --radius:         12px;
    --radius-sm:      8px;
    --radius-xs:      6px;

    /* Shadows */
    --shadow-sm:      0 1px 2px rgba(0,0,0,0.4);
    --shadow-md:      0 4px 14px rgba(0,0,0,0.45);
    --shadow-lg:      0 8px 32px rgba(0,0,0,0.55);
    --shadow-glow:    0 0 24px rgba(0, 200, 255, 0.12);

    /* Transitions */
    --transition:     0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ── Aurora Background Orbs ─────────────────────────────────────────────── */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(100px);
}

body::before {
    width: 600px; height: 600px;
    top: -10%; right: -5%;
    background: radial-gradient(circle, rgba(0, 200, 255, 0.07), transparent 70%);
    animation: auroraShift 18s ease-in-out infinite alternate;
}

body::after {
    width: 500px; height: 500px;
    bottom: -8%; left: -3%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.06), transparent 70%);
    animation: auroraShift 18s ease-in-out infinite alternate-reverse;
}

@keyframes auroraShift {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(40px, -30px) scale(1.08); }
    100% { transform: translate(-20px, 20px) scale(0.95); }
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: #66d9ff; }

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════════════════ */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
}

.brand-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: var(--shadow-glow);
}

.brand-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
}

.brand-sub {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    transition: all var(--transition);
    position: relative;
}

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

.nav-link.active {
    color: #ffffff;
    background: rgba(0, 200, 255, 0.08);
    box-shadow: inset 0 0 16px rgba(0, 200, 255, 0.04);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 55%;
    background: var(--gradient);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px rgba(0, 200, 255, 0.5), 0 0 24px rgba(0, 200, 255, 0.2);
    animation: neonPulse 2.5s ease-in-out infinite;
}

@keyframes neonPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 200, 255, 0.5), 0 0 24px rgba(0, 200, 255, 0.2); }
    50%      { box-shadow: 0 0 16px rgba(0, 200, 255, 0.7), 0 0 36px rgba(0, 200, 255, 0.3); }
}

.nav-icon {
    width: 20px; height: 20px;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity var(--transition);
}

.nav-link.active .nav-icon { opacity: 1; filter: drop-shadow(0 0 4px rgba(0, 200, 255, 0.4)); }
.nav-link:hover .nav-icon { opacity: 1; }

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.user-info { display: flex; flex-direction: column; }

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-logout {
    font-size: 12px;
    color: var(--text-muted);
    transition: color var(--transition);
}
.user-logout:hover { color: var(--error); }

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 16px; left: 16px;
    z-index: 200;
    width: 40px; height: 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle svg { width: 20px; height: 20px; }

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════════════════ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 32px;
    position: relative;
    z-index: 1;
    animation: fadeIn 0.4s ease;
}

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

/* ── Page Header ────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    color: var(--text-secondary);
    margin-top: 4px;
    font-size: 14px;
}

.breadcrumb-link {
    font-size: 13px;
    color: var(--text-muted);
    display: inline-block;
    margin-bottom: 8px;
}
.breadcrumb-link:hover { color: var(--accent); }

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════════════════ */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-glow-top);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    z-index: 1;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.card:hover {
    border-color: rgba(0, 200, 255, 0.12);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

.card-title {
    font-size: 16px;
    font-weight: 600;
}

.card-action {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}
.card-action:hover { color: var(--accent); }

.card-body { padding: 24px; }
.card-body-table { padding: 0; }

/* ── Stat Cards ──────────────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-glow-top);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    border-color: rgba(0, 200, 255, 0.15);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 200, 255, 0.06);
}

.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg { width: 24px; height: 24px; }

.stat-icon-blue   { background: var(--info-bg);    color: var(--info);    }
.stat-icon-green  { background: var(--success-bg); color: var(--success); }
.stat-icon-purple { background: rgba(168, 85, 247, 0.12); color: var(--cat-software); }
.stat-icon-orange { background: var(--warning-bg); color: var(--warning); }

.stat-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    display: block;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    display: block;
    margin-top: 2px;
}

/* ── Content Grid (2-column) ─────────────────────────────────────────────── */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 20px;
    margin-bottom: 28px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* ── Category Bars ───────────────────────────────────────────────────────── */
.category-bars { display: flex; flex-direction: column; gap: 18px; }

.category-bar-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.category-name { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.category-count { font-size: 13px; font-weight: 600; color: var(--text-primary); font-family: 'JetBrains Mono', monospace; }

.category-bar-track {
    height: 6px;
    background: var(--bg-hover);
    border-radius: 3px;
    overflow: hidden;
}

.category-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-blue   { background: var(--cat-firmware); }
.bar-orange { background: var(--cat-hardware); }
.bar-purple { background: var(--cat-software); }

/* ═══════════════════════════════════════════════════════════════════════════
   DATA TABLES
   ═══════════════════════════════════════════════════════════════════════════ */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    padding: 12px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 14px 20px;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.data-table tbody tr:last-child td { border-bottom: none; }

.clickable-row { cursor: pointer; }

/* ── User Cell ────────────────────────────────────────────────────────────── */
.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cell-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.cell-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
}

.cell-name { display: block; font-weight: 500; color: var(--text-primary); }
.cell-sub { display: block; font-size: 11px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-completed  { background: var(--success-bg); color: var(--success); }
.badge-processing { background: var(--info-bg);    color: var(--info);    }
.badge-pending    { background: var(--warning-bg); color: var(--warning); }
.badge-paid       { background: var(--warning-bg); color: var(--warning); }
.badge-cancelled  { background: var(--error-bg);   color: var(--error);   }

.badge-cat-firmware { background: rgba(59, 130, 246, 0.12); color: var(--cat-firmware); }
.badge-cat-hardware { background: rgba(245, 158, 11, 0.12); color: var(--cat-hardware); }
.badge-cat-software { background: rgba(168, 85, 247, 0.12); color: var(--cat-software); }

/* ── Action Buttons ──────────────────────────────────────────────────────── */
.action-buttons {
    display: flex;
    gap: 6px;
}

.inline-form { display: inline; }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
}

.pagination-btn {
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
}
.pagination-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.pagination-info { font-size: 13px; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-icon { width: 16px; height: 16px; }

.btn-primary {
    background: var(--gradient);
    color: var(--text-on-accent);
    box-shadow: var(--shadow-glow);
    position: relative;
    overflow: hidden;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 200, 255, 0.2), 0 4px 16px rgba(0, 0, 0, 0.3);
    color: #fff;
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger {
    background: linear-gradient(135deg, var(--error), #b91c1c);
    color: var(--text-on-accent);
}
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 0 20px rgba(239, 68, 68, 0.2); color: #fff; }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 6px 12px;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 6px 12px;
}
.btn-danger-ghost:hover { background: var(--error-bg); color: var(--error); }

.btn-sm { padding: 6px 12px; font-size: 12px; }

.btn-live {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: var(--shadow-glow); }
    50%      { box-shadow: 0 0 30px rgba(0, 200, 255, 0.25); }
}

.live-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--success);
    display: inline-block;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

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

.form-input:focus,
.form-select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 200, 255, 0.1);
}

.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='%2394a3b8' stroke-width='2'%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;
}

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

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0 24px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* ── Checkbox ────────────────────────────────────────────────────────────── */
.form-group-checkbox { display: flex; align-items: center; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] { display: none; }

.checkbox-custom {
    width: 18px; height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-label input:checked + .checkbox-custom {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-label input:checked + .checkbox-custom::after {
    content: '✓';
    color: white;
    font-size: 11px;
    font-weight: 700;
}

/* ── Toggle Switch ───────────────────────────────────────────────────────── */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.toggle-label input { display: none; }

.toggle-slider {
    width: 36px; height: 20px;
    background: var(--bg-hover);
    border-radius: 10px;
    position: relative;
    transition: background var(--transition);
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 16px; height: 16px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all var(--transition);
}

.toggle-label input:checked + .toggle-slider {
    background: var(--accent);
}

.toggle-label input:checked + .toggle-slider::after {
    left: 18px;
    background: white;
}

/* ── Filter Bar ──────────────────────────────────────────────────────────── */
.filter-card {
    margin-bottom: 20px;
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    flex-wrap: wrap;
}

.filter-group { flex: 0 1 auto; }
.filter-group-wide { flex: 1 1 auto; min-width: 200px; }

.filter-search { min-width: 260px; }

/* ── Search Dropdown ─────────────────────────────────────────────────────── */
.form-group { position: relative; }

.search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    max-height: 240px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: var(--shadow-lg);
    margin-top: 4px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background var(--transition);
}

.dropdown-item:hover { background: var(--bg-hover); }

.dropdown-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.dropdown-avatar-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
}

.dropdown-name { display: block; font-weight: 500; font-size: 13px; color: var(--text-primary); }
.dropdown-sub { display: block; font-size: 11px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
.dropdown-empty { padding: 12px 14px; color: var(--text-muted); font-size: 13px; }

/* ── Form Sections ───────────────────────────────────────────────────────── */
.form-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.form-section:last-of-type { border-bottom: none; }

.form-section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* ── Type Selector ───────────────────────────────────────────────────────── */
.type-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.type-card {
    cursor: pointer;
}

.type-card input { display: none; }

.type-card-inner {
    padding: 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    transition: all var(--transition);
}

.type-card input:checked + .type-card-inner {
    border-color: var(--accent);
    background: rgba(0, 200, 255, 0.06);
    box-shadow: 0 0 20px rgba(0, 200, 255, 0.1);
}

.type-card:hover .type-card-inner {
    border-color: rgba(255, 255, 255, 0.12);
    background: var(--bg-hover);
}

.type-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 12px;
}

.type-icon-blue   { background: var(--info-bg); }
.type-icon-orange { background: var(--warning-bg); }
.type-icon-purple { background: rgba(168, 85, 247, 0.12); }

.type-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }

/* ═══════════════════════════════════════════════════════════════════════════
   DETAIL PAGE
   ═══════════════════════════════════════════════════════════════════════════ */
.customer-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.profile-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    color: var(--text-muted);
    font-size: 22px;
    font-weight: 700;
}

.profile-name { font-size: 18px; font-weight: 600; }
.profile-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.profile-link { margin-left: 8px; font-size: 12px; }

.detail-list { display: flex; flex-direction: column; gap: 14px; }

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.detail-item:last-child { border-bottom: none; }

.detail-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.detail-value { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.detail-value.highlight { color: var(--success); font-size: 18px; font-weight: 700; }

/* ── Customer Cards Grid ─────────────────────────────────────────────────── */
.customer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.customer-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all var(--transition);
    color: inherit;
    text-decoration: none;
    display: block;
}

.customer-card:hover {
    border-color: rgba(0, 200, 255, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 16px rgba(0, 200, 255, 0.05);
    color: inherit;
}

.customer-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.customer-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.customer-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    color: var(--text-muted);
    font-size: 18px;
    font-weight: 700;
}

.customer-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.customer-discord { font-size: 12px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; display: block; margin-top: 2px; }

.customer-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.customer-stat { text-align: center; }
.customer-stat-value { font-size: 18px; font-weight: 700; color: var(--text-primary); display: block; font-family: 'JetBrains Mono', monospace; }
.customer-stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* ── Large Customer Profile ──────────────────────────────────────────────── */
.customer-profile-large {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-avatar-large {
    width: 72px; height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border);
}

.stats-row {
    display: flex;
    gap: 32px;
    justify-content: center;
}

.mini-stat { text-align: center; }
.mini-stat-value { font-size: 24px; font-weight: 700; font-family: 'JetBrains Mono', monospace; display: block; color: var(--text-primary); }
.mini-stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* ═══════════════════════════════════════════════════════════════════════════
   LOG VIEWER
   ═══════════════════════════════════════════════════════════════════════════ */
.log-card { margin-bottom: 0; }

.log-viewer {
    height: calc(100vh - 200px);
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.7;
    padding: 16px 20px;
    background: var(--bg-deep);
    border-radius: var(--radius-sm);
}

.log-line {
    padding: 1px 0;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
}

.log-line-new {
    animation: logHighlight 2s ease;
}

@keyframes logHighlight {
    0%  { background: rgba(0, 200, 255, 0.12); }
    100% { background: transparent; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════════════ */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: white;
    min-width: 280px;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 3.7s forwards;
    box-shadow: var(--shadow-lg);
}

.toast-success { background: linear-gradient(135deg, #059669, #047857); }
.toast-error   { background: linear-gradient(135deg, #dc2626, #b91c1c); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to   { opacity: 0; transform: translateX(50px); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════════════════════ */
.login-body {
    background: var(--bg-deep);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: orbFloat 15s ease-in-out infinite;
}

.bg-orb-1 {
    width: 500px; height: 500px;
    top: -150px; right: -100px;
    background: radial-gradient(circle, rgba(0, 200, 255, 0.12), transparent 70%);
    animation-delay: 0s;
}

.bg-orb-2 {
    width: 400px; height: 400px;
    bottom: -100px; left: -50px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.10), transparent 70%);
    animation-delay: -5s;
}

.bg-orb-3 {
    width: 300px; height: 300px;
    top: 40%; left: 60%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08), transparent 70%);
    animation-delay: -10s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(30px, -20px) scale(1.05); }
    66%      { transform: translate(-20px, 15px) scale(0.95); }
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    padding: 24px;
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 48px 40px;
    text-align: center;
    animation: cardFloat 0.6s ease;
}

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

.login-brand { margin-bottom: 32px; }

.login-brand-icon {
    width: 64px; height: 64px;
    border-radius: 16px;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 16px;
    box-shadow: var(--shadow-glow);
}

.login-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 6px;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

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

.login-divider span {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.discord-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 24px;
    background: #5865F2;
    color: white;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    transition: all var(--transition);
    text-decoration: none;
}

.discord-btn:hover {
    background: #4752c4;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(88, 101, 242, 0.3);
    color: white;
}

.discord-logo { width: 22px; height: 22px; }

.login-footer {
    margin-top: 24px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Unauthorized page ───────────────────────────────────────────────────── */
.unauthorized-user {
    padding: 16px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    grid-column: 1 / -1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════════════════ */
.text-mono   { font-family: 'JetBrains Mono', monospace; }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: 12px; }
.text-center { text-align: center; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

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

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .sidebar-toggle {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding: 24px 16px;
        padding-top: 64px;
    }

    .page-header {
        flex-direction: column;
    }

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

    .filter-form {
        flex-direction: column;
    }

    .filter-search { min-width: unset; }

    .type-selector {
        grid-template-columns: 1fr;
    }

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

    .data-table { font-size: 12px; }
    .data-table thead th,
    .data-table tbody td { padding: 10px 12px; }
}

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

    .login-card {
        padding: 32px 24px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR SECTION LABELS
   ═══════════════════════════════════════════════════════════════════════════ */
.nav-section-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 12px 14px 4px;
    opacity: 0.6;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TREND BADGES & STAT SUBS
   ═══════════════════════════════════════════════════════════════════════════ */
.stat-sub {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.trend-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    margin-top: 4px;
}

.trend-up {
    background: var(--success-bg);
    color: var(--success);
}

.trend-down {
    background: var(--error-bg);
    color: var(--error);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    margin: 24px;
    animation: cardFloat 0.3s ease;
    box-shadow: var(--shadow-lg);
}

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

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════════════════════════════════════ */
.tab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--bg-base);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 4px;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.tab-btn.active {
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1px solid rgba(0, 200, 255, 0.1);
    box-shadow: 0 0 12px rgba(0, 200, 255, 0.04);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.tab-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
    background: rgba(0, 200, 255, 0.15);
    color: var(--accent);
    transition: all var(--transition);
}

.tab-btn.active .tab-counter {
    background: rgba(0, 200, 255, 0.22);
    color: #66d9ff;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CHARTS
   ═══════════════════════════════════════════════════════════════════════════ */
.chart-container {
    position: relative;
    height: 280px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANALYTICS EXTRAS
   ═══════════════════════════════════════════════════════════════════════════ */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-hover);
    color: var(--text-muted);
}

.rank-1 { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.rank-2 { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.rank-3 { background: rgba(180, 120, 80, 0.15); color: #cd7f32; }

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SETTINGS
   ═══════════════════════════════════════════════════════════════════════════ */
.config-value {
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-surface);
    padding: 3px 10px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

.config-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.config-set { background: var(--success); }
.config-unset { background: var(--text-muted); opacity: 0.4; }

/* ═══════════════════════════════════════════════════════════════════════════
   TICKET SYSTEM STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Ticket Number ──────────────────────────────────────────────────────── */
.ticket-num {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 14px;
    color: var(--accent);
}

/* ── Status Badges ──────────────────────────────────────────────────────── */
.badge-open            { background: var(--success-bg); color: var(--success); }
.badge-pending         { background: var(--warning-bg); color: var(--warning); }
.badge-on-hold         { background: rgba(249, 115, 22, 0.12); color: #f97316; }
.badge-waiting         { background: var(--info-bg); color: var(--info); }
.badge-in-progress     { background: rgba(168, 85, 247, 0.12); color: #a855f7; }
.badge-closed-ticket   { background: var(--error-bg); color: var(--error); }
.badge-default         { background: rgba(255,255,255,0.06); color: var(--text-muted); }

/* ── Priority Badges ────────────────────────────────────────────────────── */
.badge-prio-low        { background: var(--success-bg); color: var(--success); }
.badge-prio-normal     { background: var(--info-bg); color: var(--info); }
.badge-prio-high       { background: rgba(249, 115, 22, 0.12); color: #f97316; }
.badge-prio-urgent     { background: var(--error-bg); color: var(--error); }

/* ── Audit Badge ────────────────────────────────────────────────────────── */
.badge-audit {
    background: rgba(0, 200, 255, 0.08);
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
}

.audit-meta {
    display: inline-block;
    padding: 1px 6px;
    margin: 1px 2px;
    background: var(--bg-hover);
    border-radius: 4px;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
}

/* ── Info Grid (Ticket Detail) ──────────────────────────────────────────── */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-item-full {
    grid-column: 1 / -1;
}

.info-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.info-value.mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

/* ── Timeline ───────────────────────────────────────────────────────────── */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
    position: absolute;
    left: -20px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(0, 200, 255, 0.15);
}

.timeline-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.timeline-action {
    font-size: 13px;
    color: var(--text-secondary);
}

.timeline-time {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
}

.timeline-actor {
    font-size: 12px;
    color: var(--text-muted);
}

.timeline-actor code {
    font-size: 11px;
    padding: 1px 5px;
    background: var(--bg-hover);
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
}

/* ── Staff Notes ────────────────────────────────────────────────────────── */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.note-item {
    padding: 14px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.note-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.note-author {
    font-size: 12px;
    padding: 2px 6px;
    background: var(--bg-hover);
    border-radius: 4px;
    color: var(--accent);
}

.note-time {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.note-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PANEL EDITOR STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Editor Layout ──────────────────────────────────────────────────────── */
.editor-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: start;
}

.editor-main { min-width: 0; }

.editor-sidebar {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (max-width: 1024px) {
    .editor-layout { grid-template-columns: 1fr; }
    .editor-sidebar { position: static; }
}

/* ── Quick Nav ──────────────────────────────────────────────────────────── */
.editor-quick-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.editor-quick-nav a {
    display: block;
    padding: 8px 12px;
    color: var(--text-secondary);
    font-size: 13px;
    border-radius: var(--radius-xs);
    text-decoration: none;
    transition: all var(--transition);
}

.editor-quick-nav a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ── Discord Preview ────────────────────────────────────────────────────── */
.discord-preview {
    background: #2b2d31;
    border-radius: 8px;
    padding: 16px;
}

.discord-embed {
    display: flex;
    border-radius: 4px;
    overflow: hidden;
    background: #2b2d31;
    border: 1px solid rgba(255,255,255,0.06);
}

.discord-embed-bar {
    width: 4px;
    flex-shrink: 0;
    background: #3498db;
    transition: background 0.2s;
}

.discord-embed-content {
    padding: 12px 16px;
    flex: 1;
    min-width: 0;
}

.discord-embed-title {
    font-size: 15px;
    font-weight: 600;
    color: #f2f3f5;
    margin-bottom: 6px;
}

.discord-embed-desc {
    font-size: 13px;
    color: #dbdee1;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.discord-embed-image {
    margin-top: 12px;
}

.discord-embed-image img {
    width: 100%;
    border-radius: 4px;
    max-height: 200px;
    object-fit: cover;
}

.discord-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 6px 16px;
    background: #5865f2;
    color: white;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    cursor: default;
    transition: background 0.15s;
}

/* ── Color Picker ───────────────────────────────────────────────────────── */
.color-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-picker {
    width: 42px;
    height: 42px;
    padding: 0;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    cursor: pointer;
    background: none;
}

.color-picker::-webkit-color-swatch-wrapper { padding: 2px; }
.color-picker::-webkit-color-swatch { border-radius: 3px; border: none; }

/* ── Button Style Picker ────────────────────────────────────────────────── */
.btn-style-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-style-option {
    cursor: pointer;
}

.btn-style-option input { display: none; }

.btn-style-preview {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    transition: all 0.15s;
    border: 2px solid transparent;
}

.btn-style-option input:checked + .btn-style-preview {
    box-shadow: 0 0 0 2px var(--accent);
    transform: scale(1.05);
}

.btn-style-primary   { background: #5865f2; }
.btn-style-success   { background: #248046; }
.btn-style-danger    { background: #da373c; }
.btn-style-secondary { background: #4e5058; }

/* ── Deploy Status ──────────────────────────────────────────────────────── */
.deploy-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius-xs);
    font-size: 13px;
}

.deploy-status.deployed {
    background: var(--success-bg);
    color: var(--success);
}

.deploy-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

.deploy-status code {
    font-size: 11px;
    background: rgba(0,0,0,0.2);
    padding: 1px 5px;
    border-radius: 3px;
}

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s;
}

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

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.2s ease-out;
}

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

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

.modal-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

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

/* ── Form Hints ─────────────────────────────────────────────────────────── */
.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

/* ── Panel Cards Grid ───────────────────────────────────────────────────── */
.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 20px;
}

.panel-card .card-header {
    padding-bottom: 12px;
}

.panel-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-card-title .card-title { flex: 1; }

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

.panel-preview {
    margin-bottom: 16px;
}

.panel-preview-embed {
    background: #2b2d31;
    border-left: 4px solid #3498db;
    border-radius: 4px;
    padding: 12px 16px;
}

.panel-preview-title {
    font-size: 14px;
    font-weight: 600;
    color: #f2f3f5;
    margin-bottom: 4px;
}

.panel-preview-desc {
    font-size: 12px;
    color: #dbdee1;
    line-height: 1.4;
}

.panel-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Intake Field Rows ──────────────────────────────────────────────────── */
.intake-field-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.intake-field-row .form-input { flex: 1; }

/* ── Rules List ─────────────────────────────────────────────────────────── */
.rules-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.rule-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
}

.rule-add-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Teams ───────────────────────────────────────────────────────────────── */
.teams-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.team-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
}

.team-name { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.team-role-id { font-size: 11px; color: var(--text-muted); margin-left: 8px; }

.team-create-form {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.form-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.teams-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}


