/* Fly Media admin. Brand from www.flymedia.be: Poppins, green #A0C51E,
   navy #1E3142, and the card corner that is rounder at the bottom left. */

:root {
    --fm-green: #A0C51E;
    --fm-green-dark: #86A816;
    --fm-green-soft: #F1F7DD;
    --fm-navy: #1E3142;
    --fm-navy-2: #2A4256;
    --fm-grey: #657786;
    --fm-grey-light: #AAB8C2;
    --fm-line: #E6ECF0;
    --fm-bg: #F5F7FA;
    --fm-red: #D64545;
    --fm-red-soft: #FBEAEA;
    --fm-amber: #C98A00;
    --fm-amber-soft: #FDF3DC;
    --fm-blue: #2F6FB2;
    --fm-blue-soft: #E7F0FA;
    --fm-radius: 10px;
    --fm-radius-card: 12px;
    --fm-shadow: 0 1px 2px rgba(30, 49, 66, .04), 0 8px 24px -12px rgba(30, 49, 66, .14);
    --sidebar-w: 248px;

    --bs-body-font-family: 'Poppins', Arial, sans-serif;
    --bs-body-font-weight: 300;
    --bs-body-font-size: .9375rem;
    --bs-body-color: var(--fm-navy);
    --bs-body-bg: var(--fm-bg);
    --bs-link-color-rgb: 30, 49, 66;
    --bs-border-color: var(--fm-line);
}

body { min-height: 100vh; }
b, strong { font-weight: 600; }
a { text-decoration: none; }
.text-muted { color: var(--fm-grey) !important; }

/* ---- environment warning ----------------------------------------------- */

.env-bar {
    /* below the mobile menu (1050) and its backdrop (1040) */
    position: sticky; top: 0; z-index: 1030;
    background: var(--fm-red); color: #fff;
    font-weight: 500; font-size: .8125rem; letter-spacing: .03em;
    text-align: center; padding: 6px 12px;
}
.env-bar .bi { margin-right: 6px; }

/* ---- shell ----------------------------------------------------------------- */

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

.sidebar {
    width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
    background: var(--fm-navy); color: rgba(255, 255, 255, .72);
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    padding: 20px 14px;
    /* The watermark is pure white; the navy layer on top keeps it faint. Both
       layers belong to the same background, so they stay together when the
       menu scrolls (a separate ::before overlay scrolled away from it). */
    background-image: linear-gradient(rgba(30, 49, 66, .93), rgba(30, 49, 66, .93)), url(img/flymedia-m-white.png);
    background-repeat: no-repeat; background-size: 100% 100%, 170% auto; background-position: 0 0, 40% 108%;
}
.sidebar-logo { display: block; padding: 0 10px 14px; }
.sidebar-logo img { width: 128px; height: auto; display: block; }

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 12px; margin-bottom: 2px; border-radius: 8px;
    color: rgba(255, 255, 255, .72); font-weight: 400; font-size: .875rem;
    transition: background .15s, color .15s;
}
.nav-item .bi { font-size: 1.05rem; width: 18px; text-align: center; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.is-active { background: rgba(160, 197, 30, .16); color: #fff; font-weight: 500; }
.nav-item.is-active .bi { color: var(--fm-green); }
.nav-legacy .nav-item { font-size: .8125rem; padding-top: 7px; padding-bottom: 7px; }
.nav-ext { margin-left: auto; font-size: .7rem !important; opacity: .45; }
.nav-section {
    margin: 22px 12px 8px; font-size: .6875rem; font-weight: 500;
    letter-spacing: 1.2px; text-transform: uppercase; color: rgba(255, 255, 255, .4);
}
.sidebar-foot {
    margin-top: auto; display: flex; align-items: center; gap: 10px;
    padding: 14px 10px 0; border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: .8125rem;
}
.avatar {
    width: 32px; height: 32px; border-radius: 50%; flex: 0 0 32px;
    background: var(--fm-green); color: var(--fm-navy);
    display: grid; place-items: center; font-weight: 600;
}
.who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; }
.logout { margin-left: auto; color: rgba(255, 255, 255, .55); font-size: 1.1rem; }
.logout:hover { color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 26px 34px 10px;
}
.page-title { font-size: 1.625rem; font-weight: 600; margin: 0; color: var(--fm-navy); }
.page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.burger { display: none; border: 0; background: none; font-size: 1.6rem; color: var(--fm-navy); padding: 0; }
.content { padding: 12px 34px 48px; }
.sidebar-backdrop { display: none; }

.flash {
    margin: 4px 34px 0; padding: 10px 16px; border-radius: 8px;
    background: var(--fm-green-soft); color: #4D6108; font-weight: 400;
    display: flex; align-items: center; gap: 10px;
}

/* ---- buttons (as on flymedia.be) ------------------------------------------ */

.btn { font-weight: 500; font-size: .875rem; border-radius: 6px; padding: 8px 16px; border-width: 2px; }
.btn-sm { font-size: .8125rem; padding: 4px 11px; border-width: 1px; }
.btn-primary {
    --bs-btn-bg: var(--fm-green); --bs-btn-border-color: var(--fm-green); --bs-btn-color: #fff;
    --bs-btn-hover-bg: var(--fm-green-dark); --bs-btn-hover-border-color: var(--fm-green-dark); --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--fm-green-dark); --bs-btn-active-border-color: var(--fm-green-dark); --bs-btn-active-color: #fff;
    --bs-btn-disabled-bg: var(--fm-green); --bs-btn-disabled-border-color: var(--fm-green);
    --bs-btn-focus-shadow-rgb: 160, 197, 30;
    box-shadow: 0 5px 15px rgba(160, 197, 30, .35);
}
.btn-secondary {
    --bs-btn-bg: var(--fm-navy); --bs-btn-border-color: var(--fm-navy); --bs-btn-color: #fff;
    --bs-btn-hover-bg: #121D26; --bs-btn-hover-border-color: #121D26; --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #121D26; --bs-btn-active-border-color: #121D26;
}
.btn-light {
    --bs-btn-bg: #fff; --bs-btn-border-color: var(--fm-line); --bs-btn-color: var(--fm-navy);
    --bs-btn-hover-bg: var(--fm-bg); --bs-btn-hover-border-color: var(--fm-grey-light); --bs-btn-hover-color: var(--fm-navy);
}
.btn-link { --bs-btn-color: var(--fm-grey); --bs-btn-hover-color: var(--fm-navy); text-decoration: none; padding-left: 6px; padding-right: 6px; }
.btn-danger-link { color: var(--fm-grey); background: none; border: 0; padding: 2px 6px; }
.btn-danger-link:hover { color: var(--fm-red); }

/* ---- cards ------------------------------------------------------------------ */

.card-fm {
    background: #fff; border-radius: var(--fm-radius-card);
    box-shadow: var(--fm-shadow); margin-bottom: 24px;
}
.card-fm > .card-head {
    display: flex; align-items: center; gap: 10px;
    padding: 18px 22px 10px;
}
.card-head h2 { font-size: 1rem; font-weight: 600; margin: 0; }
.card-head .count {
    font-size: .75rem; font-weight: 500; color: var(--fm-grey);
    background: var(--fm-bg); border-radius: 20px; padding: 1px 9px;
}
.card-head .head-right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body-fm { padding: 4px 22px 20px; }
.card-foot { padding: 12px 22px 18px; border-top: 1px solid var(--fm-line); }

.eyebrow {
    font-size: .6875rem; font-weight: 500; letter-spacing: 1.2px;
    text-transform: uppercase; color: var(--fm-grey);
}

/* ---- key figures ------------------------------------------------------------ */

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }
.kpi {
    background: #fff; border-radius: var(--fm-radius-card); box-shadow: var(--fm-shadow);
    padding: 18px 20px; display: flex; flex-direction: column; gap: 4px;
}
.kpi .value { font-size: 1.5rem; font-weight: 600; line-height: 1.2; color: var(--fm-navy); }
.kpi .sub { font-size: .8125rem; color: var(--fm-grey); }
.kpi.is-alert .value { color: var(--fm-red); }

/* ---- badges ----------------------------------------------------------------- */

.status-badge {
    display: inline-block; font-size: .75rem; font-weight: 500; white-space: nowrap;
    padding: 3px 10px; border-radius: 20px; line-height: 1.4;
}
.tone-neutral { background: #EEF1F4; color: #4A5966; }
.tone-info    { background: var(--fm-blue-soft); color: var(--fm-blue); }
.tone-green   { background: var(--fm-green-soft); color: #56700A; }
.tone-warning { background: var(--fm-amber-soft); color: #8A5E00; }
.tone-navy    { background: #E3E8EE; color: var(--fm-navy); }
.tone-muted   { background: #F1F3F5; color: #7D8B96; }

.type-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .8125rem; color: var(--fm-grey); white-space: nowrap;
}
.type-badge .bi { color: var(--fm-green-dark); }

/* ---- tables ----------------------------------------------------------------- */

.table-fm { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table-fm th {
    font-size: .6875rem; font-weight: 500; letter-spacing: 1px; text-transform: uppercase;
    color: var(--fm-grey); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--fm-line);
    white-space: nowrap;
}
.table-fm td { padding: 12px; border-bottom: 1px solid var(--fm-line); vertical-align: middle; }
.table-fm tr:last-child td { border-bottom: 0; }
.table-fm tbody tr { transition: background .12s; }
.table-fm tbody tr:hover { background: #FAFBFC; }
.table-fm .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-fm .shrink { width: 1%; white-space: nowrap; }
.table-fm tr.is-clickable { cursor: pointer; }
.table-wrap { overflow-x: auto; margin: 0 -12px; padding: 0 12px; }

.project-title { font-weight: 500; color: var(--fm-navy); display: block; }
.project-title:hover { color: var(--fm-green-dark); }
.base-value { font-size: 1.6rem; font-weight: 600; color: var(--fm-navy); line-height: 1.2; }
.customer-line { display: block; font-size: .8125rem; color: var(--fm-grey); }

.is-late { color: var(--fm-red) !important; font-weight: 500; }
.is-soon { color: var(--fm-amber) !important; font-weight: 500; }
/* Invoiced: done, not deleted, so muted instead of struck through. */
.is-done { color: var(--fm-grey) !important; }
.rate-low { color: var(--fm-red); font-weight: 500; }
.rate-ok { color: #56700A; font-weight: 500; }

/* ---- filters ---------------------------------------------------------------- */

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 20px; font-size: .8125rem; font-weight: 400;
    background: #fff; color: var(--fm-grey); border: 1px solid var(--fm-line);
}
.chip:hover { color: var(--fm-navy); border-color: var(--fm-grey-light); }
.chip.is-active { background: var(--fm-navy); color: #fff; border-color: var(--fm-navy); }
.chip .n { font-size: .75rem; opacity: .7; }
.filters .form-select { width: auto; min-width: 180px; font-size: .8125rem; border-radius: 20px; }

/* ---- forms ------------------------------------------------------------------ */

.form-label { font-size: .8125rem; font-weight: 500; color: var(--fm-navy); margin-bottom: 5px; }
.form-control, .form-select { font-size: .875rem; border-color: var(--fm-line); border-radius: 7px; font-weight: 300; }
.form-control:focus, .form-select:focus { border-color: var(--fm-green); box-shadow: 0 0 0 .2rem rgba(160, 197, 30, .2); }
.form-text { font-size: .75rem; color: var(--fm-grey); }
.form-check-input:checked { background-color: var(--fm-green); border-color: var(--fm-green); }
.form-check-input:focus { border-color: var(--fm-green); box-shadow: 0 0 0 .2rem rgba(160, 197, 30, .2); }
.field-error { color: var(--fm-red); font-size: .8125rem; margin-top: 4px; }
.form-section { padding-top: 6px; }
.form-section + .form-section { border-top: 1px solid var(--fm-line); margin-top: 8px; padding-top: 20px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form .form-control { flex: 1 1 180px; }
.inline-form .narrow { flex: 0 0 auto; width: auto; }

/* ---- to-dos ----------------------------------------------------------------- */

.todo-list { list-style: none; margin: 0; padding: 0; }
.todo {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 10px 0; border-bottom: 1px solid var(--fm-line);
}
.todo:last-child { border-bottom: 0; }
.todo .check {
    flex: 0 0 22px; width: 22px; height: 22px; margin-top: 1px;
    border: 2px solid var(--fm-grey-light); border-radius: 6px; background: #fff;
    display: grid; place-items: center; cursor: pointer; padding: 0; color: transparent;
    transition: all .15s;
}
.todo .check:hover { border-color: var(--fm-green); }
.todo.is-checked .check { background: var(--fm-green); border-color: var(--fm-green); color: #fff; }
.todo .what { flex: 1; min-width: 0; }
.todo .title { cursor: text; word-break: break-word; }
.todo.is-checked .title { color: var(--fm-grey-light); text-decoration: line-through; }
.todo .meta { font-size: .75rem; color: var(--fm-grey); margin-top: 2px; }
.todo .meta a { color: var(--fm-grey); }
.todo .meta a:hover { color: var(--fm-navy); }
.todo .edit-form { display: none; }
.todo.is-editing .title, .todo.is-editing .meta { display: none; }
.todo.is-editing .edit-form { display: flex; }
.todo .tools { opacity: 0; transition: opacity .15s; }
.todo:hover .tools, .todo.is-editing .tools { opacity: 1; }
.done-toggle { font-size: .8125rem; color: var(--fm-grey); padding: 10px 0 0; display: inline-block; }

/* ---- click to edit (same idea as the old admin) ------------------------------ */

[data-edit-target] { cursor: pointer; border-bottom: 1px dashed transparent; }
[data-edit-target]:hover { border-bottom-color: var(--fm-grey-light); }

/* ---- empty states ------------------------------------------------------------ */

.empty { text-align: center; padding: 34px 20px; color: var(--fm-grey); }
/* only the illustration icon, not the icons inside buttons */
.empty > .bi { font-size: 2rem; color: var(--fm-grey-light); display: block; margin-bottom: 8px; }
.empty p { margin-bottom: 14px; }
.empty-inline { color: var(--fm-grey); font-size: .875rem; padding: 6px 0 10px; }

/* ---- project page ------------------------------------------------------------- */

.project-head {
    background: var(--fm-navy); color: #fff; border-radius: var(--fm-radius-card);
    padding: 22px 26px 22px 30px; margin-bottom: 24px; position: relative; overflow: hidden;
}
.project-head::after {
    content: ""; position: absolute; right: -40px; bottom: -60px; width: 260px; height: 200px;
    background: url(img/flymedia-m-white.png) no-repeat right bottom / contain; opacity: .06;
}
.project-head > * { position: relative; z-index: 1; }
.project-head .customer { color: var(--fm-green); font-weight: 500; font-size: .875rem; }
.project-head .customer:hover { color: #fff; }
.project-head h1 { font-size: 1.375rem; font-weight: 600; margin: 2px 0 12px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: .8125rem; }
.fact .k { color: rgba(255, 255, 255, .55); display: block; font-size: .6875rem; letter-spacing: 1px; text-transform: uppercase; }
.fact .v { color: #fff; font-weight: 500; }
.project-head .type-badge, .project-head .type-badge .bi { color: #fff; }
.status-form .form-select {
    width: auto; font-size: .8125rem; font-weight: 500; border-radius: 20px;
    padding-top: 3px; padding-bottom: 3px;
}
.notes-view { white-space: pre-wrap; font-size: .875rem; }

/* ---- responsive --------------------------------------------------------------- */

@media (max-width: 1199.98px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed; left: 0; top: 0; z-index: 1050;
        transform: translateX(-100%); transition: transform .2s ease;
    }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 1040; background: rgba(30, 49, 66, .45); }
    .burger { display: inline-block; }
    .topbar { padding: 18px 16px 8px; }
    .content { padding: 10px 16px 40px; }
    .flash { margin: 4px 16px 0; }
}
@media (max-width: 575.98px) {
    .kpis { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .page-title { font-size: 1.3rem; }
    .card-fm > .card-head, .card-body-fm { padding-left: 16px; padding-right: 16px; }
    .hide-sm { display: none; }
}

.flash-error { background: var(--fm-red-soft); color: #8E2B2B; }
.flash-info { background: #fff; color: var(--fm-navy); border: 1px solid var(--fm-line); }
.flash-info a { font-weight: 500; }

.nowrap { white-space: nowrap; }
.topbar .page-actions:only-child { margin-left: auto; }

/* ---- shared row elements ----------------------------------------------------- */

.inline-edit { min-width: 120px; }
.inline-value { display: inline-block; min-width: 1.5em; }
.link-quiet { color: var(--fm-navy); font-weight: 400; }
.link-quiet:hover { color: var(--fm-green-dark); text-decoration: underline; }
.project-chip {
    display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
    font-size: .75rem; color: var(--fm-grey); background: var(--fm-bg);
    border-radius: 20px; padding: 1px 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.project-chip:hover { color: var(--fm-navy); background: #E9EEF2; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; align-items: center; }
.totals { display: flex; gap: 28px; flex-wrap: wrap; justify-content: flex-end; padding: 14px 22px 18px; border-top: 1px solid var(--fm-line); font-size: .875rem; }
.totals strong { font-weight: 600; }

.group-row td { background: var(--fm-bg); font-weight: 500; font-size: .8125rem; padding-top: 8px; padding-bottom: 8px; }

/* ---- login ---------------------------------------------------------------------- */

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--fm-navy); }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: var(--fm-radius-card); padding: 34px 32px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .45); }
.login-logo { display: block; width: 150px; margin: 0 auto 26px; }

.sidebar-search { position: relative; margin: 0 4px 14px; }
.sidebar-search .bi { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: rgba(255, 255, 255, .45); font-size: .85rem; }
.sidebar-search input {
    width: 100%; border: 0; border-radius: 8px; padding: 8px 12px 8px 34px;
    background: rgba(255, 255, 255, .08); color: #fff; font: 300 .8125rem Poppins, Arial, sans-serif;
}
.sidebar-search input::placeholder { color: rgba(255, 255, 255, .45); }
.sidebar-search input:focus { outline: none; background: rgba(255, 255, 255, .14); }
.logout { background: none; border: 0; padding: 0; }
.nav-section:empty { margin: 12px 0 0; border-top: 1px solid rgba(255, 255, 255, .08); }

/* Buttons in table rows stay on one line ("+1 jaar"). */
.table-fm .btn { white-space: nowrap; }

/* ---- alert levels: red = vervallen, amber = dreigt, blue = ter info ------------- */

.tone-late { background: var(--fm-red-soft); color: #A02F2F; }
.kpi.is-warn .value { color: var(--fm-amber); }
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.level-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.level-dot.level-late { background: var(--fm-red); }
.level-dot.level-soon { background: var(--fm-amber); }
.level-dot.level-info { background: var(--fm-blue); }

.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-item { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--fm-line); }
.alert-item:last-child { border-bottom: 0; }
.alert-icon {
    flex: 0 0 32px; width: 32px; height: 32px; border-radius: 8px;
    display: grid; place-items: center; font-size: .95rem;
}
.level-late .alert-icon { background: var(--fm-red-soft); color: var(--fm-red); }
.level-soon .alert-icon { background: var(--fm-amber-soft); color: var(--fm-amber); }
.level-info .alert-icon { background: var(--fm-blue-soft); color: var(--fm-blue); }
.alert-item .what { flex: 1; min-width: 0; }
.alert-item .title { color: var(--fm-navy); font-weight: 500; font-size: .875rem; display: block; }
.alert-item .title:hover { color: var(--fm-green-dark); }
.alert-item .meta { font-size: .75rem; color: var(--fm-grey); margin-top: 1px; }
.alert-item .tools { display: flex; align-items: center; gap: 4px; }
.alert-item .tools .form-select { width: auto; font-size: .75rem; border-radius: 20px; padding-top: 2px; padding-bottom: 2px; }
.alert-list.compact { max-height: 60vh; overflow-y: auto; }
.alert-list.compact .alert-item { padding: 9px 16px; }
.alert-list.compact .alert-icon { flex-basis: 28px; width: 28px; height: 28px; font-size: .85rem; }

/* ---- top bar: timer and bell ------------------------------------------------------ */

.topbar-tools { display: flex; align-items: center; gap: 10px; }
.pop { position: relative; }
.pop > summary { list-style: none; cursor: pointer; }
.pop > summary::-webkit-details-marker { display: none; }
.pop-panel {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 1020;
    width: 380px; max-width: calc(100vw - 32px);
    background: #fff; border-radius: var(--fm-radius-card); box-shadow: 0 18px 50px -12px rgba(30, 49, 66, .35);
    overflow: hidden;
}
.pop-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 8px; font-size: .875rem; }
.pop-head strong { margin-right: auto; }
.pop-foot { display: block; padding: 11px 16px; border-top: 1px solid var(--fm-line); font-size: .8125rem; font-weight: 500; color: var(--fm-navy); background: #FAFBFC; }
.pop-foot:hover { color: var(--fm-green-dark); }

.bell > summary {
    width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; position: relative;
    background: #fff; box-shadow: var(--fm-shadow); color: var(--fm-grey); font-size: 1.1rem;
}
.bell.has-soon > summary { color: var(--fm-amber); }
.bell.has-late > summary { color: var(--fm-red); }
.bell-count {
    position: absolute; top: -4px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: 10px; background: var(--fm-amber); color: #fff; font-size: .6875rem; font-weight: 600;
    display: grid; place-items: center; border: 2px solid var(--fm-bg);
}
.bell.has-late .bell-count { background: var(--fm-red); }

.timer > summary {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 20px;
    background: #fff; box-shadow: var(--fm-shadow); color: var(--fm-navy); font-size: .8125rem; font-weight: 500;
}
.timer > summary .bi { font-size: 1.1rem; color: var(--fm-green-dark); }
.timer.is-running > summary { background: var(--fm-navy); color: #fff; }
.timer-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fm-green); animation: fm-pulse 1.6s infinite; }
.timer-clock { font-variant-numeric: tabular-nums; }
.timer-what { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .75; font-weight: 400; }
.timer .pop-panel { width: 320px; }
@keyframes fm-pulse { 50% { opacity: .35; } }

.nav-badge {
    margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 11px; text-align: center;
    background: var(--fm-amber); color: #fff; font-size: .6875rem; font-weight: 600; line-height: 20px;
}
.nav-badge.has-late { background: var(--fm-red); }

/* ---- project board ------------------------------------------------------------------ */

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 16px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.board-col { background: #EBEFF3; border-radius: var(--fm-radius-card); padding: 12px; min-height: 140px; transition: background .15s; }
.board-col.is-over { background: var(--fm-green-soft); }
.board-col h2 { font-size: .8125rem; font-weight: 600; margin: 2px 4px 12px; display: flex; align-items: center; gap: 8px; }
.board-col h2 .count { margin-left: auto; font-size: .75rem; font-weight: 500; color: var(--fm-grey); }
.board-card {
    display: block; background: #fff; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px;
    box-shadow: 0 1px 2px rgba(30, 49, 66, .06); cursor: grab; color: var(--fm-navy);
    border-left: 3px solid transparent;
}
.board-card:hover { box-shadow: var(--fm-shadow); color: var(--fm-navy); }
.board-card.is-dragging { opacity: .45; }
.board-card.is-late { border-left-color: var(--fm-red); }
.board-card.is-soon { border-left-color: var(--fm-amber); }
.board-card .t { font-weight: 500; font-size: .875rem; display: block; }
.board-card .c { font-size: .75rem; color: var(--fm-grey); }
.board-card .m { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: .75rem; color: var(--fm-grey); }

.view-switch { display: inline-flex; background: #fff; border: 1px solid var(--fm-line); border-radius: 20px; padding: 2px; }
.view-switch a { padding: 5px 14px; border-radius: 18px; font-size: .8125rem; color: var(--fm-grey); }
.view-switch a.is-active { background: var(--fm-navy); color: #fff; }

/* ---- bars and charts (figures, outlook, budget) ---------------------------------------- */

.bar { height: 8px; background: var(--fm-bg); border-radius: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--fm-green); border-radius: 4px; }
.bar.is-warn > span { background: var(--fm-amber); }
.bar.is-over > span { background: var(--fm-red); }

.chart { display: flex; align-items: flex-end; gap: 8px; height: 230px; padding-top: 22px; position: relative; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; position: relative; z-index: 1; }
.chart .stack { width: 100%; max-width: 46px; display: flex; flex-direction: column-reverse; border-radius: 6px 6px 0 0; overflow: hidden; }
.chart .stack span { display: block; width: 100%; }
.chart .lbl { font-size: .6875rem; color: var(--fm-grey); }
.chart .val { font-size: .6875rem; color: var(--fm-navy); font-weight: 500; white-space: nowrap; }
.chart .col.is-now .lbl { color: var(--fm-navy); font-weight: 600; }
.chart .target-line { position: absolute; left: 0; right: 0; z-index: 2; border-top: 2px dashed var(--fm-navy); opacity: .45; pointer-events: none; }
.chart .target-line span { position: absolute; right: 0; top: -20px; font-size: .6875rem; color: var(--fm-grey); background: #fff; padding: 0 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .75rem; color: var(--fm-grey); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.c-green { background: var(--fm-green); } .c-navy { background: var(--fm-navy); } .c-blue { background: #7FA7D6; }
.c-amber { background: #E7B54A; } .c-grey { background: var(--fm-grey-light); } .c-light { background: #D8E7A6; }
.c-red { background: #E58C8C; }
.chart .avg-line { position: absolute; left: 0; right: 0; z-index: 2; border-top: 2px dotted var(--fm-green-dark); opacity: .7; pointer-events: none; }
.chart .avg-line span { position: absolute; left: 0; top: -20px; font-size: .6875rem; color: var(--fm-green-dark); background: #fff; padding: 0 4px; }
.rhythm { display: flex; gap: 18px; align-items: flex-start; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--fm-line); }
.rhythm .eyebrow { display: block; }
.rhythm strong { font-size: 1.05rem; white-space: nowrap; }
.share-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; background: var(--fm-bg); }
.share-bar span { display: block; min-width: 3px; }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 8px; vertical-align: 0; }
.dep-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.dep-facts .eyebrow { display: block; font-size: .625rem; }
.dep-facts strong { font-size: 1.15rem; }

.is-cancelled td { color: var(--fm-grey); }
.mini-bar { display: inline-block; width: 70px; vertical-align: middle; margin-left: 8px; }

@media (max-width: 575.98px) {
    .kpis-3 { grid-template-columns: minmax(0, 1fr); }
    .topbar-tools { margin-left: auto; }
    .chart .val { display: none; }
}

/* ---- customer timeline ------------------------------------------------------------ */

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--fm-line); }
.timeline li { display: flex; gap: 12px; padding: 8px 0; position: relative; }
.timeline .dot {
    flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
    background: #fff; border: 2px solid var(--fm-line); color: var(--fm-grey); font-size: .85rem; position: relative;
}
.timeline .kind-call .dot, .timeline .kind-meeting .dot, .timeline .kind-mail .dot { border-color: var(--fm-green); color: var(--fm-green-dark); }
.timeline .kind-note .dot { border-color: var(--fm-navy); color: var(--fm-navy); }
.timeline .what { flex: 1; min-width: 0; padding-top: 2px; }
.timeline .meta { font-size: .75rem; color: var(--fm-grey); }
.timeline .text { font-size: .875rem; white-space: pre-wrap; word-break: break-word; }
.timeline .tools { opacity: 0; transition: opacity .15s; }
.timeline li:hover .tools { opacity: 1; }

/* ---- costs and cashflow ------------------------------------------------------------- */

.cat-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 7px; vertical-align: 0; }

.cash-chart { width: 100%; height: auto; display: block; }
.cash-chart path { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.cash-chart .real { stroke: var(--fm-green); }
.cash-chart .careful { stroke: var(--fm-navy); stroke-dasharray: 5 5; stroke-width: 1.8; opacity: .7; }
.cash-chart .hist { stroke: var(--fm-grey-light); }
.cash-chart .zero { stroke: var(--fm-red); stroke-width: 1; opacity: .5; }
.cash-chart .buffer { stroke: var(--fm-amber); stroke-width: 1; stroke-dasharray: 3 4; }
.cash-chart .now { stroke: var(--fm-line); stroke-width: 1; }
.cash-chart .lbl { font: 400 11px Poppins, Arial, sans-serif; fill: var(--fm-grey); }

.cash-rows { font-size: .875rem; }
.cash-row { display: grid; grid-template-columns: minmax(0, 2.2fr) repeat(4, minmax(0, 1fr)); gap: 10px; padding: 10px 12px; align-items: center; }
.cash-row .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cash-head { font-size: .6875rem; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; color: var(--fm-grey); border-bottom: 1px solid var(--fm-line); }
.cash-bucket { border-bottom: 1px solid var(--fm-line); }
.cash-bucket > summary { list-style: none; cursor: pointer; }
.cash-bucket > summary::-webkit-details-marker { display: none; }
.cash-bucket > summary:hover { background: #FAFBFC; }
.cash-bucket[open] > summary { background: var(--fm-bg); }
.cash-events { margin: 0 0 8px; font-size: .8125rem; }
.cash-events td { padding: 8px 12px; }
@media (max-width: 575.98px) {
    .cash-row { grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); }
}

/* ---- sidebar: compact, with a thin light scrollbar inside the dark menu --------------- */

.sidebar { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .16) transparent; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 3px; }
.sidebar:hover::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .26); }
.nav-item { padding-top: 7px; padding-bottom: 7px; }
.nav-section { margin-top: 16px; margin-bottom: 6px; }
.nav-section:empty { margin-top: 8px; }
.sidebar-logo { padding-bottom: 10px; }
.sidebar-search { margin-bottom: 10px; }

.alert-item.is-good .alert-icon { background: var(--fm-green-soft); color: #56700A; }

.wa-steps { display: grid; gap: 8px; }
.wa-step { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wa-step .btn { flex: 0 0 auto; min-width: 190px; text-align: left; }
.wa-step .text-truncate { min-width: 0; }

.dropzone {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    padding: 26px 16px; border: 2px dashed var(--fm-grey-light); border-radius: var(--fm-radius-card);
    background: #FAFBFC; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; margin: 0;
}
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .bi { font-size: 1.8rem; color: var(--fm-green-dark); }
.dropzone .dz-title { font-weight: 500; font-size: .9375rem; }
.dropzone .dz-sub { font-size: .75rem; color: var(--fm-grey); }
.dropzone:hover, .dropzone.is-over { border-color: var(--fm-green); background: var(--fm-green-soft); }
.dropzone.is-busy { border-style: solid; border-color: var(--fm-green); background: var(--fm-green-soft); pointer-events: none; }
.dropzone.is-ready { border-color: var(--fm-green); background: var(--fm-green-soft); animation: fm-ready 1.4s ease-in-out 3; }
@keyframes fm-ready { 50% { box-shadow: 0 0 0 6px rgba(160, 197, 30, .25); } }

/* ---- on/off switches: the state in words next to it ------------------------------ */

.fm-switch { display: inline-flex; align-items: center; gap: 8px; padding-left: 0; margin: 0; cursor: pointer; font-size: .8125rem; white-space: nowrap; }
.fm-switch .form-check-input { float: none; margin: 0; width: 2.3em; height: 1.25em; cursor: pointer; }
.fm-switch .switch-label { color: var(--fm-grey); }
.fm-switch .switch-label.is-on { color: #56700A; font-weight: 500; }
.switch-form { display: inline-block; margin: 0; }

/* An input group inside a row of fields keeps its own width (the € and the amount together). */
.inline-form .input-group { flex: 0 0 auto; width: auto; flex-wrap: nowrap; }
.inline-form .input-group .form-control { flex: 1 1 auto; width: 110px; }

/* The menu column stays navy to the bottom of a long page (the menu itself
   is sticky and only one screen high). */
@media (min-width: 992px) {
    .app { background: linear-gradient(to right, var(--fm-navy) var(--sidebar-w), var(--fm-bg) var(--sidebar-w)); }
}
