/* Thema van het platform bovenop Bootstrap 5 (ADR-0021). Bootstrap en de
   iconen staan lokaal in assets/vendor, zonder CDN (ADR-0012). Hier staan
   alleen de kleuren, de app-schil met zijbalk en de eigen onderdelen.

   Huisstijl per tenant (ADR-0036): een tenant overschrijft alleen
   --at-primary en --at-accent via /branding/theme.css. Elke andere tint
   wordt hier met color-mix() van die twee afgeleid. Nooit een merkkleur
   hardcoderen; neutrale grijzen en statuskleuren mogen wel. */

:root {
    --at-primary: #1d3751;
    --at-accent: #e67e22;
    --at-primary-dark: color-mix(in srgb, var(--at-primary), #000 25%);
    --at-accent-hover: color-mix(in srgb, var(--at-accent), #000 12%);
    --at-accent-active: color-mix(in srgb, var(--at-accent), #000 22%);
    --at-accent-light: color-mix(in srgb, var(--at-accent), #fff 20%);
    --at-accent-soft: color-mix(in srgb, var(--at-accent), #fff 86%);
    --at-accent-tint: color-mix(in srgb, var(--at-accent), #fff 93%);
    --at-accent-border: color-mix(in srgb, var(--at-accent), #fff 65%);
    --at-accent-glow: color-mix(in srgb, var(--at-accent), transparent 72%);
    --at-sidebar-width: 16rem;
    --bs-body-bg: #f4f6f9;
    --bs-body-color: #1e293b;
    --bs-link-color: var(--at-primary);
    --bs-link-hover-color: var(--at-accent);
    --bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Bootstrap 5.3 kleurt links met --bs-link-color-rgb; dat is geen
   afgeleide van een hex-variabele, dus hier rechtstreeks. */
a {
    color: var(--bs-link-color);
}

a:hover {
    color: var(--bs-link-hover-color);
}

.btn-primary {
    --bs-btn-bg: var(--at-accent);
    --bs-btn-border-color: var(--at-accent);
    --bs-btn-hover-bg: var(--at-accent-hover);
    --bs-btn-hover-border-color: var(--at-accent-hover);
    --bs-btn-active-bg: var(--at-accent-active);
    --bs-btn-active-border-color: var(--at-accent-active);
    --bs-btn-disabled-bg: var(--at-accent);
    --bs-btn-disabled-border-color: var(--at-accent);
}

.btn-outline-primary {
    --bs-btn-color: var(--at-primary);
    --bs-btn-border-color: var(--at-primary);
    --bs-btn-hover-bg: var(--at-primary);
    --bs-btn-hover-border-color: var(--at-primary);
    --bs-btn-active-bg: var(--at-primary);
    --bs-btn-active-border-color: var(--at-primary);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--at-accent);
    box-shadow: 0 0 0 0.25rem var(--at-accent-glow);
}

.card {
    --bs-card-border-color: #e3e8ef;
    --bs-card-border-radius: 0.65rem;
    --bs-card-cap-bg: #f7f9fc;
    --bs-card-cap-padding-y: 0.7rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    color: var(--at-primary);
    border-bottom-color: #e9eef4;
}

.card-header > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.5rem;
    background: var(--at-accent-soft);
    color: var(--at-accent);
    font-size: 0.95rem;
}

.form-label {
    color: #334155;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.form-control,
.form-select {
    border-color: #d3dae3;
    border-radius: 0.45rem;
    padding: 0.5rem 0.75rem;
    color: #1e293b;
}

.form-control::placeholder {
    color: #a3adba;
}

.form-control:hover:not(:focus),
.form-select:hover:not(:focus) {
    border-color: #b6c1cf;
}

.table > :not(caption) > * > * {
    padding: 0.75rem 1rem;
}

.table thead th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    background: #f8fafc;
    border-bottom-width: 1px;
}

/* --- App-schil ------------------------------------------------------ */

.app-body {
    min-height: 100vh;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--at-sidebar-width);
    flex: 0 0 var(--at-sidebar-width);
    /* !important: Bootstrap maakt offcanvas-lg op grote schermen transparant. */
    background: var(--at-primary) !important;
    color: #fff;
    display: flex;
    flex-direction: column;
}

@media (min-width: 992px) {
    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
    }
}

.sidebar.offcanvas-lg {
    --bs-offcanvas-width: var(--at-sidebar-width);
    --bs-offcanvas-bg: var(--at-primary);
    --bs-offcanvas-color: #fff;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 4.25rem;
}

.brand {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    min-width: 0;
}

.brand:hover {
    color: #fff;
}

.brand img {
    max-height: 2.4rem;
    max-width: 12rem;
    display: block;
    background: #fff;
    padding: 0.25rem 0.4rem;
    border-radius: 0.35rem;
}

.brand-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* "Platformbeheer" naast de naam op beheer (ADR-0096). */
.brand-sub {
    font-weight: 400;
    font-size: 0.8rem;
    opacity: 0.75;
    margin-left: 0.35rem;
}

.sidebar-nav {
    padding: 0.75rem;
    flex: 1;
    overflow-y: auto;
}

.sidebar-heading {
    margin: 0.9rem 0.75rem 0.3rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.5);
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.82);
    padding: 0.4rem 0.75rem;
    border-radius: 0.5rem;
    font-weight: 500;
    width: 100%;
    background: transparent;
    border: 0;
    text-align: left;
}

.sidebar .nav-link i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
    opacity: 0.9;
}

.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: inset 3px 0 0 var(--at-accent);
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer form {
    margin: 0;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--at-primary);
    color: #fff;
    padding: 0.6rem 1rem;
}

.topbar-title {
    font-weight: 600;
}

.content {
    padding: 1.5rem;
    max-width: 90rem;
    width: 100%;
}

@media (min-width: 992px) {
    .content {
        padding: 2rem 2.5rem;
    }
}

/* --- Pagina-onderdelen ---------------------------------------------- */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--at-primary);
}

.page-subtitle {
    margin: 0.2rem 0 0;
    color: #64748b;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.form-actions-sticky {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: 1.5rem -1.5rem -1.5rem;
    padding: 0.9rem 1.5rem;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid #e3e8ef;
    box-shadow: 0 -6px 16px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(4px);
}

@media (min-width: 992px) {
    .form-actions-sticky {
        margin: 1.5rem -2.5rem -2rem;
        padding: 0.9rem 2.5rem;
    }
}

.form-actions-hint {
    margin-left: auto;
    color: #64748b;
    font-size: 0.9rem;
}

.page-heading {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.85rem;
    background: linear-gradient(145deg, var(--at-accent), var(--at-accent-light));
    color: #fff;
    font-size: 1.4rem;
    box-shadow: 0 6px 14px var(--at-accent-glow);
    flex: 0 0 auto;
}

.lookup-panel {
    display: flex;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    border-radius: 0.85rem;
    background: var(--at-accent-tint);
    border: 1px solid var(--at-accent-border);
}

.lookup-panel-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--at-accent);
    color: #fff;
    font-size: 1.35rem;
    flex: 0 0 auto;
}

.lookup-panel-body {
    flex: 1;
    min-width: 0;
}

.lookup-panel-title {
    display: block;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--at-primary);
    margin-bottom: 0.15rem;
}

.lookup-panel-text {
    color: #6b7280;
    margin-bottom: 0.75rem;
    font-size: 0.92rem;
}

@media (max-width: 575.98px) {
    .lookup-panel {
        flex-direction: column;
        gap: 0.75rem;
    }
}

.empty-state {
    text-align: center;
    color: #64748b;
    padding: 3rem 1rem;
}

.empty-state i {
    display: block;
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
    color: #cbd5e1;
}

.stat {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 0.5rem;
    background: #f8fafc;
    border-radius: 0.5rem;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
}

.stat-label {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.theme-picker {
    width: 100%;
    max-width: 8rem;
    height: 2.75rem;
}

.logo-preview img {
    max-height: 4rem;
    max-width: 16rem;
    background: #fff;
    padding: 0.4rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
}

.lookup-status {
    min-height: 1.25rem;
    margin: 0.5rem 0 0;
}

.lookup-status.text-danger {
    color: var(--bs-danger) !important;
}

.lookup-results {
    margin-top: 0.5rem;
}

/* --- Inloggen -------------------------------------------------------- */

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(160deg, var(--at-primary) 0%, var(--at-primary-dark) 100%);
}

.auth-card {
    width: 100%;
    max-width: 26rem;
    border: 0;
}

.auth-brand {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--at-primary);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.02em;
}

.auth-brand img {
    max-height: 4rem;
    max-width: 14rem;
    object-fit: contain;
}

/* QR-code om een authenticator-app te koppelen (ADR-0091); wit vlak,
   zodat de app de code ook in het donker leest. */
.qr-code svg {
    width: 220px;
    height: 220px;
    padding: 0.5rem;
    background: #fff;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
}

.code-input {
    letter-spacing: 0.4em;
    font-variant-numeric: tabular-nums;
}

/* --- Foutpagina ------------------------------------------------------ */

.error-status {
    font-size: 3.5rem;
    font-weight: 700;
    color: #cbd5e1;
    margin: 0;
    line-height: 1;
}

.error-detail {
    overflow-x: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 1rem;
    border-radius: 0.375rem;
    font-size: 0.85rem;
}

/* --- Overzichten en detailpagina's ---------------------------------- */

.card-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    background: #f7f9fc;
    border-bottom: 1px solid #e9eef4;
    border-radius: 0.65rem 0.65rem 0 0;
}

.card-toolbar-search {
    flex: 1 1 18rem;
    min-width: 14rem;
}

.card-toolbar-search .input-group-text {
    background: #fff;
    color: #94a3b8;
    border-right: 0;
}

.card-toolbar-search .form-control {
    border-left: 0;
}

.card-toolbar-filter {
    flex: 0 0 auto;
    width: auto;
    min-width: 11rem;
}

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.6rem;
    background: var(--at-primary);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    flex: 0 0 auto;
}

.avatar-image,
.page-icon-image {
    background: #fff;
    border: 1px solid var(--bs-border-color, #dee2e6);
    box-shadow: none;
    overflow: hidden;
}

.avatar-image img,
.page-icon-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.2rem;
}

.avatar-photo img,
.page-icon-photo img {
    object-fit: cover;
    padding: 0;
}

.article-image-preview img {
    max-width: 20rem;
    max-height: 14rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.5rem;
    background: #fff;
    padding: 0.25rem;
}

.logo-manager {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bs-border-color, #dee2e6);
}

.logo-file {
    max-width: 16rem;
}

.avatar-muted {
    background: #e2e8f0;
    color: var(--at-primary);
}

.entity-link {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: inherit;
    text-decoration: none;
}

a.entity-link:hover .fw-semibold {
    color: var(--at-accent);
}

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.status-lead {
    background: #fff1e0;
    color: #b45309;
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-inactive {
    background: #e2e8f0;
    color: #475569;
}

.status-archived {
    background: #fef3c7;
    color: #92400e;
}

/* Codefragmenten zoals rechtsleutels en logboekacties: rustig, niet roze */
code {
    color: #475569;
    background: #f1f5f9;
    padding: 0.1em 0.35em;
    border-radius: 0.25rem;
    font-size: 0.85em;
}

/* Notities-tijdlijn (ADR-0032) */
.note-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.note-actions {
    margin-left: auto;
    white-space: nowrap;
}

.note-body {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Sorteerbare kolomkoppen (ADR-0031) */
.sort-link {
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}

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

.sort-link.active {
    color: var(--at-primary);
}

.detail-row {
    display: flex;
    gap: 1rem;
    padding: 0.45rem 0;
    border-bottom: 1px dashed #edf1f5;
}

.detail-row:last-of-type {
    border-bottom: 0;
}

.detail-label {
    flex: 0 0 7rem;
    color: #64748b;
    font-size: 0.9rem;
}

.detail-value {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.page-icon.page-icon-text {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.type-switch {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.type-switch .btn {
    min-width: 8.5rem;
}

.type-switch-hint {
    margin-left: 0.5rem;
}

.avatar-private,
.page-icon-private {
    background: linear-gradient(145deg, #3b82f6, #60a5fa);
    box-shadow: 0 6px 14px rgba(59, 130, 246, 0.25);
}

.status-type {
    background: #e8eef5;
    color: var(--at-primary);
}

.duplicate-warning ul {
    padding-left: 1.1rem;
}

/* --- Offerteformulier (ADR-0041) ------------------------------------- */

.quote-lines th {
    white-space: nowrap;
}

.quote-lines td {
    padding: 0.4rem 0.4rem;
    vertical-align: top;
}

.quote-lines .form-control-sm,
.quote-lines .form-select-sm {
    min-width: 5rem;
}

.quote-col-kind { width: 8.5rem; }
.quote-col-article { width: 14rem; }
.quote-col-number { width: 6rem; }
.quote-col-unit { width: 6.5rem; }
.quote-col-amount { width: 8rem; }
.quote-col-vat { width: 8rem; }
.quote-col-remove { width: 3rem; }

.quote-totals {
    background: #f8fafc;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.quote-totals-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.quote-action summary {
    list-style: none;
    cursor: pointer;
}

.quote-action summary::-webkit-details-marker {
    display: none;
}

.quote-action-form {
    margin-top: 0.75rem;
    max-width: 28rem;
}

/* --- Logboek --------------------------------------------------------- */

.log-table td {
    vertical-align: top;
}

.log-changes {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
}

.log-changes li {
    padding: 0.1rem 0;
}

.log-field {
    display: inline-block;
    min-width: 7rem;
    color: #64748b;
}

/* Agenda van de planning (ADR-0057): week in kolommen, dag per medewerker. */
.agenda-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-top: 1px solid var(--bs-border-color);
}

.agenda-day {
    min-height: 12rem;
    padding: 0.5rem;
    border-right: 1px solid var(--bs-border-color);
}

.agenda-day:last-child {
    border-right: 0;
}

.agenda-day-today {
    background: color-mix(in srgb, var(--at-primary) 5%, #ffffff);
}

.agenda-day-head {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
    color: #475569;
    font-size: 0.85rem;
}

.agenda-day-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

.agenda-day-today .agenda-day-number {
    color: var(--at-primary);
}

.agenda-day-add {
    margin-left: auto;
    color: #94a3b8;
    text-decoration: none;
}

.agenda-day-add:hover {
    color: var(--at-primary);
}

.agenda-empty {
    color: #94a3b8;
    font-size: 0.85rem;
}

.agenda-item {
    display: block;
    margin-bottom: 0.4rem;
    padding: 0.4rem 0.5rem;
    border-left: 3px solid var(--at-primary);
    border-radius: 0.35rem;
    background: color-mix(in srgb, var(--at-primary) 8%, #ffffff);
    color: inherit;
    text-decoration: none;
    font-size: 0.85rem;
}

.agenda-item:hover {
    background: color-mix(in srgb, var(--at-primary) 15%, #ffffff);
    color: inherit;
}

.agenda-item-done {
    border-left-color: #166534;
    background: #f0fdf4;
}

.agenda-item-cancelled {
    border-left-color: #94a3b8;
    background: #f8fafc;
    color: #94a3b8;
    text-decoration: line-through;
}

.agenda-item-time {
    display: block;
    font-weight: 600;
    color: #475569;
}

.agenda-item-cancelled .agenda-item-time {
    color: #94a3b8;
}

.agenda-item-title {
    display: block;
    font-weight: 600;
}

.agenda-item-meta {
    display: block;
    color: #64748b;
    font-size: 0.78rem;
}

.agenda-day-list {
    padding: 0.5rem 1rem 1rem;
}

.agenda-person {
    padding: 0.75rem 0;
    border-top: 1px solid var(--bs-border-color);
}

.agenda-person:first-child {
    border-top: 0;
}

.agenda-person-name {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.agenda-person .agenda-item {
    max-width: 40rem;
}

@media (max-width: 991.98px) {
    .agenda-week {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .agenda-day {
        min-height: 0;
        border-right: 0;
        border-bottom: 1px solid var(--bs-border-color);
    }
}

/* Handtekening op de werkbon (ADR-0058). */
.signature-pad {
    position: relative;
    border: 1px dashed #94a3b8;
    border-radius: 0.5rem;
    background: #ffffff;
}

.signature-pad.is-signed {
    border-style: solid;
    border-color: var(--at-primary);
}

.signature-pad.is-invalid {
    border-color: #dc3545;
}

.signature-canvas {
    display: block;
    width: 100%;
    height: 12rem;
    touch-action: none;
}

.signature-clear {
    position: absolute;
    top: 0.25rem;
    right: 0.5rem;
}

/* Dashboard (ADR-0104): aandachtspunten bovenaan, daaronder één compacte
   kaart per module. Kleuren alleen uit de --at-*-variabelen: de rand is
   een tint van de primaire kleur met een zachte schaduw in dezelfde tint. */
.dash-label,
.dash-calm,
.dash-alerts,
.dash-cards {
    /* Terug naar de lichte rand: color-mix(in srgb, var(--at-primary), #fff 60%). */
    --dash-edge: var(--at-primary);
    --dash-shadow: 0 1px 3px color-mix(in srgb, var(--at-primary), transparent 82%);
}
.dash-label {
    margin: 0 0 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.dash-calm {
    margin: 0 0 1.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--dash-edge);
    border-radius: 0.65rem;
    background: #fff;
    box-shadow: var(--dash-shadow);
    color: #64748b;
}

.dash-alerts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.dash-alert {
    display: block;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--dash-edge);
    border-left: 3px solid var(--at-accent);
    border-radius: 0.65rem;
    background: #fff;
    box-shadow: var(--dash-shadow);
    color: inherit;
    text-decoration: none;
}

.dash-alert:hover {
    border-color: var(--at-primary);
    border-left-color: var(--at-accent);
    background: var(--at-accent-tint);
    color: inherit;
}

.dash-alert-overdue {
    border-left-color: var(--bs-danger);
}

.dash-alert-overdue .dash-alert-count {
    color: var(--bs-danger);
}

.dash-alert-info {
    border-left-color: #cbd5e1;
}

.dash-alert-count {
    display: block;
    font-size: 1.65rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--at-primary);
}

.dash-alert-label {
    font-size: 0.85rem;
    color: #64748b;
}

.dash-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.dash-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--dash-edge);
    border-radius: 0.65rem;
    background: #fff;
    box-shadow: var(--dash-shadow);
}

.dash-card-head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.dash-card-title {
    font-weight: 600;
    color: var(--at-primary);
}

.dash-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--at-primary), #fff 90%);
    color: var(--at-primary);
}

.dash-figure {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 600;
    line-height: 1.15;
    color: var(--at-primary);
}

.dash-caption {
    margin: 0;
    font-size: 0.85rem;
    color: #64748b;
}

.dash-link {
    margin-top: auto;
    padding-top: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--at-accent-hover);
    text-decoration: none;
}

.dash-link:hover {
    color: var(--at-accent-active);
}

/* Kleuren van de soorten afspraak (ADR-0115): een vast palet, rustig en leesbaar. */
.kind-green { background: #dcfce7; color: #166534; }
.kind-blue { background: #dbeafe; color: #1e40af; }
.kind-orange { background: #ffedd5; color: #9a3412; }
.kind-red { background: #fee2e2; color: #991b1b; }
.kind-purple { background: #ede9fe; color: #5b21b6; }
.kind-teal { background: #ccfbf1; color: #115e59; }
.kind-pink { background: #fce7f3; color: #9d174d; }
.kind-yellow { background: #fef9c3; color: #854d0e; }
.kind-gray { background: #e2e8f0; color: #475569; }

.kind-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.kind-color-choice {
    cursor: pointer;
    margin: 0;
}

.kind-color-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.kind-color-choice .status-badge {
    border: 2px solid transparent;
}

.kind-color-choice input:checked + .status-badge {
    border-color: var(--at-primary);
}

.kind-color-choice input:focus-visible + .status-badge {
    outline: 2px solid var(--at-accent);
    outline-offset: 2px;
}

/* Mijn taken (ADR-0117) */
.nav-badge {
    margin-left: auto;
    min-width: 1.5rem;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    background: var(--at-accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.task-item {
    padding: 1rem 1.25rem;
}

.task-title {
    font-weight: 600;
}

.task-description {
    margin-top: 0.25rem;
    color: var(--bs-secondary-color);
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin-top: 0.4rem;
}

.task-meta i {
    margin-right: 0.3rem;
}

.task-more {
    position: relative;
}

.task-more summary {
    list-style: none;
    cursor: pointer;
}

.task-more summary::-webkit-details-marker {
    display: none;
}

.task-more-body {
    position: absolute;
    right: 0;
    z-index: 5;
    min-width: 16rem;
    margin-top: 0.25rem;
    padding: 0.75rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.12);
}

/* Tabs op de relatiepagina (ADR-0137): één regel, op een smal scherm zijwaarts te schuiven. */
.customer-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    white-space: nowrap;
}

.customer-tabs .nav-link {
    color: var(--bs-secondary-color);
}

.customer-tabs .nav-link:hover {
    color: var(--bs-body-color);
}

.customer-tabs .nav-link.active {
    color: var(--at-primary);
    font-weight: 600;
    background: transparent;
    border-color: var(--bs-border-color) var(--bs-border-color) var(--bs-body-bg);
}

/* Bevestigingsvenster (ADR-0138): vervangt window.confirm. */
.confirm-dialog {
    width: min(28rem, calc(100vw - 2rem));
    padding: 0;
    color: var(--bs-body-color);
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.25);
}

.confirm-dialog::backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.confirm-dialog-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
}

.confirm-dialog-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Naam en uitloggen in een uitklapmenu onderaan het menu (ADR-0140). */
.sidebar-footer .dropdown-toggle::after {
    margin-left: auto;
}

.sidebar-footer .dropdown-menu {
    min-width: 100%;
}

/* Het submenu van Instellingen links van de inhoud (ADR-0140): op een smal scherm een rij die zijwaarts schuift. */
.settings-nav {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    white-space: nowrap;
}

.settings-nav-heading {
    display: none;
}

.settings-nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.75rem;
    color: var(--bs-secondary-color);
    border-radius: 0.5rem;
    text-decoration: none;
}

.settings-nav-link:hover {
    color: var(--bs-body-color);
    background: var(--bs-tertiary-bg);
}

.settings-nav-link.active {
    color: var(--at-primary);
    font-weight: 600;
    background: var(--bs-tertiary-bg);
}

@media (min-width: 992px) {
    .settings-nav {
        flex-direction: column;
        gap: 0.1rem;
        overflow: visible;
        white-space: normal;
    }

    .settings-nav-heading {
        display: block;
        margin: 1rem 0.75rem 0.25rem;
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--bs-secondary-color);
    }

    .settings-nav-heading:first-child {
        margin-top: 0;
    }
}

/* Verplicht veld en de ingeklapte sectie "Meer gegevens" in het relatieformulier (ADR-0137). */
.form-label.is-required::after {
    content: " *";
    color: var(--bs-danger);
}

.more-details > summary {
    padding: 0.75rem 1rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
}

.more-details > summary::-webkit-details-marker {
    display: none;
}

.more-details[open] > summary {
    margin-bottom: 1.5rem;
}

.more-details-icon {
    display: inline-block;
    margin-right: 0.5rem;
    transition: transform 0.15s;
}

.more-details[open] .more-details-icon {
    transform: rotate(90deg);
}

/* Het vaste blok onderaan het menu: Platform, Instellingen en je naam, gescheiden van het werkmenu (ADR-0140). */
.sidebar-footer .nav-link {
    margin-bottom: 0.1rem;
}

.sidebar-heading-first {
    margin-top: 0;
}

.sidebar-user {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Het overzicht van Instellingen: rustige tegels per rubriek (ADR-0140). */
.settings-section {
    margin-top: 2rem;
}

.settings-section-title {
    margin-bottom: 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bs-secondary-color);
}

.settings-tile {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
    padding: 1rem 1.15rem;
    color: inherit;
    text-decoration: none;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
}

.settings-tile:hover {
    border-color: var(--at-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.settings-tile-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.15rem;
    color: var(--at-primary);
    background: color-mix(in srgb, var(--at-primary) 10%, transparent);
    border-radius: 0.6rem;
}

.settings-tile-text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.settings-tile-title {
    font-weight: 600;
}

.settings-tile-description {
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
}

.settings-tile-arrow {
    flex: 0 0 auto;
    color: var(--bs-secondary-color);
}

/* Een organisatieregel op de persoonspagina: de samenvatting is de regel, Wijzigen klapt het formulier open (ADR-0137). */
.org-row > summary {
    list-style: none;
    cursor: pointer;
}

.org-row > summary::-webkit-details-marker {
    display: none;
}
