/* Arkivbevakning – mörkt tema, tidningskänsla */
:root {
  --bg: #0d1015;
  --bg-2: #11151c;
  --card: #161b24;
  --card-hi: #1c222d;
  --line: #242c39;
  --line-soft: #1d242f;
  --text: #e7e9ee;
  --text-dim: #b3bcc9;
  --muted: #8b96a8;
  --accent: #d8a44a;
  --accent-dim: #a87f36;
  --danger: #e0705f;
  --ok: #5fc9a4;
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(216, 164, 74, .07), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(99, 164, 216, .06), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}

a { color: #9dc2e2; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between;
  padding: 16px 28px 14px;
  background: rgba(13, 16, 21, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.brand { display: flex; gap: 14px; align-items: center; min-width: 0; }
.brand .mark {
  font-size: 30px; line-height: 1; color: var(--accent);
  text-shadow: 0 0 18px rgba(216, 164, 74, .35);
}
.brand h1 {
  margin: 0; font-family: var(--serif); font-weight: 600;
  font-size: 25px; letter-spacing: .2px;
}
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; letter-spacing: .1px; }

.topbar-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.search { display: flex; align-items: center; }
.search input {
  width: min(34vw, 360px);
  padding: 9px 13px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 9px 0 0 9px;
  color: var(--text); font-size: 13.5px;
  outline: none;
}
.search input:focus { border-color: var(--accent-dim); background: #0b0e13; }
.search input::placeholder { color: #6b7688; }
.search button {
  padding: 9px 14px; border-radius: 0 9px 9px 0;
  border: 1px solid var(--line); border-left: 0;
  background: var(--card); color: var(--text-dim);
  font-size: 13px; cursor: pointer;
}
.search button:hover { background: var(--card-hi); color: var(--text); }

/* ---------------------------------------------------------- buttons */
.btn {
  font: inherit; font-size: 13px;
  padding: 8px 14px; border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--card); color: var(--text);
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--card-hi); border-color: #31404f; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--text-dim); }
.btn.ghost:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.btn.primary { background: linear-gradient(180deg, #e0ac52, #c58f34); border-color: #b07f2c; color: #1b1508; font-weight: 600; }
.btn.primary:hover { background: linear-gradient(180deg, #e8b761, #cf9a3d); }
.btn.danger { color: #f0a196; border-color: #4a2b28; background: #241717; }
.btn.danger:hover { background: #301c1b; }

.icon {
  background: none; border: 0; color: #6f7b8c; cursor: pointer;
  font-size: 15px; padding: 4px 6px; border-radius: 7px; line-height: 1;
}
.icon:hover { color: var(--accent); background: rgba(255, 255, 255, .05); }
.icon.on { color: var(--accent); }
.icon.danger:hover { color: var(--danger); }

/* ---------------------------------------------------------- statline + chips */
.statline {
  display: flex; flex-wrap: wrap; gap: 9px; align-items: baseline;
  padding: 16px 28px 4px; color: var(--text-dim); font-size: 13px;
}
.statline strong { color: var(--text); font-weight: 600; }
.statline .dot { color: #3a4657; }
.statline .muted { color: var(--muted); }

.chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px 28px 6px;
}
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .015);
  color: var(--text-dim); font-size: 12.5px;
  transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { text-decoration: none; background: var(--card); color: var(--text); }
.chip em { font-style: normal; color: var(--muted); font-size: 11.5px; }
.chip .swatch {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--c, var(--muted));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, #888) 18%, transparent);
}
.chip.active {
  color: #10141a; font-weight: 600;
  background: color-mix(in srgb, var(--c, var(--accent)) 78%, #0d1015);
  border-color: color-mix(in srgb, var(--c, var(--accent)) 85%, #000);
}
.chip.active em { color: #26313a; }
.chip.all.active { background: var(--accent); border-color: var(--accent); color: #171206; }
.chip.all.active em { color: #4a3a15; }

/* ---------------------------------------------------------- sidospalt + träd */
.shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  align-items: start;
}
.content { min-width: 0; }

.side {
  position: sticky;
  top: 72px;
  align-self: start;
  max-height: calc(100vh - 72px);
  overflow-y: auto;
  padding: 16px 12px 24px 18px;
  border-right: 1px solid var(--line-soft);
  scrollbar-width: thin;
  scrollbar-color: #2b3442 transparent;
}
.side::-webkit-scrollbar { width: 8px; }
.side::-webkit-scrollbar-thumb { background: #2b3442; border-radius: 8px; }

.side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 6px 10px;
}
.side-title {
  font-family: var(--serif); font-size: 12px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted);
}
.side-close { display: none; color: var(--muted); font-size: 15px; }
.side-close:hover { color: var(--accent); }

.tree ul { list-style: none; margin: 0; padding: 0; }

.node-row {
  display: flex; align-items: center; gap: 2px;
  border-radius: 8px; padding-right: 7px;
}
.node-row:hover { background: rgba(255, 255, 255, .035); }
.node-row .nm {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 2px; font-size: 13.5px; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.node-row .nm:hover { text-decoration: none; color: var(--text); }
.node-row em {
  font-style: normal; font-size: 11px; color: #6b7688;
  font-variant-numeric: tabular-nums;
}
.node.active > .node-row { background: rgba(216, 164, 74, .10); }
.node.active > .node-row .nm { color: var(--text); font-weight: 600; }
.node.active > .node-row em { color: var(--accent-dim); }

.swatch {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c, #8d99ae); flex: none;
}
.swatch.all { background: var(--accent); }

.tw {
  width: 18px; height: 26px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; color: #7b8798; font-size: 0;
  cursor: pointer; padding: 0;
  transition: transform .16s, color .15s;
}
.tw::before {
  content: "";
  width: 0; height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}
.tw:hover { color: var(--accent); }
.tw.spacer { cursor: default; }
.tw.spacer::before { display: none; }
.node.open > .node-row .tw { transform: rotate(90deg); color: var(--accent-dim); }

.kids {
  display: none;
  margin: 2px 0 6px 18px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}
.node.open > .kids { display: block; }

.kid {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 5px 8px; border-radius: 7px;
  font-size: 12.5px; color: var(--muted);
}
.kid .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kid em {
  font-style: normal; font-size: 10.5px; color: #5a6678;
  font-variant-numeric: tabular-nums;
}
.kid:hover { background: rgba(255, 255, 255, .04); color: var(--text); text-decoration: none; }
.kid.active { background: rgba(216, 164, 74, .13); color: var(--text); font-weight: 600; }
.kid.empty { color: #55606f; font-size: 12px; font-style: italic; }

.side-foot {
  margin-top: 14px; padding: 12px 6px 0;
  border-top: 1px solid var(--line-soft);
}
.btn.small { width: 100%; font-size: 12px; padding: 6px 10px; }
.menu { display: none; }

.backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(5, 7, 10, .6); }

/* ---------------------------------------------------------- filters */
.filters {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  padding: 8px 28px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.toggle, .select {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--text-dim); font-size: 13px;
}
.toggle input { accent-color: var(--accent); width: 15px; height: 15px; }
.select span { color: var(--muted); font-size: 12px; }
.select select, .cat-select, .bulkbar select {
  font: inherit; font-size: 12.5px;
  background: var(--bg-2); color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 9px; cursor: pointer; outline: none;
}
.select select:hover, .cat-select:hover { color: var(--text); border-color: #31404f; }

.viewswitch {
  margin-left: auto; display: inline-flex;
  border: 1px solid var(--line); border-radius: 9px; overflow: hidden;
}
.viewswitch a {
  padding: 6px 13px; font-size: 12.5px; color: var(--muted);
}
.viewswitch a:hover { text-decoration: none; background: var(--card); color: var(--text); }
.viewswitch a.on { background: var(--card-hi); color: var(--text); }

.resultline { padding: 14px 28px 0; margin: 0; color: var(--text-dim); font-size: 13px; }

.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  margin: 0; padding: 14px 28px 0;
  color: var(--muted); font-size: 12.5px;
}
.breadcrumb strong { color: var(--text); font-weight: 600; }
.breadcrumb .sep { color: #3a4657; }
.breadcrumb .swatch { width: 7px; height: 7px; border-radius: 50%; background: var(--c, #8d99ae); }
.breadcrumb .clear { margin-left: 6px; font-size: 12px; color: var(--muted); }
.breadcrumb .clear:hover { color: var(--accent); }

/* ---------------------------------------------------------- feed + cards */
.feed { padding: 18px 28px 120px; max-width: 1180px; }
.cards { display: flex; flex-direction: column; gap: 12px; }

.card {
  position: relative;
  background: linear-gradient(180deg, var(--card), #141922);
  border: 1px solid var(--line-soft);
  border-left: 3px solid color-mix(in srgb, var(--c, #3a4657) 70%, #2a3442);
  border-radius: var(--radius);
  padding: 15px 18px 13px;
  transition: border-color .15s, transform .12s, box-shadow .15s;
}
.card:hover { border-color: var(--line); transform: translateY(-1px); box-shadow: 0 10px 26px -18px #000; }
.card.unread { background: linear-gradient(180deg, #1a212b, #151b24); }
.card.unread .title { font-weight: 700; }

.card-top {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--muted);
}
.card-top .grow { flex: 1; }
.card .cat {
  display: inline-flex; align-items: center; gap: 6px;
  color: color-mix(in srgb, var(--c, #8d99ae) 82%, #fff);
  font-size: 11.5px; letter-spacing: .3px; text-transform: uppercase; font-weight: 600;
}
.card .cat .swatch, .table .cat .swatch {
  width: 7px; height: 7px; border-radius: 50%; background: var(--c, #8d99ae);
}
.card .src { color: var(--text-dim); font-size: 12.5px; }
.card .src::before { content: "·"; margin-right: 6px; color: #3a4657; }
.card time { color: var(--muted); font-variant-numeric: tabular-nums; }
.card time::before { content: "·"; margin-right: 6px; color: #3a4657; }

.badge-new {
  font-size: 9.5px; letter-spacing: .8px; text-transform: uppercase;
  color: #1b1508; background: var(--accent); border-radius: 5px;
  padding: 1px 6px; font-weight: 700;
}

.pick { display: inline-flex; align-items: center; cursor: pointer; }
.pick input { appearance: none; width: 15px; height: 15px; border-radius: 4px; border: 1px solid #3b4757; background: #0f1319; cursor: pointer; position: relative; }
.pick input:checked { background: var(--accent); border-color: var(--accent); }
.pick input:checked::after { content: "✓"; position: absolute; inset: -2px 0 0 2px; font-size: 12px; color: #171206; font-weight: 800; }

.title {
  margin: 9px 0 7px;
  font-family: var(--serif); font-size: 20.5px; font-weight: 600;
  line-height: 1.28; letter-spacing: .1px;
}
.title .expand {
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.title .expand:hover { color: #fff; }

.summary {
  margin: 0 0 11px; color: var(--text-dim);
  font-size: 14.5px; line-height: 1.62;
}

.card-foot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-top: 9px; border-top: 1px solid var(--line-soft);
}
.card-foot .grow { flex: 1; }
.tag {
  font-size: 11.5px; color: #8fa8bd; background: rgba(99, 164, 216, .08);
  border: 1px solid rgba(99, 164, 216, .14);
  padding: 1px 8px; border-radius: 6px;
}
.link {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: 12.5px; color: #9dc2e2;
}
.link:hover { text-decoration: underline; color: #c3dcf1; }

.original {
  margin-top: 14px; padding: 14px 16px;
  background: #0c1015;
  border: 1px solid var(--line-soft);
  border-left: 2px solid color-mix(in srgb, var(--c, #3a4657) 55%, #2a3442);
  border-radius: 10px;
}
.orig-meta {
  font-size: 11.5px; color: var(--muted);
  letter-spacing: .2px; margin-bottom: 9px;
  font-family: var(--mono);
}
.orig-body {
  font-family: var(--serif); font-size: 15px; line-height: 1.72;
  color: #d5dae2; white-space: pre-wrap;
  max-height: 480px; overflow-y: auto;
  padding-right: 8px;
}
.orig-body::-webkit-scrollbar { width: 8px; }
.orig-body::-webkit-scrollbar-thumb { background: #2a3442; border-radius: 4px; }
.orig-ref { margin-top: 12px; font-size: 11.5px; color: var(--muted); word-break: break-all; }

/* ---------------------------------------------------------- table view */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table thead th {
  text-align: left; font-weight: 500; font-size: 11.5px;
  letter-spacing: .6px; text-transform: uppercase; color: var(--muted);
  padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table tr.row:hover { background: rgba(255, 255, 255, .022); }
.table tr.row.unread .row-title { font-weight: 600; color: #fff; }
.row-title {
  background: none; border: 0; padding: 0; font: inherit; text-align: left;
  color: var(--text-dim); cursor: pointer; font-family: var(--serif); font-size: 15px;
}
.row-title:hover { color: #fff; }
.table .col-date { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.table .col-pick { width: 30px; }
.table .col-src { color: var(--text-dim); white-space: nowrap; }
.table .col-flag { width: 26px; text-align: center; }
.table .col-cat { white-space: nowrap; }
.table .detail-row td { background: #0c1015; border-bottom: 1px solid var(--line); }
.detail-inner { padding: 6px 4px 14px; }
.detail-inner .summary { max-width: 78ch; }
.detail-actions { display: flex; gap: 16px; margin-top: 12px; }
.table .star.on { color: var(--accent); }

/* ---------------------------------------------------------- empty */
.empty {
  text-align: center; padding: 90px 20px; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius);
}
.empty-mark { font-size: 44px; color: #2f3a49; }
.empty h2 { font-family: var(--serif); color: var(--text-dim); font-weight: 500; margin: 10px 0 4px; }

/* ---------------------------------------------------------- panel (new item) */
.panel {
  margin: 0 28px 18px; padding: 18px 20px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.panel h2 { margin: 0 0 14px; font-family: var(--serif); font-size: 18px; font-weight: 600; }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.formgrid label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.formgrid .wide { grid-column: 1 / -1; }
.formgrid input, .formgrid textarea, .formgrid select, .dialog-form input, .dialog-form select {
  font: inherit; font-size: 13.5px;
  background: #0c1015; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; outline: none; width: 100%;
}
.formgrid input:focus, .formgrid textarea:focus, .dialog-form input:focus { border-color: var(--accent-dim); }
.formgrid textarea { resize: vertical; }
.formactions { display: flex; gap: 10px; justify-content: flex-end; grid-column: 1 / -1; margin-top: 4px; }

/* ---------------------------------------------------------- bulkbar */
.bulkbar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 11px 16px;
  background: rgba(22, 27, 36, .96);
  border: 1px solid #33404f;
  border-radius: 14px;
  box-shadow: 0 24px 60px -20px #000, 0 0 0 1px rgba(216, 164, 74, .08);
  backdrop-filter: blur(12px);
}
.bulkbar strong { font-size: 13px; color: var(--accent); white-space: nowrap; }
.bulk-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------------------------------------------------------- dialogs */
dialog {
  border: 1px solid #33404f; border-radius: 16px;
  background: var(--bg-2); color: var(--text);
  padding: 0; width: min(560px, 92vw);
  box-shadow: 0 40px 90px -30px #000;
}
dialog::backdrop { background: rgba(5, 7, 10, .66); backdrop-filter: blur(3px); }
.dialog-form { padding: 22px 24px; display: flex; flex-direction: column; gap: 13px; }
.dialog-form h2 { margin: 0; font-family: var(--serif); font-size: 20px; font-weight: 600; }
.dialog-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.dialog-form label.inline { flex-direction: row; align-items: center; gap: 9px; font-size: 13px; color: var(--text-dim); }
.dialog-form label.inline input { width: auto; accent-color: var(--accent); }
.muted { color: var(--muted); font-size: 12.5px; margin: 0; }

.catlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; }
.catlist li { display: flex; align-items: center; gap: 10px; }
.catlist .cat-color { width: 34px; height: 30px; padding: 2px; background: #0c1015; border: 1px solid var(--line); border-radius: 7px; }
.catlist .cat-name { flex: 1; }
.catlist .muted { white-space: nowrap; }
.catadd { display: flex; gap: 8px; align-items: center; padding-top: 6px; border-top: 1px solid var(--line-soft); }
.catadd input[type=text] { flex: 1; }
.catadd input[type=color] { width: 40px; padding: 2px; }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: #1d2733; border: 1px solid #33404f; color: var(--text);
  padding: 11px 18px; border-radius: 10px; font-size: 13.5px;
  box-shadow: 0 18px 40px -18px #000; z-index: 80;
}
.toast.err { border-color: #5a2f2a; background: #29191a; color: #f0b3a9; }

.foot {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
  padding: 0 28px 40px; color: #5d6878; font-size: 11.5px;
  border-top: 1px solid var(--line-soft); margin-top: 20px; padding-top: 16px;
}

/* ---------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed; top: 0; left: 0; z-index: 60;
    width: 288px; height: 100vh; max-height: none;
    background: #10141b;
    border-right: 1px solid var(--line);
    box-shadow: 26px 0 60px -30px #000;
    transform: translateX(-102%);
    transition: transform .2s ease;
  }
  .side.open { transform: none; }
  .side-close { display: inline-flex; }
  .menu { display: inline-flex; }
}

@media (max-width: 860px) {
  .topbar { padding: 12px 16px; }
  .brand h1 { font-size: 21px; }
  .brand p { display: none; }
  .search input { width: 44vw; }
  .statline, .chips, .filters, .feed, .foot { padding-left: 16px; padding-right: 16px; }
  .panel { margin-left: 16px; margin-right: 16px; }
  .formgrid { grid-template-columns: 1fr; }
  .title { font-size: 18px; }
  .card { padding: 13px 14px 11px; }
  .bulkbar { left: 10px; right: 10px; transform: none; bottom: 10px; flex-direction: column; align-items: stretch; gap: 10px; }
  .bulk-actions { justify-content: space-between; }
  .table .col-src, .table .col-date { display: none; }
  .viewswitch { margin-left: 0; }
}

/* ---------- inloggning, konto och användare ---------- */

.authpage { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.authcard {
  width: 100%; max-width: 380px; padding: 28px 26px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}
.authbrand { text-align: center; margin-bottom: 22px; }
.authbrand .mark {
  display: inline-grid; place-items: center; width: 44px; height: 44px; margin-bottom: 10px;
  border-radius: 12px; background: rgba(216, 164, 74, .12); color: var(--accent); font-size: 22px;
}
.authbrand h1 { margin: 0 0 4px; font-family: var(--serif); font-size: 22px; }
.authbrand p { margin: 0; color: var(--muted); font-size: 13px; }
.authform { display: grid; gap: 14px; }
.authform label {
  display: grid; gap: 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.authform input {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font: 14px var(--sans);
}
.authform input:focus { outline: none; border-color: var(--accent-dim); box-shadow: 0 0 0 3px rgba(216, 164, 74, .12); }
.authform .btn { padding: 11px 14px; font-size: 14px; }
.msg { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; font-size: 13px; border: 1px solid var(--line); }
.msg.err { color: #f0a196; background: #241717; border-color: #4a2b28; }
.msg.ok { color: var(--ok); background: rgba(95, 201, 164, .08); border-color: rgba(95, 201, 164, .3); }
.authfoot { margin-top: 18px; text-align: center; font-size: 12px; color: var(--muted); }
.authfoot a { color: var(--text-dim); }

.pagetop {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between;
  padding: 13px 22px; border-bottom: 1px solid var(--line); background: var(--bg-2);
}
.pagetop .brand { display: flex; align-items: center; gap: 10px; }
.pagetop .brand .mark { color: var(--accent); font-size: 18px; }
.pagetop h1 { margin: 0; font-family: var(--serif); font-size: 17px; }
.pagetop .tools { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.pagetop .tools a { color: var(--text-dim); text-decoration: none; }
.pagetop .tools a:hover { color: var(--text); }
.pagetop .tools form { margin: 0; }

.wrap { max-width: 880px; margin: 0 auto; padding: 26px 20px 70px; }
.card {
  margin-bottom: 18px; padding: 20px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.card > h2 { margin: 0 0 4px; font-family: var(--serif); font-size: 17px; }
.card > p.hint { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.inlineform { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.inlineform label { display: grid; gap: 5px; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.inlineform input[type=text], .inlineform input[type=password] {
  padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font: 13.5px var(--sans);
}
.inlineform .check { display: flex; gap: 7px; align-items: center; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--text-dim); }

.utable { width: 100%; border-collapse: collapse; font-size: 13px; }
.utable th {
  padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--line);
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.utable td { padding: 9px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.utable tr:last-child td { border-bottom: 0; }
.utable td form { display: flex; gap: 6px; align-items: center; margin: 0; flex-wrap: wrap; }
.utable input[type=password] {
  width: 140px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font-size: 13px;
}
.muted { color: var(--muted); }
.tag { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); font-size: 11px; color: var(--muted); white-space: nowrap; }
.tag.on { color: var(--ok); border-color: rgba(95, 201, 164, .35); }
.tag.off { color: var(--danger); border-color: rgba(224, 112, 95, .35); }
.tag.admin { color: var(--accent); border-color: rgba(216, 164, 74, .35); }

.userchip {
  display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 12px;
  border: 1px solid var(--line-soft); border-radius: 999px; background: rgba(255, 255, 255, .02);
}
.userchip a { color: var(--text-dim); text-decoration: none; font-size: 13px; }
.userchip a:hover { color: var(--text); }
.userchip form { margin: 0; }
.userchip .btn { padding: 5px 10px; font-size: 12.5px; }
