/* ==========================================================================
   Uptime Monitor — eigen stijllaag bovenop Bootstrap.
   Alle kleuren, randen en schaduwen komen uit de variabelen hieronder, zodat de
   hele interface in één keer van uiterlijk kan veranderen.
   ========================================================================== */

:root {
    --bg: #f5f7fa;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --border: #e6eaf0;
    --border-strong: #d7dee8;

    --text: #0f172a;
    --text-soft: #475569;
    --text-muted: #8494a8;

    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff4ff;

    --up: #16a34a;
    --up-soft: #e9f9ef;
    --down: #e11d48;
    --down-soft: #fdeef1;
    --pending: #d97706;
    --pending-soft: #fdf4e3;
    --paused: #64748b;
    --paused-soft: #eef1f5;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
    --shadow: 0 4px 16px rgba(15, 23, 42, .06);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12);

    --sidebar-width: 248px;
    --topbar-height: 68px;
}

html {
    font-size: 15px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

h1, h2, h3, h4, h5 {
    color: var(--text);
    letter-spacing: -.02em;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .9em;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* ---------- Raamwerk: zijbalk + inhoud ---------------------------------- */

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    z-index: 1040;
}

.app-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-page {
    padding: 26px 30px 56px;
    width: 100%;
    max-width: 1460px;
}

/* Merk */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 18px;
    color: var(--text);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -.02em;
}

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

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 6px 14px rgba(37, 99, 235, .3);
}

/* Navigatie */
.nav-side {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-side a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    font-weight: 600;
    font-size: .95rem;
    transition: background .15s, color .15s;
}

.nav-side a:hover {
    background: var(--surface-muted);
    color: var(--text);
}

.nav-side a.active {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.nav-side svg {
    flex: 0 0 auto;
    opacity: .85;
}

.nav-side-foot {
    margin-top: auto;
    padding-top: 14px;
}

.side-status {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 12px;
    background: var(--surface-muted);
    font-size: .85rem;
    color: var(--text-soft);
}

.side-status:hover {
    border-color: var(--border-strong);
    color: var(--text-soft);
}

.side-status .side-status-link {
    color: var(--primary);
    font-weight: 600;
}

/* Bovenbalk */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 30px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.topbar-search {
    position: relative;
    flex: 1 1 auto;
    max-width: 520px;
}

.topbar-search svg {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.topbar-search input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-muted);
    padding: 0 84px 0 40px;
    font-size: .92rem;
    color: var(--text);
}

.topbar-search input:focus {
    outline: none;
    background: #fff;
    border-color: #bfd3fb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.topbar-search kbd {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 7px;
    font-size: .72rem;
    color: var(--text-muted);
    font-family: inherit;
}

.icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-soft);
    display: grid;
    place-items: center;
}

.icon-btn:hover {
    background: var(--surface-muted);
    border-color: var(--border);
    color: var(--text);
}

.icon-btn .dot {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--down);
    border: 2px solid #fff;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 9px 5px 5px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    text-align: left;
}

.user-chip:hover {
    background: var(--surface-muted);
    border-color: var(--border);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: .82rem;
    letter-spacing: .02em;
}

.user-chip .name {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    line-height: 1.15;
}

.user-chip .role {
    font-size: .76rem;
    color: var(--text-muted);
}

.sidebar-toggle {
    display: none;
}

/* ---------- Paginakop ---------------------------------------------------- */

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 22px;
}

.page-head h1 {
    font-size: 2.1rem;
    font-weight: 700;
    margin: 0;
}

.page-head .page-sub {
    color: var(--text-muted);
    margin: 6px 0 0;
    font-size: .98rem;
}

.page-head .actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

/* ---------- Knoppen ------------------------------------------------------ */

.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.btn:focus, .btn:active:focus, .form-control:focus, .form-select:focus, .form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .15);
}

.btn-primary {
    background: linear-gradient(180deg, #3b82f6, #2563eb);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(37, 99, 235, .25);
}

.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(180deg, #2f76ef, #1d4ed8);
    border-color: var(--primary-dark);
}

.btn-light, .btn-outline-secondary {
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--text-soft);
}

.btn-light:hover, .btn-outline-secondary:hover {
    background: var(--surface-muted);
    border-color: var(--border-strong);
    color: var(--text);
}

/* Segmentknop voor lijst/tegel-weergave */
.segmented {
    display: inline-flex;
    padding: 3px;
    gap: 3px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
}

.segmented button {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    border-radius: 7px;
    width: 34px;
    height: 30px;
    display: grid;
    place-items: center;
}

.segmented button:hover {
    color: var(--text);
}

.segmented button.active {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

/* ---------- Kaarten ------------------------------------------------------ */

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.panel-head h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}

.panel-body {
    padding: 18px 20px;
}

.card {
    border-color: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card-header {
    background: var(--surface);
    border-bottom-color: var(--border);
    font-weight: 700;
    padding: 14px 18px;
}

/* ---------- Statustegels ------------------------------------------------- */

.stat-card {
    height: 100%;
    color: var(--text);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}

.stat-card.up { background: linear-gradient(180deg, #f2fbf5, #ffffff); border-color: #d6efdf; }
.stat-card.down { background: linear-gradient(180deg, #fff3f5, #ffffff); border-color: #f6d7de; }
.stat-card.pending { background: linear-gradient(180deg, #fffaf0, #ffffff); border-color: #f4e3c3; }
.stat-card.paused { background: linear-gradient(180deg, #f6f8fb, #ffffff); border-color: #e2e8f0; }

.stat-top {
    display: flex;
    align-items: center;
    gap: 13px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    color: #fff;
    flex: 0 0 auto;
}

.stat-card.up .stat-icon { background: var(--up); box-shadow: 0 6px 14px rgba(22, 163, 74, .25); }
.stat-card.down .stat-icon { background: var(--down); box-shadow: 0 6px 14px rgba(225, 29, 72, .25); }
.stat-card.pending .stat-icon { background: var(--pending); box-shadow: 0 6px 14px rgba(217, 119, 6, .25); }
.stat-card.paused .stat-icon { background: var(--paused); box-shadow: 0 6px 14px rgba(100, 116, 139, .22); }

.stat-num {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-weight: 600;
    font-size: .92rem;
}

.stat-card.up .stat-label { color: var(--up); }
.stat-card.down .stat-label { color: var(--down); }
.stat-card.pending .stat-label { color: var(--pending); }
.stat-card.paused .stat-label { color: var(--paused); }

.stat-spark {
    margin-left: auto;
    width: 96px;
    height: 34px;
}

.stat-spark svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.stat-foot {
    font-size: .82rem;
    color: var(--text-muted);
}

/* ---------- Statuspil ---------------------------------------------------- */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px 5px 10px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
}

.pill::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
}

.pill-Up { background: var(--up-soft); color: var(--up); }
.pill-Down { background: var(--down-soft); color: var(--down); }
.pill-Pending { background: var(--pending-soft); color: var(--pending); }
.pill-Paused { background: var(--paused-soft); color: var(--paused); }

.pill-Down::before {
    animation: pulse-dot 1.6s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
}

@media (prefers-reduced-motion: reduce) {
    .pill-Down::before { animation: none; }
}

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    background: var(--paused);
}

.status-dot.Up { background: var(--up); }
.status-dot.Down { background: var(--down); }
.status-dot.Pending { background: var(--pending); }
.status-dot.Paused { background: var(--paused); }

/* ---------- Favicon ------------------------------------------------------ */

.favicon {
    position: relative;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    overflow: hidden;
    font-size: .74rem;
    font-weight: 700;
    color: var(--text-soft);
    text-transform: uppercase;
}

.favicon img {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 18px;
    height: 18px;
    object-fit: contain;
    background: inherit;
}

.favicon-lg {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    font-size: 1rem;
}

.favicon-lg img {
    width: 26px;
    height: 26px;
}

/* De beginletter staat eronder en komt tevoorschijn als het icoon niet geladen kan worden. */
.favicon span {
    line-height: 1;
}

/* ---------- Tabel -------------------------------------------------------- */

.data-table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th {
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .02em;
    padding: 11px 14px;
    white-space: nowrap;
}

.data-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table .num, .data-table .text-nowrap {
    white-space: nowrap;
}

/* Het actiemenu hoeft in een rij niet de volle knopmaat te hebben. */
.data-table .icon-btn {
    width: 34px;
    height: 34px;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover {
    background: var(--surface-muted);
}

a.name {
    font-weight: 600;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.name:hover {
    color: var(--primary);
}

.data-table a.name {
    max-width: 230px;
}

.name-cell {
    display: flex;
    align-items: center;
    gap: 11px;
}

.name-sub {
    font-size: .79rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 1px;
}

.target-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-soft);
    font-size: .88rem;
}

.chip {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    color: var(--text-soft);
    font-size: .72rem;
    font-weight: 600;
}

.ext-link {
    color: var(--text-muted);
    opacity: 0;
    transition: opacity .15s;
}

tr:hover .ext-link, .monitor-card:hover .ext-link {
    opacity: 1;
}

.ext-link:hover {
    color: var(--primary);
}

.num {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.up-good { color: var(--up); }
.up-warn { color: var(--pending); }
.up-bad { color: var(--down); }

/* ---------- Heartbeat-balk ---------------------------------------------- */

.hb-bar {
    display: flex;
    gap: 2px;
    align-items: center;
}

.hb {
    width: 5px;
    height: 22px;
    border-radius: 3px;
    background: #e2e8f0;
    flex: 0 0 auto;
    transition: transform .12s;
}

.hb:hover {
    transform: scaleY(1.15);
}

.hb-lg .hb {
    width: 9px;
    height: 32px;
    border-radius: 4px;
}

.hb.Up { background: var(--up); }
.hb.Down { background: var(--down); }
.hb.Pending { background: var(--pending); }
.hb.Paused { background: #cbd5e1; }

/* ---------- Tegelweergave ------------------------------------------------ */

.monitor-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .15s, transform .15s;
}

.monitor-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.monitor-card .mc-head {
    display: flex;
    align-items: flex-start;
    gap: 11px;
}

.monitor-card .mc-stats {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: .82rem;
    color: var(--text-muted);
}

.monitor-card .mc-stats strong {
    display: block;
    font-size: .98rem;
    color: var(--text);
}

/* ---------- Dropdownmenu ------------------------------------------------- */

.dropdown-menu {
    border-color: var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    font-size: .92rem;
}

.dropdown-item {
    border-radius: 7px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text-soft);
    font-weight: 500;
}

.dropdown-item:hover, .dropdown-item:focus {
    background: var(--surface-muted);
    color: var(--text);
}

.dropdown-item.danger {
    color: var(--down);
}

.dropdown-item.danger:hover {
    background: var(--down-soft);
    color: var(--down);
}

.dropdown-menu form {
    margin: 0;
}

.dropdown-menu button.dropdown-item {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
}

/* ---------- Meldingen ---------------------------------------------------- */

.alert {
    border-radius: var(--radius-sm);
    border-width: 1px;
}

.flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: var(--primary-soft);
    border: 1px solid #d7e3fd;
    color: #1e40af;
    font-weight: 500;
    margin-bottom: 18px;
}

.empty-state {
    text-align: center;
    padding: 56px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--primary-soft);
    color: var(--primary);
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
}

/* Voetstrook onder het overzicht */
.footer-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 18px;
}

.footer-strip > div {
    flex: 1 1 280px;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 16px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
}

.footer-strip .tint {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    flex: 0 0 auto;
}

/* ---------- Inloggen en foutpagina --------------------------------------- */

.login-wrap {
    max-width: 400px;
    margin: 8vh auto 0;
}

.login-wrap .brand-mark,
.login-wrap .empty-icon {
    display: grid;
}

/* ---------- Publieke statuspagina ---------------------------------------- */

.status-page {
    max-width: 880px;
    margin: 0 auto;
}

.status-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.status-banner.ok {
    background: var(--up-soft);
    border-color: #cdebd8;
    color: #14532d;
}

.status-banner.fail {
    background: var(--down-soft);
    border-color: #f5cdd6;
    color: #881337;
}

.status-banner .banner-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #fff;
    flex: 0 0 auto;
}

.status-banner.ok .banner-icon { color: var(--up); }
.status-banner.fail .banner-icon { color: var(--down); }

/* ---------- Formulieren -------------------------------------------------- */

.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: var(--border-strong);
    padding: .5rem .75rem;
}

.form-label {
    font-weight: 600;
    font-size: .88rem;
    color: var(--text-soft);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ---------- Grafiek ------------------------------------------------------ */

.chart svg {
    width: 100%;
    height: 140px;
}

/* ---------- Responsief --------------------------------------------------- */

@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: var(--shadow-lg);
    }

    body.sidebar-open .app-sidebar {
        transform: none;
    }

    body.sidebar-open::after {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .35);
        z-index: 1035;
    }

    .app-content {
        margin-left: 0;
    }

    .app-topbar {
        padding: 0 16px;
    }

    .app-page {
        padding: 20px 16px 48px;
    }

    .sidebar-toggle {
        display: grid;
    }

    .user-chip .name, .user-chip .role {
        display: none;
    }

    .page-head h1 {
        font-size: 1.7rem;
    }
}

@media (max-width: 575.98px) {
    .topbar-search kbd {
        display: none;
    }
}
