:root {
  --bg: var(--ax-ink);
  --bg-alt: var(--ax-surface);
  --card: var(--ax-raised);
  --card-border: var(--ax-line);
  --accent: var(--ax-accent);
  --accent-2: var(--ax-accent-hover);
  --text: var(--ax-fg);
  --muted: var(--ax-muted);
  --danger: var(--ax-bad);
  --success: var(--ax-ok);
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--ax-font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-weight: 400; font-size: 0.8em; }

code {
  background: #1e2333;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.85em;
  color: var(--ax-accent-text);
}

/* ---- Login screen ---- */
.login-screen {
  min-height: calc(100vh - var(--ax-nav-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: linear-gradient(180deg, var(--card), var(--bg-alt));
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: 0 20px 60px rgba(70, 115, 204, 0.16);
}

.login-logo { width: 56px; height: 56px; object-fit: contain; margin-bottom: 10px; display: block; }
.login-card h1 { font-size: 22px; margin: 0 0 4px; }
.login-card p { margin: 0 0 20px; font-size: 14px; }

.error-text {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
  margin-top: 8px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 14px 0 6px;
}

input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  background: #0e1119;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
}

textarea { resize: vertical; }

input[type="color"] {
  width: 46px;
  height: 42px;
  padding: 2px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: #0e1119;
  cursor: pointer;
}

.color-row { display: flex; gap: 10px; }
.color-row input[type="text"] { flex: 1; }

/* ---- Buttons ---- */
.btn {
  border: none;
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s, opacity 0.15s;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 8px 24px rgba(58, 99, 184, 0.3);
}
.btn-primary:hover { opacity: 0.92; }

.btn-ghost {
  background: #1a1f2e;
  color: var(--text);
  border: 1px solid var(--card-border);
}
.btn-ghost:hover { background: #232838; }

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.22); }

.btn-small { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; margin-top: 20px; }

.btn-discord {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  background: #5865f2;
  color: white;
  box-shadow: 0 8px 24px rgba(88, 101, 242, 0.35);
}
.btn-discord:hover { opacity: 0.92; }

/* ---- Server picker screen ---- */
.picker-card { max-width: 460px; }

.picker-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.picker-header h1 { font-size: 20px; margin: 0 0 4px; }
.picker-header p { margin: 0; }

.picker-list { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }

.picker-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: #0e1119;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.picker-row:hover { background: #171c2a; border-color: var(--accent); }

.picker-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.picker-icon-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-size: 14px;
}

.picker-name { flex: 1; }
.picker-arrow { color: var(--muted); }

/* ---- App shell ---- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  background: var(--bg-alt);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  flex-shrink: 0;
}

.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; }
.sidebar-logo { width: 30px; height: 30px; object-fit: contain; }
.sidebar-title { font-weight: 700; font-size: 15px; }
.sidebar-sub { font-size: 12px; color: var(--muted); }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.nav-item {
  text-align: left;
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: #1a1f2e; color: var(--text); }
.nav-item.active { background: rgba(70, 115, 204, 0.16); color: var(--ax-accent-text); }

.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--card-border); }

.guild-pill {
  font-size: 11px;
  color: var(--muted);
  background: #0e1119;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 10px;
  text-align: center;
  word-break: break-all;
}

.main { flex: 1; padding: 30px 40px 60px; max-width: 1100px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 26px;
}
.topbar h1 { margin: 0 0 4px; font-size: 24px; }
.topbar p { margin: 0; font-size: 14px; }

.status-pill {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.tab-panel { display: flex; flex-direction: column; gap: 20px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .app { flex-direction: column; }
  .sidebar { width: 100%; }
  .main { padding: 20px; }
}

.panel-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.panel-card h2 { margin: 0 0 4px; font-size: 16px; }
.panel-card.notice { background: rgba(70, 115, 204, 0.07); border-color: rgba(70, 115, 204, 0.28); }

.flex-between { display: flex; align-items: center; justify-content: space-between; }

.save-bar { display: flex; align-items: center; gap: 14px; }
.save-status { font-size: 13px; color: var(--success); min-height: 18px; }

/* ---- Toggle ---- */
.toggle-row { display: flex; align-items: center; gap: 14px; margin: 16px 0; }
.toggle { position: relative; width: 42px; height: 24px; flex-shrink: 0; margin: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: #2a3040;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.15s;
}
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }
.toggle-label { font-size: 14px; font-weight: 600; }
.toggle-sub { font-size: 12px; margin-top: 2px; }

/* ---- Discord embed preview ---- */
.discord-preview {
  background: #313338;
  border-radius: 10px;
  padding: 16px;
}
.discord-embed {
  background: #2b2d31;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
}
.discord-embed-bar { width: 4px; flex-shrink: 0; background: #1e3a8a; }
.discord-embed-body { padding: 12px 14px; flex: 1; position: relative; }
.discord-embed-thumb {
  position: absolute; top: 12px; right: 14px;
  width: 64px; height: 64px; border-radius: 6px; object-fit: cover;
}
.discord-embed-title { color: #fff; font-weight: 700; font-size: 15px; margin-bottom: 6px; padding-right: 76px; }
.discord-embed-desc { color: #dbdee1; font-size: 13.5px; line-height: 1.4; white-space: pre-wrap; padding-right: 76px; }
.discord-embed-image { width: 100%; border-radius: 5px; margin-top: 10px; max-height: 200px; object-fit: cover; }
.discord-embed-footer { color: #949ba4; font-size: 12px; margin-top: 10px; }
.discord-select {
  margin-top: 10px;
  background: #383a40;
  color: #dbdee1;
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 13.5px;
}

/* ---- Types list ---- */
.count-pill {
  font-size: 12px;
  color: var(--muted);
  background: #0e1119;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 3px 10px;
  margin-left: 8px;
}
.types-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.type-row {
  display: flex; align-items: center; justify-content: space-between;
  background: #0e1119;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px 14px;
}
.type-row-info { display: flex; align-items: center; gap: 10px; }
.type-emoji { font-size: 18px; }
.type-label { font-weight: 600; font-size: 14px; }
.type-key { font-size: 12px; color: var(--muted); }
.type-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.type-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.type-flag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.type-flag-on { background: rgba(34, 197, 94, 0.14); color: #86efac; }
.type-flag-off { background: rgba(239, 68, 68, 0.14); color: #fca5a5; }
.type-flag-muted { background: rgba(148, 163, 184, 0.14); color: #cbd5e1; }
.type-row-actions { display: flex; gap: 8px; flex-shrink: 0; }
.empty-state { color: var(--muted); font-size: 13px; padding: 20px 0; text-align: center; }

/* ---- Tickets list ---- */
.tickets-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.ticket-row {
  display: flex; justify-content: space-between; align-items: center;
  background: #0e1119;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
}
.ticket-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(70, 115, 204, 0.16);
  color: var(--ax-accent-text);
}
.ticket-badge.claimed { background: rgba(234, 179, 8, 0.15); color: #fde68a; }

/* ---- Webshop tab ---- */
.product-admin-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.product-admin-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: #0e1119;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 14px;
}
.product-admin-info { display: flex; flex-direction: column; gap: 4px; }
.product-admin-actions { display: flex; gap: 6px; flex-shrink: 0; }
.product-version {
  font-size: 11px;
  color: var(--muted);
  background: #1a1f2e;
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 6px;
}

/* ---- Productfoto's (dashboard) ---- */
.photo-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.photo-item {
  position: relative; width: 84px; height: 56px; border-radius: 8px; overflow: hidden;
  border: 2px solid var(--card-border); background: #0e1119; cursor: pointer; flex-shrink: 0;
}
.photo-item.is-cover { border-color: var(--accent, #5865f2); cursor: default; }
.photo-item img, .photo-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 26px; height: 26px;
  border-radius: 50%; background: rgba(0, 0, 0, 0.62); color: #fff; font-size: 11px; line-height: 26px; text-align: center;
  pointer-events: none;
}
.photo-badge {
  position: absolute; left: 0; bottom: 0; right: 0; text-align: center;
  font-size: 10px; font-weight: 700; padding: 1px 0; background: rgba(88, 101, 242, 0.92); color: #fff;
}
.photo-remove {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, 0.72); color: #fff; font-size: 10px; line-height: 18px; padding: 0; cursor: pointer;
}
.photo-remove:hover { background: var(--danger, #ef4444); }
.photo-cover-btn {
  position: absolute; left: 0; bottom: 0; right: 0; border: 0; padding: 1px 0; font-size: 10px;
  background: rgba(0, 0, 0, 0.72); color: #fff; cursor: pointer;
}
.photo-cover-btn:hover { background: rgba(88, 101, 242, 0.92); }
.photo-add {
  display: inline-flex; align-items: center; justify-content: center; width: 84px; height: 56px;
  border: 2px dashed var(--card-border); border-radius: 8px; color: var(--muted); font-size: 12px; cursor: pointer;
}
.photo-add:hover { color: #fff; border-color: var(--muted); }

/* ---- Product bewerken, bundels, codes ---- */
.product-admin-row { flex-wrap: wrap; }
.product-edit { flex: 1 1 100%; border-top: 1px solid var(--card-border); margin-top: 6px; padding-top: 8px; }
.product-edit.hidden { display: none; }
.edit-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.check-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: auto; padding: 8px 10px; background: #0e1119; border: 1px solid var(--card-border); border-radius: 10px; }
.check-item { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; cursor: pointer; }
.check-item input { width: auto; margin: 0; }

/* ---- Bestellingen ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: #0e1119; border: 1px solid var(--card-border); border-radius: 12px; padding: 14px 16px; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.stat-label { color: var(--muted); font-size: 12px; margin-top: 4px; }
.order-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.order-toolbar input[type="search"] { flex: 1 1 220px; min-width: 0; }
.order-toolbar select { flex: 0 1 200px; }
.order-admin-list { display: flex; flex-direction: column; gap: 8px; }
.order-admin-row { background: #0e1119; border: 1px solid var(--card-border); border-radius: 12px; overflow: hidden; }
.order-admin-head {
  width: 100%; display: grid; grid-template-columns: minmax(150px, 1.1fr) 170px minmax(0, 2fr) 110px; align-items: center; gap: 14px;
  background: transparent; border: 0; color: var(--text); font: inherit; text-align: left; padding: 12px 14px; cursor: pointer;
}
.order-admin-head:hover { background: rgba(255, 255, 255, 0.03); }
.order-admin-head > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.order-admin-head .muted { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-col-total { text-align: right; font-weight: 700; align-items: flex-end; }
.order-badge { display: inline-block; width: fit-content; font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: 4px 10px; border-radius: 999px; border: 1px solid transparent; }
.order-badge-pending { background: rgba(245, 158, 11, .14); color: #fbbf24; border-color: rgba(245, 158, 11, .35); }
.order-badge-paid { background: rgba(34, 197, 94, .14); color: #4ade80; border-color: rgba(34, 197, 94, .35); }
.order-badge-failed { background: rgba(239, 68, 68, .14); color: #fca5a5; border-color: rgba(239, 68, 68, .35); }
.order-badge-canceled { background: rgba(148, 163, 184, .14); color: #cbd5e1; border-color: rgba(148, 163, 184, .35); }
.stat-paid .stat-value { color: #4ade80; }
.stat-pending .stat-value { color: #fbbf24; }
.stat-failed .stat-value { color: #fca5a5; }
.order-admin-detail { border-top: 1px solid var(--card-border); padding: 14px; }
.order-admin-detail.hidden { display: none; }
.order-detail-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; }
.order-lines { width: 100%; border-collapse: collapse; font-size: 13px; }
.order-lines th, .order-lines td { padding: 6px 8px; border-bottom: 1px solid var(--card-border); text-align: left; }
.order-lines .num { text-align: right; white-space: nowrap; }
.order-lines tfoot td { border-bottom: 0; color: var(--muted); }
.order-lines .order-total td { color: var(--text); font-weight: 700; }
.order-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13px; align-content: start; }
.order-meta dt { color: var(--muted); }
.order-meta dd { margin: 0; overflow-wrap: anywhere; }
.order-note { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(245, 158, 11, .1); border: 1px solid rgba(245, 158, 11, .3); color: #fcd34d; font-size: 13px; }
.order-events { margin-top: 14px; }
.order-events h3 { margin: 0 0 6px; font-size: 13px; }
.order-events ul { margin: 0; padding-left: 18px; font-size: 12.5px; display: flex; flex-direction: column; gap: 3px; }
.order-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
@media (max-width: 900px) {
  .order-admin-head { grid-template-columns: 1fr auto; row-gap: 6px; }
  .order-col-status { grid-column: 2; grid-row: 1; align-items: flex-end !important; }
  .order-col-customer { grid-column: 1 / -1; grid-row: 3; }
  .order-col-total { grid-column: 2; grid-row: 2; }
  .order-detail-grid { grid-template-columns: 1fr; }
}

/* ---- Platform-integratie: de gedeelde Aurex-navigatie staat boven de sidebar ---- */
.app { min-height: calc(100vh - var(--ax-nav-h)); }
.sidebar { position: sticky; top: var(--ax-nav-h); height: calc(100vh - var(--ax-nav-h)); overflow-y: auto; }
@media (max-width: 900px) { .sidebar { position: static; height: auto; } }
.status-pill.online { color: var(--ax-ok); }
.bot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.bot-stat { background: var(--bg-alt); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 14px 16px; }
.bot-stat .k { font-size: 12px; color: var(--muted); }
.bot-stat .v { font-size: 22px; font-weight: 600; margin-top: 4px; }
.bot-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; background: var(--ax-faint); }
.bot-dot.on { background: var(--ax-ok); } .bot-dot.off { background: var(--ax-bad); }

/* ---- Betalingen ---- */
.order-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; font-size: 13px; word-break: break-word; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pay-actions { margin-top: 12px; }
.pay-confirm .order-toolbar { flex-wrap: wrap; }
.pay-confirm .pay-amount { max-width: 220px; }
.pay-confirm .pay-note { flex: 1 1 220px; }
@media (max-width: 700px) { .pay-confirm .pay-amount { max-width: none; width: 100%; } }

.aurex-admin-panel { margin:14px 0; padding:14px; border:1px solid var(--card-border); border-radius:10px; background:var(--ax-raised); }
.aurex-admin-panel h3 { margin:0 0 8px; font-size:15px; }
.aurex-admin-license { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:9px 0; border-top:1px solid var(--card-border); font-size:13px; }
.aurex-admin-license code { overflow-wrap:anywhere; }
@media(max-width:620px) { .aurex-admin-license { align-items:flex-start; flex-direction:column; } }

.nexus-admin-license { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; padding:14px 0; border-top:1px solid var(--card-border); }
.nexus-admin-license-main { min-width:0; }
.nexus-admin-license p { margin:5px 0; font-size:12px; }
.nexus-admin-license code { display:inline-block; max-width:100%; padding:5px 7px; border-radius:6px; background:var(--ax-raised); overflow-wrap:anywhere; font-size:12px; }
.nexus-admin-license-actions { display:flex; flex-wrap:wrap; gap:7px; }
@media(max-width:700px) { .nexus-admin-license { flex-direction:column; } }
