:root {
    --bg: #0b1220;
    --surface: #111827;
    --border: #1f2937;
    --text: #f3f4f6;
    --muted: #9ca3af;
    --accent: #0ea5e9;
    --accent-hover: #0284c7;
    --danger: #ef4444;
    --success: #22c55e;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem;
}

header.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

header.app-header h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
}

.stat-box .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-box .label {
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 0.65rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th { color: var(--muted); font-weight: 500; font-size: 0.8rem; }

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    background: #1e3a5f;
    color: #7dd3fc;
}

.badge.inactive { background: #3f1d1d; color: #fca5a5; }

label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    color: var(--muted);
}

input[type="text"],
input[type="url"],
input[type="password"],
textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #0b1220;
    color: var(--text);
    font-size: 0.95rem;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.checkbox-row input { width: auto; margin: 0; }

.btn {
    display: inline-block;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    background: var(--accent);
}

.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn-secondary { background: #374151; }
.btn-danger { background: var(--danger); }
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.8rem; }

.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-error { background: #3f1d1d; color: #fecaca; }
.alert-success { background: #14532d; color: #bbf7d0; }

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 380px;
}

.qr-preview {
    text-align: center;
    padding: 1rem;
}

.qr-preview img {
    max-width: 220px;
    border-radius: 8px;
    background: #fff;
    padding: 8px;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 120px;
    margin-top: 1rem;
}

.chart-bar {
    flex: 1;
    background: var(--accent);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    position: relative;
}

.chart-bar span {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: var(--muted);
    white-space: nowrap;
}

.copy-url {
    font-family: monospace;
    font-size: 0.85rem;
    background: #0b1220;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    word-break: break-all;
    margin: 0.5rem 0 1rem;
}