:root{
    --bg:#eef2f6;
    --panel:#ffffff;
    --border:#d8e0e8;
    --text:#17324d;
    --muted:#6b7280;
    --accent:#007bff;
    --accent-hover:#0056b3;
    --success:#1d8348;
    --danger:#c0392b;
}
*{
    box-sizing:border-box;
}
body{
    margin:0;
    font-family:Arial, Helvetica, sans-serif;
    background:var(--bg);
    color:var(--text);
}
a{
    color:var(--accent);
}
.page{
    max-width:1200px;
    margin:0 auto;
    padding:24px;
}
.header{
    display:flex;
    justify-content:space-between;
    gap:16px;
    align-items:flex-start;
    margin-bottom:18px;
}
.title-block h1{
    margin:0 0 6px;
}
.card{
    background:var(--panel);
    border:1px solid var(--border);
    border-radius:16px;
    padding:18px;
    box-shadow:0 10px 24px rgba(14, 30, 37, 0.08);
}
.toolbar,
.row{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    align-items:center;
}
.toolbar{
    margin-bottom:18px;
}
.row-spaced{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    justify-content:space-between;
    align-items:center;
}
.grid{
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:14px;
    margin-bottom:18px;
}
.tables{
    display:grid;
    grid-template-columns:minmax(0, 1.2fr) minmax(0, 1fr);
    gap:18px;
}
.tables-single{
    display:grid;
    grid-template-columns:1fr;
    gap:18px;
}
.full-width{
    margin-top:18px;
}
.nav{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}
.nav-link,
button{
    border:none;
    border-radius:12px;
    padding:10px 16px;
    font-size:15px;
    cursor:pointer;
    background:var(--accent);
    color:white;
    text-decoration:none;
    display:inline-block;
}
.nav-link:hover,
button:hover{
    background:var(--accent-hover);
}
.secondary{
    background:#e7eef6;
    color:var(--text);
}
.secondary:hover{
    background:#d6e3f1;
}
.danger{
    background:var(--danger);
}
.danger:hover{
    background:#a93226;
}
.muted{
    color:var(--muted);
}
.msg{
    margin-top:12px;
    font-size:14px;
}
.mono,
code{
    font-family:ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size:13px;
    word-break:break-all;
}
.status-chip{
    display:inline-block;
    padding:6px 10px;
    border-radius:999px;
    font-size:13px;
    font-weight:700;
    margin-right:8px;
}
.ok{
    background:#def4e6;
    color:var(--success);
}
.off{
    background:#f7e0de;
    color:var(--danger);
}
.toggle{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:12px 0;
    border-top:1px solid var(--border);
}
.toggle:first-of-type{
    border-top:none;
}
label{
    display:block;
    margin-bottom:6px;
    font-weight:600;
}
input{
    min-width:280px;
    padding:12px;
    border:1px solid var(--border);
    border-radius:12px;
    font-size:15px;
}
select,
textarea{
    min-width:280px;
    padding:12px;
    border:1px solid var(--border);
    border-radius:12px;
    font-size:15px;
    background:#fff;
    color:var(--text);
}
input[type="password"]{
    width:100%;
}
.field{
    margin-top:14px;
}
.stat-label{
    color:var(--muted);
    font-size:13px;
    margin-bottom:6px;
}
.stat-value{
    font-size:30px;
    font-weight:700;
}
.stack{
    display:flex;
    flex-direction:column;
    gap:12px;
}
.list-clean{
    margin:0;
    padding-left:18px;
}
.list-clean li{
    margin-bottom:6px;
}
.chart-card{
    min-height: 320px;
}
.chart-wrap{
    width:100%;
    overflow-x:auto;
}
.chart-svg{
    width:100%;
    min-width:640px;
    height:240px;
    display:block;
}
.chart-empty{
    color:var(--muted);
    padding:24px 0;
}
.chart-legend{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    margin-top:12px;
    font-size:13px;
    color:var(--muted);
}
.chart-legend-item{
    display:flex;
    align-items:center;
    gap:8px;
    padding:6px 10px;
    border:1px solid var(--border);
    border-radius:999px;
    background:#f8fbff;
}
.chart-legend-swatch{
    width:18px;
    height:3px;
    border-radius:999px;
    flex:0 0 auto;
}
.mini-stat-grid{
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:14px;
}
.mini-stat{
    padding:14px;
    border:1px solid var(--border);
    border-radius:14px;
    background:#f8fbff;
}
.mini-stat-value{
    font-size:24px;
    font-weight:700;
    margin-top:6px;
}
.table-scroll{
    overflow-x:auto;
}
table{
    width:100%;
    border-collapse:collapse;
    font-size:14px;
}
th, td{
    text-align:left;
    padding:10px 8px;
    border-bottom:1px solid var(--border);
    vertical-align:top;
}
th{
    color:var(--muted);
    font-size:13px;
}
@media (max-width: 900px){
    .grid,
    .tables,
    .tables-single,
    .mini-stat-grid{
        grid-template-columns:1fr;
    }
    input{
        min-width:0;
        width:100%;
    }
}
@media (max-width: 760px){
    .page{
        padding:16px;
    }
}
