:root {
  --bg: #f4f2ee; --kort: #fff; --tekst: #1f2933; --dempet: #66727f; --linje: #e2ded6;
  --mork: #16323a; --aksent: #1d5c66; --aksent2: #2f7f8a; --gronn: #2f855a; --rod: #c53030; --gul: #c98a1b; --gra: #a0aec0;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--tekst); }
h1 { font-size: 24px; margin: 0 0 16px; } h2 { font-size: 17px; margin: 0 0 12px; } h3 { font-size: 14px; margin: 0 0 6px; }
a { color: var(--aksent); }
button, input, select, textarea { font: inherit; color: inherit; }
.skall { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--mork); color: #dbe7ea; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.logo { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; font-weight: 700; font-size: 18px; color: #fff; }
.logo svg { width: 28px; height: 28px; }
.logo small { display: block; font-weight: 400; font-size: 11px; color: #9fb7bd; }
.meny { flex: 1; overflow: auto; padding: 6px 0; }
.meny a { display: flex; gap: 10px; align-items: center; padding: 10px 18px; color: inherit; text-decoration: none; border-left: 3px solid transparent; }
.meny a:hover { background: #1f434d; }
.meny a.aktiv { background: #1f434d; border-left-color: #5ec4d1; color: #fff; }
.meny .gruppe { padding: 14px 18px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #86a2a9; }
.bruker { padding: 12px 18px; border-top: 1px solid #27505b; font-size: 13px; }
.bruker b { display: block; color: #fff; font-size: 14px; }
.bruker button { background: none; border: 0; color: #9fd3db; padding: 4px 0; margin-right: 12px; cursor: pointer; text-decoration: underline; }
main { padding: 24px 28px 60px; min-width: 0; max-width: 1400px; }
.kort { background: var(--kort); border: 1px solid var(--linje); border-radius: 8px; padding: 18px; margin-bottom: 18px; }
.rad { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mellom { justify-content: space-between; }
.verktoy { margin-bottom: 16px; }
.fliser { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.flis { background: var(--kort); border: 1px solid var(--linje); border-top: 3px solid var(--aksent2); border-radius: 8px; padding: 12px 14px; }
.flis span { display: block; font-size: 13px; color: var(--dempet); } .flis b { font-size: 22px; }
.flis.rod { border-top-color: var(--rod); } .flis.gronn { border-top-color: var(--gronn); } .flis.gul { border-top-color: var(--gul); }
.to { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; } .to > .kort { margin-bottom: 0; }
.knapp { background: #fff; border: 1px solid #c9c4ba; border-radius: 6px; padding: 7px 13px; cursor: pointer; white-space: nowrap; }
.knapp:hover { background: #f1eee8; }
.knapp.pri { background: var(--aksent); border-color: var(--aksent); color: #fff; } .knapp.pri:hover { background: #17494f; }
.knapp.fare { color: var(--rod); border-color: #e3b5b5; }
.knapp.liten { padding: 3px 9px; font-size: 13px; }
input, select, textarea { border: 1px solid #c9c4ba; border-radius: 6px; padding: 7px 9px; background: #fff; max-width: 100%; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid #5ec4d1; outline-offset: 1px; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--linje); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--dempet); background: #faf8f4; white-space: nowrap; }
td.t, th.t { text-align: right; font-variant-numeric: tabular-nums; }
tfoot td { font-weight: 700; background: #faf8f4; }
.rull { overflow-x: auto; }
.merke { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #e2e8f0; color: #2d3748; white-space: nowrap; }
.merke.godkjent { background: #d6f0e0; color: #1e6641; } .merke.sokt { background: #fbeccb; color: #7a5208; } .merke.avslatt { background: #f8d7d7; color: #8b1f1f; }
.dempet { color: var(--dempet); } .liten { font-size: 13px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #cfe3e6; color: var(--mork); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
/* Vaktplan */
.plan { table-layout: fixed; min-width: 900px; }
.plan th:first-child, .plan td:first-child { width: 190px; }
.plan td { height: 64px; padding: 5px; border-left: 1px solid var(--linje); }
.plan .helg { background: #faf7f1; } .plan .idag { background: #eef7f8; } .plan th.rodt { color: var(--rod); }
.vakt { display: block; width: 100%; text-align: left; border: 0; border-radius: 5px; color: #fff; padding: 4px 7px; font-size: 12.5px; margin-bottom: 3px; cursor: default; line-height: 1.3; }
button.vakt { cursor: pointer; } .vakt b { display: block; } .vakt.frav { opacity: .92; background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255,255,255,.18) 6px 12px); }
.ny { border: 1px dashed #c9c4ba; background: none; color: var(--dempet); border-radius: 5px; width: 100%; padding: 1px; cursor: pointer; opacity: 0; }
td:hover > .ny, .ny:focus { opacity: 1; }
/* Ferieplan */
.mnd { border-collapse: separate; border-spacing: 1px; min-width: 900px; }
.mnd th, .mnd td { padding: 0; text-align: center; border: 0; font-size: 12px; height: 26px; min-width: 22px; }
.mnd td:first-child, .mnd th:first-child { text-align: left; padding: 0 8px; white-space: nowrap; background: none; }
.mnd td { background: #f1eee8; } .mnd td.fri { background: #e4dfd5; } .mnd td.sokt { opacity: .5; }
/* Hjem */
.smal { max-width: 560px; margin: 0 auto; }
.stemple { width: 100%; border: 0; border-radius: 8px; padding: 18px; font-size: 20px; font-weight: 700; color: #fff; background: var(--gronn); cursor: pointer; }
.stemple.ut { background: var(--rod); }
.stor { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dagrad { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--linje); align-items: center; }
.dagrad:last-child { border: 0; } .dagrad .d { text-align: center; line-height: 1.1; } .dagrad .d b { font-size: 18px; display: block; }
/* Diagram */
.stolper { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 8px; }
.stolper div { flex: 1; background: var(--aksent2); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.stolper div.helg { background: #b9cfd3; }
.akse { display: flex; gap: 4px; font-size: 11px; color: var(--dempet); } .akse span { flex: 1; text-align: center; overflow: hidden; }
.andel { display: flex; height: 16px; border-radius: 99px; overflow: hidden; background: #e9e5dd; margin: 8px 0; } .andel i { display: block; }
.prikk { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
/* Skjema og dialog */
dialog { border: 0; border-radius: 10px; padding: 0; width: min(480px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(22,50,58,.45); }
dialog form { padding: 20px; } dialog label, .felt { display: block; margin-bottom: 12px; font-size: 13px; font-weight: 600; }
dialog label input:not([type=checkbox]), dialog label select, dialog label textarea { display: block; width: 100%; margin-top: 4px; font-weight: 400; }
dialog label.cb { display: flex; gap: 8px; align-items: center; }
.feil { color: var(--rod); font-size: 13px; min-height: 18px; margin: 4px 0; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--mork); color: #fff; padding: 10px 18px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; }
#toast.vis { opacity: 1; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .kort { width: min(380px, 100%); } .login label { display: block; margin-bottom: 12px; font-weight: 600; font-size: 13px; }
.login input { display: block; width: 100%; margin-top: 4px; font-size: 17px; padding: 10px; }
.faner { display: flex; gap: 4px; border-bottom: 1px solid var(--linje); margin-bottom: 16px; }
.faner button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 14px; cursor: pointer; }
.faner button.aktiv { border-bottom-color: var(--aksent); font-weight: 700; }
@media (max-width: 860px) {
  .skall { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; min-width: 0; }
  .meny { display: flex; overflow-x: auto; padding: 0 8px; } .meny .gruppe { display: none; }
  .meny a { border-left: 0; border-bottom: 3px solid transparent; padding: 10px 12px; white-space: nowrap; } .meny a.aktiv { border-bottom-color: #5ec4d1; }
  .bruker { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } .bruker b { display: inline; }
  main { padding: 16px; } .to { grid-template-columns: 1fr; }
}
@media print { .side, .verktoy, .knapp { display: none !important; } .skall { display: block; } main { padding: 0; } }

.lenke { background: none; border: 0; color: var(--aksent); text-decoration: underline; cursor: pointer; padding: 0; }

/* Innlogging / stemplingsterminal */
.terminal { max-width: 1500px; margin: 0 auto; padding: 28px 40px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px 110px; align-items: start; }
.terminal header { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.tmerke { display: flex; align-items: center; gap: 16px; min-width: 0; }
.tmerke img, .tmerke svg { height: 68px; width: auto; max-width: 260px; flex: none; }
.tmerke b { display: block; font-size: 34px; letter-spacing: .04em; color: var(--mork); line-height: 1.1; }
.tmerke span { color: var(--dempet); font-size: 16px; }
#klokke { font: 600 20px ui-monospace, Consolas, monospace; color: var(--mork); }
.tfelt label { display: block; font-size: 26px; margin-bottom: 22px; }
.tfelt input { display: block; width: 100%; margin-top: 8px; font-size: 24px; padding: 10px 12px; border-radius: 4px; }
.tfelt .knapp.pri { font-size: 18px; font-weight: 700; padding: 10px 20px; }
.tfelt .lenke { font-size: 16px; }
.tast { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px 30px; max-width: 640px; }
.tast button { height: 68px; font-size: 20px; background: #fff; border: 1px solid #b9b4aa; border-radius: 4px; cursor: pointer; touch-action: manipulation; }
.tast button:hover { background: #f1eee8; } .tast button:active { background: #dfe9ea; }
.tast .ok { grid-column: span 2; }
@media (max-width: 860px) {
  .terminal { grid-template-columns: minmax(0, 1fr); padding: 18px 16px; gap: 22px; }
  .tmerke img, .tmerke svg { height: 46px; } .tmerke b { font-size: 24px; } .tmerke span { font-size: 13px; }
  .tfelt label { font-size: 19px; margin-bottom: 14px; } .tast { gap: 10px; max-width: none; } .tast button { height: 56px; }
}

/* Hjem – to kolonner: stempling til venstre, timeliste til høyre */
.hjem { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; max-width: 900px; margin: 0 auto; align-items: start; }
.hjem .kort { box-shadow: 0 1px 4px rgba(0,0,0,.08); border-radius: 4px; }
.idag { padding: 26px 30px 0; overflow: hidden; }
.idag .rad { border-bottom: 2px solid #b5b0a6; padding-bottom: 12px; } .idag h2 { font-size: 24px; margin: 0; } .idag .stor { font-size: 24px; font-weight: 400; }
.idag .midt { margin: 26px 0 18px; } .midt { text-align: center; }
.idag .felt input { display: block; width: 100%; margin-top: 4px; font-weight: 400; }
.idag .stemple { display: block; width: calc(100% + 60px); margin: 8px -30px 0; border-radius: 0; text-align: left; padding: 24px 40px; font-size: 20px; }
.idag .stemple span { display: inline-block; width: 44px; }
.lenkekort { display: flex; justify-content: space-between; align-items: center; padding: 10px 30px; text-decoration: none; color: inherit; font-size: 16px; }
.lenkekort span, .ttittel span { font-size: 26px; line-height: 1; }
.ferie { padding: 0; } .ferie .info { background: #e3f1f6; padding: 12px 30px; } .ferie .rad { padding: 14px 30px; }
.tliste { padding: 22px 22px 16px; }
.ttittel { text-decoration: none; color: inherit; border-bottom: 2px solid #b5b0a6; padding-bottom: 10px; } .ttittel h2 { font-size: 24px; margin: 0; }
.to-faner button { flex: 1; text-transform: uppercase; font-size: 13px; font-weight: 700; letter-spacing: .02em; padding: 12px 6px; } .to-faner button.aktiv { color: var(--aksent); }
.ukevelger { justify-content: center; margin-bottom: 10px; } .mndtittel { font-size: 16px; margin-bottom: 6px; }
.dag { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--linje); }
.dnr { text-align: center; font-size: 12px; line-height: 1.3; } .dnr b { display: block; font-size: 14px; } .dag.naa .dnr b { text-decoration: underline; }
.dkort { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.14); border-radius: 3px; padding: 10px 14px; } .dkort.tom { box-shadow: none; background: none; color: var(--dempet); padding: 4px 0; }
.dkort summary, .dsum { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; } .dsum { cursor: default; }
.dkort summary::-webkit-details-marker { display: none; }
.dkort summary { flex-wrap: wrap; } .dkort summary .dtekst { flex: 1 1 0; } .dkort summary .dlinje { flex: 0 0 100%; padding-top: 0; }
.pil { font-size: 20px; margin-left: 4px; transition: transform .15s; } .dkort[open] .pil { transform: rotate(180deg); }
.dikon { width: 24px; height: 24px; border-radius: 50%; flex: none; }
.dtekst { flex: 1; background: #e6f4f1; padding: 3px 8px; min-width: 0; } .dtekst b, .dtekst small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .dtekst small { text-transform: uppercase; font-size: 11px; color: var(--dempet); }
.dlinje { padding: 6px 0 0 36px; color: var(--dempet); } .dlinje b { color: var(--tekst); }
.dmer { border-top: 1px solid var(--linje); margin-top: 10px; padding: 8px 0 0 36px; font-size: 13px; } .dmer > div { padding: 2px 0; }
.ukesum { padding-top: 14px; }
@media (max-width: 860px) { .hjem { grid-template-columns: minmax(0, 1fr); } }

/* Ansattinfo-panel */
dialog form { max-height: 92vh; overflow-y: auto; }
.profilknapp { position: fixed; top: 12px; right: 16px; width: 44px; height: 44px; border: 0; cursor: pointer; background: #e39b83; color: #fff; font-size: 15px; z-index: 5; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
#panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(340px, 100vw); background: #fff; box-shadow: -4px 0 24px rgba(0,0,0,.25); z-index: 20; display: flex; flex-direction: column; }
#panel[hidden] { display: none; }
.phode { background: var(--mork); color: #fff; display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 16px; }
.phode b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .phode .avatar { background: #e39b83; color: #fff; }
.phode button { background: none; border: 0; color: #fff; font-size: 18px; cursor: pointer; padding: 4px 8px; }
.pinn { flex: 1; overflow-y: auto; padding: 8px 12px 16px; } .pinn h3 { margin: 12px 0 4px; font-size: 14px; }
.pboks { border: 1px solid var(--linje); border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 6px; }
.pboks summary { padding: 8px 12px; cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--linje); } .pboks > div { padding: 8px; }
.plinje, .plenke { display: flex; justify-content: space-between; gap: 10px; background: #f1f3f5; border-radius: 3px; padding: 6px 10px; margin-bottom: 4px; font-size: 13px; }
.plinje span { text-align: right; } .plenke { color: var(--aksent); font-weight: 600; text-decoration: underline; border: 0; width: 100%; cursor: pointer; text-align: left; }
.plenke.parorende { background: #fdf0e2; color: #c9741a; }
.pstatus { border: 1px solid var(--linje); border-radius: 4px; padding: 8px 12px; font-size: 13px; color: var(--dempet); margin-bottom: 6px; } .pstatus.inne { color: #fff; background: var(--gronn); border-color: var(--gronn); }
.pvakt { color: #fff; border-radius: 4px; padding: 6px 10px; font-size: 12.5px; display: flex; gap: 4px; margin-bottom: 4px; } .pvakt span { margin-left: auto; font-weight: 700; white-space: nowrap; }
.pbunn { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--linje); }
.pbunn a, .pbunn button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 14px 2px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; text-align: center; color: var(--tekst); text-decoration: none; cursor: pointer; }
.pbunn .aktiv { border-bottom-color: var(--aksent); color: var(--aksent); }
@media (max-width: 860px) { .profilknapp { top: 10px; right: 10px; } }
@media print { .profilknapp, #panel { display: none !important; } }
