* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f7fb;
    color: #1f2937;
}

a {
    color: inherit;
}

.site-header {
    background: linear-gradient(135deg, #0b3c5d, #145a7a);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.topbar {
    padding: 16px 20px 12px;
}

.topbar-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.brand-link {
    text-decoration: none;
    color: inherit;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.logo {
    height: 86px;
    width: auto;
    border-radius: 10px;
    padding: 4px;
}

.brand-text {
    margin-top: 10px;
}

.brand-name {
    font-size: 1.4rem;
    font-weight: bold;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.95rem;
    opacity: 0.95;
    margin-top: 4px;
}

.menu-toggle {
    display: none;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 10px;
    background: rgba(255,255,255,0.10);
    color: #fff;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.menu-toggle:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.42);
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 999px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px 16px;
    flex-wrap: wrap;
}

.nav a {
    text-decoration: none;
    color: #fff;
    background: rgba(255,255,255,0.12);
    padding: 10px 14px;
    border-radius: 8px;
    transition: 0.2s ease;
    font-weight: 600;
}

.nav a:hover,
.nav a.aktiv {
    background: rgba(255,255,255,0.26);
}

.nav-spacer {
    flex: 1 1 auto;
}

.nav-user-dropdown {
    position: relative;
}

.nav-user-button {
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.nav-user-button:hover,
.nav-user-dropdown.open .nav-user-button {
    background: rgba(255,255,255,0.26);
}

.nav-user-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 220px;
    background: #fff;
    color: #1f2937;
    border-radius: 12px;
    border: 1px solid #dbe7f1;
    box-shadow: 0 10px 24px rgba(15, 47, 68, 0.16);
    overflow: hidden;
    z-index: 50;
}

.nav-user-dropdown.open .nav-user-menu {
    display: block;
}

.nav-user-meta {
    padding: 14px 16px 10px;
    border-bottom: 1px solid #e5edf5;
}

.nav-user-meta strong {
    display: block;
    color: #0f2f44;
}

.nav-user-meta small {
    display: block;
    margin-top: 4px;
    color: #64748b;
}

.nav-user-menu a.nav-user-logout {
    display: block;
    padding: 12px 16px;
    background: #fff;
    color: #0f2f44;
    border-radius: 0;
    font-weight: 600;
}

.nav-user-menu a.nav-user-logout:hover {
    background: #f8fafc;
}

.nav-mobile-user {
    display: none;
}

.nav-mobile-user-box {
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 12px;
    padding: 14px;
    margin-top: 8px;
}

.nav-mobile-user-title {
    font-size: 0.85rem;
    opacity: 0.85;
    margin-bottom: 4px;
}

.nav-mobile-user-name {
    font-size: 1rem;
    font-weight: 700;
}

.nav-mobile-user-role {
    margin-top: 4px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.nav-mobile-logout {
    margin-top: 12px;
    width: 100%;
}

@media (max-width: 700px) {
    .topbar {
        padding-bottom: 14px;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .logo {
        height: 72px;
    }

    .brand-text {
        margin-top: 12px;
    }

    .brand-name {
        font-size: 1.15rem;
    }

    .brand-subtitle {
        font-size: 0.92rem;
    }

    .nav {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 0 20px 16px;
    }

    .nav.open {
        display: flex;
    }

    .nav a {
        width: 100%;
    }

    .nav-spacer,
    .nav-user-dropdown {
        display: none;
    }

    .nav-mobile-user {
        display: block;
        width: 100%;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.footer {
    text-align: center;
    padding: 20px;
    color: #64748b;
    font-size: 0.95rem;
}

h1, h2, h3 {
    color: #0f2f44;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.card {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 6px 18px rgba(15, 47, 68, 0.08);
    border: 1px solid #e5edf5;
}

.card h3 {
    margin-top: 0;
}

.card p {
    color: #475569;
}

.card-actions {
    margin-top: 14px;
}

.knapp,
button,
input[type=submit],
input[type=button] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.05s ease;
    white-space: nowrap;
}

.knapp:active,
button:active,
input[type=submit]:active,
input[type=button]:active {
    transform: translateY(1px);
}

.knapp-primary,
button,
input[type=submit] {
    background: #0b6ea8;
    color: #fff;
    border-color: #0b6ea8;
}

.knapp-primary:hover,
button:hover,
input[type=submit]:hover {
    background: #095885;
    border-color: #095885;
}

.knapp-rediger {
    background: #eaf3f8;
    color: #0b3c5d;
    border-color: #c7dbe7;
}

.knapp-rediger:hover {
    background: #d8ebf5;
    border-color: #a9c8d8;
}

.knapp-light {
    background: #ffffff;
    color: #334155;
    border-color: #cbd5e1;
}

.knapp-light:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.knapp-slett {
    background: #c0392b;
    color: #fff;
    border-color: #c0392b;
}

.knapp-slett:hover {
    background: #992d22;
    border-color: #992d22;
}

input[type=submit].knapp-slett,
.knapp.knapp-slett {
    background: #c0392b;
    color: #fff;
    border-color: #c0392b;
}

input[type=submit].knapp-slett:hover,
.knapp.knapp-slett:hover {
    background: #992d22;
    border-color: #992d22;
}
.handlingar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: stretch;
}

.handlingar a,
.handlingar form {
    margin: 0;
}

.handlingar form {
    display: flex;
}

.handlingar .knapp,
.handlingar input[type=submit] {
    min-width: 90px;
}

.full-width {
    width: 100%;
}

form {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-top: 10px;
    margin-bottom: 4px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(15, 47, 68, 0.08);
}

th, td {
    border-bottom: 1px solid #e5edf5;
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

th {
    background: #eaf3f8;
    color: #0f2f44;
}

tr:last-child td {
    border-bottom: none;
}

.melding {
    background: #ecfdf3;
    color: #166534;
    border: 1px solid #bbf7d0;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.feil {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.handlingar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #0b3c5d, #145a7a);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-wrap {
    width: 100%;
    max-width: 420px;
}

.login-box {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}

.login-logo-wrap {
    text-align: center;
    margin-bottom: 10px;
}

.login-logo {
    height: 70px;
    width: auto;
}

.dashboard-hero {
    background: linear-gradient(135deg, #dff3ff, #f8fcff);
    border: 1px solid #d7ebf6;
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 22px;
}

.dashboard-hero h1 {
    margin-top: 0;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin: 20px 0;
}

.status-box {
    background: #fff;
    border: 1px solid #e5edf5;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 6px 18px rgba(15, 47, 68, 0.05);
}

.status-box .label {
    color: #64748b;
    font-size: 0.9rem;
}

.status-box .value {
    font-size: 1.7rem;
    font-weight: bold;
    margin-top: 6px;
    color: #0f2f44;
}

@media (max-width: 700px) {
    .topbar {
        align-items: flex-start;
    }

    .brukerfelt {
        width: 100%;
        justify-content: space-between;
    }

    .nav {
        flex-direction: column;
    }

    .nav a {
        width: 100%;
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead {
        display: none;
    }

    tr {
        margin-bottom: 14px;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 4px 14px rgba(15, 47, 68, 0.08);
        overflow: hidden;
    }

    td {
        border: none;
        border-bottom: 1px solid #eef2f7;
        position: relative;
        padding-left: 46%;
        min-height: 44px;
    }

    td:last-child {
        border-bottom: none;
    }

    td::before {
        content: attr(data-label);
        position: absolute;
        left: 12px;
        top: 10px;
        width: 40%;
        font-weight: bold;
        color: #334155;
    }
}

/* Autocomplete */

.autocomplete-field {
    position: relative;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-top: none;
    z-index: 1000;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 6px 18px rgba(15, 47, 68, 0.08);
    display: none;
}

.autocomplete-suggestion {
    padding: 8px 10px;
    cursor: pointer;
}

.autocomplete-suggestion:hover {
    background: #eef6fb;
}

/* Inline checkbox / radio */

.inline-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
}

.inline-check input[type="radio"],
.inline-check input[type="checkbox"] {
    width: auto;
    margin: 0;
}

details summary {
    cursor: pointer;
    font-weight: 600;
    color: #0b6ea8;
}

.detaljboks {
    margin-top: 10px;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.detaljboks p {
    margin: 8px 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-gronn {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.status-gul {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.status-raud {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.status-prikk {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: 0 0 10px;
}

.status-prikk.status-gronn {
    background: #22c55e;
    border: none;
}

.status-prikk.status-gul {
    background: #f59e0b;
    border: none;
}

.status-prikk.status-raud {
    background: #ef4444;
    border: none;
}

.delstatus-liste {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 8px 0 12px;
}

.delstatus-rad {
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge {
    background: #eef2ff;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.8em;
    margin-left: 5px;
}

/* =========================
   AUTOCOMPLETE
========================= */
.autocomplete-field {
    position: relative;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-top: none;
    z-index: 1000;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 6px 18px rgba(15, 47, 68, 0.08);
    display: none;
}

.autocomplete-suggestion {
    padding: 8px 10px;
    cursor: pointer;
}

.autocomplete-suggestion:hover {
    background: #eef6fb;
}

/* =========================
   FORM / UI
========================= */

.inline-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
}

.inline-check input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.valrad {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin: 8px 0 14px;
}

.fartoy-rad {
    border-bottom: 1px solid #e5edf5;
    padding: 10px 0;
}

.fartoy-rad:last-child {
    border-bottom: none;
}

.heimehavn-valg {
    margin-left: 28px;
    margin-top: 8px;
}

.heimehavn-valg select {
    max-width: 360px;
}

details summary {
    cursor: pointer;
    font-weight: 600;
}

.detaljboks {
    margin-top: 10px;
}

.detaljboks p {
    margin: 8px 0;
}

/* =========================
   MOBILTILPASSING
========================= */

@media (max-width: 700px) {
    .valrad {
        flex-direction: column;
        gap: 6px;
    }

    .heimehavn-valg {
        margin-left: 0;
    }
}

/* =========================
   DASHBOARD
========================= */

.foresporsel-hero {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.foresporsel-overline {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #0b6ea8;
    margin-bottom: 8px;
}

.foresporsel-highlight {
    min-width: 260px;
    background: #ffffff;
    border: 1px solid #d7ebf6;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 10px 24px rgba(15, 47, 68, 0.10);
}

.foresporsel-highlight .label {
    color: #64748b;
    font-size: 0.95rem;
}

.foresporsel-highlight .value {
    font-size: 3rem;
    line-height: 1;
    font-weight: 800;
    color: #0f2f44;
    margin: 10px 0 14px;
}

.foresporsel-highlight.has-alert {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fff7e6, #ffffff);
}

.status-box-priority {
    border: 2px solid #f59e0b;
    background: linear-gradient(135deg, #fffaf0, #ffffff);
}

.status-box-priority .value {
    font-size: 2.4rem;
}

.card-priority {
    border: 2px solid #d7ebf6;
    box-shadow: 0 10px 24px rgba(11, 110, 168, 0.10);
}

@media (max-width: 700px) {
    .foresporsel-highlight {
        width: 100%;
    }
}


