/* ============================================================
   Futurum – grafisk profil för Projekttidslinje
   Bygger på Futurums grafiska manual (2025):
   färger, typografi (Avenir Next LT Pro / Source Sans Pro) och vågen.
   ============================================================ */

:root {
    /* Grundfärger */
    --fu-mullvad:   #312F2E;   /* PMS 440 C – text, mörka ytor */
    --fu-orange:    #E96300;   /* Futurum Orange – används sparsamt på detaljer */

    /* Orange-skalan */
    --fu-orange-1:  #FDF8F4;   /* sidbakgrund */
    --fu-orange-2:  #F6CDA4;   /* vågor, mjuka ytor */
    --fu-orange-3:  #F19959;   /* illustrationer, accenter */

    /* Komplementfärger */
    --fu-beige-1:   #F7F3F0;
    --fu-beige-2:   #B1A99C;
    --fu-green-1:   #EEFAEE;
    --fu-green-2:   #BBE1C6;
    --fu-green-3:   #509B7E;
    --fu-green-4:   #035341;
    --fu-rosa-1:    #FFECFF;
    --fu-lila:      #D6C2D9;
    --fu-hallon:    #B7547B;
    --fu-bordeaux:  #45062B;

    /* Härledda nyanser */
    --fu-text:        var(--fu-mullvad);
    --fu-text-muted:  rgba(49, 47, 46, 0.68);
    --fu-text-faint:  rgba(49, 47, 46, 0.48);
    --fu-line:        rgba(49, 47, 46, 0.12);
    --fu-line-strong: rgba(49, 47, 46, 0.22);
    --fu-surface:     #FFFFFF;
    --fu-surface-alt: var(--fu-beige-1);
    --fu-orange-hover:#CF5800;
    --fu-focus:       rgba(233, 99, 0, 0.22);

    /* Typografi */
    --fu-font: "Avenir Next LT Pro", "Avenir Next", "Avenir", "Source Sans Pro", "Source Sans 3",
               "Segoe UI", system-ui, -apple-system, sans-serif;
    --fu-font-caps: "Source Sans Pro", "Source Sans 3", "Segoe UI", system-ui, sans-serif;

    --fu-radius:    10px;
    --fu-radius-sm: 6px;
    --fu-radius-lg: 16px;
    --fu-shadow:    0 1px 2px rgba(49, 47, 46, 0.06), 0 4px 16px rgba(49, 47, 46, 0.06);
    --fu-shadow-lg: 0 20px 60px rgba(49, 47, 46, 0.18);
}

/* Om Avenir Next LT Pro finns licensierad som webbfont: lägg woff2-filerna i
   wwwroot/fonts/ och avkommentera. Annars faller stacken tillbaka på systemtypsnitt.

@font-face { font-family: "Avenir Next LT Pro"; font-weight: 400; src: url("/fonts/AvenirNextLTPro-Regular.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Avenir Next LT Pro"; font-weight: 500; src: url("/fonts/AvenirNextLTPro-Medium.woff2")  format("woff2"); font-display: swap; }
@font-face { font-family: "Avenir Next LT Pro"; font-weight: 600; src: url("/fonts/AvenirNextLTPro-Demi.woff2")    format("woff2"); font-display: swap; }
@font-face { font-family: "Avenir Next LT Pro"; font-weight: 700; src: url("/fonts/AvenirNextLTPro-Bold.woff2")    format("woff2"); font-display: swap; }
*/

/* ---------- Bas ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--fu-font);
    font-size: 15px;
    line-height: 1.45;
    background: var(--fu-orange-1);
    color: var(--fu-text);
}

h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; color: var(--fu-text); }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }

a { color: var(--fu-green-4); }
a:hover { color: var(--fu-orange); }

code, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; }

.fu-muted { color: var(--fu-text-muted); }
.fu-overline {
    font-family: var(--fu-font-caps);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fu-text-muted);
}

/* ---------- Sidhuvud ---------- */
.topbar {
    background: var(--fu-surface);
    border-bottom: 1px solid var(--fu-line);
    padding: 0 28px;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.topbar .brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--fu-text); }
.topbar .brand-logo { height: 22px; width: auto; display: block; }
.topbar .brand-divider { width: 1px; height: 22px; background: var(--fu-line-strong); }
.topbar .brand-title { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.topbar .brand-mark {
    display: inline-block; width: 10px; height: 10px; border-radius: 50%;
    background: var(--fu-orange); margin-right: 2px;
}
.topbar nav { display: flex; align-items: center; gap: 4px; }
.topbar nav a {
    font-family: var(--fu-font-caps);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    font-weight: 600;
    color: var(--fu-text-muted);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 999px;
    transition: background .15s, color .15s;
}
.topbar nav a:hover { color: var(--fu-text); background: var(--fu-beige-1); }
.topbar nav a.active { color: var(--fu-orange); }

main { min-height: calc(100vh - 110px); }

.footer {
    text-align: center;
    padding: 20px 16px 28px;
    color: var(--fu-text-faint);
    font-size: 12.5px;
}

/* ---------- Layoutytor ---------- */
.fu-page { max-width: 1100px; margin: 0 auto; padding: 28px 24px; }
.fu-page--wide { max-width: none; }
.fu-page--narrow { max-width: 640px; }

.fu-card {
    background: var(--fu-surface);
    border-radius: var(--fu-radius);
    padding: 28px;
    box-shadow: var(--fu-shadow);
    border: 1px solid var(--fu-line);
}
.fu-card--soft { background: var(--fu-surface-alt); border-color: transparent; box-shadow: none; }

.fu-pagehead {
    display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
    margin-bottom: 24px;
}
.fu-pagehead h1 { font-size: 26px; }
.fu-pagehead .sub { color: var(--fu-text-muted); font-size: 14px; margin-top: 4px; }
.fu-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Knappar ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font-family: var(--fu-font);
    font-weight: 600; font-size: 13.5px; line-height: 1;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer; text-decoration: none;
    transition: background .15s, color .15s, border-color .15s, transform .08s, box-shadow .15s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--fu-focus); }

.btn-primary { background: var(--fu-orange); color: #fff; }
.btn-primary:hover { background: var(--fu-orange-hover); color: #fff; }

.btn-dark { background: var(--fu-mullvad); color: #fff; }
.btn-dark:hover { background: #1f1d1c; color: #fff; }

.btn-secondary { background: var(--fu-surface); color: var(--fu-text); border-color: var(--fu-line-strong); }
.btn-secondary:hover { background: var(--fu-beige-1); color: var(--fu-text); }

.btn-ghost { background: transparent; color: var(--fu-text-muted); }
.btn-ghost:hover { background: var(--fu-beige-1); color: var(--fu-text); }

.btn-green { background: var(--fu-green-4); color: #fff; }
.btn-green:hover { background: #02402F; color: #fff; }

.btn-green-soft { background: var(--fu-green-1); color: var(--fu-green-4); border-color: var(--fu-green-2); }
.btn-green-soft:hover { background: var(--fu-green-2); color: var(--fu-green-4); }

.btn-warn { background: var(--fu-orange-2); color: var(--fu-mullvad); }
.btn-warn:hover { background: #F0BC86; color: var(--fu-mullvad); }

.btn-danger { background: var(--fu-rosa-1); color: var(--fu-bordeaux); border-color: var(--fu-lila); }
.btn-danger:hover:not(:disabled) { background: var(--fu-bordeaux); color: #fff; border-color: var(--fu-bordeaux); }

.btn-danger-solid { background: var(--fu-bordeaux); color: #fff; }
.btn-danger-solid:hover { background: #33041F; color: #fff; }

.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn-sm { padding: 7px 13px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-link {
    background: none; border: none; padding: 0;
    color: var(--fu-green-4); font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: underline;
    text-underline-offset: 3px;
}
.btn-link:hover { color: var(--fu-orange); }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 11px; border-radius: 999px;
    font-family: var(--fu-font-caps);
    font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
    line-height: 1;
}
.badge-dark    { background: var(--fu-mullvad); color: #fff; }
.badge-orange  { background: var(--fu-orange);  color: #fff; }
.badge-soft    { background: var(--fu-beige-1); color: var(--fu-text); }
.badge-success { background: var(--fu-green-1); color: var(--fu-green-4); }
.badge-danger  { background: var(--fu-rosa-1);  color: var(--fu-bordeaux); }
.badge-admin   { background: var(--fu-green-4); color: #fff; }

.badge-dot::before {
    content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block;
}

/* ---------- Meddelanden ---------- */
.alert {
    padding: 12px 16px; border-radius: var(--fu-radius-sm); font-size: 13.5px; margin-bottom: 18px;
    border: 1px solid transparent;
}
.alert-info    { background: var(--fu-beige-1); color: var(--fu-text); border-left: 4px solid var(--fu-orange); }
.alert-success { background: var(--fu-green-1); color: var(--fu-green-4); border-color: var(--fu-green-2); }
.alert-error   { background: var(--fu-rosa-1);  color: var(--fu-bordeaux); border-color: var(--fu-lila); }
.alert-warn    { background: var(--fu-orange-2); color: var(--fu-mullvad); }

/* ---------- Formulär ---------- */
.fld { display: flex; flex-direction: column; }
.fld label, .fu-label {
    display: block;
    font-size: 12.5px; font-weight: 600; color: var(--fu-text); margin-bottom: 6px;
}
.fld input:not([type="checkbox"]):not([type="color"]):not([type="radio"]), .fld select, .fld textarea,
.fu-input {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--fu-line-strong);
    border-radius: var(--fu-radius-sm);
    font-size: 14px;
    font-family: var(--fu-font);
    color: var(--fu-text);
    background: var(--fu-surface);
    transition: border-color .15s, box-shadow .15s;
}
.fld textarea, textarea.fu-input { resize: vertical; }
.fld input:not([type="checkbox"]):focus, .fld select:focus, .fld textarea:focus, .fu-input:focus {
    outline: none;
    border-color: var(--fu-orange);
    box-shadow: 0 0 0 3px var(--fu-focus);
}
.fld input:disabled, .fld input[readonly], .fu-input:disabled, .fu-input[readonly] {
    background: var(--fu-beige-1); color: var(--fu-text-muted); cursor: not-allowed;
}
.fld small, .fu-hint { font-size: 12px; color: var(--fu-text-muted); margin-top: 5px; display: block; }
.fu-error { color: var(--fu-bordeaux); font-size: 12px; margin-top: 4px; }

input[type="checkbox"] { accent-color: var(--fu-orange); width: 16px; height: 16px; vertical-align: -3px; }
.fu-check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.fu-check label { margin: 0; font-weight: 500; }

/* ---------- Tabeller ---------- */
.fu-table { width: 100%; border-collapse: collapse; }
.fu-table thead th {
    font-family: var(--fu-font-caps);
    text-transform: uppercase; letter-spacing: 0.08em;
    font-size: 11.5px; font-weight: 600; color: var(--fu-text-muted);
    text-align: left; padding: 12px 12px;
    border-bottom: 2px solid var(--fu-line-strong);
    background: var(--fu-beige-1);
}
.fu-table tbody td {
    padding: 14px 12px; font-size: 14px;
    border-bottom: 1px solid var(--fu-line);
}
.fu-table tbody tr:hover { background: var(--fu-orange-1); }
.fu-table .strong { font-weight: 600; }
.fu-table .actions { display: flex; gap: 6px; white-space: nowrap; }
.text-center { text-align: center; }

/* ---------- Modal ---------- */
.fu-modal {
    display: none; position: fixed; inset: 0;
    background: rgba(49, 47, 46, .55);
    z-index: 1000; align-items: center; justify-content: center; padding: 20px;
}
.fu-modal.open { display: flex; }
.fu-modal-box {
    background: var(--fu-surface); border-radius: var(--fu-radius-lg);
    padding: 32px; max-width: 500px; width: 100%; box-shadow: var(--fu-shadow-lg);
    max-height: 92vh; overflow-y: auto;
}
.fu-modal-box h3 { font-size: 20px; margin-bottom: 22px; }

/* ---------- Vågen (dekor) ---------- */
.fu-wave-bg {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}
.fu-wave-bg::before {
    content: "";
    position: absolute; inset: 0; z-index: -1;
    background-color: var(--fu-orange-1);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 900' preserveAspectRatio='none'><path fill='%23F6CDA4' d='M0 620 C 320 560, 520 720, 860 640 S 1300 520, 1440 560 L1440 900 L0 900 Z'/></svg>");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-position: bottom;
}

/* Liten vågremsa (t.ex. ovanför tidslinjen) */
.fu-wave-strip {
    height: 14px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 14' preserveAspectRatio='none'><path fill='%23F6CDA4' d='M0 10 C 200 2, 400 14, 600 8 S 1000 0, 1200 6 L1200 14 L0 14 Z'/></svg>");
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

/* ---------- Responsivt ---------- */
@media (max-width: 720px) {
    .topbar { padding: 0 16px; }
    .topbar .brand-title { display: none; }
    .fu-page { padding: 20px 14px; }
    .fu-card { padding: 20px; }
    .fu-table .actions { flex-direction: column; }
}

/* ---------- Tillägg v2: topbar-användare, detaljruta, kontaktkort ---------- */
.topbar .topbar-user { margin-left: 10px; display: inline-flex; align-items: center; }
.topbar .topbar-logout { display: inline-flex; margin-left: 4px; }

.fu-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; }
.fu-detail .full { grid-column: 1 / -1; }
.fu-detail dt { font-family: var(--fu-font-caps); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; color: var(--fu-text-muted); margin-bottom: 3px; }
.fu-detail dd { font-size: 14.5px; margin: 0; }
.fu-contact { background: var(--fu-beige-1); border-radius: var(--fu-radius); padding: 14px 16px; }
.fu-contact .name { font-weight: 700; font-size: 15px; }
.fu-contact .role { color: var(--fu-text-muted); font-size: 13px; margin-top: 1px; }
.fu-contact .phone { margin-top: 8px; font-size: 14px; }
.fu-contact .phone a { color: var(--fu-green-4); text-decoration: none; font-weight: 600; }
.fu-contact .phone a:hover { color: var(--fu-orange); }
.fu-desc { white-space: pre-wrap; line-height: 1.55; font-size: 14.5px; }
.fu-modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.fu-modal-head h3 { margin-bottom: 4px; }
.fu-modal-close { background: none; border: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--fu-text-muted); padding: 0 4px; }
.fu-modal-close:hover { color: var(--fu-text); }
.fu-modal-box--wide { max-width: 640px; }
.fu-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; margin-right: 6px; }
.fu-fieldset { border: 1px solid var(--fu-line); border-radius: var(--fu-radius); padding: 16px 18px 18px; margin: 0; }
.fu-fieldset legend { font-family: var(--fu-font-caps); text-transform: uppercase; letter-spacing: .08em; font-size: 11.5px; font-weight: 600; color: var(--fu-text-muted); padding: 0 6px; }
.fu-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fu-grid-3 { display: grid; grid-template-columns: 2fr 1.2fr 1.4fr; gap: 14px; }
.fu-warn-text { color: var(--fu-bordeaux); font-size: 12.5px; }
.fu-switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.fu-switch input { width: 40px; height: 22px; appearance: none; background: var(--fu-beige-2); border-radius: 999px; position: relative; cursor: pointer; transition: background .15s; }
.fu-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.fu-switch input:checked { background: var(--fu-green-4); }
.fu-switch input:checked::after { transform: translateX(18px); }
@media (max-width: 720px) {
    .fu-detail, .fu-grid-2, .fu-grid-3 { grid-template-columns: 1fr; }
    .topbar .topbar-user { display: none; }
}
