/* ============================================================================
   Quantum Sniper — Admin Dashboard Styles
   Dark FinTech Theme with Glassmorphism
   ============================================================================ */

:root {
    --bg-primary: #0B0F19;
    --bg-secondary: #111827;
    --bg-card: #161F30;
    --bg-card-hover: #1C2640;
    --border-subtle: #1E293B;
    --border-accent: #22314E;
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --accent-blue: #3B82F6;
    --accent-blue-hover: #2563EB;
    --accent-green: #10B981;
    --accent-green-dark: #065F46;
    --accent-red: #EF4444;
    --accent-red-dark: #7F1D1D;
    --accent-yellow: #F59E0B;
    --accent-purple: #8B5CF6;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', monospace;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* === HEADER === */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: linear-gradient(180deg, #111827 0%, var(--bg-primary) 100%);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-logo {
    font-size: 28px;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.4)); }
    50% { filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.8)); }
}

.header-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1.5px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot-green { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.dot-yellow { background: var(--accent-yellow); box-shadow: 0 0 6px var(--accent-yellow); }
.dot-red { background: var(--accent-red); box-shadow: 0 0 6px var(--accent-red); }

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-mono);
}

.btn-refresh {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-refresh:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-blue);
    transform: rotate(180deg);
}

/* === CONFIG BAR === */
.config-bar {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 14px 32px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

.config-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 200px;
}

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

.config-input {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
    outline: none;
    transition: border-color 0.2s ease;
}

.config-input:focus {
    border-color: var(--accent-blue);
}

.btn-save-config {
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.btn-save-config:hover { background: var(--accent-blue-hover); }

/* === TABS === */
.tabs {
    display: flex;
    gap: 4px;
    padding: 16px 32px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.tab {
    padding: 10px 24px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
}

.tab:hover { color: var(--text-primary); }
.tab.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

/* === MAIN CONTENT === */
.main-content {
    padding: 0;
    max-width: 1400px;
    margin: 0 auto;
}

.tab-content {
    display: none;
    padding: 24px 32px;
}

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

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

.section-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.section-badge {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
}

/* === TABLE === */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

tbody td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

tbody tr {
    transition: background 0.15s ease;
}

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

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

.empty-state {
    text-align: center;
    padding: 40px !important;
    color: var(--text-muted);
    font-style: italic;
}

/* === STATUS BADGES === */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-active { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.status-expired { background: rgba(245, 158, 11, 0.15); color: var(--accent-yellow); }
.status-revoked { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.status-banned { background: rgba(239, 68, 68, 0.25); color: #F87171; }

/* === BUTTONS === */
.btn-primary {
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
}

.btn-primary:hover { background: var(--accent-blue-hover); transform: translateY(-1px); }

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
}

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

.btn-danger {
    background: var(--accent-red);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
}

.btn-danger:hover { background: #DC2626; transform: translateY(-1px); }

.btn-sm {
    padding: 5px 12px;
    font-size: 11px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.15s ease;
    font-family: var(--font-sans);
}

.btn-sm.revoke { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.btn-sm.revoke:hover { background: var(--accent-red); color: white; }
.btn-sm.activate { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.btn-sm.activate:hover { background: var(--accent-green); color: white; }
.btn-sm.extend { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.btn-sm.extend:hover { background: var(--accent-blue); color: white; }

/* === TELEMETRY GRID === */
.telemetry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.telemetry-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
    transition: border-color 0.2s ease;
}

.telemetry-card:hover { border-color: var(--accent-blue); }

.telemetry-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.telemetry-card-key {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-blue);
}

.telemetry-card-broker {
    font-size: 11px;
    color: var(--text-muted);
}

.telemetry-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(30, 41, 59, 0.5);
}

.telemetry-metric:last-child { border-bottom: none; }

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

.metric-value {
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-mono);
}

.metric-positive { color: var(--accent-green); }
.metric-negative { color: var(--accent-red); }

/* === BOT STATS GRID === */
.bot-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.bot-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.bot-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--bot-color, var(--accent-blue));
}

.bot-card-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
}

.bot-metric {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 13px;
}

.bot-metric-label { color: var(--text-muted); }
.bot-metric-value { font-weight: 600; font-family: var(--font-mono); }

/* === MODAL === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

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

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.25s ease;
    overflow: hidden;
}

.modal-lg { max-width: 680px; }
.modal-md { max-width: 520px; }

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(17, 24, 39, 0.6);
}

.modal-header h3 { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.modal-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    line-height: 1;
}

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

.modal-body {
    padding: 24px;
    max-height: calc(85vh - 140px);
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
    background: rgba(17, 24, 39, 0.4);
}

/* === PRESETS GRID === */
.presets-container {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 20px;
}

.presets-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-blue);
    margin-bottom: 10px;
}

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

.btn-preset {
    padding: 8px 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.btn-preset:hover {
    border-color: var(--accent-blue);
    color: var(--text-primary);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
}

/* === FORM ROWS & INPUTS === */
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.flex-1 { flex: 1; }

.form-group {
    margin-bottom: 0;
}

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

.form-input {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

select.form-input {
    cursor: pointer;
}

.input-with-action {
    display: flex;
    gap: 6px;
}

.btn-fill-test {
    padding: 0 12px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: var(--accent-purple);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-fill-test:hover {
    background: rgba(139, 92, 246, 0.25);
}

.form-hint {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.btn-cancel {
    padding: 10px 18px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

/* === RESULT BOX & DISPLAY === */
.result-box {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.result-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-green);
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.license-key-display {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 2px;
    background: var(--bg-primary);
    border: 1px solid var(--border-accent);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    user-select: all;
}

.btn-copy-big {
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--accent-green), #059669);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-copy-big:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border-subtle);
}

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

.res-item-label {
    font-size: 11px;
    color: var(--text-muted);
}

.res-item-val {
    font-size: 13px;
    color: var(--text-primary);
}

select.form-input {
    appearance: none;
    cursor: pointer;
}

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

/* === KEY DISPLAY === */
code {
    font-family: var(--font-mono);
    font-size: 12px;
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--accent-blue);
}

/* === LOGIN SCREEN / GATE === */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    background: var(--bg-primary);
    overflow: hidden;
}

.login-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15), transparent 70%);
    pointer-events: none;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 440px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(16px);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.login-header h1 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1.5px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.login-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--accent-red);
    font-size: 11px;
    font-weight: 600;
    border-radius: 100px;
    margin-top: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-group {
    margin-bottom: 18px;
}

.login-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.login-group input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease;
}

.login-group input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent-blue), #2563EB);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.login-error {
    margin-top: 14px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--accent-red);
    border-radius: var(--radius-sm);
    font-size: 12px;
    text-align: center;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
    font-size: 11px;
    color: var(--text-muted);
}

.btn-logout {
    padding: 8px 14px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--accent-red);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-1px);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .header { flex-direction: column; gap: 12px; padding: 12px 16px; }
    .header-right { flex-wrap: wrap; justify-content: center; }
    .tabs { overflow-x: auto; padding: 12px 16px 0; }
    .tab-content { padding: 16px; }
    .config-bar { padding: 12px 16px; }
    .telemetry-grid { grid-template-columns: 1fr; }
    .bot-stats-grid { grid-template-columns: 1fr; }
    .login-card { padding: 28px 20px; }
}
