/* =========================================================
   MFA Mierlo webapp
   Centrale stylesheet
   ========================================================= */

:root {
    color-scheme: light dark;

    --bg: #f4f5f7;
    --surface: #ffffff;
    --surface-subtle: #f4f4f5;
    --surface-strong: #eef2f7;

    --text: #1f2937;
    --text-muted: #6b7280;
    --text-faint: #9ca3af;

    --border: #e5e7eb;
    --border-strong: #d4d4d8;

    --button: #1f2937;
    --button-text: #ffffff;

    --success-bg: #dcfce7;
    --success-text: #166534;

    --danger-bg: #fee2e2;
    --danger-text: #991b1b;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 14px;

    --page-small: 680px;
    --page-medium: 760px;
    --page-wide: 900px;

    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111827;
        --surface: #1f2937;
        --surface-subtle: #27272a;
        --surface-strong: #374151;

        --text: #f3f4f6;
        --text-muted: #9ca3af;
        --text-faint: #9ca3af;

        --border: #374151;
        --border-strong: #52525b;

        --button: #f3f4f6;
        --button-text: #111827;

        --success-bg: #14532d;
        --success-text: #dcfce7;

        --danger-bg: #7f1d1d;
        --danger-text: #fee2e2;
    }
}


/* =========================================================
   Basis
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
}

a {
    color: inherit;
}

h1 {
    margin: 0;
    font-size: 1.7rem;
}

h2 {
    margin: 0 0 12px;
    font-size: 1rem;
}


/* =========================================================
   Algemene pagina-opbouw
   ========================================================= */

main {
    width: 100%;
    max-width: var(--page-wide);
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.top-actions,
.user-actions,
.actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.top-actions,
.user-actions {
    justify-content: flex-end;
}


/* =========================================================
   Header
   ========================================================= */

header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 18px 20px;
}

header h1 {
    margin: 0;
    font-size: 22px;
}

header p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 14px;
}

header a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
}


/* =========================================================
   Kaarten / oppervlakken
   ========================================================= */

.card,
.user,
.voicemail,
form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.card {
    padding: 22px;
    margin-bottom: 14px;
}

.user {
    padding: 16px;
    margin-bottom: 12px;
}

.voicemail {
    padding: 18px;
    margin-bottom: 14px;
}

form {
    padding: 20px;
}


/* =========================================================
   Knoppen en links
   ========================================================= */

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9px;
    padding: 10px 14px;
    background: var(--button);
    color: var(--button-text);
    font: inherit;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
}

.button:hover,
button:hover {
    opacity: .88;
}

.edit-link {
    font-size: .9rem;
    text-decoration: none;
}

.edit-link:hover {
    text-decoration: underline;
}


/* =========================================================
   Formulieren
   ========================================================= */

label.field {
    display: block;
    margin-bottom: 18px;
    font-weight: 600;
}

input[type="text"],
input[type="email"] {
    display: block;
    width: 100%;
    margin-top: 7px;
    padding: 11px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
}

input:focus {
    outline: 2px solid var(--text-muted);
    outline-offset: 2px;
}

fieldset {
    border: 0;
    padding: 0;
    margin: 4px 0 22px;
}

legend {
    font-weight: 700;
    margin-bottom: 10px;
}

.option,
.role {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
}

.info {
    margin: 0 0 20px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-subtle);
}

.error {
    margin-bottom: 18px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    background: var(--danger-bg);
    color: var(--danger-text);
}


/* =========================================================
   Badges
   ========================================================= */

.badge,
.status {
    display: inline-block;
    border-radius: 999px;
    background: var(--surface-strong);
    font-size: .82rem;
}

.badge {
    padding: 4px 9px;
}

.status {
    padding: 5px 9px;
    white-space: nowrap;
}

.active {
    background: var(--success-bg);
    color: var(--success-text);
}

.inactive {
    background: var(--danger-bg);
    color: var(--danger-text);
}


/* =========================================================
   Gebruikersbeheer
   ========================================================= */

.user-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.name {
    font-weight: 700;
    font-size: 1.05rem;
}

.email {
    margin-top: 4px;
    color: var(--text-muted);
}

.meta {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--text-faint);
    font-size: 12px;
}


/* =========================================================
   Voicemail inbox
   ========================================================= */

.topline {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.subject {
    font-size: 18px;
    font-weight: 650;
    margin: 0;
}

.caller {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 5px;
}

.summary {
    margin: 14px 0;
    line-height: 1.5;
}

.deadline {
    font-size: 14px;
    font-weight: 600;
}


/* =========================================================
   Voicemail detail
   ========================================================= */

.field {
    margin-bottom: 16px;
}

.field:last-child {
    margin-bottom: 0;
}

.label {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 3px;
}

.value {
    line-height: 1.5;
}

.transcript {
    white-space: pre-wrap;
    line-height: 1.6;
}


/* =========================================================
   Login
   ========================================================= */

body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
}

.login-card h1 {
    margin: 0 0 6px;
    font-size: 24px;
}

.login-card .intro {
    margin: 0 0 24px;
    color: var(--text-muted);
    line-height: 1.5;
}

.login-card label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 600;
}

.login-card input {
    width: 100%;
    margin-top: 0;
    padding: 12px;
}

.login-card button {
    width: 100%;
    margin-top: 14px;
    padding: 12px;
}

.note {
    margin: 18px 0 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
}

.message {
    margin-bottom: 20px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-subtle);
    line-height: 1.4;
}


/* =========================================================
   Pagina-specifieke breedtes
   ========================================================= */

body.page-form main {
    max-width: var(--page-small);
}

body.page-detail main {
    max-width: var(--page-medium);
}



/* =========================================================
   App shell
   ========================================================= */

.app-page {
    min-height: calc(100vh - 132px);
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 0;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.app-header-inner {
    width: 100%;
    max-width: var(--page-wide);
    min-height: 64px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 28px;
}

.app-brand {
    flex: 0 0 auto;
    color: var(--text);
    font-weight: 750;
    text-decoration: none;
    letter-spacing: -.015em;
}

.desktop-nav {
    display: flex;
    align-items: stretch;
    gap: 4px;
    min-width: 0;
    margin-left: auto;
}

.desktop-nav a,
.desktop-nav .nav-future {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 64px;
    padding: 0 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.desktop-nav a:hover {
    color: var(--text);
}

.desktop-nav a.active-nav {
    color: var(--text);
}

.desktop-nav a.active-nav::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: -1px;
    height: 2px;
    background: var(--text);
    border-radius: 2px 2px 0 0;
}

.nav-future,
.drawer-future,
.footer-future {
    opacity: .45;
    cursor: default;
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 0;
    margin-left: auto;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    font-size: 22px;
    font-weight: 400;
}

.menu-toggle:hover,
.drawer-close:hover {
    opacity: 1;
    background: var(--surface-subtle);
}

.page-heading {
    margin-bottom: 24px;
}

.page-heading h1 {
    margin-top: 0;
}

.page-heading p {
    margin: 6px 0 0;
    color: var(--text-muted);
}

.page-heading-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.back-link {
    display: inline-block;
    margin-bottom: 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
}

.back-link:hover {
    color: var(--text);
}

.clickable-card {
    cursor: pointer;
}

.clickable-card:hover {
    border-color: var(--border-strong);
}

.inline-action-form {
    margin-top: 12px;
    padding: 0;
    border: 0;
    background: transparent;
}

.claimed-by {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 14px;
}


/* Footer */

.app-footer {
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
}

.app-footer-inner {
    width: 100%;
    max-width: var(--page-wide);
    min-height: 68px;
    margin: 0 auto;
    padding: 18px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.footer-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.footer-account {
    justify-content: flex-end;
}

.app-footer a {
    color: var(--text-muted);
}


/* Drawer */

.mobile-drawer {
    position: fixed;
    z-index: 100;
    top: 0;
    right: 0;
    width: min(86vw, 340px);
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: -18px 0 45px rgba(0, 0, 0, .16);
    transform: translateX(105%);
    transition: transform .2s ease;
}

.mobile-drawer.is-open {
    transform: translateX(0);
}

.drawer-backdrop {
    position: fixed;
    z-index: 90;
    inset: 0;
    background: rgba(0, 0, 0, .42);
    opacity: 0;
    transition: opacity .2s ease;
}

.drawer-backdrop.is-open {
    opacity: 1;
}

.drawer-head {
    min-height: 64px;
    padding: 0 16px 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--border);
}

.drawer-title {
    font-weight: 750;
}

.drawer-close {
    width: 42px;
    height: 42px;
    padding: 0;
    background: transparent;
    color: var(--text);
    border: 0;
    font-size: 30px;
    line-height: 1;
    font-weight: 300;
}

.drawer-nav {
    padding: 12px;
}

.drawer-nav a,
.drawer-future {
    display: block;
    padding: 13px 12px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.drawer-nav a:hover {
    background: var(--surface-subtle);
}

.drawer-separator {
    height: 1px;
    margin: 10px 12px;
    background: var(--border);
}

.drawer-account {
    margin-top: auto;
    padding: 18px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
}

.drawer-account strong {
    color: var(--text);
}

.drawer-account a {
    margin-top: 10px;
}

body.drawer-open {
    overflow: hidden;
}


/* =========================================================
   Mobiel
   ========================================================= */

@media (max-width: 600px) {
    main {
        padding: 16px 12px 36px;
    }

    header {
        padding: 16px 12px;
    }

    .top {
        align-items: flex-start;
        flex-direction: column;
    }

    .top-actions {
        justify-content: flex-start;
    }

    .user-head {
        gap: 12px;
    }

    .card {
        padding: 17px;
    }

    .voicemail {
        padding: 15px;
    }

    form {
        padding: 17px;
    }
}

@media (max-width: 760px) {
    .desktop-nav {
        display: none;
    }

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

    .app-header-inner {
        min-height: 58px;
    }

    .page-heading-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-footer-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .footer-account {
        justify-content: flex-start;
    }
}

@media (min-width: 761px) {
    .mobile-drawer,
    .drawer-backdrop {
        display: none !important;
    }
}

