:root{
  --bg:#0b1220;
  --panel:#111a2b;
  --panel2:#0f172a;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --line:rgba(255,255,255,.08);
  --primary:#2563eb;
  --primary2:#1d4ed8;
  --ok:#16a34a;
  --warn:#d97706;
  --danger:#dc2626;
  --radius:14px;
  --shadow:0 10px 30px rgba(0,0,0,.35);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:radial-gradient(1200px 600px at 20% -10%, rgba(37,99,235,.14), transparent 60%),
             radial-gradient(900px 500px at 90% 0%, rgba(96,165,250,.10), transparent 55%),
             var(--bg);
  color:var(--text);
  font-size:15px;
  line-height:1.45;
}

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

.sidebar{
  border-right:1px solid var(--line);
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015));
  padding:16px;
  position:sticky;
  top:0;
  height:100vh;
}

.brand{ display:flex; align-items:center; gap:10px; font-weight:700; letter-spacing:.2px; margin-bottom:16px; }
.badge{ font-size:12px; color:var(--muted); border:1px solid var(--line); padding:2px 8px; border-radius:999px; background:rgba(255,255,255,.03); }

.nav{ display:flex; flex-direction:column; gap:6px; }
.nav a{
  text-decoration:none;
  color:var(--text);
  padding:10px 10px;
  border-radius:12px;
  border:1px solid transparent;
  background:transparent;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.nav a:hover{ background:rgba(255,255,255,.05); border-color:rgba(255,255,255,.06); }
.nav a.active{ background:rgba(37,99,235,.16); border-color:rgba(37,99,235,.30); }

.main{ display:flex; flex-direction:column; min-width:0; }

.topbar{
  position:sticky;
  top:0;
  z-index:10;
  border-bottom:1px solid var(--line);
  background:rgba(11,18,32,.72);
  backdrop-filter:blur(10px);
}
.topbar .inner{
  padding:14px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.title{ font-size:18px; font-weight:650; }

.container{ max-width:1100px; padding:18px; }

.stack{ display:flex; flex-direction:column; gap:12px; }

.card{
  background:linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02));
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:14px;
  box-shadow:var(--shadow);
}

.muted{ color:var(--muted); font-size:13px; }
.mono{ font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:12px; }

.row{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.grid2{ display:grid; gap:12px; }
@media (min-width: 900px){ .grid2{ grid-template-columns:1fr 1fr; } }

label{ display:block; font-size:12px; color:var(--muted); margin:0 0 6px; }

input,select,textarea{
  width:100%;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(2,6,23,.55);
  color:var(--text);
  padding:9px 10px;
  font-size:14px;
  outline:none;
}
input:focus,select:focus,textarea:focus{ border-color:rgba(37,99,235,.65); box-shadow:0 0 0 3px rgba(37,99,235,.18); }
textarea{ min-height:70px; resize:vertical; }

.btn{
  height:36px;
  padding:0 12px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.06);
  color:var(--text);
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.btn:hover{ background:rgba(255,255,255,.09); }
.btn:disabled{ opacity:.55; cursor:not-allowed; }
.btn.primary{ background:var(--primary); border-color:transparent; }
.btn.primary:hover{ background:var(--primary2); }
.btn.danger{ background:rgba(220,38,38,.18); border-color:rgba(220,38,38,.35); }
.btn.ok{ background:rgba(22,163,74,.18); border-color:rgba(22,163,74,.35); }
.btn.warn{ background:rgba(217,119,6,.18); border-color:rgba(217,119,6,.35); }

.table{ width:100%; border-collapse:collapse; margin-top:10px; }
.table th,.table td{ border-bottom:1px solid var(--line); padding:10px 8px; text-align:left; font-size:14px; vertical-align:top; }
.table th{ color:var(--muted); font-weight:600; }

.pill{ display:inline-flex; align-items:center; gap:8px; padding:3px 10px; border-radius:999px; border:1px solid var(--line); color:var(--muted); font-size:12px; background:rgba(255,255,255,.04); }
.pill.ok{ color:#86efac; border-color:rgba(22,163,74,.35); background:rgba(22,163,74,.12); }

.hidden{ display:none !important; }

.tabs{ display:flex; gap:8px; flex-wrap:wrap; }
.tab{
  height:34px;
  padding:0 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.04);
  color:var(--text);
  cursor:pointer;
}
.tab.active{ background:rgba(37,99,235,.16); border-color:rgba(37,99,235,.30); }

/* mobile */
@media (max-width: 860px){
  .app{ grid-template-columns:1fr; }
  .sidebar{
    position:fixed;
    left:0;
    top:0;
    width:280px;
    transform:translateX(-100%);
    transition:transform .2s ease;
    z-index:20;
  }
  .sidebar.open{ transform:translateX(0); }
  .overlay{ position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:15; }
}

/* compat for old button classes from existing JS */
button{ font: inherit; }
button.primary, .primary.btn{ background: var(--primary); border-color: transparent; }
button.primary:hover, .primary.btn:hover{ background: #2563eb; }
button.ok{ background: rgba(22,163,74,.18); border-color: rgba(22,163,74,.35); }
button.warn{ background: rgba(217,119,6,.18); border-color: rgba(217,119,6,.35); }
button.danger{ background: rgba(220,38,38,.18); border-color: rgba(220,38,38,.35); }
button.primary,button.ok,button.warn,button.danger{
  height:36px; padding:0 12px; border-radius:10px;
  border:1px solid rgba(255,255,255,.10);
  color: var(--text);
  cursor:pointer;
  background: rgba(255,255,255,.06);
}
button.primary:disabled,button.ok:disabled,button.warn:disabled,button.danger:disabled{
  opacity:.55; cursor:not-allowed;
}
/* ============================= */
/* Mijn klanten – rustiger layout */
/* ============================= */

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

.actions button{
  height:32px;
  padding:0 10px;
  border-radius:10px;
  font-size:13px;
}

/* Links sectie compacter */
.links{
  margin-top:10px;
  padding-top:10px;
  border-top:1px solid var(--line);
}

.links .mono{
  font-size:12px;
  line-height:1.35;
}

.links button{
  height:32px;
  padding:0 10px;
  font-size:13px;
}

/* ============================= */
/* Tolk pagina (scoped)          */
/* ============================= */
body.tolk-page{
  --bg:#0b0f14;
  --panel:#121a23;
  --muted:#8aa0b5;
  --text:#e7eef6;
  --accent:#3aa0ff;
  --warn:#ffcc66;
  --bad:#ff6b6b;
  --ok:#5ee38f;
  --border:#223043;

  margin:0;
  min-height:100vh;
  background:var(--bg);
  color:var(--text);
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

body.tolk-page header{
  padding:14px 16px;
  border-bottom:1px solid var(--border);
  background:linear-gradient(180deg, #0d141d 0%, #0b0f14 100%);
  display:flex;
  gap:14px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
}

body.tolk-page .leftHead{
  display:flex;
  gap:14px;
  align-items:baseline;
  flex-wrap:wrap;
}

body.tolk-page .meta{ color:var(--muted); font-size:13px; }

/* overschrijf portal .title waar nodig */
body.tolk-page .title{ font-size:18px; font-weight:700; }

body.tolk-page .pill.bad{ color:var(--bad); border-color:rgba(255,107,107,.35); background:rgba(255,107,107,.08); }

body.tolk-page .wrap{
  display:grid;
  grid-template-columns: 1.6fr 1fr;
  gap:12px;
  padding:12px;
  height:calc(100vh - 62px);
}

body.tolk-page .card{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:12px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  min-height:0;
  box-shadow:none; /* portal.css geeft shadow, hier liever strak */
  padding:0;       /* portal.css zet padding, hier via interne onderdelen */
}

body.tolk-page .card h2{
  margin:0;
  padding:10px 12px;
  font-size:14px;
  border-bottom:1px solid var(--border);
  color:#cfe0f2;
}

body.tolk-page .scroll{
  padding:10px 12px;
  overflow:auto;
  min-height:0;
}

body.tolk-page .transcriptList{
  display:flex;
  flex-direction:column;
  gap:8px;
}

body.tolk-page .line{
  border:1px solid rgba(255,255,255,.06);
  border-radius:10px;
  padding:10px 10px;
  background:#0e1520;
  cursor:pointer;
}

body.tolk-page .line:hover{ border-color:rgba(58,160,255,.25); }
body.tolk-page .line .idx{ color:var(--muted); font-size:12px; }
body.tolk-page .line .txt{ margin-top:6px; white-space:pre-wrap; line-height:1.25; font-size:16px; }
body.tolk-page .line.partial{ opacity:.75; }
body.tolk-page .line.corrected .txt{ color:var(--warn); }

body.tolk-page label{ color:var(--muted); font-size:13px; }

body.tolk-page input[type="text"],
body.tolk-page textarea{
  width:100%;
  box-sizing:border-box;
  background:#0e1520;
  border:1px solid rgba(255,255,255,.08);
  color:var(--text);
  border-radius:10px;
  padding:10px 10px;
  font-size:14px;
  outline:none;
}

body.tolk-page textarea{ min-height:120px; resize:vertical; }

body.tolk-page .banner{
  display:none;
  padding:10px 12px;
  border-top:1px solid var(--border);
  background:#0f1620;
  color:#d7e6f7;
}

body.tolk-page .banner.warn{
  border-top-color:rgba(255,204,102,.35);
  background:rgba(255,204,102,.07);
}

body.tolk-page .banner.bad{
  border-top-color:rgba(255,107,107,.35);
  background:rgba(255,107,107,.08);
}

body.tolk-page .small{ font-size:12px; color:var(--muted); }
body.tolk-page .hr{ height:1px; background:var(--border); margin:10px 0; }

body.tolk-page .btn{ padding:10px 12px; border-radius:10px; border:1px solid var(--border); background:transparent; color:var(--text); cursor:pointer; font-weight:700; }
body.tolk-page .btn.warn{ background:rgba(255,204,102,0.14); border-color:rgba(255,204,102,0.45); color:var(--warn); }

body.tolk-page .editBtn{
  padding:6px 8px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,.14);
  background:transparent;
  color:var(--muted);
  font-weight:700;
  font-size:12px;
  cursor:pointer;
}

body.tolk-page .editBtn:hover{
  border-color:rgba(58,160,255,.35);
  color:#cfe0f2;
}

@media (max-width: 980px){
  body.tolk-page .wrap{ grid-template-columns: 1fr; height:auto; }
  body.tolk-page .card{ min-height:360px; }
}

.transcript-line {
  opacity: 0;
  animation: fadeIn 0.2s ease-out forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}
/* dit is een andere optie om te testen */
/* .transcript-line { */
  /* opacity: 0; */
  /* animation: fadeIn 0.3s ease-out forwards; */
/* } */