* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    background: #0a0f1c;
    color: #e4e8ee;
}
a { color: #5bb8f5; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Auth pagina's (login / register) ---------- */
body.auth-dark {
    background: linear-gradient(135deg, #101a2e 0%, #060a13 100%);
}
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}
.auth-box {
    background: rgba(20, 29, 48, .85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,.5);
    padding: 32px 40px 40px;
    width: 100%;
    max-width: 760px;
    color: #e4e8ee;
    border: 1px solid rgba(255,255,255,.08);
}
.auth-box h1 { font-size: 22px; margin: 0 0 24px; color: #fff; }
.auth-box .form-row label { color: #93a0b0; }
.auth-box .form-row input,
.auth-box .form-row select,
.auth-box .form-row textarea {
    background: #0d1526;
    border: 1px solid #2a3548;
    color: #e4e8ee;
}
.auth-box .form-row input::placeholder { color: #5c6780; }
.auth-box .form-row input:focus,
.auth-box .form-row select:focus { outline: none; border-color: #4fb3f0; }
.auth-footer { color: #93a0b0; }
.auth-footer a { color: #6db3f5; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 32px;
}
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13px; color: #93a0b0; margin-bottom: 6px; }
.form-row input, .form-row select, .form-row textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #2a3548;
    border-radius: 6px;
    font-size: 14px;
    background: #0d1526;
    color: #e4e8ee;
    font-family: inherit;
}
.form-row input::placeholder, .form-row textarea::placeholder { color: #5c6780; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
    outline: none;
    border-color: #4fb3f0;
    background: #101c33;
}
.form-row small { display: block; margin-top: 4px; font-size: 11px; color: #6b7688; }

.btn {
    display: inline-block;
    background: #2f7fb8;
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}
.btn:hover { background: #266a9c; text-decoration: none; }
.btn-danger { background: #c94b4b; }
.btn-danger:hover { background: #ab3b3b; }
.auth-footer { margin-top: 18px; font-size: 13px; }

/* ---------- App layout ---------- */
.topbar {
    background: linear-gradient(120deg, #123255 0%, #1c72a8 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 52px;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 20;
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.topbar .brand { font-weight: 700; font-size: 17px; }
.topbar .brand span { font-weight: 400; color: #bfe4ff; }
.topbar .right { display: flex; align-items: center; gap: 20px; font-size: 13px; }
.topbar .right img { width: 22px; height: 22px; border-radius: 50%; vertical-align: middle; margin-right: 6px; background: #33465e; }
.live-clock { font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: .5px; }
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 6px 10px;
    margin-right: 6px;
    border-radius: 4px;
}
.menu-toggle:hover { background: rgba(255,255,255,.15); }
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 19;
}
.sidebar-backdrop.show { display: block; }

.layout { display: flex; padding-top: 52px; min-height: 100vh; }
.sidebar {
    width: 190px;
    background: #0d1526;
    color: #c3c9d1;
    padding: 18px 0;
    position: fixed;
    top: 52px; bottom: 0; left: 0;
    overflow-y: auto;
    z-index: 21;
    border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar .user-block { text-align: center; padding: 0 10px 16px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 10px; }
.sidebar .user-block img { width: 46px; height: 46px; border-radius: 50%; background: #22314a; border: 2px solid rgba(255,255,255,.1); }
.sidebar .user-block .naam { font-weight: 600; margin-top: 8px; font-size: 14px; color: #fff; }
.sidebar .user-block .label { font-size: 11px; color: #93a0b0; margin-top: 4px; }
.status-btn {
    display: block;
    margin: 8px 14px 18px;
    text-align: center;
    padding: 8px 0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}
.status-btn.online { background: #c9504f; }
.status-btn.offline { background: #2fae5c; }
button.status-btn {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    outline: none;
    font: inherit;
    cursor: pointer;
    width: calc(100% - 28px);
}
.nowplaying { margin: 0 14px 18px; background: #060a13; color: #9fe6b8; padding: 8px 10px; font-size: 12px; border-radius: 6px; border: 1px solid rgba(255,255,255,.06); }
.sidebar nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 20px;
    color: #a9b2c0;
    font-size: 14px;
}
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(79,179,240,.12); color: #fff; text-decoration: none; }
.sidebar nav a.active { border-left: 3px solid #4fb3f0; }

.content { margin-left: 190px; flex: 1; padding: 24px 30px 60px; }
.content h1 { font-size: 22px; margin: 0 0 18px; font-weight: 600; color: #fff; }

.card {
    background: #101a2e;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
    margin-bottom: 20px;
    overflow: hidden;
}
.card .card-header {
    background: rgba(79,179,240,.08);
    border-bottom: 2px solid #2f7fb8;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 14px;
    color: #fff;
}
.card .card-body { padding: 18px 20px; color: #d3d9e2; overflow-x: auto; }
.card .card-body p { color: #93a0b0; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { color: #fff; border-radius: 10px; padding: 18px 20px; position: relative; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.stat .num { font-size: 30px; font-weight: 700; }
.stat .lbl { font-size: 13px; opacity: .9; }
.stat.blue { background: linear-gradient(135deg, #1ec2e8, #178fc4); }
.stat.green { background: linear-gradient(135deg, #3fd67a, #229654); }
.stat.orange { background: linear-gradient(135deg, #ffbf5c, #e08a1e); }
.stat.red { background: linear-gradient(135deg, #ff6b6b, #c9403f); }

table { width: auto; min-width: 100%; border-collapse: collapse; font-size: 14px; }
table th { text-align: left; background: rgba(255,255,255,.04); padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.1); color: #93a0b0; font-weight: 600; }
table td { padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.06); color: #d3d9e2; }
table tr:hover td { background: rgba(255,255,255,.02); }
table input[type="text"], table input[readonly] {
    background: #0d1526; border: 1px solid #2a3548; color: #d3d9e2;
}

.settings-grid { display: flex; flex-wrap: wrap; gap: 26px 30px; text-align: center; }
.settings-grid a,
.settings-grid a:visited {
    display: block;
    width: 130px;
    color: #d3d9e2 !important;
    text-decoration: none !important;
    font-size: 13px;
}
.settings-grid a:hover {
    color: #fff !important;
    text-decoration: none !important;
}
.settings-grid .icon {
    font-size: 34px; margin: 0 auto 8px;
    background: rgba(79,179,240,.08);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    line-height: 1;
}

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; }
.flash.success { background: rgba(63,214,122,.12); color: #7ce8a3; border: 1px solid rgba(63,214,122,.35); }
.flash.error { background: rgba(255,107,107,.12); color: #ff9d9d; border: 1px solid rgba(255,107,107,.35); }

.embed-block { margin-bottom: 24px; }
.embed-block h3 { margin: 0 0 8px; font-size: 15px; color: #5bb8f5; }
.embed-block input {
    width: 100%; padding: 8px 10px; font-family: monospace; font-size: 13px;
    border: 1px solid #2a3548; border-radius: 6px; background: #0d1526; color: #d3d9e2;
}

.copy-row { display: flex; gap: 8px; align-items: stretch; }
.copy-row input {
    flex: 1; min-width: 0;
    padding: 8px 10px; font-family: monospace; font-size: 13px;
    border: 1px solid #2a3548; border-radius: 6px; background: #0d1526; color: #d3d9e2;
}
.copy-btn {
    flex-shrink: 0;
    background: #2f7fb8;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0 16px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}
.copy-btn:hover { background: #266a9c; }
.copy-btn:disabled { background: #2fae5c; cursor: default; opacity: 1; }

.search-row { display: flex; gap: 10px; flex-wrap: wrap; }
.search-row input[type="text"] {
    flex: 1;
    min-width: 220px;
    padding: 9px 12px;
    border: 1px solid #2a3548;
    border-radius: 6px;
    background: #0d1526;
    color: #e4e8ee;
    font-size: 14px;
}
.search-row input[type="text"]:focus { outline: none; border-color: #4fb3f0; }
.search-row .btn { flex-shrink: 0; }

footer.pagefoot { margin-left: 190px; padding: 14px 30px; font-size: 12px; color: #6b7688; display:flex; justify-content: space-between; border-top: 1px solid rgba(255,255,255,.06); }
footer.pagefoot a { color: #5bb8f5; }

@media (max-width: 800px) {
    .form-grid { grid-template-columns: 1fr; }
    .stats { grid-template-columns: 1fr 1fr; }
}

/* ---------- Responsive: tablet/mobiel ---------- */
@media (max-width: 720px) {
    .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }

    .topbar { padding: 0 12px; }
    .topbar .brand { font-size: 15px; }
    .topbar .right { gap: 10px; }
    .topbar .right #refresh-counter,
    .topbar .right .online-users-toggle { display: none; }

    .sidebar {
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: 6px 0 24px rgba(0,0,0,.55);
        width: 220px;
    }
    .sidebar.open { transform: translateX(0); }

    .content { margin-left: 0; padding: 18px 16px 50px; }
    .content h1 { flex-wrap: wrap; gap: 10px; font-size: 19px; }
    footer.pagefoot { margin-left: 0; padding: 14px 16px; flex-direction: column; gap: 4px; text-align: center; }

    .online-users-panel { left: 10px; right: 10px; min-width: unset; }

    .prog-header, .prog-row { grid-template-columns: 80px 80px 100px 1fr 1fr; gap: 6px; }
}

/* Brede tabellen (bv. het accountoverzicht in het beheerpaneel) klappen al
   op een gewoon laptop-/tabletscherm om naar gestapelde kaartjes per rij,
   i.p.v. dat je horizontaal moet scrollen. Losse breakpoint (1100px) omdat
   deze tabel veel breder is dan de rest van de layout. */
@media (max-width: 1100px) {
    table.responsive-table { min-width: 0; }
    /* Geen <thead> in de markup: de kop-rij is gewoon de eerste <tr>. */
    table.responsive-table tr:first-child { display: none; }
    table.responsive-table tr {
        display: block;
        margin-bottom: 14px;
        border: 1px solid rgba(255,255,255,.1);
        border-radius: 10px;
        overflow: hidden;
    }
    table.responsive-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        text-align: right;
        border-bottom: 1px solid rgba(255,255,255,.06);
        white-space: normal;
        padding: 8px 14px;
    }
    table.responsive-table td:last-child { border-bottom: none; }
    table.responsive-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 12px;
        color: #93a0b0;
        text-align: left;
        flex-shrink: 0;
    }
    table.responsive-table td[data-label="Acties"] {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    table.responsive-table td[data-label="Acties"]::before { display: none; }
}

@media (max-width: 480px) {
    .stats { grid-template-columns: 1fr; }
    .auth-box { padding: 24px 20px 30px; }
}

/* ---------- Programma rooster ---------- */
.prog-header, .prog-row {
    display: grid;
    grid-template-columns: 110px 110px 160px 1fr 1fr;
    gap: 8px;
    align-items: center;
}
.prog-header { font-weight: 600; font-size: 13px; margin-bottom: 6px; color: #93a0b0; }
.prog-dag { margin: 22px 0 8px; font-size: 15px; color: #5bb8f5; }
.prog-grid { display: flex; flex-direction: column; gap: 4px; }
.prog-row input, .prog-row select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #2a3548;
    border-radius: 6px;
    font-size: 13px;
    background: #0d1526;
    color: #d3d9e2;
}
@media (max-width: 900px) {
    .prog-header, .prog-row { grid-template-columns: 90px 90px 120px 1fr 1fr; }
}

/* ---------- Gebruikers online paneel ---------- */
.online-users-toggle { cursor: pointer; user-select: none; }
.online-users-panel {
    display: none;
    position: fixed;
    top: 52px; right: 20px;
    z-index: 25;
    background: #101a2e;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
    min-width: 320px;
    padding: 10px;
}
.online-users-panel.open { display: block; }
.online-users-panel table { color: #fff; }
.online-users-panel th { background: transparent; color: #93a0b0; border-bottom: 1px solid rgba(255,255,255,.15); }
.online-users-panel td { border-bottom: 1px solid rgba(255,255,255,.08); color: #e4e8ee; }
