/* Huisstijl C.V. "De Aester" Echt: rood zoals op aester.nl */
:root { --aester-red: #d00000; --aester-red-dark: #a80000; }

.btn-primary,
.btn-primary:focus {
    background-color: var(--aester-red);
    background-image: none;
    border-color: var(--aester-red-dark);
}
.btn-primary:hover,
.btn-primary:active,
.btn-primary.disabled,
.btn-primary[disabled] {
    background-color: var(--aester-red-dark);
    background-image: none;
    border-color: var(--aester-red-dark);
}
a { color: var(--aester-red); }
a:hover { color: var(--aester-red-dark); }

/* Menubalk */
.navbar-default {
    background: var(--aester-red);
    background-image: none;
    border: 0;
    border-radius: 0;
    box-shadow: 0 3px 6px rgba(0, 0, 0, .25);
}
.navbar-default .navbar-brand { padding: 5px 15px; }
.navbar-default .navbar-brand img {
    height: 40px;
    background: #fff;
    border-radius: 4px;
    padding: 2px;
}
.navbar-default .navbar-nav > li > a {
    color: #fff;
    text-transform: uppercase;
    border: 2px solid transparent;
    border-radius: 3px;
    margin: 8px 0 8px 5px;
    padding: 5px 12px;
}
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus,
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
    background: transparent;
    color: #fff;
    border-color: #fff;
}
.navbar-default .navbar-nav > .active > a { font-weight: bold; }
.navbar-default .navbar-toggle { border-color: #fff; }
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus { background: var(--aester-red-dark); }
.navbar-default .navbar-toggle .icon-bar { background: #fff; }
.navbar-default .navbar-collapse { border-color: rgba(255, 255, 255, .3); }
/* "Toevoegen" is wit op de rode balk */
.navbar-default .btn-primary.navbar-btn {
    background: #fff;
    color: var(--aester-red);
    border-color: #fff;
    font-weight: bold;
}
.navbar-default .btn-primary.navbar-btn:hover { background: #f2f2f2; }

/* Loginscherm (in de stijl van intranet.aester.nl) */
body.login-page { background: #d2d6de; }
.login-box { width: 360px; max-width: 90%; margin: 7% auto; }
.login-logo { text-align: center; margin-bottom: 25px; }
.login-logo img { max-width: 180px; height: auto; }
.login-box-body {
    background: #fff;
    padding: 20px;
    color: #666;
    border-top: 3px solid var(--aester-red);
}
.login-box-msg { margin: 0; text-align: center; padding: 0 20px 20px; }
.login-box-body .form-control-feedback { color: #777; }
.login-box-body .form-control { border-radius: 0; box-shadow: none; }
.login-box-body .form-control:focus { border-color: var(--aester-red); }
.login-box-body .btn { border-radius: 0; box-shadow: none; }

/* Lijst: statusbadges (donkere tekst op lichte kleur, ook herkenbaar aan het icoon) */
.stage {
    display: inline-block;
    padding: 3px 10px;
    border: 1px solid;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.stage .glyphicon { margin-right: 4px; font-size: 11px; }
.stage-open     { background: #eceff1; color: #37474f; border-color: #b0bec5; }
.stage-mailed   { background: #e3f2fd; color: #0d47a1; border-color: #90caf9; }
.stage-approved { background: #fff3e0; color: #8a4b00; border-color: #ffcc80; }
.stage-finished { background: #e8f5e9; color: #1b5e20; border-color: #a5d6a7; }
.stage-declined { background: #ffebee; color: #b71c1c; border-color: #ef9a9a; }
.stage-inactive { background: #f5f5f5; color: #616161; border-color: #ddd; font-style: italic; }

/* Lijst: actieknoppen, elk met eigen kleur en groter icoon */
.row-actions .btn { padding: 5px 9px; background: #fff; border-width: 1px; }
.row-actions .btn .glyphicon { font-size: 16px; top: 2px; }
.row-actions .act-mail   { color: #1565c0; border-color: #90caf9; }
.row-actions .act-pdf    { color: #6a1b9a; border-color: #ce93d8; }
.row-actions .act-edit   { color: #2e7d32; border-color: #a5d6a7; }
.row-actions .act-delete { color: #c62828; border-color: #ef9a9a; }
.row-actions .act-mail:hover   { background: #e3f2fd; }
.row-actions .act-pdf:hover    { background: #f3e5f5; }
.row-actions .act-edit:hover   { background: #e8f5e9; }
.row-actions .act-delete:hover { background: #ffebee; }
.row-actions .act-done { color: #1b5e20; background: #e8f5e9; border-color: #a5d6a7; opacity: 1; }

/* Welkom en voortgangsbalk op de lijstpagina */
.welcome { margin: 5px 0 20px; }
.welcome .lead { margin-bottom: 10px; }
.welcome .progress { height: 26px; margin-bottom: 6px; box-shadow: none; background: #eceff1; }
.welcome .progress-bar { box-shadow: none; line-height: 26px; font-weight: 600; }
.bar-finished { background: #2e7d32; }
.bar-declined { background: #c62828; }
.bar-approved { background: #ef8f00; }
.bar-mailed   { background: #1565c0; }
.bar-open     { background: #b0bec5; color: #37474f; }
.welcome .legend { font-size: 12px; color: #666; }
.welcome .legend span { display: inline-block; margin-right: 12px; }
.welcome .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; }

/* Compacte voortgangsbalk (Verdeling, Looplijst) */
.progress-compact { height: 12px; margin: 0; min-width: 90px; box-shadow: none; background: #eceff1; }
.progress-compact .progress-bar { box-shadow: none; }

/* Fase wijzigen: één gedeeld menu onder de badge */
.stage-toggle { cursor: pointer; background-clip: padding-box; }
.stage-toggle .caret { margin-left: 4px; }
#stage-menu { position: absolute; display: none; }
#stage-menu button { display: block; width: 100%; padding: 6px 16px; text-align: left; border: 0; background: transparent; white-space: nowrap; }
#stage-menu button:hover { background: #f5f5f5; }
#stage-menu li.active button { font-weight: bold; }

/* Tabellen als kaarten op een smal scherm (Verdeling, Looplijst) */
@media (max-width: 767px) {
    .table-cards thead { display: none; }
    .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
    .table-cards tr { margin-bottom: 12px; border: 1px solid #ddd; border-radius: 4px; padding: 6px 0; background: #fff; }
    .table-cards td { border: 0 !important; padding: 4px 12px !important; }
    .table-cards td[data-label]::before { content: attr(data-label) ": "; font-weight: 600; color: #777; }
}
.row-actions .act-archive { color: #ef6c00; border-color: #ffcc80; }
.row-actions .act-restore { color: #1565c0; border-color: #90caf9; }
.row-actions .act-archive:hover { background: #fff3e0; }
.row-actions .act-restore:hover { background: #e3f2fd; }

/* Voorbeeld van de advertentie bij hover */
#ad-preview-box {
    position: fixed;
    display: none;
    z-index: 2000;
    max-width: 340px;
    padding: 6px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
    pointer-events: none;
}
#ad-preview-box img { display: block; max-width: 326px; max-height: 70vh; height: auto; }
#ad-preview-box .caption { margin-top: 4px; font-size: 12px; color: #666; text-align: center; }
.row-actions .act-inform { color: #00838f; border-color: #80deea; }
.row-actions .act-inform:hover { background: #e0f7fa; }

/* ---------- Responsive ---------- */
/* Lange namen en e-mailadressen mogen afbreken */
#advertisers .name { overflow-wrap: anywhere; }

/* Acties in de lijst en op Verdeling/Looplijst */
.actions-cell { white-space: nowrap; text-align: right; }

/* Tablet: de navbar past niet op één regel, dus compacter en zonder naam bij het profielicoon */
@media (min-width: 768px) and (max-width: 991px) {
    .navbar-default .navbar-nav > li > a { padding: 5px 8px; margin-left: 2px; font-size: 13px; }
    .navbar-default .navbar-brand { padding-left: 8px; padding-right: 8px; }
    .nav-user-name { display: none; }
}

/* Telefoon */
@media (max-width: 767px) {
    /* iOS zoomt in op invoervelden kleiner dan 16px */
    input.form-control, select.form-control, textarea.form-control { font-size: 16px; }

    /* Ingeklapt menu: geen inspringing of rand van de desktopbalk */
    .navbar-default .navbar-nav > li > a { margin: 4px 0; }
    .navbar-default .navbar-nav > li > .btn { margin-left: 15px; }

    /* Acties in de lijst: laten wrappen in plaats van de tabel breder te maken */
    #advertisers .actions { white-space: normal; }
    .row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 150px; margin-left: auto; }
    .row-actions > .btn { float: none; margin: 0 !important; border-radius: 4px !important; }

    /* Filters: twee per regel */
    #toolbar select.form-control { display: inline-block; width: calc(50% - 4px); margin-bottom: 8px; }

    /* Statuspillen: één regel, zijwaarts scrollen */
    .stage-pills { white-space: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .stage-pills > li, .stage-pills > li.pull-right { float: none !important; display: inline-block; }

    /* Actieknoppen op kaarten onder elkaar */
    .table-cards td.actions-cell { text-align: left; white-space: normal; }
    .table-cards td.actions-cell .btn { display: block; width: 100%; margin: 0 0 6px; }
}

/* Aanraakschermen: grotere doelen */
@media (pointer: coarse) {
    .row-actions .btn { min-width: 44px; min-height: 44px; }
    .stage-toggle { padding: 8px 14px; }
    .stage-pills > li > a { padding: 10px 14px; }
}

/* Menu: ballontje dat de beheerder attendeert op registratiefouten */
.badge-attention {
    background: #d9534f;
    color: #fff;
    font-weight: 700;
    margin-left: 2px;
    animation: attention-pulse 2s ease-in-out infinite;
}
@keyframes attention-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(217, 83, 79, .5); }
    50% { box-shadow: 0 0 0 6px rgba(217, 83, 79, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .badge-attention { animation: none; }
}
