[hidden] { display: none !important; }
:root {
  --accent: #2b2b2b;
  --accent-soft: #efece6;
  --bg: #f6f5f2;
  --panel: #ffffff;
  --border: #e4e1da;
  --text: #1f2330;
  --muted: #6b7185;
  --open: #2563eb;   --open-bg: #e8f0fe;
  --pending: #b45309; --pending-bg: #fef3c7;
  --solved: #15803d; --solved-bg: #dcfce7;
  --urgent: #dc2626; --high: #ea580c; --medium: #6b7280; --low: #94a3b8;
  --note-bg: #fffbea; --note-border: #f3dc8c;
  --radius: 8px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: #1d4ed8; text-decoration: none; }
a:hover { text-decoration: underline; }
.sidebar a:hover, .topnav a:hover, .brand:hover, .btn:hover, .chip:hover { text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 20px;
  height: 56px; padding: 0 20px;
  background: var(--panel); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 17px; }
.brand { gap: 14px; }
.brand-logo { height: 26px; width: auto; display: block; }
.brand-sep { width: 1px; height: 24px; background: var(--border); }
.brand-app { font-size: 15px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.topbar { box-shadow: 0 1px 0 rgba(0,0,0,.02); }
.sidebar { display: flex; flex-direction: column; }
.side-foot { margin-top: auto; padding: 24px 10px 6px; display: flex; flex-direction: column; gap: 6px; opacity: .55; }
.side-foot img { width: 110px; height: auto; }
.side-foot span { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
div.empty::before { content: ""; display: block; width: 140px; height: 42px; margin: 0 auto 14px; background: url(/logo.svg) center/contain no-repeat; opacity: .12; }
.dept-select { border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; background: #fff; }
.topnav { display: flex; gap: 4px; }
.topnav a { padding: 8px 12px; border-radius: 6px; color: var(--muted); font-weight: 500; }
.topnav a.active { color: var(--accent); background: var(--accent-soft); }
.user { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 13px;
}

/* Layout */
.layout { display: flex; min-height: calc(100vh - 56px); }
.sidebar { width: 210px; flex: none; padding: 16px 10px; background: var(--panel); border-right: 1px solid var(--border); }
.side-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 10px 8px; }
.sidebar a { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 6px; color: var(--text); }
.sidebar a:hover { background: var(--bg); }
.sidebar a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.main { flex: 1; min-width: 0; padding: 20px 24px; }

/* List */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.toolbar h1 { font-size: 20px; margin: 0; font-weight: 600; }
.search { margin-left: auto; width: 300px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
table.tickets { width: 100%; border-collapse: collapse; }
.tickets th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tickets td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tickets tr:last-child td { border-bottom: 0; }
.tickets tbody tr { cursor: pointer; }
.tickets tbody tr:hover { background: #fafbff; }
.tickets .num { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tickets .subj { font-weight: 600; }
.tickets .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.tickets .when { color: var(--muted); white-space: nowrap; font-size: 13px; }
.new-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: middle; }
.empty { padding: 48px; text-align: center; color: var(--muted); }
.pager { display: flex; justify-content: flex-end; gap: 8px; align-items: center; padding: 10px 12px; color: var(--muted); }

/* Pills */
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.open { color: var(--open); background: var(--open-bg); }
.pill.pending { color: var(--pending); background: var(--pending-bg); }
.pill.solved { color: var(--solved); background: var(--solved-bg); }
.pill.rejected { color: #b91c1c; background: #fee2e2; }
.rate { display: inline-block; height: 8px; border-radius: 4px; background: #fca5a5; vertical-align: middle; margin-right: 6px; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.presets .btn { padding: 5px 10px; font-size: 13px; }
.presets .btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
input[type=date] { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.prio { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.prio::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--c); }
.prio.urgent { --c: var(--urgent); } .prio.high { --c: var(--high); } .prio.medium { --c: var(--medium); } .prio.low { --c: var(--low); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-weight: 500; }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.success { background: var(--solved); border-color: var(--solved); color: #fff; }
.btn:disabled { opacity: .55; cursor: default; }

/* Ticket detail */
.crumbs { font-size: 15px; margin-bottom: 12px; color: var(--muted); }
.crumbs a { color: var(--accent); }
.ticket-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.ticket-head { padding: 16px 18px; }
.ticket-head h1 { font-size: 20px; margin: 0 0 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; color: var(--text); background: #fff; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin: 18px 0 14px; }
.tabs button { background: none; border: 0; padding: 10px 18px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 500; }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.sortbar { display: flex; justify-content: flex-end; margin: -8px 0 10px; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.sortbar select { border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px; background: #fff; }

.msg { display: flex; gap: 10px; margin-bottom: 14px; }
.msg .bubble { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.msg .mhead { display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--border); background: #fafbfd; font-size: 13px; }
.msg .mhead .who { font-weight: 600; }
.msg .mhead .meta { color: var(--muted); white-space: nowrap; }
.msg.reply .bubble { border-color: #d6d1c7; }
.msg.reply .mhead { background: var(--accent-soft); }
.msg.note .bubble { background: var(--note-bg); border-color: var(--note-border); }
.msg.note .mhead { background: #fff5cc; }
.msg.auto .bubble { opacity: .8; }
.msg.auto .mhead { background: #f3f4f6; }
.mail-body { padding: 12px 14px; overflow-x: auto; line-height: 1.5; }
.mail-body img { max-width: 100%; height: auto; }
.mail-body table { max-width: 100%; }
.atts { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 12px; }
.att { display: inline-flex; gap: 8px; align-items: center; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; color: var(--text); max-width: 260px; }
.att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att small { color: var(--muted); }

.composer { padding: 14px; margin-top: 18px; }
.composer .ctabs { display: flex; gap: 6px; margin-bottom: 10px; }
.composer .ctabs button { border: 1px solid var(--border); background: #fff; border-radius: 6px; padding: 5px 12px; cursor: pointer; }
.composer .ctabs button.active { background: var(--accent-soft); border-color: #d6d1c7; color: var(--accent); font-weight: 600; }
.composer.note-mode { background: var(--note-bg); border-color: var(--note-border); }
.composer .row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.composer .row input { flex: 1; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; }
.composer textarea { width: 100%; min-height: 140px; resize: vertical; padding: 10px; border: 1px solid var(--border); border-radius: 6px; line-height: 1.5; }
.composer .actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.composer .actions .spacer { flex: 1; }
.file-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.file-list .att button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 0 0 4px; }

.props { padding: 0; position: sticky; top: 76px; }
.props h2 { font-size: 15px; margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.props .body { padding: 12px 16px 16px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field select { width: 100%; padding: 7px 8px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.timing { border-top: 1px solid var(--border); padding: 12px 16px; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13px; }
.timing dt { color: var(--muted); }
.timing dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.timing .big { font-weight: 700; color: var(--solved); }

.events { list-style: none; margin: 0; padding: 4px 16px; }
.events li { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; }
.events li:last-child { border-bottom: 0; }
.events .t { color: var(--muted); white-space: nowrap; font-size: 13px; }

/* Stats */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { padding: 14px 16px; }
.kpi .label { color: var(--muted); font-size: 12px; }
.kpi .value { font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; }
.card h3 { font-size: 14px; margin: 0; padding: 12px 14px; border-bottom: 1px solid var(--border); }
table.simple { width: 100%; border-collapse: collapse; }
.simple th, .simple td { padding: 8px 14px; border-bottom: 1px solid var(--border); text-align: left; }
.simple th { font-size: 12px; color: var(--muted); font-weight: 600; }
.simple td.n, .simple th.n { text-align: right; font-variant-numeric: tabular-nums; }
.simple tr:last-child td { border-bottom: 0; }
.bars { display: flex; align-items: flex-end; gap: 14px; height: 160px; padding: 16px 14px 6px; }
.bars .wk { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars .pair { display: flex; gap: 3px; align-items: flex-end; flex: 1; width: 100%; justify-content: center; }
.bars .b { width: 12px; border-radius: 3px 3px 0 0; min-height: 2px; }
.bars .b.c { background: var(--accent); } .bars .b.s { background: var(--solved); }
.bars .lbl { font-size: 11px; color: var(--muted); }
.legend { display: flex; gap: 14px; padding: 0 14px 12px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: #1f2330; color: #fff; padding: 10px 18px; border-radius: 8px; opacity: 0; transition: .2s; pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #b91c1c; }
.banner { padding: 10px 14px; border-radius: 8px; background: var(--pending-bg); color: var(--pending); margin-bottom: 14px; }

@media (max-width: 1000px) {
  .ticket-wrap { grid-template-columns: 1fr; }
  .props { position: static; }
  .sidebar { display: none; }
  .search { width: 180px; }
}

/* ---- rekrytering extras ---- */
.stage-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.stage-tabs button { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.stage-tabs button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.stage-tabs .n { opacity: .7; margin-left: 4px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); background: #fcfbf8; }
.filters label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.filters select, .filters input[type=search], .filters input[type=number] { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: #fff; font: inherit; font-size: 13px; }
.score { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; padding: 3px 8px; border-radius: 999px; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.score.hi { background: #dcfce7; color: #15803d; } .score.mid { background: #fef3c7; color: #b45309; } .score.lo { background: #fee2e2; color: #b91c1c; } .score.na { background: #f3f4f6; color: #6b7280; }
.ko { display: inline-block; font-size: 11px; font-weight: 700; color: #b91c1c; background: #fee2e2; border-radius: 4px; padding: 1px 6px; margin-left: 6px; }
.pipeline { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.pipeline button { flex: 1; border: 0; border-right: 1px solid var(--border); background: #fff; padding: 9px 10px; cursor: pointer; font: inherit; font-size: 13px; min-width: 90px; }
.pipeline button:last-child { border-right: 0; }
.pipeline button.active { background: var(--accent); color: #fff; font-weight: 600; }
.pipeline button.rejected.active { background: #b91c1c; }
.pipeline button.hired.active { background: #15803d; }
.stars button { background: none; border: 0; font-size: 20px; cursor: pointer; color: #d6d1c7; padding: 0 1px; }
.stars button.on { color: #f59e0b; }
.answers { list-style: none; margin: 0; padding: 0; }
.answers li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.answers li:last-child { border-bottom: 0; }
.answers .q { color: var(--muted); }
.answers .a { font-weight: 600; text-align: right; }
.answers .pts { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
.qb { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 10px; background: #fff; }
.qb-head { display: flex; gap: 8px; align-items: center; }
.qb-head input { flex: 1; }
.qb input[type=text], .qb select, .qb input[type=number] { padding: 7px 8px; border: 1px solid var(--border); border-radius: 6px; font: inherit; font-size: 14px; }
.qb .opt { display: grid; grid-template-columns: 1fr 90px 110px 30px; gap: 6px; align-items: center; margin-top: 6px; }
.qb .opt-head { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.qb .icon-btn { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font: inherit; background: #fff; }
.pill.draft { color: #6b7280; background: #f3f4f6; } .pill.published { color: #15803d; background: #dcfce7; } .pill.closed { color: #b91c1c; background: #fee2e2; }
.mini-pipe { display: flex; gap: 4px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.mini-pipe span b { color: var(--text); }
.bulkbar { display: flex; gap: 8px; align-items: center; padding: 10px 14px; background: var(--accent-soft); border-bottom: 1px solid var(--border); font-size: 13px; }
@media (max-width: 900px) { .form-grid { grid-template-columns: 1fr; } .qb .opt { grid-template-columns: 1fr 70px 90px 26px; } }

/* v2: låsta fält, obligatoriska fält, mallar */
.form-grid input:disabled, .form-grid select:disabled, .form-grid textarea:disabled { background: #2b2b2b; color: #f3f4f6; border-color: #2b2b2b; cursor: not-allowed; opacity: 1; }
.form-grid .req { color: #b91c1c; }
.form-grid .invalid { border-color: #dc2626 !important; box-shadow: 0 0 0 2px rgba(220, 38, 38, .15); }
.form-grid .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.meta-line { font-size: 12px; color: var(--muted); margin-top: 12px; line-height: 1.5; }
.rest-filter { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.rest-filter select { border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; background: #fff; font: inherit; color: var(--text, #111); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tpl-card { padding: 16px; cursor: pointer; transition: box-shadow .15s; }
.tpl-card:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .08); }
.tpl-card h3 { margin: 0 0 6px; font-size: 16px; padding: 0; border: 0; }
.tpl-card .sub { font-size: 13px; color: var(--muted); }
.role-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eef2ff; color: #3730a3; }
.role-badge.admin { background: #fef3c7; color: #92400e; }
.role-badge.rest { background: #ecfdf5; color: #065f46; }

/* read-only template text in the ad editor */
.tpl-preview { background: var(--bg, #f6f6f6); border: 1px dashed #ccc; border-radius: 8px; padding: 12px 14px; }
.tpl-preview .tp-head { font-size: 13px; color: var(--muted, #777); margin-bottom: 6px; }
.tpl-preview .tp-block { margin-top: 10px; }
.tpl-preview .tp-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--muted, #777); }
.tpl-preview .tp-text { white-space: pre-wrap; font-size: 14px; margin-top: 3px; }

/* Platsbanken */
.chip.ok { background: #dcfce7; color: #15803d; }
.chip.bad { background: #fee2e2; color: #b91c1c; }
.tbl input { padding: 6px 8px; font-size: 13px; width: 100%; }
tr.warn td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
.q-photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 1px solid #ddd; }
.cand-ava { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 12px; }
.mini-ava { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 6px; }
.person { display: flex; gap: 10px; align-items: center; }
.ava { flex: 0 0 auto; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 15px; }
.hist { display: inline-block; margin-top: 3px; font-size: 11.5px; font-weight: 600; color: #92400e; background: #fef3c7; border-radius: 999px; padding: 1px 8px; }
.hist.bad { color: #b91c1c; background: #fee2e2; }
.hist-card h3 { color: #92400e; }
