/* ═══════════════════════════════════════════════════════════════
   Priority.win — Admin Panel Styles
   Dark purple theme matching the Priority.win brand
   ═══════════════════════════════════════════════════════════════ */

:root {
    --bg-primary: #0d0d14;
    --bg-secondary: #13131f;
    --bg-card: #1a1a2e;
    --bg-card-hover: #1f1f35;
    --bg-input: #12121e;
    --border: #2a2a45;
    --border-focus: #7c3aed;
    --accent: #a855f7;
    --accent-hover: #9333ea;
    --accent-glow: rgba(168, 85, 247, 0.3);
    --accent-dim: rgba(168, 85, 247, 0.15);
    --text-primary: #e8e8f0;
    --text-secondary: #9090a8;
    --text-muted: #5a5a75;
    --success: #22c55e;
    --warning: #eab308;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --info: #3b82f6;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

/* ── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ── LOGIN PAGE ──────────────────────────────────────────────── */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(ellipse at center, #1a1030 0%, var(--bg-primary) 70%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 36px 36px;
    box-shadow: var(--shadow), 0 0 60px rgba(168, 85, 247, 0.05);
}

.login-logo {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo .logo-icon {
    filter: drop-shadow(0 0 12px var(--accent-glow));
    margin-bottom: 16px;
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--text-primary);
}

.login-logo .accent {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-logo .subtitle {
    font-size: 13px;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 4px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.input-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-login:active {
    transform: translateY(0);
}

.error-text {
    color: var(--danger);
    font-size: 13px;
    text-align: center;
    margin-top: 12px;
    min-height: 20px;
}

.login-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ── DASHBOARD LAYOUT ────────────────────────────────────────── */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-brand {
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.sidebar-brand h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
}

.sidebar-brand .accent {
    color: var(--accent);
}

.sidebar-brand p {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active {
    color: var(--accent);
    background: var(--accent-dim);
    border-left-color: var(--accent);
}

.nav-item .icon {
    font-size: 18px;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-logout {
    width: 100%;
    padding: 8px;
    margin-top: 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 32px;
    max-width: calc(100vw - 240px);
}

.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

/* ── STATS CARDS ─────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── TABLE ───────────────────────────────────────────────────── */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.table-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.table-actions {
    display: flex;
    gap: 8px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 4px 12px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

td {
    padding: 12px 14px;
    font-size: 13px;
    border-bottom: 1px solid rgba(42, 42, 69, 0.5);
    vertical-align: middle;
}

/* Specific Column Widths */
th:nth-child(2),
td:nth-child(2) {
    min-width: 140px;
}

/* Username */
th:nth-child(4),
td:nth-child(4) {
    min-width: 180px;
}

/* Hardware */
th:nth-child(5),
td:nth-child(5) {
    min-width: 140px;
}

/* IP */
th:nth-child(6),
td:nth-child(6) {
    min-width: 120px;
}

/* HWID */
th:nth-child(7),
td:nth-child(7) {
    min-width: 100px;
}

/* Status */
th:nth-child(6),
td:nth-child(6) {
    min-width: 100px;
}

/* HWID */

tr:hover td {
    background: rgba(168, 85, 247, 0.03);
}

/* ── BADGES ──────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.badge-dev {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.badge-beta {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.badge-user {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.badge-premium {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

.badge-staff {
    background: rgba(236, 72, 153, 0.2);
    color: #ec4899;
}

.badge-owner {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.badge-sub {
    background: rgba(14, 165, 233, 0.2);
    color: #0ea5e9;
}

.badge-co-owner {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
}

.badge-banned {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.badge-active {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.badge-expired {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
}

.hwid-text {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: var(--text-muted);
}

/* ── MODAL ───────────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow), 0 0 80px rgba(168, 85, 247, 0.08);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal h3 {
    font-size: 18px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal .input-group {
    margin-bottom: 16px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

.select-group select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
}

.select-group select:focus {
    border-color: var(--accent);
}

.select-group select option {
    background: var(--bg-card);
}

/* Rules Checkbox Grid */
.rules-checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background: var(--bg-input);
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.rule-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.rule-checkbox input {
    width: 16px !important;
    height: 16px !important;
    cursor: pointer;
}

.rule-checkbox:hover {
    color: var(--text-primary);
}

/* ── LOGS ────────────────────────────────────────────────────── */
.log-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(42, 42, 69, 0.3);
    font-size: 13px;
}

.log-action {
    font-weight: 500;
    min-width: 120px;
}

.log-details {
    color: var(--text-secondary);
    flex: 1;
}

.log-time {
    color: var(--text-muted);
    font-size: 11px;
    white-space: nowrap;
}

/* ── SECTIONS ────────────────────────────────────────────────── */
.section {
    display: none;
}

.section.active {
    display: block;
}

/* ── SEARCH ──────────────────────────────────────────────────── */
.search-input {
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    width: 200px;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--accent);
    width: 260px;
}

/* ── TOAST ────────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    animation: toastIn 0.3s ease;
    min-width: 260px;
    box-shadow: var(--shadow);
}

.toast-success {
    background: #065f46;
    color: #6ee7b7;
    border-left: 3px solid var(--success);
}

.toast-error {
    background: #7f1d1d;
    color: #fca5a5;
    border-left: 3px solid var(--danger);
}

.toast-info {
    background: #1e3a5f;
    color: #93c5fd;
    border-left: 3px solid var(--info);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ── HARDWARE & IP STYLES ──────────────────────────────────────── */
.hw-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: help;
}

.hw-cpu {
    font-size: 12px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.hw-gpu {
    font-size: 10px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.ip-text {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 11px;
    color: #fff;
    background: rgba(124, 58, 237, 0.4);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.no-data {
    color: var(--text-muted);
    font-style: italic;
    font-size: 11px;
}

/* ── SWITCH (TOGGLE) ─────────────────────────────────────────── */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-muted);
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent-dim);
    border-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(20px);
    background-color: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

textarea.search-input {
    resize: none;
    transition: border-color 0.2s;
}

textarea.search-input:focus {
    width: 100% !important; /* Prevent expansion of broadcast textarea */
    border-color: var(--accent);
}