/* Hawkeye dashboard: mörkblå botten, en enda turkos accent, få lådor, tydliga rader. */
:root {
  --bg: #0e1424; --panel: #121a2f; --raised: #16203a; --raised2: #1d2a4a; --rule: #1f2a47; --rule2: #1a2340;
  --text: #e9edf8; --muted: #8d98b5; --gold: #5eead4; --gold-ink: #04201b; --gold-soft: #5eead41c;
  --good: #7fc47a; --bad: #ec6a55; --warn: #e3a93b; --alliance: #5b8fe6; --horde: #d9503f;
  --serif: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--sans); }
body { min-height: 100vh; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 700; line-height: 1.2; letter-spacing: .005em; }
h2 { font-size: 28px; } h3 { font-size: 17px; margin-bottom: 12px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
a { color: inherit; }

/* Inloggning */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(380px, 100%); display: grid; gap: 14px; text-align: center; padding: 38px 30px; background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; }
.login-card h1 { font-size: 30px; color: var(--gold); }
.crest { font-size: 44px; line-height: 1; }
.error { color: var(--bad); min-height: 1.4em; margin: 0; font-size: 14px; }

/* Skal */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 22px 12px 16px; border-right: 1px solid var(--rule); display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 18px; }
.brand .logo { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; font-size: 20px; background: var(--raised); border: 1px solid var(--rule); }
.brand b { display: block; font-family: var(--serif); font-size: 16px; } .brand span { font-size: 12px; color: var(--muted); }
.nav-group { margin: 14px 10px 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--panel); color: var(--text); }
.nav a.active { background: var(--gold-soft); color: var(--text); box-shadow: inset 2px 0 0 var(--gold); }
.nav a span { width: 20px; text-align: center; }
.grow { flex: 1; }
.pill { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 13px; color: var(--muted); }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.main { padding: 30px clamp(18px, 3.4vw, 48px) 70px; max-width: 1180px; width: 100%; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head .muted { margin-top: 4px; max-width: 62ch; }
.head .title { display: flex; align-items: center; gap: 14px; }
.guild-icon { width: 48px; height: 48px; border-radius: 10px; background: var(--raised); object-fit: cover; }
.section { margin: 30px 0 12px; padding-top: 18px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .grow { flex: 1; min-width: 12px; }
.toolbar input[type=search], .toolbar .search { max-width: 260px; }

/* Ytor: få lådor */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-bottom: 16px; }
.grid.wide { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; padding: 18px 20px; }
.notice { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 33%, transparent); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 4px 0 24px; color: var(--muted); }
.facts b { color: var(--text); font-family: var(--serif); font-size: 22px; margin-right: 6px; font-weight: 700; }
.todo { display: grid; border: 1px solid var(--rule); border-radius: 10px; background: var(--panel); margin-bottom: 26px; }
.todo > div { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--rule2); }
.todo > div:last-child { border-bottom: 0; } .todo .t { flex: 1; }
.check { display: flex; gap: 10px; padding: 6px 0; align-items: flex-start; }
.ok { color: var(--good); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; } .kv > :nth-child(odd) { color: var(--muted); }

/* Roster-remsa: klasserna med egna ikoner */
.rs { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 4px 10px; }
.rs-c { display: grid; justify-items: center; gap: 4px; padding: 12px 6px; border-radius: 10px; text-align: center; }
.rs-c:hover { background: var(--panel); }
.rs-c img, .rs-c .ph { width: 52px; height: 52px; object-fit: contain; display: grid; place-items: center; font-size: 30px; }
.rs-c b { font-family: var(--serif); font-size: 22px; line-height: 1; color: var(--c, var(--text)); }
.rs-c span { font-size: 13px; color: var(--muted); }
.vs { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; margin: 6px 0 22px; }
.vs img { width: 40px; height: 40px; } .vs .bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--raised); } .vs .bar span { display: block; transition: width .5s; }
.vs b { font-family: var(--serif); font-size: 20px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 34px; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; }
.bar-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .bar-v { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.track { height: 8px; border-radius: 99px; background: var(--raised); overflow: hidden; display: block; }
.fill { display: block; height: 100%; border-radius: 99px; background: var(--c, var(--gold)); transition: width .5s; }
.split { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--raised); margin: 6px 0 12px; } .split span { display: block; background: var(--c); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--muted)); margin-right: 7px; }
.stat-n { font-family: var(--serif); font-size: 30px; font-weight: 700; } .stat-l { color: var(--muted); font-size: 13px; }

/* Flikar */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin: 0 0 22px; overflow-x: auto; }
.tab { appearance: none; background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); } .tab.on { color: var(--text); border-bottom-color: var(--gold); }

/* Formulär */
input, select, textarea { width: 100%; background: var(--raised); color: var(--text); border: 1px solid var(--rule); border-radius: 8px; padding: 9px 12px; font: inherit; outline: none; transition: border-color .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
input:disabled, select:disabled, textarea:disabled { opacity: .5; }
textarea { resize: vertical; min-height: 120px; }
label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); font-weight: 600; }
.form { display: grid; gap: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; } .row > * { flex: 1; min-width: 150px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn { appearance: none; border: 1px solid var(--rule); background: var(--raised); color: var(--text); padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: border-color .15s, background .15s; }
.btn:hover { border-color: #5a4f3e; background: #2f291f; } .btn:active { transform: translateY(1px); } .btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); } .btn.primary:hover { filter: brightness(1.1); }
.btn.danger { background: transparent; border-color: #e0654a66; color: #f09480; } .btn.danger:hover { background: #e0654a1c; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); } .btn.ghost:hover { color: var(--text); background: var(--panel); }
.btn.small { padding: 5px 10px; font-size: 13px; } .btn.wide { width: 100%; }
.swatches { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.swatch { width: 28px; height: 28px; border-radius: 6px; border: 2px solid transparent; background: var(--c); cursor: pointer; padding: 0; }
.swatch.on { border-color: var(--text); }
.swatches input[type=color], input[type=color] { width: 44px; height: 38px; padding: 3px; flex: none; cursor: pointer; }
.checkbox { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 500; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--gold); flex: none; }
input[type=file] { padding: 6px; font-size: 13px; }

/* Tabeller och listor */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 10px; background: var(--panel); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--rule); }
td { padding: 9px 14px; border-bottom: 1px solid var(--rule2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; } tbody tr:hover { background: #ffffff05; }
td select { padding: 6px 9px; font-size: 14px; }
.who { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--raised); flex: none; object-fit: cover; }
.badge { display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; color: var(--c, var(--muted)); background: color-mix(in srgb, var(--c, #a29680) 16%, transparent); border: 1px solid color-mix(in srgb, var(--c, #a29680) 38%, transparent); margin-right: 4px; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; color: var(--muted); }
.list { border: 1px solid var(--rule); border-radius: 10px; background: var(--panel); overflow: hidden; }
.item { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--rule2); background: none; }
.item:last-child { border-bottom: 0; } .item:hover { background: #ffffff05; }
.item.ch { grid-template-columns: 24px 26px 1fr auto auto; padding: 8px 16px; }
.item .name { font-weight: 600; word-break: break-word; } .item .sub { color: var(--muted); font-size: 13px; }
.ricon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; background: color-mix(in srgb, var(--c, #a29680) 20%, var(--raised)); border: 2px solid var(--c, var(--rule)); overflow: hidden; flex: none; }
.ricon img { width: 100%; height: 100%; object-fit: cover; } .ricon.big { width: 56px; height: 56px; font-size: 28px; }
.cat-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--raised); font-family: var(--serif); font-weight: 700; border-bottom: 1px solid var(--rule); gap: 10px; cursor: pointer; }
.cat-head .twist { color: var(--muted); margin-right: 8px; display: inline-block; width: 12px; }
.cat-block { margin-bottom: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { cursor: pointer; border: 1px solid var(--rule); background: none; color: var(--muted); border-radius: 99px; padding: 5px 13px; font: inherit; font-size: 14px; }
.chip:hover { color: var(--text); } .chip.on { color: var(--text); border-color: var(--gold); background: var(--gold-soft); }
.selbar { position: sticky; bottom: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; margin-top: 14px; background: var(--raised); border: 1px solid var(--gold); border-radius: 10px; box-shadow: 0 10px 30px #0008; z-index: 5; }
.mover { display: inline-flex; gap: 2px; margin-right: 6px; } .mover .btn { padding: 2px 7px; min-width: 26px; }
.menu { position: relative; } .menu-pop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: var(--raised); border: 1px solid var(--rule); border-radius: 10px; padding: 6px; z-index: 20; box-shadow: 0 14px 40px #000a; display: grid; }
.menu-pop button { text-align: left; background: none; border: 0; color: var(--text); font: inherit; padding: 8px 10px; border-radius: 6px; cursor: pointer; } .menu-pop button:hover { background: #ffffff0d; }
.menu-pop button:disabled { opacity: .4; cursor: not-allowed; }

/* Modal och kommandopalett */
.modal-bg { position: fixed; inset: 0; background: #000a; display: grid; place-items: center; z-index: 40; padding: 18px; }
.modal { width: min(520px, 100%); max-height: 92vh; overflow: auto; background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 24px; display: grid; gap: 16px; box-shadow: 0 40px 100px #000b; }
.modal h2 { font-size: 21px; }
.icon-edit { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; } .icon-edit .ricon { width: 64px; height: 64px; font-size: 32px; }
.icon-edit .col { display: grid; gap: 8px; flex: 1; min-width: 180px; }
.locked { display: flex; gap: 16px; align-items: center; padding: 14px 16px; border: 1px dashed var(--rule); border-radius: 10px; background: var(--raised); } .locked p { margin: 4px 0 0; }
.pal { align-items: flex-start; padding-top: 12vh; } .pal .modal { padding: 12px; width: min(560px, 94vw); gap: 8px; }
.pal-list { display: grid; gap: 2px; max-height: 52vh; overflow: auto; }
.pal-item { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; cursor: pointer; background: none; border: 0; color: inherit; font: inherit; border-radius: 8px; padding: 9px 12px; }
.pal-item small { margin-left: auto; color: var(--muted); }
.pal-item:hover, .pal-item.first { background: var(--gold-soft); }

/* Paneler, Discord-förhandsvisning och övrigt */
.panel-card { display: grid; gap: 8px; justify-items: start; } .panel-card .ico { font-size: 28px; }
.split-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.dc { background: #313338; border-radius: 10px; padding: 18px; color: #dbdee1; font-family: "gg sans", "Segoe UI", system-ui, sans-serif; }
.dc-head { display: flex; gap: 12px; } .dc-av { width: 40px; height: 40px; border-radius: 50%; background: #3a2c05; display: grid; place-items: center; flex: none; }
.dc-name { font-weight: 600; color: #fff; } .dc-tag { background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; border-radius: 4px; padding: 1px 5px; margin-left: 6px; vertical-align: middle; }
.dc-text { margin: 2px 0 8px; white-space: pre-wrap; word-break: break-word; } .dc-ping { background: #5865f24d; color: #c9cdfb; border-radius: 4px; padding: 0 3px; }
.dc-embed { background: #2b2d31; border-left: 4px solid var(--c, #e3a93b); border-radius: 4px; padding: 10px 14px 12px; max-width: 520px; }
.dc-title { font-weight: 700; color: #fff; margin-bottom: 4px; word-break: break-word; } .dc-desc { font-size: 14px; white-space: pre-wrap; word-break: break-word; } .dc-foot { margin-top: 10px; font-size: 12px; color: #b5bac1; }
.raid-card { display: grid; gap: 8px; } .raid-counts { display: flex; gap: 16px; font-size: 16px; }
.link { color: var(--gold); text-decoration: none; font-size: 14px; } .link:hover { text-decoration: underline; }
.warn-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule2); } .warn-row:last-child { border-bottom: 0; }
code { background: var(--raised); border: 1px solid var(--rule); border-radius: 6px; padding: 1px 7px; font-size: 13px; color: var(--gold); }
.emoji-card { display: grid; justify-items: center; gap: 8px; text-align: center; } .emoji-card img { width: 48px; height: 48px; object-fit: contain; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.icon-cell { display: grid; gap: 8px; justify-items: center; padding: 12px; border: 1px solid var(--rule); border-radius: 10px; background: var(--raised); } .icon-cell img { width: 64px; height: 64px; object-fit: contain; } .icon-cell select { font-size: 13px; }
#toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 10px; z-index: 60; }
.toast { background: var(--raised); border: 1px solid var(--rule); border-left: 3px solid var(--gold); padding: 11px 16px; border-radius: 8px; box-shadow: 0 10px 30px #0009; max-width: 360px; }
.toast.good { border-left-color: var(--good); } .toast.bad { border-left-color: var(--bad); }
.loading { padding: 60px; text-align: center; color: var(--muted); }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--rule); border-radius: 10px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; padding: 10px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .brand { padding: 0 8px 0 0; } .brand span, .grow, .nav-group, .pill { display: none; }
  .nav { display: flex; gap: 4px; } .nav a { padding: 8px 12px; white-space: nowrap; } .nav a.active { box-shadow: inset 0 -2px 0 var(--gold); }
  .split-2 { grid-template-columns: 1fr; } h2 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.cat-head .btn, .cat-head button { font-family: var(--sans); }
.side > .btn { justify-content: flex-start; white-space: nowrap; }
@media (max-width: 860px) { .side > .btn { padding: 8px; font-size: 0; } .side > .btn::first-letter { font-size: 16px; } }

/* Servervalare och Anpassa */
.sw { width: 100%; justify-content: flex-start; gap: 10px; padding: 8px 10px; margin-bottom: 8px; background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; color: var(--text); }
.sw img, .sw-i { width: 28px; height: 28px; border-radius: 7px; flex: none; object-fit: cover; display: grid; place-items: center; background: var(--raised); }
.sw-n { flex: 1; text-align: left; font-family: var(--serif); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .menu { display: block; } .side .menu > .btn { width: 100%; }
.sw-pop { left: 0; right: 0; min-width: 0; } .sw-pop button, .sw-add { display: flex; gap: 10px; align-items: center; }
.sw-pop button img, .sw-pop .sw-i { width: 24px; height: 24px; border-radius: 6px; object-fit: cover; flex: none; }
.sw-pop button.on { background: var(--gold-soft); } .sw-add { padding: 8px 10px; color: var(--gold); text-decoration: none; border-top: 1px solid var(--rule); margin-top: 4px; border-radius: 0 0 6px 6px; }
.pgrid { display: grid; gap: 8px; }
.pcard { display: grid; gap: 2px; text-align: left; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 10px; background: var(--raised); color: var(--text); font: inherit; cursor: pointer; }
.pcard:hover { border-color: #5a4f3e; } .pcard.on { border-color: var(--gold); background: var(--gold-soft); }
.checks { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.item.sv { grid-template-columns: 40px 1fr auto; }

.boot { color: var(--gold); text-align: center; margin-top: 30vh; font-size: 16px; }
.boot small { color: var(--muted, #999); }

/* Mallar */
.tgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); margin-bottom: 18px; }
.tcard { display: grid; gap: 8px; align-content: start; text-align: left; padding: 16px; border: 1px solid var(--rule); border-radius: 12px; background: var(--panel); color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, transform .15s; }
.tcard:hover { border-color: #5a4f3e; transform: translateY(-1px); } .tcard.on { border-color: var(--gold); background: var(--gold-soft); }
.tcard b { font-size: 16px; } .t-top { display: flex; justify-content: space-between; align-items: center; } .t-ic { font-size: 28px; }
.t-meta { display: flex; flex-wrap: wrap; gap: 6px; } .t-meta span { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--raised); border: 1px solid var(--rule); color: var(--muted); }
.t-have { display: grid; gap: 4px; } .meter { display: block; height: 5px; border-radius: 99px; background: var(--raised); overflow: hidden; } .meter i { display: block; height: 100%; background: var(--gold); }
.tree { display: grid; gap: 14px; max-height: 620px; overflow: auto; padding-right: 4px; }
.cat-n { font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); margin: 6px 0 6px; padding-bottom: 6px; border-bottom: 1px solid var(--rule); display: flex; gap: 8px; align-items: center; }
.cat-ic { font-size: 15px; letter-spacing: 0; } .cat-count { margin-left: auto; font-size: 11px; color: var(--muted); background: var(--raised); border-radius: 99px; padding: 1px 8px; letter-spacing: 0; } .cat-n .lock { font-size: 12px; }
.chn { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 8px; font-size: 14px; } .chn:hover { background: var(--raised); }
.chi { flex: none; width: 28px; height: 28px; display: grid; place-items: center; font-size: 16px; border-radius: 8px; background: var(--raised); color: var(--muted); }
.chb { display: grid; min-width: 0; flex: 1; } .chb b { font-weight: 600; } .chb small { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chp { display: flex; gap: 5px; flex: none; } .pillx { font-size: 11px; color: var(--muted); border: 1px solid var(--rule); border-radius: 99px; padding: 1px 7px; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; } .opt { align-items: flex-start; } .opt small { display: block; font-size: 12px; }
.warnline { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: #e3a93b18; border: 1px solid #e3a93b55; font-size: 13px; }
.blog-card { margin-bottom: 18px; } .blog { max-height: 300px; overflow: auto; margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--rule); font: 13px/1.6 ui-monospace, Consolas, monospace; }
.bl.head { color: var(--gold); font-weight: 700; margin-top: 8px; } .bl.add { color: var(--good); } .bl.skip { color: var(--muted); } .bl.warn { color: var(--warn); } .bl.info { color: #7fb4d9; }
.sumline { margin: 8px 0 0; font-weight: 600; } .pill-run { color: var(--gold); animation: pulse 1.2s infinite; } @keyframes pulse { 50% { opacity: .45; } }

/* ═══ v6: tema, skeletons, tomma lägen, nya sidor ═══ */
:root[data-theme="light"] {
  --bg: #f3f5fa; --panel: #ffffff; --raised: #eef1f8; --raised2: #e2e7f3; --rule: #d8deec; --rule2: #e6eaf4;
  --text: #151b2e; --muted: #60698a; --gold: #0f8f7e; --gold-ink: #ffffff; --gold-soft: #0f8f7e1a;
  --good: #3f7d34; --bad: #c0432a; --warn: #a8680f; --alliance: #2f64bd; --horde: #b4352a;
  color-scheme: light;
}
:root[data-theme="light"] .btn:hover { background: var(--raised); border-color: #b9b9b0; }
:root[data-theme="light"] .btn.primary:hover { background: #c8841f; }
:root[data-theme="light"] .item:hover, :root[data-theme="light"] tbody tr:hover { background: #00000006; }
:root[data-theme="light"] .modal-bg { background: #2a221688; }
:root[data-theme="light"] .toast { box-shadow: 0 10px 30px #2a22162e; }
:root[data-theme="light"] .menu-pop, :root[data-theme="light"] .modal { box-shadow: 0 20px 60px #2a221633; }
:root[data-theme="light"] .menu-pop button:hover, :root[data-theme="light"] .pal-item:hover { background: #00000008; }

.enter { animation: enter .22s ease-out both; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.skel-wrap { display: grid; gap: 12px; }
.skel { border-radius: 10px; background: linear-gradient(90deg, var(--panel) 25%, var(--raised) 37%, var(--panel) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; }
.skel-title { height: 34px; width: 240px; } .skel-sub { height: 16px; width: 380px; max-width: 80%; margin-bottom: 14px; } .skel-row { height: 56px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.empty-state { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 44px 20px; border: 1px dashed var(--rule); border-radius: 12px; background: var(--panel); }
.empty-state .es-ic { font-size: 38px; line-height: 1; margin-bottom: 4px; } .empty-state p { margin: 0 0 8px; max-width: 46ch; }
.btn.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; } .btn.danger-solid:hover { filter: brightness(1.1); }
.modal.small { width: min(440px, 100%); } .modal.wide { width: min(760px, 100%); } .modal.huge { width: min(980px, 100%); }
kbd { font: 600 12px var(--sans); padding: 2px 7px; border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 6px; background: var(--raised); }
.side-foot { display: flex; gap: 4px; align-items: center; } .side-foot .btn:first-child { flex: 1; justify-content: flex-start; }
.side-foot .btn { padding: 8px 10px; }
@media (max-width: 860px) { .side-foot { display: none; } }

/* Små statistikkort (översikt) */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 0 0 22px; }
.kpi { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 12px; background: var(--panel); position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--c, var(--gold)); }
.kpi b { font-family: var(--serif); font-size: 28px; line-height: 1.1; } .kpi span { color: var(--muted); font-size: 13px; } .kpi small { font-size: 12px; color: var(--muted); }
.kpi .up { color: var(--good); } .kpi .down { color: var(--bad); }
.chart-card { margin-bottom: 18px; } .chart-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; margin-bottom: 4px; }
.chart-wrap { position: relative; } .chart-wrap svg { width: 100%; height: auto; display: block; overflow: visible; }
.ch-axis { stroke: var(--rule2); stroke-width: 1; } .ch-label { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.ch-line { fill: none; stroke: var(--gold); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; } .ch-area { fill: var(--gold); opacity: .13; }
.ch-join { fill: var(--good); } .ch-left { fill: var(--bad); } .ch-dot { fill: var(--gold); stroke: var(--panel); stroke-width: 2; }
.ch-tip { position: absolute; pointer-events: none; transform: translate(-50%, -100%); background: var(--raised); border: 1px solid var(--rule); border-radius: 8px; padding: 6px 10px; font-size: 12px; white-space: nowrap; box-shadow: 0 8px 24px #0006; z-index: 5; }
.ch-tip b { display: block; } .legend-i { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-left: 12px; }
.legend-i i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); display: inline-block; }

/* Kom igång och hälsa */
.setup { border: 1px solid var(--rule); border-radius: 12px; background: var(--panel); padding: 16px 18px; margin-bottom: 20px; display: grid; gap: 10px; }
.setup-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.prog { height: 6px; border-radius: 99px; background: var(--raised); overflow: hidden; } .prog i { display: block; height: 100%; background: var(--gold); border-radius: 99px; transition: width .4s; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 6px 18px; }
.step { display: flex; align-items: center; gap: 10px; padding: 6px 0; color: var(--text); text-decoration: none; }
.step .cb { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--rule); display: grid; place-items: center; font-size: 12px; flex: none; }
.step.done .cb { background: var(--good); border-color: var(--good); color: #fff; } .step.done { color: var(--muted); text-decoration: line-through; }
a.step:hover:not(.done) { color: var(--gold); }
.health-top { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; padding: 20px 22px; margin-bottom: 18px; }
.ring { width: 96px; height: 96px; } .ring circle { fill: none; stroke-width: 9; } .ring .bg { stroke: var(--raised); } .ring .fg { stroke: var(--c, var(--good)); stroke-linecap: round; transition: stroke-dashoffset .6s; }
.ring text { font: 700 22px var(--serif); fill: var(--text); text-anchor: middle; dominant-baseline: central; }
.check-row { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: start; padding: 12px 16px; border-bottom: 1px solid var(--rule2); }
.check-row:last-child { border-bottom: 0; } .check-row b { display: block; } .check-row .st { font-size: 18px; line-height: 1.3; }

/* Logg */
.tl-day { margin: 22px 0 6px; font-family: var(--serif); font-weight: 700; text-transform: capitalize; } .tl-day:first-child { margin-top: 0; }
.tl { display: grid; gap: 0; border-left: 2px solid var(--rule); margin-left: 6px; }
.tl-i { position: relative; display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; padding: 7px 0 7px 18px; align-items: baseline; }
.tl-i::before { content: ""; position: absolute; left: -6px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--muted)); border: 2px solid var(--bg); }
.tl-i time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; } .tl-i .d { color: var(--muted); }

/* Kort och listor för funktionssidorna */
.fcards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.fcard { display: grid; gap: 10px; align-content: start; padding: 16px 18px; border: 1px solid var(--rule); border-radius: 12px; background: var(--panel); }
.fcard h4 { margin: 0; font: 700 16px var(--serif); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .fcard .meta { display: flex; gap: 6px 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.fcard .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.fcard.off { opacity: .6; }
.switch { position: relative; width: 40px; height: 22px; flex: none; } .switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--raised); border: 1px solid var(--rule); transition: .2s; } .switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch input:checked + i { background: var(--gold); border-color: var(--gold); } .switch input:checked + i::after { transform: translateX(18px); background: var(--gold-ink); }
.switch input:focus-visible + i { outline: 2px solid var(--gold); outline-offset: 2px; }
.dc-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.dc-btn { display: inline-flex; align-items: center; gap: 6px; background: #4e5058; color: #fff; border-radius: 4px; padding: 6px 14px; font-size: 14px; font-weight: 500; }
.dc-btn.s1 { background: #5865f2; } .dc-btn.s2 { background: #248046; } .dc-btn.s3 { background: #da373c; }
.dc-select { margin-top: 10px; background: #1e1f22; border: 1px solid #1e1f22; border-radius: 4px; padding: 9px 12px; color: #949ba4; font-size: 14px; display: flex; justify-content: space-between; max-width: 420px; }
.rolepick { max-height: 300px; overflow: auto; border: 1px solid var(--rule); border-radius: 10px; background: var(--raised); }
.rp-i { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: center; padding: 7px 12px; border-bottom: 1px solid var(--rule2); cursor: pointer; font-weight: 500; color: var(--text); } .rp-i:last-child { border-bottom: 0; }
.rp-i:hover { background: var(--gold-soft); } .rp-i.disabled { opacity: .45; cursor: not-allowed; }
.rp-sel { display: grid; grid-template-columns: 1fr 90px 64px auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule2); }
.rp-sel .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-row { display: grid; gap: 3px; margin: 6px 0; } .res-row .t { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.big-tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; } 
.note { padding: 10px 12px; border: 1px solid var(--rule); border-radius: 10px; background: var(--raised); display: grid; gap: 4px; } .note .row-between { align-items: flex-start; }
.mcard-top { display: flex; gap: 16px; align-items: center; } .mcard-top .avatar { width: 64px; height: 64px; }
.mstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .mstats div { padding: 10px 12px; border: 1px solid var(--rule); border-radius: 10px; background: var(--raised); } .mstats b { display: block; font-family: var(--serif); font-size: 18px; } .mstats span { font-size: 12px; color: var(--muted); }
.lockflag { color: var(--warn); margin-left: 6px; font-size: 13px; }
.hint { font-size: 13px; color: var(--muted); margin: -4px 0 0; }
@media (max-width: 860px) {
  .health-top { grid-template-columns: 1fr; justify-items: center; text-align: center; } .rp-sel { grid-template-columns: 1fr 1fr; } .tl-i { grid-template-columns: 44px 1fr; } .tl-i .by { display: none; }
}

/* Omröstningsstaplar, nästa-tid, klipptext */
.fcard .bars { display: grid; gap: 8px; } .fcard .bar { display: grid; gap: 4px; font-size: 13px; }
.fcard .bar-top { display: flex; justify-content: space-between; gap: 10px; } .fcard .bar-top b { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.fcard .bar-track { height: 8px; border-radius: 99px; background: var(--raised); overflow: hidden; } .fcard .bar-track i { display: block; height: 100%; background: var(--blue, #4f86d9); border-radius: 99px; transition: width .5s; }
.fcard .bar.win .bar-track i { background: var(--gold); } .fcard .bar.win .bar-top span { font-weight: 700; }
.fcard .next { font-size: 13px; color: var(--text); } .note.bad { border-color: #e0654a; }
.clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-row { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; } .res-row:last-child { border-bottom: 0; }
.head { flex-wrap: wrap; } main, .main { min-width: 0; } .tabs { max-width: 100%; }
@media (max-width: 760px) { .head .row-gap { width: 100%; } }

/* Statistikkanaler */
.stat-pv { display: inline-flex; align-self: start; padding: 8px 12px; border-radius: 8px; background: var(--raised); border: 1px solid var(--rule); font-weight: 600; font-size: 14px; }
.kinds { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.kind { display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 12px; background: var(--panel); color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, transform .15s; }
.kind:hover { border-color: var(--gold); transform: translateY(-1px); } .kind > div { flex: 1; } .kind .ki { font-size: 26px; } .kind .plus { color: var(--gold); font-size: 20px; }
.stack.dim { opacity: .55; pointer-events: none; }

/* WoW-nyheter */
.wh-hero { display: grid; gap: 4px; padding: 16px 18px; margin-bottom: 16px; border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); border-radius: 12px; background: linear-gradient(120deg, var(--gold-soft), transparent); }
.wh-hero a { font: 700 20px var(--serif); color: var(--text); text-decoration: none; } .wh-hero a:hover { color: var(--gold); }
.wh-list { display: grid; gap: 14px; margin-top: 14px; }
.wh-card { display: grid; grid-template-columns: 240px 1fr; gap: 16px; padding: 14px; border: 1px solid var(--rule); border-radius: 12px; background: var(--panel); }
.wh-card:not(:has(.wh-img)) { grid-template-columns: 1fr; }
.wh-img { display: block; border-radius: 8px; overflow: hidden; background: var(--raised); aspect-ratio: 16 / 9; align-self: start; } .wh-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; } .wh-card:hover .wh-img img { transform: scale(1.04); }
.wh-body { display: grid; gap: 8px; align-content: start; min-width: 0; } .wh-body h4 { margin: 0; font: 700 17px var(--serif); } .wh-body h4 a { color: var(--text); text-decoration: none; } .wh-body h4 a:hover { color: var(--gold); }
.wh-body p { margin: 0; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wh-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .wh-body .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.wh-mini { display: grid; margin-top: 10px; } .wh-row { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--rule); color: var(--text); text-decoration: none; } .wh-row:first-child { border-top: 0; } .wh-row:hover .wh-t { color: var(--gold); }
.wh-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .wh-cat { font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 2px 7px; border-radius: 6px; background: var(--raised); color: var(--muted); }
.wh-cat.c-Forever { color: #e3a93b; } .wh-cat.c-Live { color: #4f86d9; } .wh-cat.c-PTR { color: #a06cd5; } .wh-cat.c-WoW { color: #57b36a; } .wh-cat.c-Wowhead { color: #e0654a; }
@media (max-width: 760px) { .wh-card { grid-template-columns: 1fr; } }

/* Städa gamla mallens kanaler */
.cl-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.cl-list { max-height: 300px; overflow: auto; display: grid; gap: 10px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 10px; background: var(--raised); }
.cl-row { padding: 3px 0 3px 8px; font-size: 14px; font-weight: 400; gap: 8px; } .cl-row .chi { width: 18px; } .block { display: block; font-weight: 400; }

/* ---- 6.9: Mallar, steg + översikt ---- */
.msteps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 16px; }
.mstep { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 12px; background: var(--panel); opacity: .72; }
.mstep > div { display: grid; gap: 2px; } .mstep small { font-size: 12px; line-height: 1.35; }
.mstep-n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--raised); border: 1px solid var(--rule); color: var(--muted); }
.mstep.now { opacity: 1; border-color: var(--gold); background: var(--gold-soft); } .mstep.now .mstep-n { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.mstep.done { opacity: .9; } .mstep.done .mstep-n { background: var(--good); color: #10200a; border-color: var(--good); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.tile { display: grid; gap: 1px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--rule); background: var(--raised); }
.tile b { font-size: 28px; line-height: 1.1; } .tile span { font-weight: 600; font-size: 13px; } .tile small { font-size: 12px; }
.tile.gold { border-color: color-mix(in srgb, var(--gold) 40%, transparent); } .tile.gold b { color: var(--gold); } .tile.ok b { color: var(--good); } .tile.bad { border-color: #e0654a66; background: #e0654a14; } .tile.bad b { color: var(--bad); }
.warnline { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: #e3a93b14; border: 1px solid #e3a93b44; font-size: 13px; }
.tree.tree-grid { max-height: none; overflow: visible; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; align-items: start; }
.tree-grid .cat { border: 1px solid var(--rule); border-radius: 12px; padding: 4px 10px 8px; background: var(--panel); }
.chn.has { opacity: .62; } .chn.has:hover { opacity: 1; }
.state { flex: none; width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; }
.state.new { background: var(--gold-soft); color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); } .state.has { background: #8bb66a22; color: var(--good); border: 1px solid #8bb66a55; }
.legend { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.badge.has { opacity: .65; }
.optgroup { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 12px; margin-top: 10px; }
.og-head { display: grid; gap: 1px; } .og-head b { font-size: 14px; } .og-head small { font-size: 12px; }
.optgroup.danger { border-color: #e0654a55; background: #e0654a0d; } .optgroup.danger.on { border-color: var(--bad); } .optgroup.danger .og-head b { color: var(--bad); }
.actionbar { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; padding: 14px 16px; border: 1px solid var(--gold); border-radius: 12px; background: var(--panel); box-shadow: 0 -8px 24px #0009; }
.ab-text { display: grid; gap: 2px; max-width: 520px; } .ab-text small { font-size: 12px; }

/* ---- 6.9: allmän finslipning ---- */
.card { transition: border-color .15s; } .card:hover { border-color: #4a4132; }
button, .btn, select, input { transition: border-color .15s, background .15s, color .15s, transform .1s; }
.btn:active:not(:disabled) { transform: translateY(1px); } .btn:disabled { opacity: .5; cursor: not-allowed; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.muted.small, .small.muted { line-height: 1.4; }
@media (max-width: 760px) { .msteps, .tiles { grid-template-columns: 1fr 1fr; } .tree.tree-grid { grid-template-columns: 1fr; } .actionbar { position: static; } }
@media (max-width: 480px) { .msteps { grid-template-columns: 1fr; } }

/* ---- 6.9.1: mer luft överallt ---- */
html, body { font-size: 16px; line-height: 1.65; }
h2 { font-size: 30px; } h3 { font-size: 18px; margin-bottom: 16px; }
p { margin: 0 0 14px; }
.small { font-size: 13.5px; }
.shell { grid-template-columns: 256px minmax(0, 1fr); }
.side { padding: 26px 14px 20px; gap: 6px; }
.brand { padding: 0 12px 24px; gap: 14px; }
.nav-group { margin: 22px 12px 8px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.nav a { padding: 10px 12px; gap: 13px; margin-bottom: 2px; }
.pill { padding: 10px 12px; }
.main { padding: 40px clamp(24px, 4vw, 64px) 100px; max-width: 1320px; }
.head { margin-bottom: 32px; gap: 20px; }
.head .muted { margin-top: 8px; line-height: 1.6; }
.section { margin: 44px 0 20px; padding-top: 26px; }
.toolbar { gap: 12px; margin-bottom: 24px; }
.grid { gap: 24px; margin-bottom: 24px; }
.card { padding: 26px 28px; border-radius: 14px; }
.card + .card { margin-top: 0; }
.main > .card, .main > .tabs + .card, .detail > .card { margin-bottom: 24px; }
.detail { display: grid; gap: 24px; }
.notice { padding: 16px 20px; margin-bottom: 24px; gap: 14px; }
.facts { gap: 10px 40px; margin: 8px 0 36px; }
.todo { margin-bottom: 36px; border-radius: 14px; }
.todo > div { padding: 16px 22px; gap: 16px; }
.check { padding: 9px 0; gap: 12px; }
.kv { gap: 12px 24px; }
.rs { gap: 10px 16px; } .rs-c { padding: 16px 8px; gap: 6px; }
.vs { margin: 10px 0 32px; gap: 18px; }
.bar-row { padding: 8px 0; gap: 14px; }
.tabs { gap: 6px; margin: 0 0 32px; } .tab { padding: 12px 18px; }
input, select, textarea { padding: 11px 14px; border-radius: 10px; }
label { gap: 8px; }
.form { gap: 22px; }
.row { gap: 16px; } .row-gap { gap: 12px; } .row-between { gap: 16px; }
.btn { padding: 10px 18px; border-radius: 10px; gap: 8px; } .btn.small { padding: 6px 13px; }
.checkbox { gap: 12px; padding: 4px 0; }
th { padding: 15px 20px; } td { padding: 14px 20px; }
.table-wrap { border-radius: 14px; }
.who { gap: 14px; }
.badge { padding: 3px 11px; margin: 0 6px 6px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px 4px; }
/* Mallar */
.msteps { gap: 16px; margin: 0 0 28px; } .mstep { padding: 18px 20px; gap: 14px; border-radius: 14px; }
.tgrid, .tcard-grid { gap: 20px; }
.tcard { padding: 22px; gap: 12px; border-radius: 14px; }
.tiles { gap: 16px; margin-top: 20px; } .tile { padding: 18px 20px; }
.tree.tree-grid { gap: 20px; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.tree-grid .cat { padding: 10px 16px 14px; border-radius: 14px; }
.cat-n { margin: 8px 0 10px; padding-bottom: 12px; }
.chn { padding: 9px 10px; gap: 14px; margin-bottom: 2px; }
.chi { width: 32px; height: 32px; }
.chb small { margin-top: 2px; }
.optgroup { padding: 18px 20px; gap: 14px; margin-top: 18px; border-radius: 14px; }
.actionbar { padding: 18px 22px; margin-top: 24px; border-radius: 14px; }
.warnline { padding: 12px 16px; margin: 16px 0 0; }
@media (max-width: 900px) { .shell { grid-template-columns: 1fr; } .main { padding: 24px 18px 80px; } .card { padding: 20px; } .tree.tree-grid { grid-template-columns: 1fr; } }
.stack { gap: 24px; } .split-2 { gap: 24px; }
.item { padding: 14px 20px; gap: 18px; } .item.ch { padding: 11px 20px; gap: 14px; }
.cat-head { padding: 14px 20px; }
.chip { padding: 7px 16px; } .chips { gap: 8px; }
.selbar { padding: 14px 20px; }
.modal { padding: 30px; gap: 22px; border-radius: 16px; }
.warn-row { padding: 16px 0; }
.panel-card { gap: 12px; }
.icon-grid { gap: 16px; } .icon-cell { padding: 16px; gap: 12px; }
.toast { padding: 14px 20px; }
.empty { padding: 56px 24px; } .loading { padding: 80px; }
.dc { padding: 22px; }
a.kpi, .kpi a, a.kpi * { text-decoration: none; color: inherit; } .kpi span { color: var(--muted); } .kpi .up { color: var(--good); } .kpi .down { color: var(--bad); }
.kpis { gap: 20px; margin: 0 0 32px; } .kpi { padding: 20px 22px; gap: 4px; border-radius: 14px; } .kpi b { font-size: 32px; }
a.kpi:hover { border-color: #5a4f3e; }

.setup { padding: 24px 28px; gap: 18px; border-radius: 14px; margin-bottom: 28px; }
.steps { gap: 12px 24px; } .step { padding: 10px 0; gap: 12px; }
.chart-card { margin-bottom: 28px; } .chart-head { margin-bottom: 14px; }
.chart-wrap + * , .chart-card > .muted:last-child { margin-top: 14px; display: block; }

/* ---- 6.9.3: hopfällbara menygrupper ---- */
.nav-sec { display: block; } .nav-body { display: grid; gap: 2px; }
.nav-sec:not(.open) > .nav-body { display: none; }
button.nav-group { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 8px; width: calc(100% - 4px); margin: 18px 2px 6px; padding: 7px 12px; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
button.nav-group > span { flex: 1; } button.nav-group:hover { background: var(--panel); color: var(--text); }
button.nav-group:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.nav-car { font-style: normal; font-size: 11px; transition: transform .18s; } .nav-sec:not(.open) .nav-car { transform: rotate(-90deg); }
.nav-n { font-style: normal; font-size: 11px; font-weight: 600; letter-spacing: 0; padding: 0 7px; border-radius: 99px; background: var(--raised); color: var(--muted); display: none; } .nav-sec:not(.open) .nav-n { display: inline-block; }
@media (max-width: 860px) { .nav-sec, .nav-body { display: contents !important; } button.nav-group { display: none; } }

/* ---- 6.10: förhandsvisning av ändringar ---- */
.modal.review { width: min(680px, 100%); }
.rv-sum { display: flex; gap: 8px; flex-wrap: wrap; }
.rv-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 11px; border-radius: 99px; font-size: 12px; font-weight: 700; border: 1px solid var(--rule); background: var(--raised); color: var(--muted); }
.rv-chip.move, .rv-chip.change { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 33%, transparent); background: var(--gold-soft); } .rv-chip.add { color: var(--good); border-color: #8bb66a55; background: #8bb66a1c; } .rv-chip.remove { color: var(--bad); border-color: #e0654a55; background: #e0654a18; }
.rv-list { display: grid; gap: 8px; max-height: min(52vh, 460px); overflow: auto; padding-right: 4px; }
.rv-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 14px; border: 1px solid var(--rule); border-radius: 12px; background: var(--raised); }
.rv-row.remove { border-color: #e0654a55; background: #e0654a0f; } .rv-row.add { border-color: #8bb66a44; }
.rv-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--panel); font-size: 14px; }
.rv-main { display: grid; min-width: 0; } .rv-main b { overflow-wrap: anywhere; } .rv-main small { font-size: 12px; }
.rv-chg { display: flex; align-items: center; gap: 8px; font-size: 13px; flex-wrap: wrap; justify-content: flex-end; max-width: 300px; }
.rv-from { color: var(--muted); text-decoration: line-through; text-decoration-color: #e0654a99; overflow-wrap: anywhere; } .rv-to { color: var(--text); font-weight: 600; overflow-wrap: anywhere; } .rv-arrow { color: var(--gold); }
.rv-sw { display: inline-flex; align-items: center; gap: 6px; } .rv-sw i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid #ffffff33; display: inline-block; }
@media (max-width: 560px) { .rv-row { grid-template-columns: 30px 1fr; } .rv-chg { grid-column: 1 / -1; justify-content: flex-start; max-width: none; } }
.btn.danger { background: #e0654a1f; }

/* ---- 6.10: aktivitetslogg ---- */
.log-tiles { grid-template-columns: repeat(4, 1fr); margin: 0 0 22px; }
.log-tiles .tile b { font-size: 24px; } .log-tiles .tile small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--raised); border: 1px solid var(--rule); }
.seg-b { appearance: none; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; font-size: 13px; padding: 6px 14px; border-radius: 8px; cursor: pointer; } .seg-b:hover { color: var(--text); } .seg-b.on { background: var(--gold); color: var(--gold-ink); }
.chip-n { margin-left: 7px; font-size: 11px; opacity: .75; } .chip.on .chip-n { opacity: 1; }
.tl-i { grid-template-columns: 56px minmax(0, 1fr); align-items: start; padding: 6px 0 6px 20px; }
.tl-i::before { top: 20px; }
.tl-i time { padding-top: 9px; }
.tl-c { min-width: 0; border-radius: 12px; }
.tl-h { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 9px 12px; border-radius: 12px; text-align: left; background: none; border: 1px solid transparent; color: inherit; font: inherit; }
button.tl-h { cursor: pointer; } button.tl-h:hover { background: var(--panel); border-color: var(--rule); }
.tl-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--raised); font-size: 14px; }
.tl-t { min-width: 0; overflow-wrap: anywhere; } .tl-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.tl-r .by { font-size: 12px; color: var(--muted); } .tl-r .by.dash { color: var(--gold); } .tl-car { color: var(--muted); font-size: 12px; }
.tl-body { margin: 2px 0 8px 42px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 12px; background: var(--panel); display: grid; gap: 10px; }
.tl-chg { display: grid; gap: 6px; } .tl-chg .rv-row { grid-template-columns: minmax(90px, 160px) minmax(0, 1fr); padding: 8px 12px; } .tl-chg .rv-chg { justify-content: flex-start; max-width: none; }
.tl-meta { display: flex; gap: 6px 18px; flex-wrap: wrap; }
@media (max-width: 760px) { .log-tiles { grid-template-columns: 1fr 1fr; } .tl-h { grid-template-columns: 28px 1fr; } .tl-r { grid-column: 2; justify-content: flex-start; } .tl-body { margin-left: 0; } .tl-i { grid-template-columns: 44px 1fr; } .tl-i .by { display: inline; } }

/* ---- 6.10: statuskort ---- */
.st-wrap { display: grid; gap: 24px; margin-bottom: 24px; }
.sdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); margin-top: 6px; flex: none; }
.sdot.ok { background: var(--good); box-shadow: 0 0 0 3px #8bb66a26; } .sdot.warn { background: var(--warn); box-shadow: 0 0 0 3px #e3a93b26; } .sdot.bad { background: var(--bad); box-shadow: 0 0 0 3px #e0654a2b; } .sdot.off { background: #6b6455; }
.sdot.big { width: 14px; height: 14px; margin: 0; }
.st-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-radius: 12px; border: 1px solid var(--rule); background: var(--raised); text-decoration: none; color: inherit; }
.st-head.ok { border-color: #8bb66a55; background: #8bb66a14; } .st-head.warn { border-color: #e3a93b66; background: var(--gold-soft); } .st-head.bad { border-color: #e0654a66; background: #e0654a14; }
a.st-head:hover { filter: brightness(1.1); }
.st-big { display: inline-flex; align-items: center; gap: 12px; font-family: var(--serif); font-size: 20px; font-weight: 700; }
.st-tiles { grid-template-columns: repeat(4, 1fr); }
.st-tile b { font-size: 26px; }
.st-svc { text-decoration: none; color: inherit; border-radius: 10px; } .st-svc:hover { background: var(--raised); }
.st-ico { font-size: 18px; text-align: center; padding-top: 1px; }
.st-foot { display: flex; gap: 6px 22px; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule2); }
.st-mini { display: grid; gap: 12px; align-content: start; } .st-mini h3 { margin-bottom: 4px; } .st-mini .st-big { font-size: 17px; } .st-mini .st-head { padding: 11px 14px; }
.st-issues { display: grid; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; } .st-issues .check-row { text-decoration: none; color: inherit; padding: 10px 14px; } .st-issues .check-row:hover { background: var(--raised); }
@media (max-width: 760px) { .st-tiles { grid-template-columns: 1fr 1fr; } }

/* ---- 6.10: medlemshistorik ---- */
.hv-tiles { grid-template-columns: repeat(4, 1fr); margin: 0; } .hv-tiles .tile b { font-size: 24px; } .hv-tiles .tile small { font-size: 11.5px; }
.hv-list { display: grid; gap: 6px; }
.hv-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 12px; border: 1px solid var(--rule); border-radius: 12px; background: var(--raised); border-left: 3px solid var(--rule); }
.hv-row.good { border-left-color: var(--good); } .hv-row.warn { border-left-color: var(--warn); } .hv-row.bad { border-left-color: var(--bad); }
.hv-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--panel); font-size: 14px; }
.hv-main { display: grid; min-width: 0; } .hv-text { overflow-wrap: anywhere; } .hv-main small { font-size: 12px; }
.hv-row time { white-space: nowrap; }
.hv-recent { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 14px; background: var(--panel); }
@media (max-width: 760px) { .hv-tiles { grid-template-columns: 1fr 1fr; } }


/* ═══ 6.12: lugnare dashboard ═══
   Problemet var brun-på-brun: panel, bakgrund och kanter låg nästan på samma nivå, och allt hade ram. Nu skiljs lager åt med
   ljushet i stället för linjer, kanterna är hårfina, och bara det som är en egen sak får ett kort. */
html, body { font-size: 15px; line-height: 1.6; }
::selection { background: var(--gold-soft); }
* { scrollbar-width: thin; scrollbar-color: var(--raised2) transparent; }
.kpi b, .tile b, td, .bar-v, time { font-variant-numeric: tabular-nums; }

/* Rubriker: serif bara för sidans titel, resten är lugn sans */
h2 { font-size: 32px; letter-spacing: -.01em; line-height: 1.15; }
h3 { font-family: var(--sans); font-size: 15px; font-weight: 650; letter-spacing: 0; margin-bottom: 14px; color: var(--text); }
.head { margin-bottom: 36px; align-items: flex-end; }
.head .muted { font-size: 15px; margin-top: 8px; max-width: 58ch; }
.muted { color: var(--muted); }
.section { border-top: 0; margin: 48px 0 18px; padding-top: 0; }
.section h3 { margin: 0; font-size: 16px; }

/* Sidomeny */
.side { background: var(--bg); border-right: 1px solid var(--rule2); padding: 22px 14px 18px; gap: 2px; }
.brand { padding: 0 10px 20px; } .brand .logo { background: var(--raised); border: 0; }
.side > .btn.ghost { justify-content: space-between; border: 1px solid var(--rule); background: var(--panel); color: var(--muted); font-weight: 500; padding: 9px 12px; margin-bottom: 14px; }
.side > .btn.ghost::after { content: "Ctrl K"; font-size: 11px; padding: 1px 6px; border-radius: 5px; background: var(--raised); color: var(--muted); }
.side > .btn.ghost:hover { border-color: var(--raised2); color: var(--text); background: var(--panel); }
.nav a { padding: 9px 12px; border-radius: 9px; font-size: 14.5px; margin: 0; }
.nav a span { filter: grayscale(1) opacity(.7); transition: filter .15s; }
.nav a:hover { background: var(--panel); } .nav a:hover span, .nav a.active span { filter: none; }
.nav a.active { background: var(--raised); box-shadow: none; color: var(--text); font-weight: 600; }
button.nav-group { margin: 22px 4px 6px; padding: 6px 10px; font-size: 11.5px; letter-spacing: .07em; }
.pill { padding: 8px 12px; }

/* Ytor: ljushet i stället för ramar */
.main { max-width: 1240px; padding: 44px clamp(24px, 4vw, 64px) 110px; }
.card { background: var(--panel); border: 1px solid var(--rule2); border-radius: 16px; padding: 28px 30px; box-shadow: none; }
.card:hover { border-color: var(--rule2); }
.card .card { background: var(--raised); border-color: transparent; border-radius: 12px; }
.card .list, .card .table-wrap { background: transparent; border-color: var(--rule2); }
.card h3:first-child { margin-top: 0; }
.list { border: 1px solid var(--rule2); border-radius: 14px; background: var(--panel); overflow: hidden; }
.item { border-bottom: 1px solid var(--rule2); padding: 14px 20px; } .item:last-child { border-bottom: 0; }
.item:hover { background: var(--raised); }
.notice { background: var(--gold-soft); border: 0; border-radius: 12px; padding: 14px 18px; }
.todo, .setup { background: var(--panel); border-color: var(--rule2); border-radius: 16px; }
.todo > div { border-bottom-color: var(--rule2); }
.empty { background: transparent; border: 1px dashed var(--rule); border-radius: 16px; }

/* Nyckeltal: färgad punkt i stället för färgad kant */
.kpi { background: var(--panel); border: 1px solid var(--rule2); border-radius: 16px; padding: 22px 24px; }
.kpi::before { display: none; }
.kpi span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--gold)); margin-right: 8px; vertical-align: 1px; }
.kpi b { font-family: var(--sans); font-size: 34px; font-weight: 650; letter-spacing: -.02em; margin: 4px 0 2px; }
.tile { background: var(--panel); border-color: var(--rule2); border-radius: 14px; }
.card .tile { background: var(--raised); border-color: transparent; }

/* Knappar och fält */
.btn { background: transparent; border: 1px solid var(--rule); color: var(--text); font-weight: 600; border-radius: 10px; }
.btn:hover { background: var(--raised); border-color: var(--raised2); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); } .btn.primary:hover { background: var(--gold); filter: brightness(1.08); }
.btn.danger { background: transparent; border-color: #ec6a5544; color: var(--bad); } .btn.danger:hover { background: #ec6a5518; }
.btn.ghost { border-color: transparent; }
input, select, textarea { background: var(--bg); border: 1px solid var(--rule); border-radius: 10px; }
input:hover, select:hover, textarea:hover { border-color: var(--raised2); }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.card input, .card select, .card textarea { background: var(--bg); }
label { font-weight: 600; color: var(--muted); font-size: 13.5px; }
.chip { border-color: var(--rule); } .chip:hover { background: var(--raised); color: var(--text); } .chip.on { background: var(--gold-soft); border-color: var(--gold); color: var(--text); }
.checkbox { color: var(--text); }

/* Tabeller */
.table-wrap { background: var(--panel); border-color: var(--rule2); border-radius: 16px; }
th { font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: 0; text-transform: none; padding: 14px 20px; border-bottom: 1px solid var(--rule2); background: transparent; }
td { border-bottom-color: var(--rule2); padding: 14px 20px; }
tbody tr:hover { background: var(--raised); }

/* Flikar */
.tabs { border-bottom: 1px solid var(--rule2); margin-bottom: 30px; gap: 4px; }
.tab { padding: 12px 16px; font-weight: 600; } .tab.on { color: var(--text); border-bottom-color: var(--gold); }

/* Dialoger och menyer */
.modal-bg { background: #05060acc; backdrop-filter: blur(5px); }
.modal { background: var(--panel); border: 1px solid var(--rule); border-radius: 18px; box-shadow: 0 30px 90px #000c; }
.menu-pop { background: var(--raised); border-color: var(--rule); border-radius: 12px; }
.toast { background: var(--raised); border-color: var(--rule); border-radius: 12px; }

/* Smådetaljer */
.badge { border-radius: 8px; padding: 2px 9px; font-weight: 600; }
code { background: var(--raised); border-color: transparent; }
.rv-row, .hv-row { background: var(--raised); border-color: transparent; border-radius: 12px; }
.hv-row { border-left: 3px solid transparent; } .hv-row.good { border-left-color: var(--good); } .hv-row.warn { border-left-color: var(--warn); } .hv-row.bad { border-left-color: var(--bad); }
.cat-head { background: var(--raised); border-bottom-color: var(--rule2); }
.st-head, .tl-body, .hv-recent { background: var(--raised); border-color: transparent; }
.hv-recent { background: var(--panel); border: 1px solid var(--rule2); }
.st-head.ok { background: #7fc47a14; border-color: #7fc47a44; } .st-head.warn { background: var(--gold-soft); border-color: #e3a93b55; } .st-head.bad { background: #ec6a5514; border-color: #ec6a5555; }
.mstep, .step { border-color: var(--rule2); }
.tcard { background: var(--panel); border-color: var(--rule2); border-radius: 16px; } .tcard:hover { border-color: var(--raised2); transform: none; background: var(--raised); } .tcard.on { background: var(--gold-soft); border-color: var(--gold); }
.tree-grid .cat { background: var(--panel); border-color: var(--rule2); }
.optgroup { background: transparent; border-color: var(--rule2); }
.actionbar { background: var(--raised); border-color: var(--gold); box-shadow: 0 -12px 30px #0009; }
.step-n, .mstep-n { background: var(--raised2); border: 0; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (max-width: 860px) { .side { border-right: 0; border-bottom: 1px solid var(--rule2); } .side > .btn.ghost { display: none; } .main { padding: 24px 18px 80px; } .card { padding: 20px; } h2 { font-size: 26px; } }
.chart-wrap svg { overflow: hidden; }

/* Rad-knappar syns när du pekar på raden eller tabbar dit, så listorna blir lugna */
.item .btn.small, .cat-head .btn.small { border-color: transparent; color: var(--muted); background: transparent; }
.item:hover .btn.small, .item:focus-within .btn.small, .cat-head:hover .btn.small, .cat-head:focus-within .btn.small { border-color: var(--rule); color: var(--text); }
.item .btn.small:hover, .cat-head .btn.small:hover { background: var(--raised2); }
.item.ch .mover, .cat-head .mover { opacity: 0; transition: opacity .12s; }
.item.ch:hover .mover, .item.ch:focus-within .mover, .cat-head:hover .mover, .cat-head:focus-within .mover { opacity: 1; }
.item.ch input[type=checkbox], .cat-head input[type=checkbox] { opacity: .35; transition: opacity .12s; }
.item.ch:hover input[type=checkbox], .item.ch:focus-within input[type=checkbox], .cat-head:hover input[type=checkbox], input[type=checkbox]:checked { opacity: 1; }
@media (hover: none) { .item.ch .mover, .cat-head .mover, .item.ch input[type=checkbox], .cat-head input[type=checkbox] { opacity: 1; } }

/* 6.13: Anpassa i flikar */
.ap-grid { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 32px; align-items: start; }
.ap-prev { position: sticky; top: 24px; background: var(--raised); border: 1px solid var(--rule); border-radius: 14px; padding: 18px; }
.ap-prev h3 { margin: 0 0 12px; font-size: 14px; }
.ap-g + .ap-g { margin-top: 10px; } .ap-gt { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px 8px; }
.ap-i { display: flex; gap: 8px; padding: 4px 8px; font-size: 13px; border-radius: 6px; color: var(--text); } .ap-i span { width: 18px; opacity: .8; }
.ap-dirty { margin-right: 6px; align-self: center; }
.pgrid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 14px; }
.pcard2 { display: grid; gap: 6px; align-content: start; text-align: left; padding: 16px; border: 1px solid var(--rule); border-radius: 12px; background: var(--raised2, var(--raised)); color: var(--text); font: inherit; cursor: pointer; }
.pcard2:hover { border-color: var(--muted); } .pcard2.on { border-color: var(--gold); background: var(--gold-soft); }
.pcard2 .pc-i { font-size: 24px; } .pcard2 em { font-style: normal; font-size: 12px; color: var(--muted); }
.trow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--rule); cursor: pointer; }
.trow:first-of-type { border-top: 0; }
.trow-t { display: grid; gap: 2px; } .trow-t b { font-weight: 600; }
.tag { margin-left: 8px; font-size: 10px; padding: 2px 6px; border-radius: 999px; border: 1px solid var(--rule); color: var(--muted); font-weight: 600; }
.sw-t { position: relative; flex: none; width: 40px; height: 22px; }
.sw-t input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.sw-t i { position: absolute; inset: 0; border-radius: 999px; background: var(--rule); transition: background .15s; }
.sw-t i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.sw-t input:checked + i { background: var(--gold); } .sw-t input:checked + i::after { transform: translateX(18px); }
.sw-t input:focus-visible + i { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (max-width: 900px) { .ap-grid { grid-template-columns: 1fr; } .ap-prev { position: static; order: -1; } }
.sw-t input { appearance: none; -webkit-appearance: none; background: transparent; border: 0; border-radius: 999px; }
.sw-t input::before, .sw-t input::after { display: none; }
label.trow { display: flex; gap: 16px; margin: 0; padding: 12px 0; }
.trow-t { gap: 1px; } .trow-t .muted { display: block; font-weight: 400; }
.card.form > h3 + .trow { margin-top: 6px; }


/* 6.14: Hawkeye-identitet: kall blå accent, ren sans, riktiga ikoner */
h1, h2, h3 { letter-spacing: -.012em; font-weight: 650; }
h2 { font-size: 26px; letter-spacing: -.02em; }
.brand b, .sw-n { font-weight: 650; letter-spacing: -.01em; }
.nav a > span:first-child, .ap-i > span:first-child { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; filter: none; opacity: 1; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .72; transition: opacity .12s, color .12s; }
.nav a:hover .ico, .ap-i:hover .ico { opacity: 1; }
.nav a.active .ico { opacity: 1; color: var(--gold); }
.login-card h1 { color: var(--text); letter-spacing: -.02em; }
.crest { width: 64px; height: 64px; margin: 0 auto; display: grid; place-items: center; font-size: 32px; border-radius: 18px; background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); }
:root[data-theme="light"] .btn.primary { box-shadow: 0 1px 2px #0002; }
.btn.ghost .ico { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }


/* 6.15: genvägsrutor på Översikt, rundare och mjukare */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin: 8px 0 30px; }
.tile { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 18px; background: var(--panel); border: 1px solid var(--rule); text-decoration: none; color: var(--text); text-align: left; transition: border-color .15s, transform .15s; }
.tile:hover { border-color: color-mix(in srgb, var(--gold) 45%, var(--rule)); transform: translateY(-2px); }
.tile b { font-size: 16px; font-weight: 700; } .tile span.d { color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.tile .ci { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); }
.tile .ci .ico { width: 21px; height: 21px; opacity: 1; }
.card, .item, .stat, .kpi, .table-wrap { border-radius: 16px; }
.btn { border-radius: 10px; }
.sec-h { margin: 6px 0 12px; font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }

/* 6.19 Användare och inloggningslogg */
.ava { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid; font-weight: 700; font-size: 14px; flex: none; }
.pill-s { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.pill-s.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.bad-row { background: color-mix(in srgb, var(--bad) 6%, transparent); }
.log-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .log-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px 28px; }
.perm-grid .pg { grid-column: 1 / -1; margin-top: 10px; font-weight: 600; }
.perm-grid .pr { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.perm-grid select { width: 150px; flex: none; }

/* ── 6.21 Mobil: toppfält, flik-rad längst ner, sidomeny som glider in ── */
.mbar, .mtab, .scrim { display: none; }
@media (max-width: 860px) {
  html { -webkit-text-size-adjust: 100%; }
  body { overscroll-behavior-y: none; }
  input, select, textarea { font-size: 16px !important; }              /* hindrar zoom på iPhone */
  .shell { display: block; }
  .mbar { display: flex; align-items: center; gap: 6px; position: sticky; top: 0; z-index: 40; height: 54px; padding: 0 8px; padding-top: env(safe-area-inset-top); box-sizing: content-box;
    background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--rule2); }
  .mb-btn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--text); display: grid; place-items: center; cursor: pointer; }
  .mb-btn:active { background: var(--panel); }
  .mb-btn .ico { width: 22px; height: 22px; }
  .mb-title { flex: 1; text-align: center; font-weight: 700; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* sidomenyn blir en låda från vänster */
  .shell > .side { position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: min(86vw, 330px); height: 100dvh; display: flex; flex-direction: column; align-items: stretch; flex-wrap: nowrap;
    padding: calc(18px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; overflow-x: hidden; border: 0; border-right: 1px solid var(--rule2); background: var(--bg);
    transform: translateX(-104%); transition: transform .26s cubic-bezier(.2, .8, .2, 1); box-shadow: none; }
  body.drawer-open .shell > .side { transform: none; box-shadow: 20px 0 60px #000a; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: #000a; opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.drawer-open .scrim { opacity: 1; pointer-events: auto; }
  body.drawer-open { overflow: hidden; }
  .shell > .side .nav { display: block; }
  .shell > .side .nav-sec { display: block !important; }
  .shell > .side .nav-sec.open > .nav-body { display: grid !important; }
  .shell > .side .nav-sec:not(.open) > .nav-body { display: none !important; }
  .shell > .side .nav-sec:first-child > .nav-body { display: grid !important; }
  .shell > .side button.nav-group { display: flex !important; }
  .shell > .side .nav a { padding: 12px; font-size: 15.5px; white-space: normal; box-shadow: none; }
  .shell > .side .nav a.active { background: var(--gold-soft); box-shadow: inset 3px 0 0 var(--gold); }
  .shell > .side .grow { display: block; flex: 1; min-height: 12px; }
  .shell > .side .pill { display: flex; }
  .shell > .side .side-foot { display: flex !important; padding-top: 8px; border-top: 1px solid var(--rule2); }
  .shell > .side > .btn { font-size: inherit; padding: 11px 12px; }
  .shell > .side > .btn::first-letter { font-size: inherit; }
  .shell > .side > .btn.ghost { display: flex; }
  .side .menu > .btn { padding: 10px 12px; }
  .brand span { display: inline; }

  /* flik-rad längst ner */
  .mtab { display: flex; position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--rule); }
  .mtab a, .mtab button { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; text-decoration: none; cursor: pointer; }
  .mtab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mtab .ico { width: 22px; height: 22px; }
  .mtab a.on { color: var(--gold); background: var(--gold-soft); }
  .mtab a:active, .mtab button:active { background: var(--raised); }

  /* innehåll */
  .main { padding: 18px 14px calc(96px + env(safe-area-inset-bottom)); }
  h2 { font-size: 24px; letter-spacing: -.02em; }
  .head { gap: 12px; margin-bottom: 18px; }
  .head > .btn, .head .btn:only-child { width: 100%; justify-content: center; }
  .head .row-gap { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .card { padding: 16px; border-radius: 14px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
  .kpi { padding: 13px 14px; border-radius: 12px; } .kpi b { font-size: 26px; } .kpi span { font-size: 12.5px; }
  .tiles { grid-template-columns: 1fr !important; gap: 10px; } .tile { min-height: 0; padding: 14px 16px; flex-direction: row; align-items: center; gap: 14px; }
  .tile .ci { flex: none; } .tile b { font-size: 15.5px; } .tile span:not(.ci) { margin-top: 0; font-size: 13px; }
  .tabs { display: flex; overflow-x: auto; gap: 2px; margin-left: -14px; margin-right: -14px; padding: 0 14px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; } .tab { flex: none; white-space: nowrap; padding: 12px 14px; }
  .split-2, .ap-grid, .cols { grid-template-columns: 1fr !important; }
  .row { flex-direction: column; align-items: stretch; }
  .row > label, .form .row > * { width: 100%; }
  .btn { min-height: 42px; } .btn.small { min-height: 36px; }
  table { font-size: 14px; } th, td { padding: 10px 8px; }
  .menu-pop { max-width: calc(100vw - 28px); }
  #toasts { left: 12px; right: 12px; bottom: calc(78px + env(safe-area-inset-bottom)); } .toast { max-width: none; }
  .login-card { padding: 28px 20px; }
  .perm-grid { grid-template-columns: 1fr; } .perm-grid select { width: 140px; }
  .log-tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .check-row { flex-wrap: wrap; }
  dialog, .modal, .modal-card { max-width: calc(100vw - 20px) !important; }
}
@media (max-width: 380px) { .kpis, .log-tiles { grid-template-columns: 1fr; } }
.mwrap { display: contents; }
@media (max-width: 860px) { .mwrap { display: block; position: sticky; top: 0; z-index: 40; } .mwrap .mbar { position: static; } .shell { display: block; } }
@media (max-width: 860px) {
  .item.ch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 12px; }
  .item.ch > div:nth-of-type(1) { flex: 1 1 calc(100% - 96px); min-width: 0; }
  .item.ch > :nth-child(4) { margin-left: 50px; }
  .item.ch > .btn { margin-left: auto; }
  .item .name { word-break: normal; overflow-wrap: anywhere; }
  .cat-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
  .item { grid-template-columns: 40px 1fr; } .item > .btn, .item > .row-gap { grid-column: 2; justify-self: start; }
}
@media (max-width: 860px) { .item.ch input[type=checkbox], .cat-head input[type=checkbox] { width: 22px; height: 22px; min-height: 0; flex: none; padding: 0; margin: 0; } .item.ch > span { flex: none; } }

/* 6.25.1 – ansluter igen efter omstart */
.reconnect .crest { margin: 0 auto 6px; }
.reconnect .modal { display: grid; gap: 10px; justify-items: center; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line, rgba(128,128,128,.3)); border-top-color: var(--accent, #4fd1c5); animation: hk-spin .9s linear infinite; }
@keyframes hk-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* 6.29 – direktredigering i förhandsvisningen */
.inl { cursor: text; border-radius: 4px; outline: 1px dashed transparent; outline-offset: 2px; transition: outline-color .15s; }
.inl:hover { outline-color: color-mix(in srgb, currentColor 35%, transparent); }
.inl:focus { outline: 2px solid var(--accent, #5eead4); background: color-mix(in srgb, currentColor 6%, transparent); }
.inl.empty { opacity: .45; font-style: italic; }

/* Klassväljare med flera val */
.cchips{display:flex;flex-wrap:wrap;gap:3px;max-width:230px}
.cchip{width:28px;height:28px;border-radius:8px;border:1px solid var(--line,#2a3350);background:transparent;cursor:pointer;font-size:15px;line-height:1;opacity:.5;padding:0}
.cchip:hover{opacity:.9}
.cchip.on{opacity:1;background:color-mix(in srgb,var(--c,#e3a93b) 28%,transparent);border-color:var(--c,#e3a93b)}
[hidden]{display:none!important}

/* Anpassa: servertypskort med fokussidor */
.pc-f { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0; }
.pc-f .chip { cursor: default; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); }

/* Förhandsvisning: embed-fält */
.dc-fields { margin-top: 8px; display: grid; gap: 8px; }
.dc-fname { font-weight: 600; font-size: .9em; }
.dc-fval { font-size: .88em; opacity: .85; white-space: pre-wrap; }
