:root {
  --bg: #f4f6f4;
  --surface: #ffffff;
  --surface-2: #f8faf8;
  --border: #e2e7e3;
  --text: #1c2420;
  --muted: #66736c;
  --primary: #1f6f4a;
  --primary-hover: #185a3c;
  --primary-soft: #e4f2ea;
  --accent: #e8a33d;
  --danger: #c0392b;
  --danger-soft: #fbe9e7;
  --warn-soft: #fff4dc;
  --info-soft: #e6f0fb;
  --sidebar: #15241c;
  --sidebar-text: #c9d6ce;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.06);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-size: 15px;
  color: var(--text);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--primary); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.logo {
  width: 38px; height: 38px; border-radius: 10px; background: var(--primary); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 19px;
}
.brand-name { color: #fff; font-weight: 700; letter-spacing: .12em; }
.brand-sub { font-size: 12px; opacity: .7; }
#nav a, .nav-future {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px;
  color: var(--sidebar-text); text-decoration: none; margin-bottom: 2px;
}
#nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
#nav a.active { background: var(--primary); color: #fff; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .5; margin: 16px 10px 6px; }
.nav-future { opacity: .5; cursor: default; justify-content: space-between; font-size: 14px; }
.nav-future span { font-size: 10.5px; border: 1px solid rgba(255,255,255,.25); border-radius: 99px; padding: 1px 7px; }
.sidebar-foot { margin-top: auto; padding: 10px; }
.user-chip { display: block; color: #fff; text-decoration: none; font-size: 13.5px; margin-bottom: 10px; overflow-wrap: anywhere; }
.user-chip:hover { text-decoration: underline; }

/* ---------- Jarvis Core ---------- */
.greeting { font-size: 22px; font-weight: 700; margin: 0 0 16px; }
.risk-0, .risk-1 { background: #eef1f0; color: #4a5650; }
.risk-2 { background: var(--info-soft); color: #1e5a99; }
.risk-3 { background: var(--warn-soft); color: #8a5a00; }
.risk-4, .risk-5 { background: var(--danger-soft); color: var(--danger); }

main { flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 16px 28px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 20px; margin: 0; flex: 1; }
.topbar-right { display: flex; gap: 10px; align-items: center; }
.test-banner { background: var(--warn-soft); border-bottom: 1px solid #f0dca8; padding: 8px 28px; font-size: 13.5px; }
.view { padding: 24px 28px 60px; max-width: 1400px; }
.menu-btn { display: none; }

/* ---------- komponenter ---------- */
.btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 8px 14px;
  border-radius: 8px; font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { color: var(--danger); border-color: #efc4be; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.icon-btn { background: none; border: none; font-size: 20px; cursor: pointer; position: relative; padding: 6px; }
.badge {
  position: absolute; top: 0; right: -2px; background: var(--danger); color: #fff; font-size: 11px;
  border-radius: 99px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px;
}

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card h2 { font-size: 15px; margin: 0 0 12px; }
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 16px; }
.kpi .label { color: var(--muted); font-size: 13px; }
.kpi .value { font-size: 28px; font-weight: 700; margin-top: 4px; }
.kpi .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.two-col { grid-template-columns: 2fr 1fr; }
.progress { height: 10px; background: var(--primary-soft); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress > div { height: 100%; background: var(--primary); border-radius: 99px; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill-test { background: var(--warn-soft); color: #8a5a00; }
.st-Ny { background: #eef1f0; color: #4a5650; }
.st-Kvalificerad { background: var(--info-soft); color: #1e5a99; }
.st-Utkast-klart { background: #f1e9fb; color: #6b3fa0; }
.st-Kontaktad { background: #e6f5f7; color: #136f7c; }
.st-Svarat { background: var(--warn-soft); color: #8a5a00; }
.st-Intresserad { background: var(--primary-soft); color: var(--primary); }
.st-Ej-intresserad { background: #f0f0f0; color: #777; }
.st-Avregistrerad { background: var(--danger-soft); color: var(--danger); }
.ds-Utkast { background: #eef1f0; color: #4a5650; }
.ds-Godkänt { background: var(--primary-soft); color: var(--primary); }
.ds-Simulerat-skickat { background: #e6f5f7; color: #136f7c; }

.prio { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-variant-numeric: tabular-nums; }
.prio-bar { width: 44px; height: 6px; border-radius: 99px; background: #e9ecea; overflow: hidden; }
.prio-bar > div { height: 100%; }

/* ---------- filter & tabell ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px; align-items: center; }
.filters input[type=search] { flex: 1 1 260px; }
input, select, textarea {
  font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
textarea { width: 100%; resize: vertical; line-height: 1.5; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-top: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); border-top: none; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--surface-2); }
.company { font-weight: 600; }
.result-count { padding: 10px 14px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- drawer ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(15, 25, 20, .35); z-index: 20; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100%); background: var(--surface); z-index: 21;
  overflow-y: auto; box-shadow: -8px 0 30px rgba(0,0,0,.12); padding: 22px 24px 40px;
}
.drawer-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.drawer h2 { margin: 0 0 6px; font-size: 21px; }
.drawer h3 { font-size: 14px; margin: 24px 0 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.reasons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.reasons span { background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; padding: 2px 9px; font-size: 12px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { border-left: 2px solid var(--border); padding: 0 0 14px 14px; position: relative; font-size: 14px; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.timeline .when { color: var(--muted); font-size: 12px; }
.draft-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; background: var(--surface-2); }
.draft-box input { width: 100%; margin-bottom: 8px; font-weight: 600; }
.draft-box textarea { min-height: 280px; font-size: 13.5px; }
.draft-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
.warn { background: var(--danger-soft); color: var(--danger); padding: 10px 12px; border-radius: 8px; font-size: 13.5px; margin: 10px 0; }
.info { background: var(--info-soft); color: #1e5a99; padding: 10px 12px; border-radius: 8px; font-size: 13.5px; margin: 10px 0; }

/* ---------- modal ---------- */
.modal {
  position: fixed; z-index: 31; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(720px, calc(100% - 32px));
  max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border-radius: 14px; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
#modal-backdrop { z-index: 30; }
.modal h2 { margin: 0 0 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.form-grid .full { grid-column: 1 / -1; }
.services { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 4px 0; }
.services label { flex-direction: row; align-items: center; gap: 6px; color: var(--text); font-size: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------- popover & toast ---------- */
.popover {
  position: fixed; top: 62px; right: 20px; width: min(380px, calc(100% - 32px)); max-height: 70vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 25;
}
.popover-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.notif { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; cursor: pointer; }
.notif.unread { background: var(--primary-soft); }
.notif:hover { background: var(--surface-2); }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--sidebar); color: #fff;
  padding: 12px 18px; border-radius: 10px; z-index: 40; box-shadow: var(--shadow); font-size: 14px; max-width: calc(100% - 32px);
}
.toast.error { background: var(--danger); }

.list-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); gap: 10px; }
.list-row:first-child { border-top: none; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 30px; gap: 10px; align-items: center; font-size: 13.5px; margin-bottom: 8px; }
.bar { height: 8px; background: var(--primary-soft); border-radius: 99px; overflow: hidden; }
.bar > div { height: 100%; background: var(--primary); }

/* ---------- mobil ---------- */
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; z-index: 22; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .menu-btn { display: block; }
  .two-col { grid-template-columns: 1fr; }
  .view, .topbar, .test-banner { padding-left: 16px; padding-right: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; }
  .dl dt { margin-top: 6px; }
  #new-prospect-btn { padding: 8px 10px; }
  .hide-mobile { display: none; }
}

/* ---------- fakta, kvalitet & granskning ---------- */
.fact { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; font-size: 14px; display: grid; gap: 4px; }
.fact.verified { border-left: 3px solid var(--primary); }
.fact.unverified { border-left: 3px solid var(--accent); background: var(--surface-2); }
.fact-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fact-form summary, .why summary { cursor: pointer; color: var(--primary); font-size: 14px; margin: 6px 0; }
.why p { font-size: 13.5px; margin: 6px 0; }
.quality { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: var(--surface); }
.quality-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.issue { font-size: 13px; padding: 4px 0; border-top: 1px dashed var(--border); }
.issue.block { color: var(--danger); }
.issue.warn { color: #8a5a00; }
.issue.ok { color: var(--primary); }
.review-card { margin-bottom: 16px; }
.review-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.review-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
.mail-preview { border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); padding: 14px 16px; }
.mail-subject { font-weight: 600; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.mail-preview pre { white-space: pre-wrap; font-family: inherit; font-size: 14px; line-height: 1.55; margin: 0; }
.why-box { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.why-box p { margin: 4px 0 10px; }
.why-box ul { margin: 4px 0; padding-left: 18px; }
.why-box li { margin-bottom: 6px; overflow-wrap: anywhere; }
@media (max-width: 900px) { .review-grid { grid-template-columns: 1fr; } }

/* ---------- v0.3: kontaktstatus & tredelad kvalitet ---------- */
.cs-Mejlklart { background: var(--primary-soft); color: var(--primary); }
.cs-Behöver-kontaktresearch { background: var(--info-soft); color: #1e5a99; }
.cs-Kontaktuppgift-saknas { background: #eef1f0; color: #4a5650; }
.cs-Ej-relevant { background: #f0f0f0; color: #777; }
.ds-Arkiverat { background: #f0f0f0; color: #777; }
.q-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.q-cell { background: var(--surface-2); border-radius: 6px; padding: 6px 8px; cursor: help; }
.q-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.q-val { font-weight: 700; font-size: 13.5px; }
.q-details summary { cursor: pointer; font-size: 13px; color: var(--primary); margin: 6px 0; }
.crit { margin: 8px 0; }
.crit-head { display: flex; justify-content: space-between; font-size: 13px; }
.crit .bar { margin: 3px 0; }
.review-section { margin: 10px 0; font-size: 13.5px; }
.review-section p { margin: 4px 0 0; }
@media (max-width: 600px) { .q-row { grid-template-columns: 1fr; } }

/* ---------- v0.4: affärsbedömning, sex kvalitetsdelar, tjänstekatalog ---------- */
.prio-hog { background: var(--primary-soft); color: var(--primary); }
.prio-medel { background: var(--warn-soft); color: #8a5a00; }
.prio-lag { background: #eef1f0; color: #4a5650; }
.dims { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; margin: 8px 0; }
.caps { background: var(--warn-soft); border-radius: 6px; padding: 6px 8px; font-size: 12.5px; color: #8a5a00; margin: 6px 0; }
.assess { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: var(--surface); margin-top: 6px; }
.assess-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.assess-table { width: 100%; margin-top: 6px; }
.assess-table td { border-top: 1px solid var(--border); padding: 6px 4px; font-size: 13px; vertical-align: top; }
.assess-table td:first-child { width: 34%; color: var(--muted); }
.review-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: 13.5px; margin-bottom: 6px; }
.abstain { background: var(--danger-soft); border-radius: 8px; padding: 12px 14px; font-size: 13.5px; }
.abstain p { margin: 6px 0 0; }
.service { margin-bottom: 16px; }
.service-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.svc-name { font-weight: 700; font-size: 16px; flex: 1 1 260px; }
.months { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.months label { flex-direction: row; align-items: center; gap: 4px; color: var(--text); font-size: 13.5px; }
@media (max-width: 900px) { .dims, .review-facts { grid-template-columns: 1fr; } }

/* ---------- Chatt och minne (Jarvis Core) ---------- */
.chat-layout { display: grid; grid-template-columns: 260px 1fr; gap: 16px; height: calc(100vh - 170px); min-height: 420px; }
.chat-list { padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.chat-item { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.chat-item:hover { background: var(--surface-2); }
.chat-item.active { background: var(--primary-soft); }
.chat-item-title { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-main { display: flex; flex-direction: column; min-height: 0; }
.chat-status { padding: 8px 14px; font-size: 13px; border-bottom: 1px solid var(--border); }
.chat-status.off { background: var(--surface-2); color: var(--muted); }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 78%; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.bubble.user { align-self: flex-end; background: var(--primary-soft); }
.bubble-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.chat-note { align-self: flex-start; color: var(--muted); font-size: 13px; font-style: italic; }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); align-items: flex-end; }
.chat-input textarea { flex: 1; }
.mem-actions { white-space: nowrap; }
@media (max-width: 900px) {
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .chat-list { max-height: 180px; }
  .chat-messages { min-height: 300px; }
  .bubble { max-width: 92%; }
  .list-row { flex-wrap: wrap; }
}

/* ---------- Uppgifter och godkännanden (Jarvis Core) ---------- */
.nav-badge { margin-left: auto; background: var(--danger); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
#nav a { display: flex; align-items: center; gap: 6px; }
.approval-box { border-color: #efc4be; }
.approval { border-top: 1px solid var(--border); padding: 12px 0; }
.approval:first-of-type { border-top: none; }
.json { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; overflow-x: auto; max-height: 260px; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-row { color: var(--text); text-decoration: none; }
.task-row.active { background: var(--primary-soft); border-radius: 8px; padding-left: 8px; padding-right: 8px; }
.stop-reason { color: var(--danger); margin-top: 2px; }
.step { border-left: 3px solid var(--border); padding: 8px 12px; margin: 8px 0; }
.step-done { border-left-color: var(--primary); }
.step-awaiting_approval { border-left-color: var(--accent); }
.step-failed, .step-rejected { border-left-color: var(--danger); }
.step-form { border: 1px dashed var(--border); border-radius: 8px; padding: 10px; margin: 10px 0; display: grid; gap: 8px; }
.ts-waiting, .ss-pending { background: #eef1f0; color: #4a5650; }
.ts-running, .ss-running { background: var(--info-soft); color: #1e5a99; }
.ts-awaiting_approval, .ss-awaiting_approval { background: var(--warn-soft); color: #8a5a00; }
.ts-done, .ss-done { background: var(--primary-soft); color: var(--primary); }
.ts-failed, .ss-failed, .ss-rejected { background: var(--danger-soft); color: var(--danger); }
.ts-cancelled, .ss-cancelled { background: #eef1f0; color: var(--muted); }

/* ---------- Uppgifter i chatten (fas 5) ---------- */
.task-card { align-self: stretch; border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.ts-border-awaiting_approval { border-left-color: var(--accent); }
.ts-border-done { border-left-color: var(--primary); }
.ts-border-failed { border-left-color: var(--danger); }
.ts-border-running { border-left-color: #1e5a99; }
.task-card-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.task-steps { margin: 6px 0; padding-left: 20px; }
.task-steps li { margin: 3px 0; }
.bubble.summary { border: 1px solid var(--primary-soft); }

/* ---------- Markdown i Jarvis svar ---------- */
.bubble-md { line-height: 1.5; overflow-wrap: anywhere; }
.bubble-md > :first-child { margin-top: 0; }
.bubble-md > :last-child { margin-bottom: 0; }
.bubble-md p { margin: 0 0 8px; }
.bubble-md ul, .bubble-md ol { margin: 4px 0 8px; padding-left: 22px; }
.bubble-md li { margin: 2px 0; }
.bubble-md h3, .bubble-md h4, .bubble-md h5, .bubble-md h6 { margin: 10px 0 6px; font-size: 14.5px; }
.bubble-md code { background: rgba(0,0,0,.06); border-radius: 4px; padding: 0 4px; font-size: 12.5px; }
.bubble-md hr { border: none; border-top: 1px solid var(--border); margin: 10px 0; }

/* ---------- Idag (fas 6a) ---------- */
.today-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.today-overdue { border-color: #efc4be; }
.today-item.late { background: var(--warn-soft); border-radius: 8px; padding-left: 8px; padding-right: 8px; }
.today-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.today-actions .snooze { width: auto; padding: 4px 6px; font-size: 13px; }
label.inline { display: flex; align-items: center; gap: 6px; }
label.inline input { width: auto; }
@media (max-width: 900px) {
  .today-grid { grid-template-columns: 1fr; }
  .today-item { flex-direction: column; align-items: flex-start; }
  .today-actions { justify-content: flex-start; }
}

/* ---------- Inloggning (serverdrift) ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--bg); }
.login-card { width: 100%; max-width: 380px; display: grid; gap: 12px; }
.login-card .brand { display: flex; gap: 10px; align-items: center; }
.hidden { display: none !important; }
.login-card label { display: grid; gap: 4px; }
.login-card input { width: 100%; }

/* Sidomenyn kan rullas när den är högre än skärmen (t.ex. Logga ut längst ned på mobilen). */
.sidebar { overflow-y: auto; max-height: 100vh; max-height: 100dvh; }
