:root {
    --navy:      #102a43;
    --yellow:    #ffb703;
    --yellow-dk: #e8a500;
    --teal:      #2bbfbf;
    --teal-dark: #22a0a0;
    --teal-light:#eaf8f8;
    --border:    #e2e8f0;
    --text-muted:#64748b;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
    --shadow:    0 4px 12px rgba(0,0,0,.09);
    --radius:    8px;
    --sidebar-w: 260px;
    --header-h:  62px;
}

* { box-sizing: border-box; }
body {
    background: #f4f6f8;
    font-family: 'Segoe UI', -apple-system, Arial, sans-serif;
    font-size: 14px; margin: 0; color: #334155;
}

/* ═══════════════════════════════════════════════════════
   HEADER  —  wit, sticky, één balk met logo + nav + user
   De logo-sectie is exact zo breed als de sidebar zodat
   de scheidingslijn continu doorloopt van top tot footer.
   ═══════════════════════════════════════════════════════ */
.site-header {
    background: #fff;
    border-bottom: 3px solid var(--yellow);
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    position: sticky; top: 0; z-index: 200;
    height: var(--header-h);
}
.header-inner {
    width: 100%; height: 100%;
    display: flex; align-items: stretch;
}

/* Logo-sectie */
.header-logo-area {
    width: var(--sidebar-w);
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    display: flex; align-items: center;
    padding: 0 18px;
}
.site-logo {
    color: var(--navy); font-size: 14px; font-weight: 800;
    text-decoration: none;
    display: flex; align-items: center; gap: 10px; white-space: nowrap;
}
.logo-icon {
    width: 34px; height: 34px; background: var(--yellow);
    border-radius: 9px; display: flex; align-items: center;
    justify-content: center; font-size: 1rem; font-weight: 900;
    color: var(--navy); flex-shrink: 0; transition: background .15s;
}
.logo-text-main { font-weight: 800; font-size: .95rem; color: var(--navy); display: block; line-height: 1.1; }
.logo-text-sub  { font-weight: 400; font-size: .72rem; color: var(--text-muted); display: block; }
.site-logo:hover .logo-icon { background: var(--yellow-dk); }
.site-logo:hover { color: var(--navy); }

/* Nav-sectie */
.header-nav-area {
    flex: 1; min-width: 0;
    display: flex; align-items: stretch;
    padding: 0 4px;
}
.header-nav-item {
    display: flex; align-items: center; gap: 6px;
    padding: 0 13px; height: 100%;
    color: #475569; font-size: 13.5px; font-weight: 600;
    text-decoration: none; white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: color .15s, border-color .15s;
}
.header-nav-item i { font-size: 14px; }
.header-nav-item:hover  { color: var(--navy); border-bottom-color: var(--yellow); }
.header-nav-item.active { color: var(--navy); border-bottom-color: var(--yellow); font-weight: 700; background: rgba(255,183,3,.06); }

/* Gebruiker-sectie */
.header-user-area {
    display: flex; align-items: center; gap: 4px;
    padding: 0 14px; flex-shrink: 0;
    border-left: 1px solid var(--border);
}
.header-username {
    color: #475569; font-size: 13px;
    padding: 0 8px; white-space: nowrap; font-weight: 500;
}
.btn-logout {
    color: #94a3b8; font-size: 16px;
    text-decoration: none; padding: 7px 8px; border-radius: 7px;
    display: flex; align-items: center; transition: all .15s;
    border: 1px solid transparent;
}
.btn-logout:hover { color: var(--navy); background: #f1f5f9; border-color: var(--border); }

/* ═══════════════════════════════════════════════════════
   LAYOUT  —  header → [sidebar | content] → footer
   ═══════════════════════════════════════════════════════ */
.layout-wrapper {
    display: flex; align-items: flex-start;
    min-height: calc(100vh - var(--header-h) - 40px);
}

/* ── Sidebar ────────────────────────────────────────── */
.sidebar-col {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid var(--border);
    position: sticky;
    top: var(--header-h);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto; overflow-x: hidden;
}

.sidebar-search-wrap {
    position: relative;
    padding: 12px 12px 10px;
    border-bottom: 1px solid var(--border);
}
.sidebar-search {
    width: 100%;
    padding: 7px 10px 7px 32px;
    border: 1px solid var(--border); border-radius: 6px;
    font-size: 13px; color: #334155; background: #f8fafc;
    outline: none; transition: border-color .15s, box-shadow .15s;
}
.sidebar-search:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(43,191,191,.1);
    background: #fff;
}
.sidebar-search-icon {
    position: absolute; left: 24px; top: 50%;
    transform: translateY(-50%);
    color: #94a3b8; font-size: 13px; pointer-events: none;
}

.sidebar-new-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin: 10px 12px 6px; padding: 8px 14px;
    background: var(--yellow); color: var(--navy);
    border-radius: 7px; font-size: 13px; font-weight: 700;
    text-decoration: none; transition: background .15s;
}
.sidebar-new-btn:hover { background: var(--yellow-dk); color: var(--navy); }

.sidebar-list { padding: 4px 0 8px; }

.sidebar-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    text-decoration: none; color: #334155;
    border-left: 3px solid transparent;
    transition: background .12s, border-color .12s;
}
.sidebar-item:hover { background: #f8fafc; }
.sidebar-item.active {
    background: #fffbeb;
    border-left-color: var(--yellow);
}

.sidebar-item-icon {
    width: 34px; height: 34px; border-radius: 50%;
    background: #e2e8f0; color: #64748b;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0; transition: background .12s;
}
.sidebar-item-icon.ok   { background: #dcfce7; color: #16a34a; }
.sidebar-item-icon.warn { background: #fef9c3; color: #ca8a04; }
.sidebar-item.active .sidebar-item-icon { background: #fef9c3; color: #92400e; }

.sidebar-item-body { flex: 1; min-width: 0; }
.sidebar-item-title {
    font-size: 13px; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    color: #1e293b;
}
.sidebar-item-sub { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.sidebar-item.active .sidebar-item-title { color: var(--navy); font-weight: 700; }
.sidebar-item.active .sidebar-item-sub   { color: #64748b; }

.sidebar-section-title {
    padding: 10px 14px 6px;
    font-size: 10.5px; font-weight: 700; color: #94a3b8;
    text-transform: uppercase; letter-spacing: .6px;
}

.sidebar-empty {
    padding: 24px 14px; font-size: 13px;
    color: #94a3b8; text-align: center; font-style: italic;
}

/* ── Content kolom ──────────────────────────────────── */
.content-col { flex: 1; min-width: 0; }
.content-inner {
    max-width: 960px; margin: 0 auto;
    padding: 0 28px 48px;
}

/* ═══════════════════════════════════════════════════════
   DOMAIN HEADER CARD
   ═══════════════════════════════════════════════════════ */
.page-domain-header { margin: 20px 0 14px; }
.page-domain-header h2 { font-size: 20px; color: #1e293b; font-weight: 600; margin: 0; }
.page-domain-header h2 strong { color: var(--teal); }

.domain-header-card {
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius); margin: 20px 0 14px;
    box-shadow: var(--shadow-sm); overflow: hidden;
}
.domain-header-top {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 12px; padding: 18px 22px 16px; flex-wrap: wrap;
}
.domain-header-left { flex: 1; min-width: 0; }
.domain-title { font-size: 19px; font-weight: 700; color: var(--teal); margin: 0; line-height: 1.2; }
.domain-plan {
    font-size: 12px; font-weight: 500; color: #64748b;
    background: #f1f5f9; border-radius: 4px; padding: 2px 7px; white-space: nowrap;
}
.domain-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.domain-info-row {
    display: flex; flex-wrap: wrap;
    border-top: 1px solid var(--border); background: #fafbfc;
}
.domain-info-item {
    flex: 1; min-width: 150px;
    padding: 12px 22px; border-right: 1px solid var(--border);
}
.domain-info-item:last-child { border-right: none; }
.domain-info-label {
    font-size: 10.5px; font-weight: 700; color: #94a3b8;
    text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px;
}
.domain-info-value { font-size: 13px; color: #334155; }
.domain-info-value code {
    font-size: 12.5px; color: #334155;
    background: #f1f5f9; padding: 2px 6px; border-radius: 4px;
}

.status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px;
}
.status-badge i { font-size: 7px; }
.status-badge.active   { background: #dcfce7; color: #16a34a; }
.status-badge.inactive { background: #fee2e2; color: #dc2626; }

/* ═══════════════════════════════════════════════════════
   KAARTEN
   ═══════════════════════════════════════════════════════ */
.portal-card {
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius); margin-bottom: 14px;
    overflow: hidden; box-shadow: var(--shadow-sm);
}
.portal-card-header {
    background: #fff; border-bottom: 1px solid var(--border);
    padding: 13px 20px; font-size: 14px; font-weight: 600; color: #1e293b;
}
.portal-card-body { padding: 0; }
.portal-card-body.padded { padding: 18px 20px; }

.card-header-link {
    font-size: 12px; color: var(--navy); text-decoration: none; font-weight: 600;
    background: var(--yellow); padding: 3px 10px; border-radius: 20px; white-space: nowrap;
}
.card-header-link:hover { background: var(--yellow-dk); color: var(--navy); text-decoration: none; }

.info-banner {
    background: linear-gradient(135deg, #f0f9ff 0%, #eaf8f8 100%);
    border: 1px solid #bae6fd; border-radius: var(--radius);
    padding: 16px 20px; margin-bottom: 14px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    box-shadow: var(--shadow-sm);
}
.info-banner p { margin: 0; font-size: 13.5px; color: #334155; }

.btn-teal {
    background: var(--yellow); color: var(--navy); border: none;
    padding: 8px 18px; border-radius: 6px; font-size: 13px; font-weight: 700;
    text-decoration: none; display: inline-block; cursor: pointer;
    transition: background .15s, box-shadow .15s;
    box-shadow: 0 2px 6px rgba(255,183,3,.3);
}
.btn-teal:hover {
    background: var(--yellow-dk); color: var(--navy);
    box-shadow: 0 4px 12px rgba(255,183,3,.35);
}
.btn-teal.btn-sm { padding: 5px 13px; font-size: 12px; }

.btn-navy {
    background: var(--navy); color: #fff; border: none;
    padding: 8px 18px; border-radius: 6px; font-size: 13px; font-weight: 600;
    text-decoration: none; display: inline-block; cursor: pointer;
    transition: background .15s;
}
.btn-navy:hover { background: #0b1e2e; color: #fff; }
.btn-navy.btn-sm { padding: 5px 13px; font-size: 12px; }

/* ── Tabel ──────────────────────────────────────────── */
.portal-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.portal-table th {
    background: #f8fafc; border-bottom: 2px solid var(--border);
    padding: 10px 16px; text-align: left; color: #475569;
    font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px;
}
.portal-table td {
    padding: 11px 16px; border-bottom: 1px solid #f0f4f8;
    color: #334155; vertical-align: middle;
}
.portal-table tr:last-child td { border-bottom: none; }
.portal-table tr:hover td { background: #f8fafc; }
.portal-table a { color: var(--teal); text-decoration: none; font-weight: 500; }
.portal-table a:hover { text-decoration: underline; }
.empty-row td { text-align: center; color: var(--text-muted); padding: 28px; font-style: italic; }

/* ── Quick links ────────────────────────────────────── */
.quick-section { margin-bottom: 0; }
.quick-section-title {
    color: #475569; font-size: 11px; font-weight: 700;
    padding: 11px 18px 9px; border-bottom: 1px solid var(--border);
    text-transform: uppercase; letter-spacing: .7px;
}
.quick-link {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 18px; border-bottom: 1px solid var(--border);
    text-decoration: none; color: #334155; font-size: 13px; transition: all .12s;
}
.quick-link:last-child { border-bottom: none; }
.quick-link:hover { background: #fffbeb; color: var(--navy); padding-left: 22px; }
.quick-link i.bi-chevron-right { color: #cbd5e1; font-size: 11px; flex-shrink: 0; }
.quick-link:hover i.bi-chevron-right { color: var(--yellow-dk); }

/* ── Factuur rijen ──────────────────────────────────── */
.invoice-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 18px; border-bottom: 1px solid var(--border);
    text-decoration: none; color: #334155; font-size: 13px; transition: background .12s;
}
.invoice-row:last-child { border-bottom: none; }
.invoice-row:hover { background: var(--teal-light); }

/* ── Dienst-kaarten ─────────────────────────────────── */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}
.service-card {
    background: #fff; border: 1.5px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    position: relative; transition: all .2s; box-shadow: var(--shadow-sm);
}
.service-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.service-card-status {
    position: absolute; top: 9px; right: 9px;
    font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px;
}
.service-card-status.active   { background: #dcfce7; color: #16a34a; }
.service-card-status.inactive { background: #fee2e2; color: #dc2626; }
.service-card-icon {
    background: linear-gradient(135deg, #eaf8f8 0%, #d5f0f0 100%);
    padding: 18px 12px 14px; text-align: center;
    font-size: 30px; color: var(--teal); line-height: 1;
}
.service-card-body { padding: 10px 12px 12px; }
.service-card-name { font-weight: 600; font-size: 13px; color: #1e293b; }
.service-card-desc { font-size: 11px; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }
.service-card-more { font-size: 11px; color: var(--teal); margin-top: 7px; font-weight: 600; }
.service-card-clickable { cursor: pointer; }
.service-card-clickable:hover { border-color: var(--teal); }
.service-card-clickable:hover .service-card-icon { background: linear-gradient(135deg, #d5f0f0 0%, #c2e8e8 100%); }

/* ── Stats widget ───────────────────────────────────── */
.stat-item { margin-bottom: 14px; }
.stat-item:last-child { margin-bottom: 0; }
.stat-label {
    font-size: 12px; font-weight: 600; color: #475569;
    display: flex; align-items: center; gap: 5px; margin-bottom: 5px;
}
.stat-value { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.stat-pct   { margin-left: auto; font-weight: 700; color: #334155; }
.stat-bar-track { background: #f1f5f9; border-radius: 10px; height: 7px; overflow: hidden; }
.stat-bar-fill {
    height: 100%; border-radius: 10px;
    background: linear-gradient(90deg, var(--teal) 0%, var(--teal-dark) 100%);
    transition: width .5s ease;
}
.stat-bar-fill.warn   { background: linear-gradient(90deg, #f59e0b, #d97706); }
.stat-bar-fill.danger { background: linear-gradient(90deg, #ef4444, #dc2626); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.stat-count-box {
    background: #f8fafc; border: 1px solid var(--border);
    border-radius: 8px; padding: 10px; text-align: center;
}
.stat-count-num   { font-size: 20px; font-weight: 700; color: var(--navy); line-height: 1; }
.stat-count-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Ticket thread ──────────────────────────────────── */
.ticket-thread { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.ticket-msg { display: flex; gap: 12px; align-items: flex-start; }
.ticket-avatar {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; margin-top: 2px;
}
.ticket-msg.customer .ticket-avatar { background: #e2e8f0; color: #475569; }
.ticket-msg.admin    .ticket-avatar { background: var(--teal); color: #fff; }
.ticket-bubble {
    flex: 1; min-width: 0;
    background: #fff; border: 1px solid var(--border);
    border-radius: 2px 12px 12px 12px;
    padding: 13px 17px; box-shadow: var(--shadow-sm);
}
.ticket-msg.admin .ticket-bubble { background: #f0fdfa; border-color: #a5f0f0; }
.ticket-bubble-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ticket-bubble-name { font-weight: 600; font-size: 13px; color: #1e293b; }
.ticket-bubble-time { font-size: 11.5px; color: #94a3b8; margin-left: auto; white-space: nowrap; }
.ticket-bubble-text { font-size: 13.5px; line-height: 1.7; color: #334155; white-space: pre-wrap; word-break: break-word; }

/* ── Breadcrumb ─────────────────────────────────────── */
.breadcrumb-bar { padding: 14px 0 0; }
.breadcrumb-bar .bc-inner { font-size: 12px; display: flex; align-items: center; gap: 6px; color: #94a3b8; }
.breadcrumb-bar a { color: #64748b; text-decoration: none; }
.breadcrumb-bar a:hover { color: var(--teal); }
.breadcrumb-bar .bc-sep { color: #cbd5e1; }
.breadcrumb-bar .bc-active { color: var(--teal); font-weight: 500; }

/* ── Formulieren ────────────────────────────────────── */
.form-label { font-weight: 600; font-size: 13px; color: #374151; margin-bottom: 5px; }
.form-control, .form-select { font-size: 13px; border-color: #d1d5db; border-radius: 6px; }
.form-control:focus, .form-select:focus {
    border-color: var(--teal); box-shadow: 0 0 0 3px rgba(43,191,191,.12);
}
.form-text { font-size: 12px; color: var(--text-muted); }

/* ── Meldingen ──────────────────────────────────────── */
.alert { border-radius: var(--radius); }
.alert-success { background: #f0fdf4; border: none; border-left: 4px solid #22c55e; color: #15803d; }
.alert-danger  { background: #fff1f2; border: none; border-left: 4px solid #f43f5e; color: #be123c; }
.badge { font-size: 11px; }

/* ═══════════════════════════════════════════════════════
   ADMIN  (eigen header-klasse, onaangetast)
   ═══════════════════════════════════════════════════════ */
.admin-header { background: #2c1a47; padding: 0; height: 52px; }
.admin-header .header-inner { padding: 0 16px; align-items: center; }
.admin-header .site-logo { color: #fff; height: auto; padding: 0; }
.admin-header .site-logo:hover { color: rgba(255,255,255,.85); }
.admin-header .header-right { display: flex; align-items: center; gap: 4px; }
.admin-header .btn-logout { color: rgba(255,255,255,.65); }
.admin-header .btn-logout:hover { color: #fff; background: rgba(255,255,255,.15); }
.admin-nav { background: #3d2760; border-bottom: 2px solid rgba(255,255,255,.1); height: auto; }
.admin-nav .header-inner { height: auto; align-items: center; }
.portal-main { min-height: calc(100vh - 160px); padding-bottom: 40px; }
.portal-main .container-fluid { max-width: 1200px; margin: 0 auto; }
.portal-tabs { list-style: none; margin: 0; padding: 0 20px; display: flex; }
.admin-tab {
    display: block; padding: 11px 14px; text-decoration: none;
    color: rgba(255,255,255,.7); font-size: 13px;
    border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap;
}
.admin-tab:hover { color: #fff; }
.admin-tab.active { color: #fff; border-bottom-color: var(--teal); }

/* ═══════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════ */
.site-footer-bar {
    background: var(--navy); color: rgba(255,255,255,.35);
    padding: 12px 0; font-size: 12px;
}
.footer-inner { padding: 0 20px; }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
/* Tabel scroll-wrapper voor portal tabellen */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.portal-card .table-scroll { margin: 0; }

@media (max-width: 900px) {
    :root { --sidebar-w: 220px; }
}

@media (max-width: 768px) {
    /* Layout */
    .sidebar-col { display: none; }
    .header-logo-area { width: auto; border-right: none; }
    .content-inner { padding: 0 12px 32px; }

    /* Header */
    .header-nav-area { display: none; }
    .header-user-area { margin-left: auto; }

    /* Cards */
    .info-banner { flex-direction: column; align-items: flex-start; gap: 10px; }
    .domain-info-row { flex-direction: column; }
    .domain-info-item { border-right: none; border-bottom: 1px solid var(--border); min-width: 0; }
    .domain-header-actions { flex-wrap: wrap; gap: 6px; }

    /* Tabellen: horizontaal scrollen */
    .portal-card .portal-table { min-width: 500px; }
    .portal-card-body:has(.portal-table) { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 0; }

    /* Services */
    .services-grid { grid-template-columns: 1fr 1fr; }

    /* Hosting bottom grid */
    .hosting-bottom { grid-template-columns: 1fr !important; }

    /* Admin nav scrollen */
    .portal-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; padding: 0 12px; }
    .admin-tab { flex-shrink: 0; }
    .admin-nav .header-inner { overflow-x: auto; }

    /* Page headers */
    .page-domain-header { flex-direction: column; align-items: flex-start !important; gap: 10px; }
}

@media (max-width: 560px) {
    /* Layout */
    .services-grid { grid-template-columns: 1fr; }
    .header-username { display: none; }
    .content-inner { padding: 0 10px 24px; }

    /* Kaarten */
    .portal-card-header { font-size: 13px; padding: 11px 14px; }
    .portal-card-body.padded { padding: 14px; }
    .quick-link { padding: 10px 14px; font-size: 12.5px; }

    /* Formulieren */
    .form-control, .form-select { font-size: 16px; } /* verhindert zoom op iOS */

    /* Knoppen - grotere taptargets */
    .btn-teal { padding: 10px 20px; }
}

/* iOS input-zoom voorkomen op publieke pagina's */
@media (max-width: 767px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    textarea,
    select { font-size: 16px !important; }
}
