/* Admin Portal Styles */
:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #3b82f6;
    --body-bg: #f1f5f9;
}

body {
    background-color: var(--body-bg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand i {
    color: var(--sidebar-active);
}

/* Sidebar search */
.sidebar-search {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #334155;
}

.sidebar-search .position-relative > i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 0.75rem;
    pointer-events: none;
}

.sidebar-search input {
    width: 100%;
    background: #334155;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    color: #e2e8f0;
    font-size: 0.8rem;
    padding: 0.4rem 2rem 0.4rem 2rem;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}

.sidebar-search input::placeholder { color: #64748b; }
.sidebar-search input:focus {
    border-color: var(--sidebar-active);
    background: #1e293b;
}

.search-kbd {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #1e293b;
    color: #64748b;
    border: 1px solid #475569;
    border-radius: 3px;
    font-size: 0.65rem;
    padding: 0 5px;
    line-height: 1.6;
    font-family: inherit;
    pointer-events: none;
    transition: opacity 0.15s;
}

.sidebar-search input:focus + .search-kbd,
.sidebar-search input:not(:placeholder-shown) + .search-kbd { opacity: 0; }

.search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    width: 320px;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    z-index: 2000;
    max-height: 420px;
    overflow-y: auto;
    color: #334155;
}

.search-dropdown .search-section {
    padding: 0.4rem 0.75rem 0.2rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

.search-dropdown .search-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.1s;
    text-decoration: none;
    color: inherit;
}

.search-dropdown .search-item:hover,
.search-dropdown .search-item.active {
    background: #f1f5f9;
}

.search-dropdown .search-item i {
    width: 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.search-dropdown .search-item .search-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-dropdown .search-item .search-meta {
    font-size: 0.7rem;
    color: #94a3b8;
    flex-shrink: 0;
}

.search-dropdown .search-empty {
    padding: 1.25rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.8rem;
}

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

.nav-sidebar .nav-section {
    padding: 0.75rem 1.5rem 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.nav-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.5rem;
    color: #94a3b8;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.nav-sidebar .nav-link:hover {
    color: #e2e8f0;
    background: var(--sidebar-hover);
}

.nav-sidebar .nav-link.active {
    color: #fff;
    background: rgba(59, 130, 246, 0.15);
    border-left-color: var(--sidebar-active);
}

.nav-sidebar .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
}

/* Top bar */
.top-bar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: 48px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    z-index: 900;
    display: flex;
    align-items: center;
}

.top-bar-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 0 1.5rem;
}

/* Top bar - Zoekbalk */
.top-bar-search { flex: 1; max-width: 340px; }

.top-bar-search .position-relative > i {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    color: #94a3b8; font-size: 0.75rem; pointer-events: none;
}

.top-bar-search input {
    width: 100%;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    color: #334155;
    font-size: 0.8rem;
    padding: 0.35rem 2rem 0.35rem 2rem;
    outline: none;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.top-bar-search input::placeholder { color: #94a3b8; }
.top-bar-search input:focus {
    border-color: var(--sidebar-active);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.topbar-kbd {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    background: #e2e8f0; color: #64748b; border: 1px solid #cbd5e1;
    border-radius: 3px; font-size: 0.6rem; padding: 0 4px; line-height: 1.6;
    font-family: inherit; pointer-events: none; transition: opacity 0.15s;
}
.top-bar-search input:focus + .topbar-kbd,
.top-bar-search input:not(:placeholder-shown) + .topbar-kbd { opacity: 0; }

.top-bar-search .search-dropdown { width: 380px; }

/* Top bar - Domeincheck */
.top-bar-domaincheck { flex: 1; max-width: 300px; }

.top-bar-domaincheck .position-relative > i {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    color: #94a3b8; font-size: 0.75rem; pointer-events: none;
}

.top-bar-domaincheck input {
    width: 100%;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    color: #334155;
    font-size: 0.8rem;
    padding: 0.35rem 2rem 0.35rem 2rem;
    outline: none;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.top-bar-domaincheck input::placeholder { color: #94a3b8; }
.top-bar-domaincheck input:focus {
    border-color: #10b981;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(16,185,129,0.1);
}

#topbar-domain-status {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    font-size: 0.75rem; pointer-events: none;
}

.topbar-domain-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    width: 420px;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 2000;
    padding: 0.75rem;
    color: #334155;
    font-size: 0.8rem;
}

.topbar-domain-dropdown table { margin-bottom: 0; }
.topbar-domain-dropdown .badge { font-size: 0.7rem; }

/* Top bar - Bedrijfsgegevens */
.top-bar-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
    font-size: 0.72rem;
    color: #64748b;
    white-space: nowrap;
    flex-shrink: 0;
    user-select: all;
}

.top-bar-info span {
    display: flex; align-items: center; gap: 0.3rem;
    cursor: pointer; padding: 0.2rem 0.4rem; border-radius: 0.25rem;
    transition: background 0.15s, color 0.15s;
}
.top-bar-info span:hover { background: #f1f5f9; color: #334155; }
.top-bar-info span.copied { color: #10b981; }
.top-bar-info i { color: #94a3b8; font-size: 0.65rem; transition: color 0.15s; }
.top-bar-info span.copied i { color: #10b981; }

/* Main content */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 1.5rem 2rem;
    padding-top: calc(48px + 1.5rem);
    min-height: 100vh;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.page-header .breadcrumb {
    margin: 0;
    font-size: 0.8rem;
}

/* Cards */
.stat-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    padding: 1rem 1.25rem;
}

/* Tables */
.table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    border-bottom-width: 1px;
}

.table td {
    vertical-align: middle;
    font-size: 0.875rem;
    color: #334155;
}

.table-hover tbody tr {
    cursor: pointer;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* Search bar */
.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.search-box input {
    padding-left: 2.25rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    font-size: 0.875rem;
}

.search-box input:focus {
    border-color: var(--sidebar-active);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Badges */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

/* Login page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border: none;
}

.login-card .card-body {
    padding: 2.5rem;
}

.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-brand i {
    font-size: 2.5rem;
    color: var(--sidebar-active);
}

.login-brand h2 {
    font-weight: 700;
    color: #1e293b;
    margin-top: 0.75rem;
}

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .top-bar {
        left: 0;
    }
    .top-bar-info {
        display: none;
    }
    .sidebar-toggle {
        display: block !important;
    }
}

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: var(--sidebar-bg);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    width: 40px;
    height: 40px;
}

/* Toggle badge */
.toggle-badge {
    transition: background-color 0.2s ease;
    user-select: none;
}

.toggle-badge:hover {
    opacity: 0.85;
}

.toggle-badge.toggle-busy {
    pointer-events: none;
}

.toggle-badge .toggle-icon:not(:empty) {
    display: inline-block;
}

/* Drag & drop reorder */
tr.drag-over td {
    border-top: 2px solid var(--sidebar-active) !important;
}

tr[draggable] {
    touch-action: none;
}

tr[draggable].dragging {
    opacity: 0.4;
}

.drag-handle {
    cursor: grab;
    color: #94a3b8;
    margin-right: 0.5rem;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Key-value list */
.kv-list {
    display: flex;
    flex-direction: column;
}

.kv-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.kv-row:last-child {
    border-bottom: none;
}

.kv-key {
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
}

.kv-val {
    font-size: 0.875rem;
    color: #334155;
    text-align: right;
}

.kv-editable {
    cursor: pointer;
    border-radius: 4px;
    padding: 1px 4px;
    margin: -1px -4px;
    transition: background-color 0.15s;
}

.kv-editable:hover {
    background-color: rgba(59, 130, 246, 0.08);
}

/* KVK search results */
.kvk-result:hover {
    background: #f1f5f9;
}
.kvk-result:last-child {
    border-bottom: none !important;
}
#kvk-results {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    margin-top: 0.25rem;
    overflow: hidden;
}

/* Utility */
.clickable { cursor: pointer; }
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Sidebar user profile */
.sidebar-user {
    flex-shrink: 0;
    padding: 1rem 1.5rem;
    border-top: 1px solid #334155;
    background: rgba(0,0,0,0.15);
}

.sidebar-user .user-avatar {
    font-size: 1.75rem;
    color: #64748b;
}

.sidebar-user .user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #e2e8f0;
    line-height: 1.2;
}

.sidebar-user .user-email {
    font-size: 0.7rem;
    color: #64748b;
}
