/* =============================================
   GENIO ADMIN PANEL — Dark Premium Design
   ============================================= */

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

:root {
    --bg:          #05020c;
    --surface:     #0d091e;
    --surface2:    #130e29;
    --border:      rgba(255,255,255,0.07);
    --purple:      #8b5cf6;
    --gold:        #f59e0b;
    --green:       #10b981;
    --cyan:        #06b6d4;
    --red:         #ef4444;
    --text:        #f8fafc;
    --muted:       #64748b;
    --font:        'Inter', sans-serif;
    --font-title:  'Plus Jakarta Sans', sans-serif;
}

html, body { height: 100%; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}

/* ─── LOGIN ─── */
#login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(ellipse at 50% 0%, rgba(139,92,246,0.12) 0%, transparent 60%);
}

.login-card {
    background: var(--surface);
    border: 1px solid rgba(139,92,246,0.25);
    border-radius: 20px;
    padding: 44px 40px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5);
}

.login-logo { font-size: 3rem; margin-bottom: 12px; }

.login-card h1 {
    font-family: var(--font-title);
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
}

.gold { color: var(--gold); }

.subtitle { color: var(--muted); font-size: 0.88rem; }

/* ─── LAYOUT ─── */
#app {
    display: flex;
    min-height: 100vh;
}

/* ─── SIDEBAR ─── */
.sidebar {
    width: 220px;
    min-height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    position: fixed;
    top: 0; left: 0;
    bottom: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.logo-icon { font-size: 1.5rem; }

.logo-text {
    font-family: var(--font-title);
    font-weight: 800;
    font-size: 1rem;
    color: var(--text);
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.nav-item.active { background: rgba(139,92,246,0.15); color: var(--purple); }

.nav-icon { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-footer { padding: 16px 20px 0; border-top: 1px solid var(--border); }

/* ─── MAIN ─── */
.main-content {
    margin-left: 220px;
    flex: 1;
    padding: 28px 32px;
    min-height: 100vh;
    background: var(--bg);
}

/* ─── HEADER ─── */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.top-header h2 {
    font-family: var(--font-title);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
}

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

.admin-badge {
    background: rgba(139,92,246,0.1);
    border: 1px solid rgba(139,92,246,0.2);
    color: var(--purple);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
}

/* ─── STATS GRID ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.stat-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}

.stat-icon.purple { background: rgba(139,92,246,0.15); }
.stat-icon.gold   { background: rgba(245,158,11,0.15); }
.stat-icon.green  { background: rgba(16,185,129,0.15); }
.stat-icon.cyan   { background: rgba(6,182,212,0.15); }

.stat-value {
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label { color: var(--muted); font-size: 0.8rem; }

/* ─── CARDS ─── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px 24px;
    margin-bottom: 20px;
}

.card-title {
    font-family: var(--font-title);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
}

/* ─── PLAN BARS ─── */
.plan-bars { display: flex; flex-direction: column; gap: 12px; }

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

.plan-bar-label { display: flex; align-items: center; gap: 8px; width: 160px; }

.plan-bar-count { color: var(--muted); font-size: 0.82rem; }

.plan-bar-track {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 99px;
    overflow: hidden;
}

.plan-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.6s ease;
    opacity: 0.85;
}

.plan-bar-pct { color: var(--muted); font-size: 0.8rem; width: 38px; text-align: right; }

/* ─── TABLE ─── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.data-table th {
    text-align: left;
    padding: 10px 12px;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 12px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    color: var(--text);
    vertical-align: middle;
}

.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.data-table tr:last-child td { border-bottom: none; }

.loading { text-align: center; color: var(--muted); padding: 30px !important; }

/* ─── BADGES ─── */
.plan-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.success { background: rgba(16,185,129,0.15); color: #10b981; }
.status-badge.danger  { background: rgba(239,68,68,0.15);  color: #ef4444; }

/* ─── BUTTONS ─── */
.btn-primary {
    background: linear-gradient(135deg, var(--purple), #6366f1);
    color: #fff;
    border: none;
    padding: 11px 22px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-primary:hover { opacity: 0.85; }

.btn-secondary {
    background: rgba(255,255,255,0.06);
    color: var(--muted);
    border: 1px solid var(--border);
    padding: 11px 22px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-refresh {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-logout {
    background: transparent;
    border: 1px solid rgba(239,68,68,0.3);
    color: #f87171;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    width: 100%;
    font-weight: 600;
}

.btn-mini {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    margin-right: 4px;
}

.btn-mini.danger { color: #f87171; border-color: rgba(239,68,68,0.2); }

/* ─── INPUTS ─── */
.input {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s;
}

.input:focus { border-color: rgba(139,92,246,0.5); }

.select-input { cursor: pointer; }

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

.form-label { display: block; color: var(--muted); font-size: 0.82rem; margin-bottom: 6px; font-weight: 500; }

/* ─── TOOLBAR ─── */
.page-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.search-input { flex: 1; }
.select-input { width: 160px; }

/* ─── SETTINGS LIMITS ─── */
.limits-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.limits-row:last-child { border-bottom: none; }

.limits-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    font-size: 0.85rem;
    color: var(--muted);
}

/* ─── MODAL ─── */
.modal-card {
    background: var(--surface);
    border: 1px solid rgba(139,92,246,0.3);
    border-radius: 16px;
    padding: 32px;
    width: 90%;
    max-width: 420px;
}

.modal-card h3 {
    font-family: var(--font-title);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 4px;
}

/* ─── ERROR ─── */
.error-msg {
    color: #f87171;
    font-size: 0.85rem;
    margin-top: 10px;
    min-height: 20px;
}

/* ─── TOAST ─── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--surface2);
    border: 1px solid rgba(139,92,246,0.3);
    color: var(--text);
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.toast-error { border-color: rgba(239,68,68,0.4); color: #f87171; }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .sidebar { width: 60px; }
    .logo-text, .nav-item span:last-child { display: none; }
    .main-content { margin-left: 60px; padding: 20px 16px; }
}
