/* ═══════════════════════════════════════════════
   SessionFlow Admin — Base / Design Tokens
   Variables, Reset, Utilities, Buttons, Inputs
   ═══════════════════════════════════════════════ */

:root {
    /* Color Palette */
    --bg-primary: #0f0f1a;
    --bg-secondary: #161625;
    --bg-tertiary: #1e1e32;
    --bg-card: rgba(30, 30, 50, 0.7);
    --bg-hover: rgba(99, 102, 241, 0.08);
    --bg-input: rgba(30, 30, 60, 0.6);

    --text-primary: #e4e4f0;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-light: rgba(99, 102, 241, 0.15);

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --border: rgba(99, 102, 241, 0.12);
    --border-hover: rgba(99, 102, 241, 0.3);

    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.4);
    --glass: rgba(30, 30, 60, 0.5);
    --glass-border: rgba(99, 102, 241, 0.15);

    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ─── Reset ─── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: var(--font);
    color: var(--text-primary);
}

input,
select,
textarea {
    font-family: var(--font);
    color: var(--text-primary);
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* ─── Utility ─── */
.hidden {
    display: none !important;
}

.flex {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ─── Glass Card ─── */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--transition);
    white-space: nowrap;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #818cf8);
    color: white;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    background: var(--bg-hover);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: white;
}

.btn-danger:hover {
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    position: relative;
}

.btn-icon:hover {
    background: var(--bg-hover);
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

/* ─── Inputs ─── */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: var(--transition);
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.input-sm,
.select-sm {
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: var(--transition);
    outline: none;
    color: var(--text-primary);
}

.input-sm:focus,
.select-sm:focus {
    border-color: var(--accent);
}

.select-sm {
    cursor: pointer;
}

.select-sm option {
    background: var(--bg-secondary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: var(--transition);
    outline: none;
    color: var(--text-primary);
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

/* ─── Screen System ─── */
.screen {
    display: none;
}

.screen.active {
    display: flex;
}

#app {
    height: 100vh;
}

/* ─── Status Badges ─── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
}

.status-inactive {
    background: rgba(107, 114, 128, 0.1);
    color: #9ca3af;
}

.status-banned {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.status-expired {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

.status-online {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.status-offline {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.status-valid {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
}

.status-maintenance {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

.status-disabled {
    background: rgba(107, 114, 128, 0.1);
    color: #9ca3af;
}

.badge-sm {
    display: inline-flex;
    padding: 2px 8px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.empty-state-sm {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ═══════════════════════════════════════
   CUSTOM CONFIRM DIALOG
   ═══════════════════════════════════════ */
.sf-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sf-confirm-overlay.visible {
    opacity: 1;
}

.sf-confirm-dialog {
    background: linear-gradient(145deg, rgba(22, 22, 42, 0.98), rgba(15, 15, 30, 0.98));
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 16px;
    padding: 28px 32px;
    min-width: 340px;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(99, 102, 241, 0.05);
    transform: scale(0.9);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sf-confirm-overlay.visible .sf-confirm-dialog {
    transform: scale(1);
}

.sf-confirm-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sf-confirm-icon svg {
    width: 26px;
    height: 26px;
}

.sf-confirm-icon.info {
    background: rgba(99, 102, 241, 0.12);
}

.sf-confirm-icon.info svg {
    stroke: #818cf8;
}

.sf-confirm-icon.danger {
    background: rgba(239, 68, 68, 0.12);
}

.sf-confirm-icon.danger svg {
    stroke: #f87171;
}

.sf-confirm-title {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary, #e4e4f0);
}

.sf-confirm-message {
    margin: 0 0 22px;
    font-size: 0.85rem;
    color: var(--text-secondary, #9ca3af);
    line-height: 1.5;
}

.sf-confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.sf-confirm-btn {
    flex: 1;
    padding: 9px 18px;
    border: none;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    letter-spacing: 0.2px;
}

.sf-confirm-btn.cancel {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary, #9ca3af);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sf-confirm-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #e4e4f0);
}

.sf-confirm-btn.primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.25);
}

.sf-confirm-btn.primary:hover {
    background: linear-gradient(135deg, #818cf8, #6366f1);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
}

.sf-confirm-btn.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.25);
}

.sf-confirm-btn.danger:hover {
    background: linear-gradient(135deg, #f87171, #ef4444);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
}

.sf-confirm-btn:focus {
    outline: 2px solid rgba(99, 102, 241, 0.5);
    outline-offset: 2px;
}