/* Novaram Kundeportal — base styles. Danish UI. */
:root {
  --bg: #0b1220;
  --panel: #111a2e;
  --panel-2: #0f172a;
  --border: #1f2937;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --brand: #2563eb;
  --brand-2: #1d4ed8;
  --ok: #064e3b;
  --ok-fg: #a7f3d0;
  --err: #7f1d1d;
  --err-fg: #fecaca;
  --warn: #78350f;
  --warn-fg: #fed7aa;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
a { color: #93c5fd; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; gap: 20px;
  padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; font-size: 18px; color: var(--text); }
.brand span { color: var(--brand); }
.nav { display: flex; gap: 6px; flex: 1; }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--muted); }
.nav a:hover { background: var(--panel-2); text-decoration: none; }
.nav a.active { color: var(--text); background: var(--panel-2); }
.user { display: flex; align-items: center; gap: 10px; }
.user .who { color: var(--muted); font-size: 13px; }
.nav-toggle, .nav-burger, .nav-acct { display: none; }

.container { max-width: 1040px; margin: 24px auto; padding: 0 20px; }
.container.centered { max-width: 420px; margin-top: 8vh; }

.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px; margin-bottom: 18px;
}
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 14px; }
.subtitle { color: var(--muted); margin: 0 0 18px; }

label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=search],
input[type=date], input[type=datetime-local], input[type=number], select, textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px;
  border: 1px solid #334155; background: var(--panel-2); color: var(--text);
  font: inherit;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); }
.field { margin-bottom: 4px; }

.btn {
  display: inline-block; padding: 11px 16px; border: 0; border-radius: 10px;
  background: var(--brand); color: #fff; font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--brand-2); text-decoration: none; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--panel-2); }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-danger { background: #b91c1c; }

.alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }
.alert-success { background: var(--ok); color: var(--ok-fg); }
.alert-error { background: var(--err); color: var(--err-fg); }
.alert-info { background: #1e3a5f; color: #bfdbfe; }
.alert-warning { background: var(--warn); color: var(--warn-fg); }
.field-error { color: var(--err-fg); font-size: 12px; margin-top: 4px; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
tr:hover td { background: var(--panel-2); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; }
.badge-active { background: var(--ok); color: var(--ok-fg); }
.badge-inactive { background: #334155; color: var(--muted); }
.badge-locked { background: var(--err); color: var(--err-fg); }
.badge-open { background: var(--warn); color: var(--warn-fg); }
.badge-closed { background: #334155; color: var(--muted); }

.muted { color: var(--muted); }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 220px; }
.code-input { letter-spacing: 6px; font-size: 22px; text-align: center; }

.footer {
  display: flex; justify-content: space-between; max-width: 1040px;
  margin: 30px auto; padding: 16px 20px; color: var(--muted); font-size: 13px;
  border-top: 1px solid var(--border);
}
.stat { font-size: 26px; font-weight: 700; }

/* Dashboard news */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 10px; }
.news-card { background: var(--panel); border: 1px solid var(--border); border-left: 4px solid var(--brand);
  border-radius: 12px; padding: 16px; }
.news-card.t-warning { border-left-color: #f59e0b; }
.news-card.t-critical { border-left-color: #ef4444; }
.news-card h3 { font-size: 15px; margin: 0 0 6px; }
.news-body { font-size: 14px; }
.news-body p { margin: 0 0 8px; }
.news-body a { color: #93c5fd; }
.news-date { margin-top: 8px; font-size: 11px; opacity: .7; }
.news-more { margin-bottom: 18px; }
.linkbtn { background: none; border: 0; color: #fca5a5; cursor: pointer; padding: 0; font: inherit; }
.linkbtn:hover { text-decoration: underline; }

/* Rich-text editor (Quill, snow theme) */
.ql-toolbar.ql-snow { border-color: #334155; border-top-left-radius: 10px; border-top-right-radius: 10px; background: var(--panel-2); }
.ql-container.ql-snow { border-color: #334155; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; background: #fff; color: #0b1220; }
.ql-editor { min-height: 180px; font-size: 14px; }
.ql-snow .ql-stroke { stroke: #cbd5e1; }
.ql-snow .ql-fill { fill: #cbd5e1; }
.ql-snow .ql-picker { color: #cbd5e1; }

/* Rendered rich content (news bodies etc.) */
.news-body h1, .news-body h2, .news-body h3 { margin: 6px 0; line-height: 1.3; }
.news-body h1 { font-size: 19px; } .news-body h2 { font-size: 17px; } .news-body h3 { font-size: 15px; }
.news-body ul, .news-body ol { margin: 6px 0; padding-left: 22px; }
.news-body blockquote { border-left: 3px solid var(--border); margin: 8px 0; padding: 2px 12px; color: var(--muted); }
.news-body pre, .news-body code { background: var(--panel-2); border-radius: 6px; padding: 2px 6px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.news-body pre { padding: 10px 12px; overflow-x: auto; white-space: pre-wrap; }
.ql-align-center { text-align: center; } .ql-align-right { text-align: right; } .ql-align-justify { text-align: justify; }

@media (max-width: 760px) { .news-grid { grid-template-columns: 1fr; } }

/* Branding */
.brand-logo { height: 26px; display: block; }
.auth-logo { text-align: center; margin: 0 0 22px; }
.auth-logo img { height: 46px; }

/* TOTP enrollment */
.qr-wrap { text-align: center; margin: 14px 0; }
.qr-wrap canvas, .qr-wrap img { background: #fff; padding: 10px; border-radius: 10px; display: inline-block; }
#totp-qr { display: inline-block; }
.secret-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; user-select: all;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; word-break: break-all; letter-spacing: 1px;
}
.recovery-list {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; margin: 12px 0;
}
.recovery-list code { background: var(--panel-2); padding: 8px 10px; border-radius: 8px; text-align: center; }

/* Request hub tiles */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { display: block; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.tile:hover { border-color: var(--brand); text-decoration: none; }
.tile-title { font-weight: 600; font-size: 16px; color: var(--text); margin-bottom: 4px; }
.tile-desc { font-size: 13px; }

/* Checkbox groups + inline checkboxes */
.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px; margin-top: 4px; }
.check-inline { display: flex; align-items: center; gap: 8px; color: var(--text); margin: 6px 0; }
.check-inline input { width: auto; }

/* Tables that may be wide */
.table-wrap { overflow-x: auto; }

/* Radio-card selector (e.g. mailbox type) */
.radio-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 6px 0 8px; }
.radio-card { position: relative; display: flex; flex-direction: column; gap: 6px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.radio-card:hover { border-color: var(--brand); }
.radio-card input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.radio-card:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.rc-title { font-weight: 600; }
.rc-desc { font-size: 12px; color: var(--muted); flex: 1; }
.rc-lic { align-self: flex-start; font-size: 11px; padding: 2px 8px; border-radius: 6px; background: #334155; color: var(--muted); }
.rc-lic.req { background: var(--warn); color: var(--warn-fg); }
@media (max-width: 760px) { .radio-cards { grid-template-columns: 1fr 1fr; } }

/* Conditional form fields + section headings */
.field.conditional { display: none; }
.field.conditional.is-visible { display: block; }
.form-section { margin: 20px 0 6px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 16px; }

/* Webshop product picker */
.shop-cat { margin: 6px 0 14px; }
.shop-cat-title { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 8px 0 6px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.shop-card { position: relative; display: flex; flex-direction: column; gap: 6px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 10px; }
.shop-card:hover { border-color: var(--brand); }
.shop-card input { position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; }
.shop-card:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.shop-thumb { height: 96px; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 8px; overflow: hidden; }
.shop-thumb img { max-width: 100%; max-height: 96px; object-fit: contain; }
.shop-thumb:empty { background: var(--panel-2); }
/* One-line (horizontal scroll) shop, e.g. monitors */
.shop-grid.shop-row { display: flex; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; }
.shop-grid.shop-row .shop-card { flex: 0 0 165px; }
.shop-name { font-weight: 600; font-size: 13px; }
.shop-price { font-size: 13px; }
.shop-desc { font-size: 11px; color: var(--muted); }
/* Shop filters (chips) */
.shop-filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.shop-filter { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.shop-filter.conditional { display: none; }
.shop-filter.conditional.is-visible { display: flex; }
.shop-filter-label { font-size: 13px; color: var(--muted); min-width: 140px; }
.shop-filter-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 20px; padding: 7px 16px; cursor: pointer; font: inherit; }
.chip:hover { border-color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

@media (max-width: 760px) { .shop-grid { grid-template-columns: 1fr 1fr; } .shop-filter-label { min-width: 0; width: 100%; } }

/* ───────── Mobile ───────── */
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .nav-burger {
    display: inline-flex; align-items: center; justify-content: center; margin-left: auto;
    font-size: 22px; line-height: 1; padding: 6px 12px; border: 1px solid var(--border);
    border-radius: 8px; background: var(--panel-2); color: var(--text); cursor: pointer;
  }
  .user { display: none; }
  .nav {
    order: 5; width: 100%; flex: none; display: none; flex-direction: column; gap: 2px;
    margin-top: 4px;
  }
  .nav-toggle:checked ~ .nav { display: flex; }
  .nav a { padding: 12px 10px; border-radius: 8px; }
  .nav-acct { display: block; border-top: 1px solid var(--border); margin-top: 4px; }
  .container { margin: 16px auto; padding: 0 14px; }
  .card { padding: 16px; }
  .check-grid { grid-template-columns: 1fr; }
  .footer { flex-direction: column; gap: 4px; text-align: center; }
}
@media (max-width: 640px) {
  /* Make any wide table scroll horizontally instead of breaking layout. */
  table { display: block; width: 100%; overflow-x: auto; white-space: nowrap; }
  h1 { font-size: 20px; }
}
