:root {
  --bg: #f6f3ee;
  --card: #ffffff;
  --ink: #1f1c18;
  --muted: #6f675d;
  --line: #e4ddd2;
  --accent: #b5541c;
  --done: #2f7d4f;
  --done-bg: #e3f2e8;
  --wip: #b07a10;
  --wip-bg: #fbf0d6;
  --todo-bg: #f1eee9;
  --danger: #b3261e;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171513; --card: #221f1c; --ink: #eee8df; --muted: #a39a8e; --line: #36312b;
    --accent: #e0814a; --done: #6cc28f; --done-bg: #1f3427; --wip: #e2b04a; --wip-bg: #3a3019; --todo-bg: #2b2723;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-bottom: 60px; }

.top { background: var(--card); border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; }
.top nav { display: flex; gap: 16px; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--ink); }

h1 { font-size: 1.6rem; margin: 0 0 12px; }
h2 { font-size: 1.2rem; margin: 0 0 8px; }
h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
.muted { color: var(--muted); }
.small, small { font-size: .85rem; }
.error { color: var(--danger); font-weight: 600; }
.notice { background: var(--wip-bg); border: 1px solid var(--wip); padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 16px 0; }
.card.narrow { max-width: 420px; margin: 40px auto; }
.card.note { border-left: 4px solid var(--accent); }
details.card summary { cursor: pointer; font-weight: 600; }
details.card[open] summary { margin-bottom: 12px; }

label { display: block; margin: 10px 0; font-weight: 600; font-size: .9rem; }
label input, label textarea { display: block; width: 100%; margin-top: 4px; font-weight: 400; }
label.check { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; }
label.check input { width: auto; margin: 0; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input.num { width: 70px; }

.btn { font: inherit; font-weight: 600; background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px; cursor: pointer; text-decoration: none; display: inline-block; white-space: nowrap; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--line); }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.row { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.row > input { flex: 1; }
.wrap-row { flex-wrap: wrap; }
.wrap-row > input { flex: 1 1 160px; }
form.inline { display: inline-block; margin: 4px 8px 0 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

.toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.filters { display: flex; gap: 12px; align-items: center; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .8rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
table.students { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.students td a { font-weight: 600; text-decoration: none; }
table.students tr.inactive { opacity: .5; }
td.mini { min-width: 110px; }
td.mini .bar { margin: 0 0 2px; }
table.edit td { padding: 4px; }
table.edit input:not(.num), table.edit select { width: 100%; }
td.actions { white-space: nowrap; }
td.actions form.inline { margin: 0; }

.bar { height: 10px; background: var(--todo-bg); border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.bar span { display: block; height: 100%; background: var(--done); border-radius: 99px; transition: width .25s; }
.bar.small { height: 6px; }
.bar.big { height: 14px; }

.milestone { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 16px 0; }
.ms-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ms-head h2 { margin: 0; }
.ms-count { color: var(--muted); font-size: .9rem; white-space: nowrap; }
ul.skills { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; }

.skill { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit; color: var(--ink);
  padding: 10px 12px; border-radius: 8px; border: 1px solid transparent; background: var(--todo-bg); }
button.skill { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button.skill:hover { border-color: var(--line); }
button.skill:active { transform: scale(.98); }
.skill .name { flex: 1; line-height: 1.3; }
.skill .name small { display: block; color: var(--muted); }
.skill .lbl { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.skill .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--muted); flex: none; position: relative; }
.skill.st1 { background: var(--wip-bg); }
.skill.st1 .dot { border-color: var(--wip); background: linear-gradient(90deg, var(--wip) 50%, transparent 50%); }
.skill.st1 .lbl { color: var(--wip); }
.skill.st2 { background: var(--done-bg); }
.skill.st2 .dot { border-color: var(--done); background: var(--done); }
.skill.st2 .dot::after { content: ""; position: absolute; left: 4px; top: 0px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.skill.st2 .lbl { color: var(--done); font-weight: 600; }

.chip { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: .8rem; }
.chip.st0 { background: var(--todo-bg); }
.chip.st1 { background: var(--wip-bg); color: var(--wip); }
.chip.st2 { background: var(--done-bg); color: var(--done); }
.legend { margin: 16px 0 0; }

.linkbox input { font-family: ui-monospace, monospace; font-size: .85rem; }
.hero { padding: 8px 0 4px; }
.hero h1 { font-size: 2rem; }
ul.next { margin: 0; padding-left: 20px; }
ul.next li { margin: 4px 0; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) {
  .grid2 { grid-template-columns: 1fr; }
  .linkbox .row { flex-wrap: wrap; }
  .linkbox .row input { flex-basis: 100%; }
  table.edit thead { display: none; }
  table.edit tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  table.edit td { border: 0; }
}

/* ---- Hópar, prófíll, tímar ---- */
.nowrap { white-space: nowrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 8px 0 12px; }
.tabs a { padding: 8px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--ink); border-color: var(--accent); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.chip-link { padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-size: .88rem; }
.chip-link.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-link.add { color: var(--muted); border-style: dashed; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--todo-bg); color: var(--muted); font-size: .78rem; font-weight: 500; text-decoration: none; margin: 1px 0; vertical-align: middle; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin: 6px 0; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 12px 0; padding: 8px 12px 10px; }
legend { font-weight: 600; font-size: .9rem; padding: 0 4px; }
.group-row > input:first-of-type { flex: 1; }

.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; background: var(--todo-bg); display: inline-flex; align-items: center; justify-content: center; }
.avatar.sm { width: 32px; height: 32px; font-size: .75rem; }
.avatar.lg { width: 96px; height: 96px; font-size: 1.8rem; }
.avatar.initials { color: var(--accent); font-weight: 700; border: 1px solid var(--line); }
a.who { display: inline-flex; align-items: center; gap: 10px; }

.profile { display: flex; gap: 20px; align-items: flex-start; }
.profile h1 { margin-bottom: 4px; }
.profile-body { flex: 1; min-width: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
dl.contact { display: flex; flex-wrap: wrap; gap: 4px 28px; margin: 8px 0; }
dl.contact dt { font-size: .75rem; color: var(--muted); }
dl.contact dd { margin: 0; }

.section-title { margin-top: 28px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid2 label, .grid3 label { margin: 4px 0; }
label.date { max-width: 200px; }
.lesson-new { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 8px; }
.lessons .lesson { padding: 14px 0; border-bottom: 1px solid var(--line); }
.lessons .lesson:last-child { border-bottom: 0; }
.lesson-head { margin-bottom: 6px; }
.lbl-sm { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 2px; }
.edit-lesson { margin-top: 6px; }
.edit-lesson summary { cursor: pointer; color: var(--accent); }
.edit-lesson form { margin-top: 8px; }
details.older > summary { cursor: pointer; color: var(--accent); padding: 10px 0; }
.card.homework { border-left: 4px solid var(--wip); }
.hero .avatar.lg { margin-bottom: 8px; }

@media (max-width: 720px) {
  .grid3 { grid-template-columns: 1fr; }
  .profile { flex-direction: column; align-items: center; text-align: center; }
  .tags, dl.contact { justify-content: center; }
  .group-row { flex-wrap: wrap; }
}

/* ---- Er að vinna í, dagsetningar, mæting ---- */
.skill .meta { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.skill .when { font-size: .7rem; color: var(--done); opacity: .8; white-space: nowrap; }
.skill .when:empty { display: none; }

.wipbox { border-left: 4px solid var(--wip); }
.wip-list { list-style: none; margin: 4px 0 0; padding: 0; }
.wip-list li { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.wip-list li:last-child { border-bottom: 0; }
.wip-list li > div { flex: 1; min-width: 0; }
.wip-list strong { display: block; font-weight: 600; }
.wip-list small { display: block; }
.btn.ok { background: var(--done); }
.learned-list { list-style: none; margin: 0; padding: 0; }
.learned-list li { padding: 5px 0; }
.learned-list .check { color: var(--done); font-weight: 700; }

.lesson-top { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: flex-end; }
.lesson-top label.date { margin: 4px 0; }
.att-pick { border: 0; padding: 0; margin: 4px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.att-pick legend { padding: 0; margin-bottom: 4px; font-size: .9rem; }
.att-opt { margin: 0; font-weight: 500; font-size: .85rem; cursor: pointer; }
.att-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.att-opt span { display: inline-block; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); }
.att-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.att-opt.att1 input:checked + span { background: var(--done-bg); border-color: var(--done); color: var(--done); }
.att-opt.att2 input:checked + span { background: var(--wip-bg); border-color: var(--wip); color: var(--wip); }
.att-opt.att3 input:checked + span { background: #fbe4e2; border-color: var(--danger); color: var(--danger); }
.att-opt.att4 input:checked + span { background: var(--todo-bg); border-color: var(--muted); color: var(--ink); }
@media (prefers-color-scheme: dark) { .att-opt.att3 input:checked + span, .att-badge.att3 { background: #3d1f1d; } }

.att-badge { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 99px; font-size: .75rem; font-weight: 600; vertical-align: middle; }
.att-badge.att1 { background: var(--done-bg); color: var(--done); }
.att-badge.att2 { background: var(--wip-bg); color: var(--wip); }
.att-badge.att3 { background: #fbe4e2; color: var(--danger); }
.att-badge.att4 { background: var(--todo-bg); color: var(--muted); }
.att-summary { font-size: .9rem; }
td.warn, .warn { color: var(--danger); }

.filters-att label { margin: 0; }
.filters-att label select, .filters-att label input { display: block; margin-top: 4px; font-weight: 400; }
.filters-att .quick { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.num-c { text-align: center; }
.att-table tfoot th { color: var(--ink); border-bottom: 0; }
.print-title { display: none; }
@media print {
  .top, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .print-title { display: block; }
  table.students { border: 0; }
  a { color: #000; text-decoration: none; }
}

/* ---- Viska vörumerki ---- */
.brand { font-size: 1.25rem; letter-spacing: -.01em; display: inline-flex; align-items: baseline; gap: 10px; }
.brand .tagline { font-size: .8rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
@media (max-width: 520px) { .brand .tagline { display: none; } .top-inner { padding-top: 8px; padding-bottom: 8px; } .top nav { gap: 4px 11px; font-size: .84rem; flex-wrap: wrap; } }
