:root {
    --bg: #130716;
    --panel: rgba(255,255,255,0.08);
    --panel-strong: rgba(255,255,255,0.12);
    --text: #fff7ff;
    --muted: #c9b8d1;
    --line: rgba(255,255,255,0.13);
    --pink: #e91e63;
    --purple: #7c3aed;
    --violet: #a855f7;
    --hot: #ff2f92;
    --danger: #ef4444;
    --green: #22c55e;
    --shadow: 0 18px 50px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, Arial, sans-serif;
    background:
        radial-gradient(circle at 15% 10%, rgba(233,30,99,.45), transparent 32%),
        radial-gradient(circle at 85% 0%, rgba(124,58,237,.45), transparent 35%),
        linear-gradient(145deg, #130716 0%, #210b2c 48%, #08040b 100%);
    color: var(--text);
}

a { color: inherit; }

.login-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 34px;
    border-radius: 28px;
    background: linear-gradient(160deg, rgba(255,255,255,.14), rgba(255,255,255,.06));
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.login-logo {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    font-size: 30px;
    margin-bottom: 20px;
    box-shadow: 0 14px 40px rgba(233,30,99,.35);
}

.login-card h1 { margin: 0 0 8px; font-size: 30px; }
.login-card p { margin: 0 0 24px; color: var(--muted); }
.form-row { margin-bottom: 14px; }

input, select, button { font: inherit; }

input, select {
    width: 100%;
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.08);
    color: var(--text);
    border-radius: 14px;
    padding: 13px 14px;
    outline: none;
}

select option { color: #111; }

input:focus, select:focus {
    border-color: rgba(255,47,146,.7);
    box-shadow: 0 0 0 4px rgba(255,47,146,.12);
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 14px;
    padding: 12px 16px;
    color: white;
    text-decoration: none;
    cursor: pointer;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    box-shadow: 0 12px 30px rgba(233,30,99,.28);
}

.btn.full { width: 100%; }

.error {
    background: rgba(239,68,68,.16);
    color: #fecaca;
    border: 1px solid rgba(239,68,68,.35);
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 16px;
}

.app {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 16px;
    background: rgba(8,4,11,.72);
    border-right: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 8px 22px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    box-shadow: 0 12px 28px rgba(233,30,99,.3);
}

.brand-title { font-weight: 800; line-height: 1.1; }
.brand-subtitle { font-size: 12px; color: var(--muted); }

.nav { display: grid; gap: 8px; }

.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 13px;
    border-radius: 14px;
    color: var(--muted);
    text-decoration: none;
}

.nav a:hover, .nav a.active {
    color: white;
    background: linear-gradient(135deg, rgba(233,30,99,.24), rgba(124,58,237,.24));
}

.sidebar-footer {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 18px;
    color: var(--muted);
    font-size: 12px;
}

.main { padding: 28px; min-width: 0; }

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 22px;
}

.page-head h1 { margin: 0 0 6px; font-size: 34px; }
.muted { color: var(--muted); }

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 18px 0 22px;
}

.card, .panel {
    background: linear-gradient(160deg, rgba(255,255,255,.11), rgba(255,255,255,.055));
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.card { padding: 20px; }
.card .label { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.card .value { font-size: 34px; font-weight: 800; letter-spacing: -0.04em; }

.panel { padding: 18px; margin-bottom: 18px; }

.filters {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) auto;
    gap: 12px;
    align-items: end;
}

.table-wrap {
    overflow-x: auto;
    border-radius: 22px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255,255,255,.075);
    min-width: 760px;
}

th, td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    background: rgba(255,255,255,.055);
}

tr:hover td { background: rgba(255,255,255,.05); }

.station { font-weight: 800; }
.sub { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.big-num { font-size: 22px; font-weight: 900; }

.chart-box { height: 430px; padding: 18px; }
.chart-box canvas { width: 100% !important; height: 100% !important; }

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    background: rgba(255,255,255,.1);
    color: var(--muted);
    font-size: 12px;
}

.inline-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.heatmap {
    display: grid;
    gap: 8px;
    overflow-x: auto;
}

.heat-row {
    display: grid;
    grid-template-columns: 130px repeat(24, minmax(32px, 1fr));
    gap: 4px;
    align-items: center;
    min-width: 950px;
}

.heat-cell, .heat-label, .heat-hour {
    border-radius: 8px;
    padding: 8px 6px;
    text-align: center;
    font-size: 12px;
}

.heat-label {
    text-align: left;
    color: var(--text);
    background: rgba(255,255,255,.07);
}

.heat-hour {
    color: var(--muted);
    background: rgba(255,255,255,.04);
}

.heat-cell {
    color: white;
    cursor: default;
    border: 1px solid rgba(255,255,255,.08);
}

.progress {
    height: 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    overflow: hidden;
    margin-top: 8px;
}

.progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--pink), var(--purple));
}

@media (max-width: 920px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { position: relative; height: auto; }
    .sidebar-footer { position: static; margin-top: 18px; }
    .main { padding: 18px; }
    .filters { grid-template-columns: 1fr; }
    .page-head { display: block; }
}
