@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
    --bg: #f8f6f3;
    --card: #ffffff;
    --primary: #1a5c4b;
    --primary-light: #e8f5f0;
    --primary-dark: #0f3d32;
    --accent: #e8913a;
    --accent-light: #fef3e7;
    --text: #2c2c2c;
    --text-muted: #7a7a7a;
    --border: #e8e4df;
    --danger: #c44b4b;
    --danger-light: #fef0f0;
    --success: #3a8f6a;
    --success-light: #edf8f3;
    --sidebar-width: 220px;
    --radius: 14px;
    --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'DM Sans', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary-dark);
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-logo {
    padding: 0 20px;
    margin-bottom: 32px;
}

.sidebar-logo h1 {
    font-size: 22px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
}

.sidebar-logo span {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
    display: block;
}

.sidebar nav { flex: 1; }

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.sidebar nav a:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.8);
}

.sidebar nav a.active {
    background: rgba(255,255,255,0.12);
    border-left-color: white;
    color: white;
    font-weight: 600;
}

.sidebar nav a .icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar-user {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user .label {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
}

.sidebar-user .name {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    font-weight: 500;
    margin-top: 2px;
}

.sidebar-user .relation {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    margin-top: 1px;
}

/* ===== MAIN CONTENT ===== */
.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
}

.main-inner {
    max-width: 960px;
    margin: 0 auto;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ===== CARDS ===== */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

/* ===== STAT CARDS ===== */
.stat-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.stat-card {
    flex: 1 1 200px;
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-value.primary { color: var(--primary); }
.stat-value.accent { color: var(--accent); }
.stat-value.muted { color: var(--text-muted); }
.stat-value.success { color: var(--success); }

.stat-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== TWO COLUMN LAYOUT ===== */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* ===== ALERTS ===== */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.5;
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.alert:last-child { margin-bottom: 0; }

.alert.info { background: var(--primary-light); color: var(--primary-dark); }
.alert.warning { background: var(--accent-light); color: #8a5a1e; }
.alert.danger { background: var(--danger-light); color: var(--danger); }
.alert.success { background: var(--success-light); color: var(--success); }

/* ===== CONVERSATION ROWS ===== */
.conv-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    transition: background 0.15s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.conv-row:hover { background: var(--primary-light); }

.conv-row .date {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.conv-row .meta {
    font-size: 12px;
    color: var(--text-muted);
}

.conv-row .topics {
    font-size: 13px;
    color: var(--text-muted);
    flex: 1;
    text-align: center;
}

/* ===== BADGES ===== */
.badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.badge.vrolijk { background: var(--success-light); color: var(--success); }
.badge.rustig { background: var(--primary-light); color: var(--primary); }
.badge.emotioneel { background: var(--accent-light); color: var(--accent); }
.badge.verdrietig { background: var(--danger-light); color: var(--danger); }

/* ===== TAGS ===== */
.tag {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    display: inline-block;
    margin: 2px;
}

.tag.primary { background: var(--primary-light); color: var(--primary); }
.tag.accent { background: var(--accent-light); color: var(--accent); }

/* ===== NEXT CALL BLOCK ===== */
.next-call {
    display: flex;
    align-items: center;
    gap: 16px;
}

.next-call .day-block {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

.next-call .info .date {
    font-weight: 600;
    font-size: 16px;
    color: var(--text);
}

.next-call .info .time {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 2px;
}

/* ===== DNA ENTRIES ===== */
.dna-category {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    margin-top: 16px;
}

.dna-category:first-child { margin-top: 0; }

.dna-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    border: 1px solid var(--border);
}

.dna-item.sensitive {
    background: var(--danger-light);
    border-color: #f0d0d0;
}

.dna-item .content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dna-item .badge-sensitive {
    font-size: 10px;
    padding: 2px 8px;
    background: var(--danger);
    color: white;
    border-radius: 4px;
    font-weight: 600;
}

.dna-item .actions {
    display: flex;
    gap: 6px;
}

/* ===== FORMS ===== */
.info-box {
    padding: 10px 14px;
    background: var(--accent-light);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--accent);
    margin-bottom: 16px;
    line-height: 1.5;
}

.field-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.field label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    display: block;
    margin-bottom: 4px;
}

.field input, .field select {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: 14px;
    color: var(--text);
    font-family: inherit;
}

.field input:focus, .field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.field-value {
    padding: 8px 12px;
    background: var(--bg);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text);
    border: 1px solid var(--border);
}

/* ===== BUTTONS ===== */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all 0.15s ease;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-outline {
    background: none;
    border: 1px solid var(--border);
    color: var(--primary);
}

.btn-outline:hover { background: var(--primary-light); }

.btn-small {
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 5px;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 500;
}

.btn-small.danger { color: var(--danger); border-color: rgba(196,75,75,0.25); }

/* ===== DAY SELECTOR ===== */
.day-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.day-btn {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    border: 2px solid var(--border);
    background: white;
    color: var(--text);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.day-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

/* ===== TOGGLES ===== */
.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.toggle-row .label-group .title {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

.toggle-row .label-group .desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.toggle {
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: var(--border);
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
    margin-left: 12px;
    border: none;
}

.toggle.active { background: var(--primary); }

.toggle .dot {
    width: 20px;
    height: 20px;
    border-radius: 10px;
    background: white;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: left 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle.active .dot { left: 22px; }

/* ===== SETTING ROWS ===== */
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
}

.setting-row .label { font-size: 14px; color: var(--text); }
.setting-row .value { font-size: 14px; font-weight: 600; color: var(--primary); }

/* ===== SCHEDULE SUMMARY ===== */
.schedule-summary {
    padding: 14px 18px;
    background: var(--primary-light);
    border-radius: 10px;
    font-size: 14px;
    color: var(--primary-dark);
    line-height: 1.6;
}

/* ===== UPCOMING CALLS ===== */
.upcoming-item {
    padding: 10px 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    margin-bottom: 4px;
}

.upcoming-item.next {
    background: var(--primary-light);
    font-weight: 600;
    border: 1px solid rgba(26,92,75,0.2);
}

/* ===== SPLIT VIEW (GESPREKKEN) ===== */
.split-view {
    display: flex;
    gap: 20px;
}

.split-list { width: 340px; flex-shrink: 0; }

.split-detail { flex: 1; }

.split-list .conv-item {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 6px;
    cursor: pointer;
    background: var(--bg);
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.split-list .conv-item:hover { background: var(--primary-light); }
.split-list .conv-item.active {
    background: var(--primary-light);
    border-color: rgba(26,92,75,0.25);
}

.mini-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.mini-stat {
    background: var(--bg);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
}

.mini-stat .label { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-bottom: 2px; }
.mini-stat .value { font-size: 14px; font-weight: 600; color: var(--text); }

.section-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.privacy-note {
    margin-top: 20px;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}

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

.empty-state .icon { font-size: 32px; margin-bottom: 12px; }
.empty-state .text { font-size: 15px; }

.adaptive-result {
    padding: 10px 14px;
    background: var(--success-light);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--success);
    margin-top: 8px;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.card { animation: fadeIn 0.3s ease; }
.stat-card { animation: fadeIn 0.3s ease; }
.stat-card:nth-child(2) { animation-delay: 0.05s; }
.stat-card:nth-child(3) { animation-delay: 0.1s; }
.stat-card:nth-child(4) { animation-delay: 0.15s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .two-col { grid-template-columns: 1fr; }
    .field-group { grid-template-columns: 1fr; }
    .split-view { flex-direction: column; }
    .split-list { width: 100%; }
}

/* ===== MOBILE SIDEBAR / TOP BAR ===== */
.mobile-nav-toggle { display: none; }

@media (max-width: 768px) {
    body { flex-direction: column; }

    .sidebar {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: auto;
        width: 100%;
        height: 56px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
        z-index: 200;
        transition: transform 0.25s ease;
    }

    .sidebar.hidden {
        transform: translateY(-100%);
    }

    .sidebar-logo {
        margin-bottom: 0;
        padding: 0;
    }

    .sidebar-logo span { display: none; }

    .mobile-nav-toggle {
        display: block;
        background: none;
        border: none;
        color: white;
        font-size: 22px;
        cursor: pointer;
        padding: 4px 8px;
    }

    .sidebar-collapsible {
        display: none;
        position: fixed;
        top: 56px; left: 0; right: 0;
        background: var(--primary-dark);
        flex-direction: column;
        max-height: calc(100vh - 56px);
        overflow-y: auto;
        z-index: 190;
        padding-bottom: 12px;
    }

    .sidebar-collapsible.open { display: flex; }

    .sidebar nav { flex: none; }

    .main {
        margin-left: 0;
        margin-top: 56px;
        padding: 16px;
    }

    .main-inner { max-width: 100%; }

    .page-title { font-size: 20px; }

    .stat-grid { flex-direction: column; }
    .stat-card { flex: 1 1 auto; }

    .next-call { flex-wrap: wrap; }
}
