/* ============ Inställningar ============ */

.setting-intro { font-size: 13.5px; margin-bottom: var(--s4); max-width: 640px; }

/* Läsårslista */
.year-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: var(--s5); }
.year-row {
  display: flex; align-items: center; gap: var(--s4);
  padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--card);
}
.year-row.active { border-color: var(--cyan); background: var(--cyan-050); }
.year-label { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.year-name { font-size: 15px; font-weight: 700; }
.year-count { font-size: 12.5px; white-space: nowrap; }
.year-actions { flex: none; }
.year-row .badge .icon { --i: 12px; }

.year-create {
  display: flex; align-items: flex-end; gap: var(--s3);
  padding-top: var(--s4); border-top: 1px solid var(--line); flex-wrap: wrap;
}
.hint-inline { font-size: 12.5px; max-width: 320px; }

/* Importhistorik */
.settings-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.settings-table th {
  text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.settings-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); }
.settings-table tbody tr:last-child td { border-bottom: 0; }
.settings-table tbody tr:hover { background: var(--cyan-050); }
.settings-table .num { text-align: right; white-space: nowrap; }
.settings-table th.num { text-align: right; }

/* Lösenord */
.pw-form { display: flex; flex-direction: column; gap: var(--s3); max-width: 340px; }
.pw-form .btn { align-self: flex-start; margin-top: 4px; }
.hello-recovery {
  max-width: 640px; margin-top: var(--s5); padding-top: var(--s5);
  border-top: 1px solid var(--line);
}
.hello-recovery-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: var(--s3);
}
.hello-recovery-head h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.hello-recovery-head h3 .icon { color: var(--cyan-deep); }
.hello-recovery-head .badge { margin-left: auto; }
.hello-confirm-hint { font-size: 12.5px; margin-top: calc(-1 * var(--s2)); }

/* Statistik & system */
.sys-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4);
}
@media (max-width: 900px) { .sys-grid { grid-template-columns: 1fr; } }
.sys-title { display: flex; align-items: center; gap: 8px; margin-bottom: var(--s3); font-size: 15px; }
.sys-title .icon { color: var(--cyan-deep); }
.sys-rows { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; margin-bottom: var(--s4); }
.sys-row { display: flex; align-items: center; gap: 8px; }
.sys-row .icon { --i: 14px; color: var(--muted); }
.sys-warning {
  display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px;
  background: var(--warn-100); border-radius: var(--r-sm); padding: 10px 12px;
}
.sys-warning .icon { --i: 14px; margin-top: 2px; color: #9A6A12; flex: none; }

/* Allmänt */
.general-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
@media (max-width: 900px) { .general-grid { grid-template-columns: 1fr; } }
.switch-list { display: flex; flex-direction: column; gap: var(--s3); }
.switch-row { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch { position: relative; flex: none; width: 40px; height: 22px; margin-top: 1px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute; inset: 0; border-radius: var(--r-full); background: #CFE2EA;
  transition: background var(--t-fast);
}
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform var(--t-fast);
}
.switch input:checked + .switch-track { background: var(--cyan); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--cyan-deep); outline-offset: 2px; }
.switch-text { display: flex; flex-direction: column; gap: 2px; }
.switch-label { font-size: 13.5px; font-weight: 600; }
.switch-hint { font-size: 12.5px; }

/* ============ Manual ============ */
.manual-layout { display: grid; grid-template-columns: 240px 1fr; gap: var(--s4); align-items: start; }
@media (max-width: 900px) { .manual-layout { grid-template-columns: 1fr; } .manual-toc { position: static; } }
.manual-toc { position: sticky; top: var(--s4); }
.manual-toc-title {
  display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.manual-toc nav { display: flex; flex-direction: column; gap: 2px; }
.manual-toc a {
  display: block; padding: 5px 8px; border-radius: var(--r-sm); font-size: 13px;
  color: inherit; text-decoration: none;
}
.manual-toc a:hover, .manual-toc a.active { background: var(--cyan-050); color: var(--cyan-deep); }
.manual-toc a.toc-l1 { font-weight: 700; }
.manual-toc a.toc-l3 { padding-left: 20px; font-size: 12.5px; }
.manual-prose { max-width: 820px; font-size: 14.5px; line-height: 1.6; }
.manual-prose h1 { font-size: 26px; margin: 0 0 var(--s4); }
.manual-prose h2 { font-size: 19px; margin: var(--s6) 0 var(--s3); padding-top: var(--s4); border-top: 1px solid var(--line); }
.manual-prose h3 { font-size: 15.5px; margin: var(--s5) 0 var(--s2); }
.manual-prose p { margin: 0 0 var(--s3); }
.manual-prose ul, .manual-prose ol { margin: 0 0 var(--s3); padding-left: 24px; }
.manual-prose li { margin-bottom: 4px; }
.manual-prose code {
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px;
  background: var(--cyan-050); padding: 1px 5px; border-radius: 4px;
}
.manual-prose pre {
  background: #12242C; color: #E8F4F8; padding: 12px 14px; border-radius: var(--r-md);
  overflow-x: auto; margin: 0 0 var(--s3); font-size: 12.5px; line-height: 1.5;
}
.manual-prose pre code { background: transparent; color: inherit; padding: 0; }
.manual-prose blockquote {
  margin: 0 0 var(--s3); padding: 8px 14px; border-left: 3px solid var(--cyan);
  background: var(--cyan-050); border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.manual-prose a { color: var(--cyan-deep); }
.manual-table-wrap { overflow-x: auto; margin: 0 0 var(--s3); }
.manual-prose table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.manual-prose th, .manual-prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.manual-prose th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
