/* =====================================================================
   Hof van Justitie van Suriname — Rol- & Wachtrijsysteem
   ===================================================================== */
:root {
    --navy:        #0f2747;
    --navy-2:      #16365f;
    --gold:        #c9a227;
    --bg:          #eef1f5;
    --card:        #ffffff;
    --ink:         #1b2430;
    --muted:       #6b7686;
    --line:        #d9dee6;

    --blauw:       #2563eb;
    --blauw-bg:    #e8f0fe;
    --oranje:      #e8820c;
    --oranje-bg:   #fff2e0;
    --groen:       #15a34a;
    --groen-bg:    #e7f6ec;
    --grijs:       #6b7280;
    --grijs-bg:    #eceef1;

    --radius: 12px;
    --shadow: 0 2px 8px rgba(15,39,71,.08), 0 1px 2px rgba(15,39,71,.06);
    --font: "Segoe UI", Roboto, system-ui, -apple-system, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.45;
}
a { color: var(--blauw); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
code {
    background: #f2f4f8; padding: .1em .35em; border-radius: 5px;
    font-size: .9em;
}

/* ---- Knoppen ---- */
.btn {
    display: inline-flex; align-items: center; gap: .4em;
    border: 1px solid transparent; border-radius: 9px;
    padding: .55em .95em; font-size: .95rem; font-weight: 600;
    cursor: pointer; background: #e6eaf0; color: var(--ink);
    transition: filter .12s, background .12s;
}
.btn:hover { filter: brightness(.97); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary   { background: var(--navy); color: #fff; }
.btn-secondary { background: var(--blauw); color: #fff; }
.btn-warn      { background: #b4341f; color: #fff; }
.btn-ghost     { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: #f3f5f8; }
.btn-block     { width: 100%; justify-content: center; }
.btn-lg        { font-size: 1.15rem; padding: .8em 1.6em; }
.btn-sm        { padding: .35em .6em; font-size: .82rem; }

.alert { padding: .7em .9em; border-radius: 9px; margin-bottom: 1rem; }
.alert.error { background: #fdecea; color: #b21e1e; border: 1px solid #f5c2c0; }

/* =====================================================================
   Login
   ===================================================================== */
.auth-body {
    min-height: 100vh; display: grid; place-items: center;
    background: radial-gradient(1200px 600px at 50% -10%, var(--navy-2), var(--navy));
    padding: 1rem;
}
.auth-card {
    background: var(--card); border-radius: 16px; box-shadow: var(--shadow);
    padding: 2.2rem 2rem; width: 100%; max-width: 380px; text-align: center;
}
.auth-card h1 { font-size: 1.25rem; color: var(--navy); }
/* Officieel logo (Republiek Suriname). Bronafbeelding is laag-resolutie
   (100x50), dus bewust niet groot opschalen om scherp te blijven. */
.logo-hero {
    display: block; margin: 0 auto .7rem;
    width: 190px; max-width: 80%; height: auto;
}
.logo-badge {
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; border-radius: 8px; padding: 4px 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.18); flex: none;
}
.logo-badge img { display: block; height: 34px; width: auto; }
.display-header .logo-badge img { height: 46px; }
.subtitle { color: var(--muted); margin-top: 0; }
.auth-form { text-align: left; margin: 1.4rem 0 1rem; }
.auth-form label, .grid-form label, .dialog label {
    display: block; font-size: .85rem; font-weight: 600;
    color: var(--navy); margin-bottom: .8rem;
}
.auth-form input, .grid-form input, .dialog input, textarea, select {
    width: 100%; margin-top: .25rem; padding: .6em .7em;
    border: 1px solid var(--line); border-radius: 8px; font: inherit;
    background: #fff; color: var(--ink);
}
input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--blauw); outline-offset: 0; border-color: var(--blauw);
}

/* =====================================================================
   Hub / index
   ===================================================================== */
.hub-header { text-align: center; padding: 2.5rem 1rem 1rem; color: var(--navy); }
.hub-header h1 { font-size: 1.6rem; }
.hub-main { max-width: 880px; margin: 0 auto; padding: 1rem 1rem 3rem; }
.hub-section { background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 1.4rem; margin-bottom: 1.4rem; }
.hub-grid {
    display: grid; gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    margin-top: 1rem;
}
.hub-card {
    display: flex; flex-direction: column; gap: .25rem;
    padding: 1.1rem; border: 1px solid var(--line); border-radius: var(--radius);
    background: #fff; color: var(--ink); text-align: left;
    transition: transform .1s, box-shadow .1s, border-color .1s;
}
.hub-card:hover { transform: translateY(-2px); box-shadow: var(--shadow);
    text-decoration: none; border-color: var(--navy); }
.hub-card-icon { font-size: 1.6rem; }
.hub-card-title { font-weight: 700; color: var(--navy); }
.hub-card-sub { font-size: .8rem; color: var(--muted); }
.hub-card.type-simpel { border-left: 4px solid var(--grijs); }
.hub-card.type-volledig { border-left: 4px solid var(--gold); }
.hub-footer { text-align: center; padding: 1rem; }

/* =====================================================================
   Dashboard
   ===================================================================== */
.topbar {
    display: flex; justify-content: space-between; align-items: center;
    gap: 1rem; flex-wrap: wrap;
    background: var(--navy); color: #fff; padding: .6rem 1.1rem;
}
.topbar-left { display: flex; align-items: center; gap: .7rem; }
.topbar-title { font-weight: 700; }
.topbar-sub { font-size: .78rem; opacity: .75; }
.topbar-right { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.loc-switch { display: flex; align-items: center; gap: .4rem; font-size: .85rem; }
.loc-switch select { width: auto; padding: .35em .5em; }
.user-chip { font-size: .85rem; display: inline-flex; align-items: center; gap: .35rem; }
.role-tag {
    background: rgba(255,255,255,.18); border-radius: 6px;
    padding: .05em .45em; font-size: .72rem; text-transform: capitalize;
}

.dash-main { max-width: 1000px; margin: 0 auto; padding: 1.2rem 1rem 3rem; }
.dash-head {
    display: flex; justify-content: space-between; align-items: flex-end;
    flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem;
}
.dash-head h2 { color: var(--navy); }
.rol-meta { font-size: .9rem; }
.dash-head-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

.picker { background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 1.6rem; max-width: 1000px;
    margin: 1.5rem auto; }

.card {
    background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 1.2rem 1.3rem; margin-bottom: 1.3rem;
}
.card h3 { color: var(--navy); }

.grid-form {
    display: grid; gap: .8rem; align-items: end;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.grid-form .wide { grid-column: span 2; }
.grid-form button { height: fit-content; }
.bulk { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.bulk summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.bulk textarea { margin: .6rem 0; }

/* ---- Zakenlijst ---- */
.case-list { display: flex; flex-direction: column; gap: .55rem; }
.case-row {
    display: grid;
    grid-template-columns: 2.2rem 4rem 1fr auto;
    gap: .7rem; align-items: center;
    border: 1px solid var(--line); border-left-width: 5px;
    border-radius: 10px; padding: .6rem .8rem; background: #fff;
}
.case-row .seq {
    font-weight: 700; color: var(--muted); text-align: center;
    background: #f1f3f7; border-radius: 7px; padding: .25rem 0;
}
.case-time { font-weight: 700; color: var(--navy); }
.case-main { min-width: 0; }
.case-parties { font-weight: 600; }
.case-sub { font-size: .82rem; color: var(--muted); }
.case-parties .badge { margin-left: .3rem; }

/* Niet-blokkerende statusregel op het dashboard */
.api-status { display: none; margin: 0 0 .6rem; padding: .5em .8em;
    border-radius: 8px; background: var(--blauw-bg); color: var(--navy);
    font-size: .9rem; font-weight: 600; }
.api-status.show { display: block; }
.api-status.error { background: #fdecea; color: #b21e1e; }
.case-actions { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }

.badge {
    display: inline-block; font-size: .72rem; font-weight: 700;
    padding: .12em .55em; border-radius: 999px; white-space: nowrap;
}
.badge-blauw  { background: var(--blauw-bg);  color: var(--blauw); }
.badge-oranje { background: var(--oranje-bg); color: #a85a00; }
.badge-groen  { background: var(--groen-bg);  color: #0e7a37; }
.badge-grijs  { background: var(--grijs-bg);  color: var(--grijs); }

.row-blauw  { border-left-color: var(--blauw); }
.row-oranje { border-left-color: var(--oranje); background: var(--oranje-bg); }
.row-groen  { border-left-color: var(--groen); }
.row-grijs  { border-left-color: var(--grijs); }
.row-groen .case-parties { text-decoration: line-through; color: var(--muted); }
.row-oranje { animation: pulseRow 1.6s ease-in-out infinite; }
@keyframes pulseRow {
    0%,100% { box-shadow: 0 0 0 0 rgba(232,130,12,.0); }
    50%     { box-shadow: 0 0 0 4px rgba(232,130,12,.18); }
}

/* ---- Dialoog ---- */
.dialog {
    border: none; border-radius: var(--radius); padding: 1.4rem;
    box-shadow: 0 10px 40px rgba(0,0,0,.25); width: min(440px, 92vw);
}
.dialog::backdrop { background: rgba(15,39,71,.45); }
.dialog h3 { color: var(--navy); }
.dialog-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: .5rem; }

/* =====================================================================
   Monitorweergave (display)
   ===================================================================== */
.display-body {
    min-height: 100vh; margin: 0;
    background: linear-gradient(180deg, #0b1f3a, #0f2747);
    color: #eaf0f8; display: flex; flex-direction: column;
}
.display-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 1.6rem; border-bottom: 2px solid rgba(201,162,39,.5);
}
.dh-left { display: flex; align-items: center; gap: .8rem; }
.dh-left .crest { font-size: 2rem; }
.dh-court { font-size: 1.1rem; font-weight: 700; }
.dh-loc { font-size: 1.5rem; font-weight: 800; color: var(--gold); }
.dh-right { text-align: right; }
.dh-date { font-size: 1rem; opacity: .85; }
.dh-clock { font-size: 1.8rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.display-main { flex: 1; padding: 1.3rem 1.6rem; }

/* Twee grote kaarten: NU BEZIG + VOLGENDE */
.now-next { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.2rem; margin-bottom: 1.3rem; }
.big-card {
    border-radius: 16px; padding: 1.4rem 1.6rem;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
}
.big-card.now {
    background: linear-gradient(180deg, rgba(232,130,12,.22), rgba(232,130,12,.10));
    border: 2px solid var(--oranje);
    animation: glowNow 1.8s ease-in-out infinite;
}
@keyframes glowNow {
    0%,100% { box-shadow: 0 0 0 0 rgba(232,130,12,.0); }
    50%     { box-shadow: 0 0 26px 2px rgba(232,130,12,.35); }
}
.big-card .bc-label {
    font-size: 1rem; letter-spacing: .12em; text-transform: uppercase;
    font-weight: 800; opacity: .85;
}
.big-card.now .bc-label { color: var(--gold); }
.big-card .bc-seq { font-size: 1rem; opacity: .7; }
.big-card .bc-parties { font-size: 2.1rem; font-weight: 800; margin: .3rem 0; line-height: 1.1; }
.big-card .bc-meta { font-size: 1.15rem; opacity: .9; }
.big-card.empty .bc-parties { font-size: 1.4rem; opacity: .5; font-weight: 600; }

/* Volledige lijst */
.board-list { display: flex; flex-direction: column; gap: .5rem; }
.board-row {
    display: grid; grid-template-columns: 3rem 5rem 1fr auto;
    gap: 1rem; align-items: center;
    padding: .7rem 1.1rem; border-radius: 11px;
    background: rgba(255,255,255,.05); border-left: 6px solid rgba(255,255,255,.2);
    font-size: 1.2rem;
}
.board-row .b-seq { font-weight: 800; opacity: .65; text-align: center; }
.board-row .b-time { font-weight: 700; color: var(--gold); }
.board-row .b-parties { font-weight: 700; }
.board-row .b-sub { font-size: .85rem; opacity: .7; }
.board-row .b-status {
    font-size: .85rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: .05em; padding: .25em .8em; border-radius: 999px;
}
.brow-blauw  { border-left-color: var(--blauw); }
.brow-blauw  .b-status { background: rgba(37,99,235,.25); color: #bcd4ff; }
.brow-oranje { border-left-color: var(--oranje); background: rgba(232,130,12,.16);
    animation: glowNow 1.8s ease-in-out infinite; }
.brow-oranje .b-status { background: rgba(232,130,12,.3); color: #ffd9a8; }
.brow-groen  { border-left-color: var(--groen); opacity: .6; }
.brow-groen  .b-parties { text-decoration: line-through; }
.brow-groen  .b-status { background: rgba(21,163,74,.25); color: #b6ecc7; }
.brow-grijs  { border-left-color: var(--grijs); opacity: .7; }
.brow-grijs  .b-status { background: rgba(107,114,128,.3); color: #d6dae0; }

.board-section-title {
    font-size: .95rem; text-transform: uppercase; letter-spacing: .12em;
    opacity: .7; margin: 1.2rem 0 .5rem;
}

.display-footer {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: .6rem; padding: .8rem 1.6rem;
    border-top: 1px solid rgba(255,255,255,.12);
}
.legend { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.legend-item { display: inline-flex; align-items: center; gap: .4rem; font-size: .9rem; }
.dot { width: 13px; height: 13px; border-radius: 50%; display: inline-block; }
.dot-blauw { background: var(--blauw); }
.dot-oranje { background: var(--oranje); }
.dot-groen { background: var(--groen); }
.dot-grijs { background: var(--grijs); }

/* Geluid-ontgrendelscherm */
.sound-gate {
    position: fixed; inset: 0; z-index: 50;
    /* Halftransparant zodat de rol er meteen achter zichtbaar is. */
    background: rgba(8,18,33,.78); display: grid; place-items: center; text-align: center;
}
.sound-gate-inner { padding: 2rem; }
.sound-gate-inner h1 { color: var(--gold); font-size: 2rem; }

/* Hoekknopje om geluid alsnog in te schakelen op een onbemand scherm */
.sound-chip {
    position: fixed; right: 1rem; bottom: 1rem; z-index: 40;
    background: var(--gold); color: #2a2200; border: none; border-radius: 999px;
    padding: .55em 1em; font-weight: 700; cursor: pointer; box-shadow: var(--shadow);
}

.hidden { display: none !important; }

/* Flash bij wijziging — eigen overlay, zodat de body-gradient hem niet bedekt */
.flash-overlay {
    position: fixed; inset: 0; z-index: 1; pointer-events: none;
    background: rgba(201,162,39,.22); opacity: 0;
}
.flash-overlay.flash { animation: flashScreen .9s ease-out; }
@keyframes flashScreen {
    0%   { opacity: 0; }
    25%  { opacity: 1; }
    100% { opacity: 0; }
}

/* Responsief */
@media (max-width: 760px) {
    .now-next { grid-template-columns: 1fr; }
    .big-card .bc-parties { font-size: 1.6rem; }
    .board-row { grid-template-columns: 2.4rem 1fr auto; font-size: 1.05rem; }
    .board-row .b-time { display: none; }
    .case-row { grid-template-columns: 2rem 1fr; }
    .case-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
