/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Core palette */
  --navy:      #1b2b4b;
  --navy-h:    #223560;
  --navy-l:    #2a3f6e;
  --orange:    #f26522;
  --orange-h:  #d9551a;
  --orange-bg: #fff4ee;

  /* Surfaces */
  --bg:        #f2f4f8;
  --surface:   #ffffff;
  --surface2:  #f7f8fc;

  /* Borders */
  --border:    #e4e8f0;
  --border2:   #ccd3e0;

  /* Text */
  --text:      #1b2340;
  --text-sub:  #4a5568;
  --text-muted:#8896ab;

  /* Status */
  --success:   #1a9e6f;
  --danger:    #d93025;
  --medley:    #6c47c9;

  /* Shape */
  --radius-s: 3px;
  --radius:   5px;
  --radius-l: 8px;

  /* Shadow */
  --shadow-s: 0 1px 3px rgba(27,43,75,.08);
  --shadow:   0 3px 12px rgba(27,43,75,.12);

  font-size: 13px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
}

.screen  { height: 100vh; }
.hidden  { display: none !important; }
.error   { color: var(--danger); font-size: 12px; margin-top: 4px; }

/* ── Scrollbar ── */
::-webkit-scrollbar        { width: 5px; height: 5px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--border2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─────────────────────────────────────
   LOGIN
───────────────────────────────────── */
#login-screen {
  background: var(--navy);
  display: flex; align-items: center; justify-content: center;
  background-image: radial-gradient(ellipse at 70% 30%, #2a3f6e 0%, #1b2b4b 60%);
}
.login-box {
  background: var(--surface);
  border-radius: var(--radius-l);
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  padding: 2.5rem 2rem;
  width: 340px;
  display: flex; flex-direction: column; gap: 10px;
}
.login-box h1 {
  font-size: 1.4rem; font-weight: 800; color: var(--navy);
  text-align: center; margin-bottom: 8px; letter-spacing: -.4px;
}
.login-box h1 span { color: var(--orange); }

/* ─────────────────────────────────────
   NAV
───────────────────────────────────── */
nav {
  display: flex; align-items: center; gap: 6px;
  height: 50px; padding: 0 16px;
  background: var(--navy);
  border-bottom: 3px solid var(--orange);
  position: sticky; top: 0; z-index: 100;
}
.nav-title {
  font-weight: 800; font-size: 1rem; letter-spacing: -.2px;
  color: #fff; white-space: nowrap; margin-right: 8px;
}
.nav-title span { color: var(--orange); }
.nav-tabs { display: flex; gap: 2px; flex: 1; }
.nav-tab {
  background: none; border: none; color: rgba(255,255,255,.55);
  padding: 6px 14px; border-radius: var(--radius-s);
  cursor: pointer; font-size: 13px; font-weight: 500;
  transition: color .15s, background .15s;
}
.nav-tab:hover  { background: rgba(255,255,255,.1); color: #fff; }
.nav-tab.active {
  background: var(--orange); color: #fff; font-weight: 700;
}
#nav-user   { font-size: 12px; color: rgba(255,255,255,.45); }
#logout-btn {
  background: none; border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.6); padding: 4px 12px; font-size: 12px;
  border-radius: var(--radius-s);
}
#logout-btn:hover { border-color: var(--danger); color: #ff8080; }

/* ─────────────────────────────────────
   INPUTS & SELECTS
───────────────────────────────────── */
input, select, textarea {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 7px 10px;
  border-radius: var(--radius); font-size: 13px; width: 100%;
  outline: none; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(242,101,34,.12);
}
input::placeholder { color: var(--text-muted); }
select { cursor: pointer; }

/* ─────────────────────────────────────
   BUTTONS
───────────────────────────────────── */
button { cursor: pointer; font-family: inherit; font-size: 13px; border-radius: var(--radius); transition: all .15s; }

.btn-primary {
  background: var(--orange); border: 1px solid var(--orange);
  color: #fff; padding: 7px 18px; font-weight: 700;
}
.btn-primary:hover { background: var(--orange-h); border-color: var(--orange-h); }

.btn-secondary {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-sub); padding: 6px 14px; font-weight: 500;
}
.btn-secondary:hover { border-color: var(--border2); color: var(--text); }

.btn-small {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-sub); padding: 4px 10px; font-size: 12px;
}
.btn-small:hover { border-color: var(--orange); color: var(--orange); }

.btn-danger { background: var(--danger); border: 1px solid var(--danger); color: #fff; padding: 4px 10px; font-size: 12px; }
.btn-danger:hover { opacity: .85; }

.btn-pdf { background: var(--medley); border: 1px solid var(--medley); color: #fff; padding: 4px 10px; font-size: 12px; }
.btn-pdf:hover { opacity: .85; }

/* ─────────────────────────────────────
   LAYOUT
───────────────────────────────────── */
.tab-content { height: calc(100vh - 50px); overflow: auto; padding: 1.25rem; }
#tab-builder { overflow: hidden; padding: 0; height: calc(100vh - 50px); }

.builder-layout {
  display: grid;
  grid-template-columns: 320px 1fr 270px;
  height: 100%; min-height: 0;
}
.builder-layout > * { min-height: 0; }

/* ─────────────────────────────────────
   PANELS
───────────────────────────────────── */
.panel { display: flex; flex-direction: column; background: var(--surface); min-height: 0; overflow: hidden; }

/* Songs panel: dark navy sidebar */
.panel-songs { background: var(--navy); border-right: none; }
.panel-songs .panel-header {
  background: var(--navy-h);
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding: 12px 14px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.panel-songs .panel-header h2 {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: rgba(255,255,255,.4);
}
.panel-songs .panel-header input,
.panel-songs .panel-header select {
  background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.12);
  color: #fff; padding: 6px 10px;
}
.panel-songs .panel-header input:focus,
.panel-songs .panel-header select:focus {
  background: rgba(255,255,255,.12); border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(242,101,34,.2);
}
.panel-songs .panel-header input::placeholder { color: rgba(255,255,255,.3); }
.panel-songs .panel-header select option { background: var(--navy); }
.panel-songs .formatie-filter label { color: rgba(255,255,255,.5); font-size: 11px; }

/* Setlist panel */
.panel-setlist { border-left: none; border-right: 1px solid var(--border); }
.panel-setlist .panel-header {
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 7px;
}
.panel-setlist .panel-header h2 {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted);
}

/* Detail panel */
.panel-detail { background: var(--surface); border-left: 1px solid var(--border); }
.panel-detail .panel-header {
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 7px;
}
.panel-detail .panel-header h2 {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted);
}

/* ─────────────────────────────────────
   SONG LIST (dark sidebar)
───────────────────────────────────── */
.song-list {
  flex: 1; overflow-y: auto; padding: 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.loading { color: rgba(255,255,255,.35); padding: 1rem; font-size: 12px; }

.song-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer; transition: background .12s, border-color .12s;
  color: rgba(255,255,255,.8);
}
.song-item:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.1); }
.song-item .song-left  { flex: 1; min-width: 0; }
.song-item .song-name  { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: rgba(255,255,255,.9); }
.song-item .song-meta  { font-size: 11px; color: rgba(255,255,255,.4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-item .song-dur   { font-size: 11px; color: rgba(255,255,255,.4); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.song-item .medley-pill {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  background: rgba(108,71,201,.5); color: #c4b5fd;
  padding: 1px 5px; border-radius: 99px; flex-shrink: 0;
  border: 1px solid rgba(108,71,201,.5);
}

/* ─────────────────────────────────────
   SETLIST META
───────────────────────────────────── */
.setlist-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.setlist-meta input { padding: 5px 8px; font-size: 12px; }
.setlist-meta input:first-child { grid-column: 1 / -1; }

/* ─────────────────────────────────────
   BLOKKEN
───────────────────────────────────── */
#blokken-container {
  flex: 1; overflow-y: auto; padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
}

.blok {
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-s);
  overflow: hidden;
}
.blok-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--navy);
  border-left: 4px solid var(--orange);
}
.blok-header input {
  flex: 1; background: transparent; border: none; box-shadow: none;
  font-size: 12px; font-weight: 700; color: rgba(255,255,255,.9);
  text-transform: uppercase; letter-spacing: .06em;
  padding: 0; width: auto;
}
.blok-header input:focus { box-shadow: none; border: none; }
.blok-doelduur-pill {
  font-size: 10px; font-weight: 600; color: rgba(255,255,255,.7);
  background: rgba(255,255,255,.12); border-radius: 20px;
  padding: 2px 8px; flex-shrink: 0; letter-spacing: .02em;
}
.blok-time {
  font-size: 17px; font-weight: 800; color: var(--orange);
  font-variant-numeric: tabular-nums; letter-spacing: -.5px;
  background: rgba(255,255,255,.1); border-radius: 99px;
  padding: 3px 12px;
}
.blok-time.over-limit {
  background: var(--danger); color: #fff;
  animation: pulse-warn .6s ease-in-out 2;
}
@keyframes pulse-warn {
  0%,100% { opacity: 1; }
  50%      { opacity: .65; }
}
.blok-delete { background: none; border: none; color: rgba(255,255,255,.3); font-size: 14px; padding: 0 2px; line-height: 1; }
.blok-delete:hover { color: #ff8080; }

.blok-nummers {
  min-height: 44px; padding: 6px;
  display: flex; flex-direction: column; gap: 3px;
}
.blok-nummers .placeholder {
  text-align: center; color: var(--text-muted); font-size: 12px;
  padding: 10px; border: 1px dashed var(--border2); border-radius: var(--radius);
}

/* ─────────────────────────────────────
   SETLIST ITEMS
───────────────────────────────────── */
.setlist-item {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 9px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; user-select: none;
  transition: border-color .1s, background .1s;
}
.setlist-item:hover    { border-color: var(--orange); background: var(--orange-bg); }
.setlist-item.selected { border-color: var(--orange); background: var(--orange-bg); border-left: 3px solid var(--orange); }
.setlist-item.sortable-ghost { opacity: .3; }

.setlist-item .drag-handle { color: var(--text-muted); font-size: 12px; cursor: grab; flex-shrink: 0; }
.setlist-item .item-num    { color: var(--text-muted); font-size: 11px; width: 18px; text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.setlist-item .item-name   { flex: 1; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.setlist-item .item-medley {
  font-size: 9px; font-weight: 700; background: #ede9fe; color: var(--medley);
  padding: 1px 5px; border-radius: 99px; flex-shrink: 0;
  border: 1px solid #d4c8f8;
}
.setlist-item .item-dur    { font-size: 12px; color: var(--text-sub); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.setlist-item .item-remove { background: none; border: none; color: var(--text-muted); font-size: 13px; padding: 0 1px; flex-shrink: 0; line-height: 1; }
.setlist-item .item-remove:hover { color: var(--danger); }

/* ─────────────────────────────────────
   SETLIST FOOTER
───────────────────────────────────── */
.setlist-actions {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px; border-top: 1px solid var(--border);
  flex-shrink: 0; background: var(--surface2);
}
.total-time { font-size: 14px; color: var(--text-sub); display: flex; align-items: baseline; gap: 14px; }
.total-time strong { color: var(--navy); font-size: 28px; font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: -.5px; }
.total-split { font-size: 13px; color: var(--text-muted); padding-left: 14px; border-left: 1px solid var(--border2); font-variant-numeric: tabular-nums; }
.total-split span { color: var(--text-sub); font-weight: 700; font-size: 20px; }

.babbels-field {
  display: flex; align-items: center; gap: 6px;
}
.babbels-field label { font-size: 12px; color: var(--text-sub); white-space: nowrap; }
.babbels-field input { width: 58px; padding: 4px 7px; font-size: 12px; font-variant-numeric: tabular-nums; }
.babbels-hint { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.save-actions {
  display: flex; gap: 8px; padding: 10px 14px;
  border-top: 1px solid var(--border); flex-shrink: 0; background: var(--surface);
}

/* ─────────────────────────────────────
   DETAIL PANEL
───────────────────────────────────── */
.song-detail-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; color: var(--text-muted); font-size: 12px;
  text-align: center; padding: 2rem; gap: 8px; line-height: 1.6;
}
.song-detail {
  padding: 16px; display: flex; flex-direction: column; gap: 14px;
  overflow-y: auto; height: 100%;
}
.detail-title    { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.3; }
.detail-duration { font-size: 28px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; letter-spacing: -.8px; }
.detail-section  { display: flex; flex-direction: column; gap: 3px; }
.detail-label    { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.detail-value    { font-size: 13px; color: var(--text); }
.detail-props    { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.prop-pill       { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; background: var(--navy); color: #fff; }
.prop-pill-code  { background: var(--orange); }
.detail-divider  { border: none; border-top: 1px solid var(--border); }

.detail-medley-list { display: flex; flex-direction: column; gap: 4px; }
.detail-medley-item {
  padding: 7px 10px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface2);
}
.detail-medley-item .sub-num   { font-size: 10px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.detail-medley-item .sub-title { font-size: 12px; font-weight: 600; color: var(--text); }
.detail-medley-item .sub-comp  { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* ─────────────────────────────────────
   HISTORY
───────────────────────────────────── */
.history-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-l); padding: 14px 16px; margin-bottom: 8px;
  box-shadow: var(--shadow-s); transition: box-shadow .15s;
  border-left: 4px solid var(--navy);
}
.history-item:hover { box-shadow: var(--shadow); }
.history-item-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.history-item h3 { font-size: 14px; font-weight: 700; color: var(--navy); }
.history-item .meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.history-actions { display: flex; gap: 5px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

/* ─────────────────────────────────────
   TEMPLATES
───────────────────────────────────── */
.template-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-l); padding: 12px 16px; margin-bottom: 6px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  box-shadow: var(--shadow-s); border-left: 4px solid var(--orange);
}
.template-item .template-info h3   { font-size: 13px; font-weight: 700; color: var(--navy); }
.template-item .template-info .meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.template-actions { display: flex; gap: 6px; flex-shrink: 0; }
.tf-blok-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tf-blok-nr { width: 18px; text-align: right; font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.tf-blok-naam { flex: 1; }
#tf-blokken { margin-top: 10px; }

/* ─────────────────────────────────────
   ADMIN
───────────────────────────────────── */
.admin-grid {
  display: grid; grid-template-columns: 300px 1fr;
  gap: 1.25rem; align-items: start;
}
.admin-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-l); padding: 1.25rem;
  box-shadow: var(--shadow-s);
}
.admin-card h2 {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted); margin-bottom: 1rem;
  padding-bottom: 8px; border-bottom: 2px solid var(--orange);
  display: inline-block;
}
.admin-hint    { font-size: 12px; color: var(--text-sub); margin-bottom: 12px; line-height: 1.5; }
.admin-form    { display: flex; flex-direction: column; gap: 7px; margin-bottom: 1.25rem; }
.users-list    { display: flex; flex-direction: column; gap: 5px; }
.user-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 7px 12px;
}
.user-item span { font-size: 13px; font-weight: 500; }

/* ── Settings form ── */
.settings-form {
  display: flex; flex-direction: column; gap: 0;
  margin-bottom: 12px; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.settings-row {
  display: grid; grid-template-columns: 155px 65px 1fr;
  align-items: center; gap: 10px; padding: 7px 10px;
  border-bottom: 1px solid var(--border); background: var(--surface);
  transition: background .1s;
}
.settings-row:last-child { border-bottom: none; }
.settings-row:hover      { background: var(--surface2); }
.settings-row.header-row {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted); background: var(--surface2);
}
.settings-row.highlight label { color: var(--orange); font-weight: 600; }
.settings-row label { font-size: 12px; color: var(--text-sub); }
.settings-row input[type="number"] { width: 65px; padding: 4px 8px; font-size: 12px; }
.settings-row input[type="text"]   { padding: 4px 8px; font-size: 12px; }
.col-preview      { font-size: 11px; color: var(--orange); font-family: monospace; }
.col-preview-hint { font-size: 11px; color: var(--text-muted); }
.filter-row { grid-template-columns: 155px 1fr 1fr; }
.settings-actions { display: flex; gap: 8px; margin-top: 10px; }

.settings-preview     { margin-top: 1rem; }
.settings-preview h3  {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-muted); margin-bottom: 8px;
}
.preview-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.preview-table-wrap table  { border-collapse: collapse; font-size: 12px; width: 100%; }
.preview-table-wrap th     { background: var(--navy); color: rgba(255,255,255,.7); padding: 6px 10px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.1); font-size: 11px; font-weight: 600; }
.preview-table-wrap td     { padding: 5px 10px; border-bottom: 1px solid var(--border); color: var(--text); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-table-wrap tr:last-child td { border-bottom: none; }
.preview-table-wrap td.is-j { color: var(--orange); font-weight: 700; }

/* ── Filter tags ── */
.filter-tags {
  display: flex; flex-wrap: wrap; gap: 5px; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 4px 8px; min-height: 32px; cursor: text;
  transition: border-color .15s, box-shadow .15s;
}
.filter-tags:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(242,101,34,.12); }
.filter-tag {
  display: flex; align-items: center; gap: 4px;
  background: var(--orange-bg); color: var(--orange);
  border: 1px solid #f9c4a8; border-radius: 99px;
  padding: 1px 8px; font-size: 11px; font-weight: 700;
}
.filter-tag button { background: none; border: none; color: var(--orange); cursor: pointer; font-size: 13px; padding: 0; line-height: 1; opacity: .6; }
.filter-tag button:hover { opacity: 1; }
.filter-tag-input { border: none; background: transparent; color: var(--text); outline: none; font-size: 12px; min-width: 50px; width: 50px; box-shadow: none; padding: 0; }

/* ─────────────────────────────────────
   MODAL
───────────────────────────────────── */
.modal {
  position: fixed; inset: 0;
  background: rgba(15,25,50,.55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal-box {
  background: var(--bg); border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.32);
  width: 90%; max-width: 520px; max-height: 88vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  background: var(--navy);
}
.modal-header h3 {
  font-size: 1rem; font-weight: 700; color: #fff;
  letter-spacing: .02em;
}
.modal-header .btn-small {
  background: rgba(255,255,255,.12); color: rgba(255,255,255,.8);
  border: none; border-radius: 6px; padding: 4px 9px; font-size: 13px; cursor: pointer;
}
.modal-header .btn-small:hover { background: rgba(255,255,255,.22); }
#modal-body, .modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.modal-footer    {
  display: flex; gap: 8px; padding: 14px 24px;
  border-top: 1px solid var(--border); justify-content: flex-end;
  background: var(--surface);
}

.detail-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.detail-blok { margin-bottom: 14px; }
.detail-blok h4 {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--orange);
  margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid var(--border);
}
.detail-blok ol  { padding-left: 18px; }
.detail-blok li  { font-size: 13px; margin-bottom: 4px; color: var(--text); }
.detail-blok li span { color: var(--text-sub); font-size: 11px; font-variant-numeric: tabular-nums; margin-left: 6px; }
.detail-blok .blok-total { font-size: 11px; color: var(--text-muted); margin-top: 5px; text-align: right; }

#settings-msg { margin-top: 8px; }

/* ── Builder optreden bar ── */
.builder-optreden-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.builder-optreden-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.optreden-info-empty { font-size: 12px; color: var(--text-muted); font-style: italic; }
.optreden-info {
  display: flex; flex-direction: column; gap: 1px;
}
.optreden-info .oi-title { font-size: 13px; font-weight: 700; color: var(--navy); }
.optreden-info .oi-meta  { font-size: 11px; color: var(--text-muted); }

.autosave-status { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.autosave-status.saving { color: var(--orange); }
.autosave-status.saved  { color: var(--success); }
.autosave-status.error  { color: var(--danger); }

.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ── Tab toolbar ── */
.tab-toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 1rem;
}
.tab-toolbar input { max-width: 280px; }

/* ── Optreden / Template form ── */
.optreden-form { display: flex; flex-direction: column; gap: 0; }
.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-l); padding: 16px 18px;
  margin-bottom: 10px;
}
.form-card-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--orange);
  margin-bottom: 12px;
}
.form-row        { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.form-row:last-child { margin-bottom: 0; }
.form-row label  { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.form-row-inline { flex-direction: row; align-items: center; gap: 10px; }
.form-row-inline label { white-space: nowrap; margin-bottom: 0; }
.required        { color: var(--orange); }

/* ── Optreden cards ── */
.optreden-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-l); padding: 14px 16px; margin-bottom: 8px;
  box-shadow: var(--shadow-s); transition: box-shadow .15s;
  border-left: 4px solid var(--navy);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.optreden-card:hover { box-shadow: var(--shadow); }
.optreden-card.is-today { border-left-color: var(--orange); }
.optreden-card.editing  { border-left-color: var(--success); background: #f0fdf4; }
.optreden-card-info h3  { font-size: 14px; font-weight: 700; color: var(--navy); }
.optreden-card-info .meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.meta-duur { color: var(--orange); font-weight: 600; }
.optreden-card-info .date-badge {
  display: inline-block; font-size: 11px; font-weight: 700;
  background: var(--navy); color: #fff;
  padding: 2px 8px; border-radius: 99px; margin-bottom: 4px;
}
.optreden-card.is-today .date-badge { background: var(--orange); }
.optreden-card-actions { display: flex; gap: 5px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
