/* QuizX-huisstijl: diep paars met goud */
:root {
  --bg: #0d0618;
  --surface: #200029;
  --surface-2: #2D0038;
  --line: #43105280;
  --line-solid: #431052;
  --fg: #faf8ff;
  --dim: #a68cb4;
  --accent: #FFD059;
  --accent-dim: #6b4a00;
  --purple: #510068;
  --ok: #34d058;
  --warn: #FFBB0D;
  --err: #ff6b61;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }

/* Belangrijk: eigen display-regels mogen het hidden-attribuut niet overrulen */
[hidden] { display: none !important; }

html, body { margin: 0; background: var(--bg); color: var(--fg); }
body {
  font: 15px/1.5 "Segoe UI", -apple-system, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 60px;
}
a { color: var(--accent); }

.wrap { max-width: 960px; margin: 0 auto; padding: 18px 16px 40px; }

/* ---------------------------------------------------------------- header */
header.top {
  position: sticky; top: 0; z-index: 30;
  background: rgba(13, 6, 24, .9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top-inner {
  max-width: 960px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.brand { font-weight: 700; letter-spacing: 2px; font-size: 15px; }
.brand span { color: var(--accent); }
.spacer { flex: 1; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 99px; font-size: 12.5px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--dim);
  white-space: nowrap;
}
.chip b { color: var(--fg); font-weight: 600; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.err { background: var(--err); }
.dot.warn { background: var(--warn); }

.gauge { width: 54px; height: 5px; border-radius: 3px; background: var(--line);
         overflow: hidden; }
.gauge i { display: block; height: 100%; background: var(--accent); }

/* ---------------------------------------------------------------- cards */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
}
.card > h2 {
  font-size: 13px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--dim); margin: 0 0 14px; font-weight: 600;
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h2 { margin: 0; flex: 1; }

/* ---------------------------------------------------------------- forms */
input, select, textarea, button {
  font: inherit; color: var(--fg);
  background: var(--surface-2); border: 1px solid var(--line-solid);
  border-radius: 10px; padding: 10px 12px;
}
input::placeholder, textarea::placeholder { color: #7b5f8c; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); background: #38004a;
}
textarea { width: 100%; min-height: 90px; resize: vertical; font-size: 14px; }
button { cursor: pointer; transition: filter .12s, border-color .12s; }
button:hover { filter: brightness(1.18); }
button.primary { background: var(--accent); color: #200029; font-weight: 700;
                 border-color: var(--accent); }
button.ghost { background: transparent; }
button.icon { background: transparent; border: none; color: var(--dim);
              padding: 6px 8px; font-size: 15px; border-radius: 8px; }
button.icon:hover { color: var(--fg); background: var(--surface-2); }
button.icon.danger:hover { color: var(--err); }
button:disabled { opacity: .45; cursor: not-allowed; filter: none; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12px; color: var(--dim); }
.grid-form { display: grid; grid-template-columns: 1.4fr 1.4fr 1fr; gap: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
          font-size: 13.5px; color: var(--dim); user-select: none; }
.toggle input { appearance: none; width: 38px; height: 22px; border-radius: 99px;
                background: var(--line); position: relative; transition: background .15s;
                padding: 0; border: none; cursor: pointer; }
.toggle input::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  background: var(--fg); top: 3px; left: 3px; transition: transform .15s;
}
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(16px); background: #200029; }

/* ------------------------------------------------------------ preview */
.preview-stage {
  display: flex; align-items: center; justify-content: center;
  padding: 20px; border-radius: 12px; margin-bottom: 14px;
  background: repeating-conic-gradient(#1a0723 0% 25%, #240a2e 0% 50%) 50%/16px 16px;
  min-height: 116px;
}
.preview-stage img {
  max-width: 100%; border-radius: 3px; box-shadow: var(--shadow);
  background: #fff;
}
.preview-stage img.inv { background: #000; }

.layout-picker { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px;
                 margin-bottom: 12px; }
.layout-opt {
  flex: 0 0 auto; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--surface-2); padding: 6px; cursor: pointer; text-align: center;
  transition: border-color .12s, transform .12s;
}
.layout-opt:hover { transform: translateY(-1px); }
.layout-opt.sel { border-color: var(--accent); }
.layout-opt img { display: block; height: 30px; width: auto; border-radius: 2px;
                  background: #fff; }
.layout-opt.inv img { background: #000; }
.layout-opt em { display: block; font-size: 10.5px; font-style: normal;
                 color: var(--dim); margin-top: 4px; letter-spacing: .4px; }
.layout-opt.sel em { color: var(--accent); }

/* ------------------------------------------------------------ job list */
.job {
  display: flex; gap: 13px; align-items: center; padding: 11px 0;
  border-top: 1px solid var(--line);
}
.job:first-child { border-top: none; }
.job-thumb {
  flex: 0 0 auto; background: #fff; border-radius: 4px; padding: 2px;
  display: flex; align-items: center;
}
.job-thumb.inv { background: #000; }
.job-thumb img { height: 40px; width: auto; display: block; }
.job-main { flex: 1; min-width: 0; }
.job-name { font-weight: 600; font-size: 14.5px;
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-name small { color: var(--dim); font-weight: 400; }
.job-meta { font-size: 12px; color: var(--dim); margin-top: 2px;
            display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.tag { padding: 1px 7px; border-radius: 99px; border: 1px solid var(--line);
       font-size: 11px; }
.tag.queued { color: var(--dim); }
.tag.printing { color: var(--accent); border-color: var(--accent-dim); }
.tag.done { color: var(--ok); border-color: #1d4429; }
.tag.error { color: var(--err); border-color: #5a2038; }
.job-actions { display: flex; align-items: center; gap: 2px; }

.empty { color: var(--dim); font-size: 14px; text-align: center; padding: 22px 10px; }

/* ------------------------------------------------------------ banner */
.banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: linear-gradient(180deg, #3a2a12, #2b1d0c);
  border: 1px solid var(--accent-dim); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 16px; font-size: 14px;
}
.banner .t { flex: 1; min-width: 200px; }

/* ------------------------------------------------------------ login */
.login-wrap { min-height: 92vh; display: flex; align-items: center;
              justify-content: center; padding: 20px;
              background: radial-gradient(70% 55% at 50% 30%, #2a0038 0%, var(--bg) 70%); }
.login-card { width: 100%; max-width: 340px; text-align: center;
              background: var(--surface); border: 1px solid var(--line-solid);
              border-radius: 18px; padding: 30px 26px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 17px; letter-spacing: 3px; margin: 0 0 4px; }
.login-card h1 span { color: var(--accent); }
.login-card p { color: var(--dim); font-size: 13px; margin: 0 0 20px; }
.login-card input { width: 100%; text-align: center; margin-bottom: 10px; }
.login-card button { width: 100%; }
.login-err { color: var(--err); font-size: 13px; min-height: 18px; margin-top: 10px; }

/* ------------------------------------------------------------ misc */
.tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.tab { padding: 7px 14px; border-radius: 99px; font-size: 13.5px; cursor: pointer;
       color: var(--dim); background: transparent; border: 1px solid transparent; }
.tab.sel { color: var(--fg); background: var(--surface-2); border-color: var(--line); }
.muted { color: var(--dim); font-size: 13px; }
details summary { cursor: pointer; color: var(--dim); font-size: 13.5px;
                  padding: 4px 0; }
dialog {
  background: var(--surface); color: var(--fg); border: 1px solid var(--line);
  border-radius: 16px; max-width: 400px; width: 92%; padding: 0;
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0, 0, 0, .68); backdrop-filter: blur(3px); }
dialog form { padding: 20px; }
dialog h3 { margin: 0 0 14px; font-size: 15px; }
dialog .field { margin-bottom: 11px; }
dialog input, dialog select { width: 100%; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--fg);
  padding: 11px 18px; border-radius: 99px; box-shadow: var(--shadow);
  font-size: 14px; z-index: 100; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.toast.err { border-color: var(--err); color: #ffc9c5; }

@media (max-width: 620px) {
  .grid-form { grid-template-columns: 1fr 1fr; }
  .grid-form .field.wide { grid-column: 1 / -1; }
  .job-thumb img { height: 34px; }
  .top-inner { gap: 8px; }
}
