:root{
    --bg1:#0b1220;
    --bg2:#0f1b33;
    --card:#101a2f;
    --card2: rgba(255,255,255,0.06);
    --line: rgba(255,255,255,0.10);
    --text:#e8eefc;
    --muted: rgba(232,238,252,0.70);
    --accent:#6ea8ff;
    --accent2:#9b7bff;
    --good:#2fe68b;
    --bad:#ff4d6d;
    --warn:#ffcc66;
    --shadow: 0 12px 35px rgba(0,0,0,0.35);
    --radius: 16px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
    margin:0;
    color:var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji";
    background:
            radial-gradient(1100px 600px at 15% 15%, rgba(110,168,255,0.25), transparent 60%),
            radial-gradient(900px 550px at 85% 25%, rgba(155,123,255,0.22), transparent 55%),
            radial-gradient(900px 600px at 50% 95%, rgba(47,230,139,0.10), transparent 60%),
            linear-gradient(180deg, var(--bg1), var(--bg2));
}

a{ color:inherit; text-decoration:none; }

.container{
    width:min(1100px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 40px;
}

.card{
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.05));
    border:1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.card-inner{
    padding: 18px;
}

.brand{
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom: 14px;
}

.logo{
    width:42px; height:42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    box-shadow: 0 10px 25px rgba(110,168,255,0.22);
}

.h-title{
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.h-sub{
    margin-top:2px;
    color: var(--muted);
    font-size: 13px;
}

.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.06);
    color: var(--text);
    cursor:pointer;
    transition: transform .06s ease, background .15s ease, border-color .15s ease;
    user-select:none;
}
.btn:hover{
    background: rgba(255,255,255,0.10);
    border-color: rgba(255,255,255,0.18);
}
.btn:active{ transform: translateY(1px); }

.btn-primary{
    border: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    box-shadow: 0 12px 25px rgba(110,168,255,0.18);
}
.btn-primary:hover{ filter: brightness(1.04); }
.btn-danger{
    border: 0;
    background: linear-gradient(135deg, #ff4d6d, #ff7b9c);
}

.input{
    width:100%;
    padding: 11px 12px;
    border-radius: 12px;
    border:1px solid var(--line);
    background: rgba(0,0,0,0.25);
    color: var(--text);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder{ color: rgba(232,238,252,0.45); }
.input:focus{
    border-color: rgba(110,168,255,0.55);
    box-shadow: 0 0 0 4px rgba(110,168,255,0.15);
}

.grid{
    display:grid;
    gap: 14px;
}

.msg{
    border-radius: 14px;
    border:1px solid var(--line);
    padding: 12px 12px;
    background: rgba(255,255,255,0.06);
    display:flex;
    gap:10px;
    align-items:flex-start;
}
.msg strong{ font-weight: 800; }
.msg.ok{ border-color: rgba(47,230,139,0.35); }
.msg.err{ border-color: rgba(255,77,109,0.35); }
.msg .dot{
    width:10px; height:10px; border-radius:999px; margin-top: 5px;
    background: var(--warn);
}
.msg.ok .dot{ background: var(--good); }
.msg.err .dot{ background: var(--bad); }

.topbar{
    display:flex;
    gap:12px;
    align-items:center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.kpi{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}
.kpi .pill{
    padding: 8px 10px;
    border-radius: 999px;
    border:1px solid var(--line);
    background: rgba(255,255,255,0.06);
    color: var(--muted);
    font-size: 12px;
}
.kpi .pill b{ color: var(--text); }

.table-wrap{
    overflow:auto;
    border-radius: var(--radius);
    border:1px solid var(--line);
    background: rgba(0,0,0,0.16);
}

table{
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 860px;
}

thead th{
    position: sticky;
    top: 0;
    background: rgba(10,18,32,0.85);
    backdrop-filter: blur(8px);
    border-bottom:1px solid var(--line);
    font-size: 12px;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: rgba(232,238,252,0.75);
    padding: 12px 12px;
    text-align:left;
}

tbody td{
    padding: 12px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    color: rgba(232,238,252,0.92);
    vertical-align: middle;
}
tbody tr:hover td{
    background: rgba(255,255,255,0.03);
}
.small{
    font-size: 12px;
    color: var(--muted);
}

/* toggle switch */
.switch{
    --h: 26px;
    --w: 46px;
    display:inline-flex;
    align-items:center;
    gap:10px;
}
.switch input{
    display:none;
}
.switch .track{
    width: var(--w);
    height: var(--h);
    border-radius: 999px;
    border:1px solid var(--line);
    background: rgba(255,255,255,0.10);
    position: relative;
    transition: background .18s ease, border-color .18s ease;
}
.switch .knob{
    width: 22px; height: 22px;
    border-radius: 999px;
    position:absolute;
    top: 50%;
    left: 2px;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.85);
    box-shadow: 0 8px 18px rgba(0,0,0,0.35);
    transition: left .18s ease, background .18s ease;
}
.switch input:checked + .track{
    background: linear-gradient(135deg, rgba(110,168,255,0.55), rgba(155,123,255,0.55));
    border-color: rgba(110,168,255,0.35);
}
.switch input:checked + .track .knob{
    left: calc(var(--w) - 24px);
    background: white;
}

.row-actions{
    display:flex;
    gap:10px;
    align-items:center;
    justify-content:flex-end;
}

@media (max-width: 720px){
    .topbar{ flex-direction: column; align-items: stretch; }
}
