/* ============================================
   STEAMGUARD PANEL — Dark Professional Theme
   Clean, fast, no lag
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --bg-0: #09090b;
    --bg-1: #0c0c10;
    --bg-2: #131318;
    --bg-3: #1a1a22;
    --bg-4: #22222e;
    --bg-hover: #1e1e2a;
    --border-1: #1e1e2a;
    --border-2: #2a2a3a;
    --border-3: #3a3a4e;
    --accent: #3b82f6;
    --accent-dim: rgba(59, 130, 246, 0.12);
    --accent-glow: rgba(59, 130, 246, 0.08);
    --cyan: #06b6d4;
    --cyan-dim: rgba(6, 182, 212, 0.12);
    --green: #10b981;
    --green-dim: rgba(16, 185, 129, 0.12);
    --red: #ef4444;
    --red-dim: rgba(239, 68, 68, 0.12);
    --yellow: #f59e0b;
    --yellow-dim: rgba(245, 158, 11, 0.12);
    --purple: #8b5cf6;
    --purple-dim: rgba(139, 92, 246, 0.12);
    --text-0: #fafafa;
    --text-1: #d4d4d8;
    --text-2: #a1a1aa;
    --text-3: #71717a;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', monospace;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-xs: 4px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
    --transition: 150ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
    font-family: var(--font);
    background: var(--bg-0);
    color: var(--text-1);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 30%, rgba(59,130,246,0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

::selection { background: var(--accent); color: #fff; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ Layout ============ */

.app-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 220px;
    background: var(--bg-1);
    border-right: 1px solid var(--border-1);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 50;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-1);
}

.sidebar-logo h1 {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-0);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.sidebar-logo span {
    display: block;
    font-family: var(--font);
    font-size: 11px;
    color: var(--text-3);
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    margin-top: 2px;
}

.nav-links { list-style: none; padding: 10px 8px; flex: 1; }

.nav-links li { margin-bottom: 2px; }

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    color: var(--text-2);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition), box-shadow var(--transition);
}

.nav-links li a:hover {
    color: var(--text-0);
    background: var(--bg-hover);
    text-decoration: none;
}

.nav-links li a.active {
    color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
    box-shadow: inset 3px 0 0 var(--accent);
}

.nav-links li a .icon { width: 20px; display: flex; align-items: center; justify-content: center; opacity: 0.45; flex-shrink: 0; }
.nav-links li a .icon svg { display: block; }
.nav-links li a:hover .icon { opacity: 0.8; }
.nav-links li a.active .icon { opacity: 1; }

.sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-1);
}

.sidebar-footer .user-info {
    font-size: 12px;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer .logout-btn {
    display: inline;
    margin-top: 6px;
    color: var(--text-3);
    cursor: pointer;
    font-size: 12px;
    background: none;
    border: none;
    font-family: inherit;
    padding: 0;
    transition: color var(--transition);
}

.sidebar-footer .logout-btn:hover { color: var(--red); }

.main-content {
    margin-left: 220px;
    flex: 1;
    padding: 28px 32px;
    min-height: 100vh;
    max-width: 1200px;
}

.page-header { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border-1); position: relative; }

.page-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    border-radius: 1px;
}

.page-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-0);
    letter-spacing: -0.3px;
}

.page-header p {
    color: var(--text-3);
    margin-top: 2px;
    font-size: 13px;
}

/* ============ Cards ============ */

.card {
    background: var(--bg-2);
    border: 1px solid var(--border-1);
    border-radius: var(--radius);
    padding: 20px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover { border-color: var(--border-2); box-shadow: 0 2px 12px rgba(0,0,0,0.25); }

.card-title {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-2);
    border: 1px solid var(--border-1);
    border-top: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 18px 20px;
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover { border-color: var(--border-2); border-top-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(59,130,246,0.08); }

.stat-value {
    font-family: var(--mono);
    font-size: 28px;
    font-weight: 600;
    color: var(--accent);
    line-height: 1.2;
}

.stat-label {
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: 4px;
}

.stat-card.purple { border-top-color: var(--purple); }
.stat-card.purple .stat-value { color: var(--purple); }
.stat-card.purple:hover { box-shadow: 0 4px 16px rgba(139,92,246,0.08); }

.stat-card.green { border-top-color: var(--green); }
.stat-card.green .stat-value { color: var(--green); }
.stat-card.green:hover { box-shadow: 0 4px 16px rgba(16,185,129,0.08); }

.stat-card.red { border-top-color: var(--red); }
.stat-card.red .stat-value { color: var(--red); }
.stat-card.red:hover { box-shadow: 0 4px 16px rgba(239,68,68,0.08); }

.stat-card.cyan { border-top-color: var(--cyan); }
.stat-card.cyan .stat-value { color: var(--cyan); }
.stat-card.cyan:hover { box-shadow: 0 4px 16px rgba(6,182,212,0.08); }

.stat-card.yellow { border-top-color: var(--yellow); }
.stat-card.yellow .stat-value { color: var(--yellow); }
.stat-card.yellow:hover { box-shadow: 0 4px 16px rgba(245,158,11,0.08); }

/* ============ Tables ============ */

.table-wrapper { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-3);
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-2);
    white-space: nowrap;
    background: var(--bg-3);
}

th:first-child { border-radius: var(--radius-xs) 0 0 0; }
th:last-child { border-radius: 0 var(--radius-xs) 0 0; }

td {
    padding: 10px 14px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-1);
    transition: background var(--transition);
    vertical-align: middle;
}

tr:nth-child(even) td { background: rgba(255,255,255,0.01); }
tr:hover td { background: var(--bg-hover); }
tr:last-child td { border-bottom: none; }

.code-text {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--cyan);
}

/* ============ Buttons ============ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(59,130,246,0.25);
}
.btn-primary:hover { background: #2563eb; border-color: #2563eb; box-shadow: 0 4px 14px rgba(59,130,246,0.35); }

.btn-secondary {
    background: var(--purple-dim);
    color: var(--purple);
    border-color: rgba(139, 92, 246, 0.2);
}
.btn-secondary:hover { background: rgba(139, 92, 246, 0.2); box-shadow: 0 2px 10px rgba(139,92,246,0.15); }

.btn-success {
    background: var(--green-dim);
    color: var(--green);
    border-color: rgba(16, 185, 129, 0.2);
}
.btn-success:hover { background: rgba(16, 185, 129, 0.2); box-shadow: 0 2px 10px rgba(16,185,129,0.15); }

.btn-danger {
    background: var(--red-dim);
    color: var(--red);
    border-color: rgba(239, 68, 68, 0.2);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.2); box-shadow: 0 2px 10px rgba(239,68,68,0.15); }

.btn-ghost {
    background: transparent;
    color: var(--text-2);
    border-color: var(--border-2);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-0); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: var(--radius-xs); }

.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ============ Forms ============ */

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-1);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    color: var(--text-0);
    font-family: var(--font);
    font-size: 13px;
    transition: border-color var(--transition);
    outline: none;
}

.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }
.form-control::placeholder { color: var(--text-3); }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%2371717a' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

/* ============ Badges ============ */

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--mono);
}

.badge-blue { background: var(--accent-dim); color: var(--accent); }
.badge-green { background: var(--green-dim); color: var(--green); }
.badge-red { background: var(--red-dim); color: var(--red); }
.badge-purple { background: var(--purple-dim); color: var(--purple); }
.badge-yellow { background: var(--yellow-dim); color: var(--yellow); }

/* ============ Modal ============ */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--bg-2);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    padding: 28px;
    min-width: 380px;
    max-width: 560px;
    box-shadow: var(--shadow-lg);
}

.modal h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-0);
    margin-bottom: 16px;
}

/* ============ Steam Guard Code ============ */

.steam-code {
    font-family: var(--mono);
    font-size: 42px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 8px;
    text-align: center;
    padding: 16px;
    background: var(--accent-dim);
    border: 1px solid rgba(59,130,246,0.15);
    border-radius: var(--radius);
    margin: 12px 0;
    user-select: all;
}

/* ============ Toast ============ */

.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.toast {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    animation: toastIn 0.2s ease;
    min-width: 260px;
    box-shadow: var(--shadow-md);
}

.toast-success { background: var(--bg-3); border-left: 3px solid var(--green); color: var(--green); }
.toast-error { background: var(--bg-3); border-left: 3px solid var(--red); color: var(--red); }
.toast-info { background: var(--bg-3); border-left: 3px solid var(--accent); color: var(--accent); }

@keyframes toastIn {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============ Loading ============ */

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.loading-lg { width: 32px; height: 32px; }

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: var(--text-3);
    font-size: 13px;
}

/* ============ Login Page ============ */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-0);
    position: relative;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.login-card {
    background: var(--bg-2);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    padding: 40px;
    width: 400px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 80px rgba(59,130,246,0.04);
    position: relative;
    z-index: 1;
}

.login-card h1 {
    font-family: var(--mono);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-0);
    text-align: center;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.login-card .subtitle {
    text-align: center;
    color: var(--text-3);
    font-size: 12px;
    margin-top: 4px;
    margin-bottom: 28px;
}

.login-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-1);
}

.login-tab {
    flex: 1;
    padding: 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-3);
    cursor: pointer;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    font-family: inherit;
    transition: color var(--transition);
}

.login-tab:hover { color: var(--text-1); }
.login-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ============ Confirmation Cards ============ */

.conf-card {
    background: var(--bg-3);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 8px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.conf-card:hover { border-color: var(--border-2); box-shadow: 0 2px 8px rgba(0,0,0,0.2); }

.conf-type { font-size: 11px; margin-bottom: 4px; }

.conf-headline {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-0);
    margin-bottom: 6px;
}

/* ============ Drop Zone ============ */

.drop-zone {
    border: 1px dashed var(--border-2);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 20px;
    background: var(--bg-1);
}

.drop-zone:hover, .drop-zone-active {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.drop-zone-icon {
    font-size: 32px;
    color: var(--text-3);
    margin-bottom: 6px;
    transition: color var(--transition);
}

.drop-zone:hover .drop-zone-icon, .drop-zone-active .drop-zone-icon {
    color: var(--accent);
}

.drop-zone-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-1);
}

.drop-zone-hint {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 2px;
}

/* ============ Utility ============ */

.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-3); }
.text-sm { font-size: 12px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.hidden { display: none !important; }

/* ============ Scrollbar ============ */

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ============ Additional Utilities ============ */

.p-0 { padding: 0; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.flex-center { display: flex; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-4 { gap: 4px; }
.font-mono { font-family: var(--mono); }
.text-xs { font-size: 10px; }
.text-11 { font-size: 11px; }
.w-full { width: 100%; }
.max-w-400 { max-width: 400px; }
.max-w-500 { max-width: 500px; }
.overflow-y { overflow-y: auto; }
.max-h-300 { max-height: 300px; }
.max-h-70vh { max-height: 70vh; }
.border-b { border-bottom: 1px solid var(--border-1); }
.cursor-pointer { cursor: pointer; }
.whitespace-nowrap { white-space: nowrap; }
.break-all { word-break: break-all; }
.select-all { user-select: all; }

/* ============ Skeleton Loading ============ */

.skeleton {
    background: linear-gradient(90deg, var(--bg-3) 25%, var(--bg-4) 50%, var(--bg-3) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-line { height: 14px; margin-bottom: 8px; }
.skeleton-card { height: 80px; margin-bottom: 12px; border-radius: var(--radius); }
.skeleton-stat { height: 90px; border-radius: var(--radius); }
.skeleton-table-row { height: 42px; margin-bottom: 2px; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============ Toast Warning + Close ============ */

.toast-warning { background: var(--bg-3); border-left: 3px solid var(--yellow); color: var(--yellow); }

.toast { position: relative; padding-right: 32px; }
.toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    cursor: pointer;
    opacity: 0.5;
    font-size: 12px;
    line-height: 1;
}
.toast-close:hover { opacity: 1; }

/* ============ Disabled Button ============ */

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}
