:root {
    /* Uvoria brand – app palet (geen paars/roze in UI) */
    --uvoria-blue:    #1B3FA0;   /* primair – diepblauw uit logo */
    --uvoria-cyan:    #00B8CC;   /* accent – cyaan uit logo */
    --uvoria-orange:  #F05A00;   /* alert/badge – oranje uit logo */
    --uvoria-navy:    #0f2560;   /* donker voor header/hover */

    /* Colors */
    --primary-color: #1B3FA0;
    --primary-hover: #0f2d7a;
    --primary-light: #e8eeff;
    --secondary-color: #64748b;
    --success-color: #059669;
    --success-bg: #d1fae5;
    --danger-color: #dc2626;
    --danger-bg: #fee2e2;
    --danger-text: #991b1b;
    --warning-color: #F05A00;
    --warning-bg: #fff0e6;
    --warning-text: #7a2800;
    --info-color: #00B8CC;
    --info-bg: #e0f8fb;
    --info-border: #a0e6ef;
    --purple-color: #1B3FA0;   /* remapped – geen echte paars meer in app */
    --teal-color:   #00B8CC;
    --debug-color:  #F05A00;

    /* Layout & Backgrounds */
    --dark-bg: #1B3FA0;
    --sidebar-bg: #ffffff;
    --body-bg: #eef2f9;
    --white: #ffffff;
    --surface-gray: #f8fafc;
    --bg-hover: #f0f4ff;
    --border-light: #e2e8f0;
    --input-border: #c8d4ee;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;

    /* Dimensions & UI */
    --sidebar-width: 260px;
    --order-sidebar-width: 360px;
    --radius-sm:  4px;
    --radius-md:  8px;   /* unified – alle knoppen/inputs dezelfde rounding */
    --radius-lg:  10px;
    --radius-xl:  14px;
    --radius-pill: 50px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.2s ease-in-out;
}

/* --- RESET & BASE --- */
* { box-sizing: border-box; outline: none; }

body {
    margin: 0;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    background: linear-gradient(135deg, #dce6f7 0%, #eef2f9 45%, #e8f5f8 100%);
    background-attachment: fixed;
    color: var(--text-color);
    height: 100vh;
    display: flex;
    overflow: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: var(--primary-color); transition: var(--transition); }
a:hover { color: var(--primary-hover); text-decoration: none; }
ul { list-style: none; padding: 0; margin: 0; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* --- UTILITIES --- */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.flex-1 { flex: 1; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.align-end { align-items: flex-end; }
.w-100 { width: 100%; }
.w-auto { width: auto !important; }
.h-300 { height: 300px !important; }
.h-200 { height: 200px !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); font-size: 0.875rem; }
.text-danger { color: var(--danger-color); }
.text-success { color: var(--success-color); }
.font-bold { font-weight: 600; }
.font-mono { font-family: 'Consolas', 'Monaco', monospace; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.cursor-pointer { cursor: pointer; }
.border-top { border-top: 1px solid var(--border-color); }
.border-bottom { border-bottom: 1px solid var(--border-color); }
.bg-white { background-color: var(--white) !important; }
.hidden { display: none !important; }

/* Spacing */
.gap-10 { gap: 10px; } .gap-20 { gap: 20px; }
.mt-5 { margin-top: 5px; } .mt-10 { margin-top: 10px; } .mt-15 { margin-top: 15px; }
.mb-5 { margin-bottom: 5px; } .mb-10 { margin-bottom: 10px; } .mb-15 { margin-bottom: 15px; }
.p-20 { padding: 20px; } .pt-10 { padding-top: 10px; }

/* --- FORMS & INPUTS --- */
.form-group { margin-bottom: 20px; }
.form-group label, .input-grid label { display: block; margin-bottom: 8px; color: #374151; font-weight: 500; font-size: 14px; }

/* Base Input Style */
input[type="text"], input[type="email"], input[type="password"], 
input[type="number"], select, textarea, .input-select, .input-modal, .input-composer {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    background-color: #f5f8ff;
    color: #111;
    transition: var(--transition);
    margin-top: 4px;
    box-sizing: border-box;
}

input:focus, textarea:focus, select:focus, .input-modal:focus, .input-composer:focus {
    outline: none;
    background-color: #ffffff;
    border-color: var(--uvoria-blue);
    box-shadow: 0 0 0 3px rgba(27, 63, 160, 0.12);
}

.input-file-hidden, .input-modal.hidden-real-input { display: none !important; }

/* Specific Input Layouts */
.input-grid { display: grid; grid-template-columns: 80px 1fr; align-items: center; gap: 10px; }
.input-grid label { text-align: right; margin-bottom: 0; color: var(--text-muted); }
.form-row { display: grid; grid-template-columns: 1fr 100px; gap: 15px; margin-bottom: 15px; }
.form-row-aligned { display: flex; gap: 16px; align-items: flex-end; }
.form-col.grow { flex: 1; }
.form-col.auto { flex: 0 0 auto; }

/* Input Groups (Attached Button) */
.input-group { display: flex; width: 100%; box-shadow: var(--shadow-sm); border-radius: var(--radius-md); }
.input-group input { border-radius: var(--radius-md) 0 0 var(--radius-md) !important; margin-top: 0 !important; flex: 1; }
.input-group .btn-addon {
    border-radius: 0 var(--radius-md) var(--radius-md) 0 !important; margin: 0;
    background: var(--surface-gray); border: 1px solid var(--input-border); border-left: none;
    color: #475569; font-weight: 600; padding: 0 20px; cursor: pointer; transition: var(--transition);
}
.input-group .btn-addon:hover { background: #e2e8f0; color: #0f172a; }

/* Tag Inputs */
.tag-input-container {
    border: 1px solid var(--input-border); border-radius: var(--radius-md);
    padding: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    background-color: var(--white); cursor: text; min-height: 40px; width: 100%; transition: var(--transition);
}
.tag-input-container:focus-within { border-color: var(--primary-color); }
.tag-item {
    background-color: #e8eeff; border: 1px solid #b0c0e8; color: #1B3FA0;
    border-radius: var(--radius-pill); padding: 2px 10px 2px 12px; font-size: 13px; font-weight: 500;
    display: flex; align-items: center; user-select: none;
}
.tag-item .remove-tag { margin-left: 6px; cursor: pointer; opacity: 0.7; font-size: 16px; width: 16px; height: 16px; border-radius: 50%; display: flex; justify-content: center; align-items: center; }
.tag-item .remove-tag:hover { opacity: 1; background: rgba(255,255,255,0.5); }
.tag-input-typer { border: none; outline: none; flex: 1; min-width: 80px; font-size: 14px; padding: 4px; background: transparent; }

/* Autocomplete */
.tag-input-wrapper {
    position: relative;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.tag-input-wrapper .hidden-real-input {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
}
.autocomplete-list {
    position: absolute; top: 100%; left: 0; width: 100%; max-height: 200px;
    overflow-y: auto; background: #fff; border: 1px solid var(--input-border); border-top: none;
    border-radius: 0 0 6px 6px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); z-index: 10000;
    list-style: none; display: none;
}
.autocomplete-list.show { display: block; }
.autocomplete-item { padding: 8px 12px; cursor: pointer; font-size: 13px; color: #374151; border-bottom: 1px solid #f3f4f6; }
.autocomplete-item:hover, .autocomplete-item.selected { background-color: #e8eeff; color: var(--uvoria-blue); }
.autocomplete-match { font-weight: bold; color: var(--uvoria-blue); }

/* Toggles (iOS Style) */
.toggle-row { display: flex; gap: 20px; margin-bottom: 15px; align-items: center; }
.toggle-label { display: flex; align-items: center; cursor: pointer; font-size: 13px; font-weight: 600; color: #374151; user-select: none; }
.toggle-switch { position: relative; width: 36px; height: 20px; background-color: #e5e7eb; border-radius: 20px; margin-right: 8px; transition: background-color 0.2s; }
.toggle-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: white; border-radius: 50%; transition: transform 0.2s; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.toggle-input { display: none; }
.toggle-input:checked + .toggle-switch { background-color: var(--primary-color); }
.toggle-input:checked + .toggle-switch::after { transform: translateX(16px); }
.toggle-input.urgent:checked + .toggle-switch { background-color: var(--danger-color); }
.toggle-wrapper.disabled { opacity: 0.5; pointer-events: none; }
.toggle-sm { display: flex; align-items: center; font-size: 12px; cursor: pointer; user-select: none; color: #4b5563; }
.toggle-sm input { margin-right: 6px; }
.toggle-link { font-size: 12px; color: var(--primary-color); cursor: pointer; font-weight: 500; }

/* ═══════════════════════════════════════════════════════════
   BUTTONS — één consistent systeem
   ═══════════════════════════════════════════════════════════ */

/* Basis — gedeeld door alle knoppen */
.btn, .btn-primary, .btn-secondary, .btn-auth, .btn-compose {
    padding: 7px 14px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer; font-size: 13px; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    transition: all 0.18s ease; line-height: 1.4;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    text-decoration: none; white-space: nowrap;
    font-family: inherit;
}
.btn:active { transform: translateY(0) !important; }

/* ── Neutraal (grijs) ── */
.btn-secondary, .btn-gray, .btn-cancel {
    background: #fff; color: #374151; border-color: #d1d5db;
}
.btn-secondary:hover, .btn-gray:hover, .btn-cancel:hover {
    background: #f4f6fb; color: #374151; border-color: #b8c4d8;
    transform: none; box-shadow: none;
}

/* ── Primair (blauw) ── */
.btn-primary, .btn-auth, .btn-send, .btn-blue {
    background: var(--uvoria-blue); color: #fff; border-color: var(--uvoria-blue);
}
.btn-primary:hover, .btn-auth:hover, .btn-send:hover, .btn-blue:hover {
    background: var(--primary-hover); color: #fff; border-color: var(--primary-hover);
    transform: none; box-shadow: none;
}
/* btn-reply buiten action-bar: zelfde lichte tint als in action-bar */
.btn-reply {
    background: #eef2ff; color: #1B3FA0; border-color: #c7d4f5;
}
.btn-reply:hover {
    background: #dde6ff; color: #0f2d7a; border-color: #a3b8ee;
    transform: none; box-shadow: none;
}

/* ── Succes (groen) ── */
.btn-archive, .btn-dark-green {
    background: #f0faf6; color: #047857; border-color: #a7f3d0;
}
.btn-archive:hover, .btn-dark-green:hover {
    background: #dcfce7; color: #065f46; border-color: #6ee7b7;
    transform: none; box-shadow: none;
}

/* ── Gevaar (rood) ── */
.btn-red, .btn-trash {
    background: #fff5f5; color: #dc2626; border-color: #fecaca;
}
.btn-red:hover, .btn-trash:hover {
    background: #fef2f2; color: #b91c1c; border-color: #f87171;
    transform: none; box-shadow: none;
}

/* ── AI / accent ── */
.btn-ai, .btn-purple {
    background: #e0f8fb; color: #006e80; border-color: #a0e6ef;
}
.btn-ai:hover, .btn-purple:hover {
    background: #c0eef5; color: #005a6a; border-color: #6ed4e0;
    transform: none; box-shadow: none;
}

/* ── Compose – neutraal grijs ── */
.btn-compose {
    background: #f4f6fb; color: #374151;
    border: 1.5px solid #dde3ef !important;
    box-shadow: none; font-weight: 600;
}
.btn-compose:hover {
    background: #eaeff8; color: #1e293b;
    border-color: #c5d0e8 !important;
    box-shadow: none;
    transform: none;
}

/* ── Auth specifiek ── */
.btn-auth { width: 100%; padding: 12px; font-size: 15px; }
/* btn-compose in sidebar via .sidebar .btn-compose */
.sidebar .btn-compose { width: 100%; padding: 10px 14px; font-size: 13.5px; }

/* ── Maten ── */
.btn-sm { font-size: 12px; padding: 4px 10px; }

/* ═══════════════════════════════════════════════════════════
   ACTION BAR — sticky balk boven e-maildetail
   ═══════════════════════════════════════════════════════════ */
.action-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 10px 20px;
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid #e8edf4;
    margin-bottom: 0;
    position: sticky; top: 0; z-index: 20;
}
.action-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.action-group-right { margin-left: auto; }
.action-bar-divider { width: 1px; height: 20px; background: #dde3ef; margin: 0 4px; }

/* Alle knoppen in de action-bar beginnen neutraal */
.action-bar .btn {
    background: #f4f6fb; color: #374151; border-color: #dde3ef;
    box-shadow: none; padding: 6px 12px; font-size: 12.5px;
}
/* Neutraal hover – geen blauwe tekst */
.action-bar .btn:hover {
    background: #eaeff8; color: #374151; border-color: #c5d0e8;
    transform: none; box-shadow: none;
}

/* Terug – wit, expliciet neutraal */
.action-bar .btn-back {
    background: #fff; color: #374151; border-color: #dde3ef;
}
.action-bar .btn-back:hover { background: #f4f6fb; color: #374151; }

/* Doorsturen – subtiel blauw accent */
.action-bar .btn-forward {
    background: #eef2ff; color: #1B3FA0; border-color: #c7d4f5;
}
.action-bar .btn-forward:hover { background: #dde6ff; color: #1B3FA0; }

/* Beantwoorden – subtiel blauw tint */
.action-bar .btn-reply {
    background: #eef2ff; color: #1B3FA0; border-color: #c7d4f5;
}
.action-bar .btn-reply:hover {
    background: #dde6ff; color: #0f2d7a; border-color: #a3b8ee;
    transform: none; box-shadow: none;
}

/* Afhandelen – subtiel groen tint */
.action-bar .btn-archive {
    background: #f0faf6; color: #047857; border-color: #a7f3d0;
}
.action-bar .btn-archive:hover {
    background: #dcfce7; color: #065f46; border-color: #6ee7b7;
    transform: none; box-shadow: none;
}

/* Verwijderen – subtiel rood (outline stijl) */
.action-bar .btn-trash {
    background: #fff5f5; color: #dc2626; border-color: #fecaca;
}
.action-bar .btn-trash:hover { background: #fef2f2; color: #b91c1c; border-color: #f87171; }

/* AI Debug – subtiel cyaan */
.action-bar .btn-ai, .action-bar .btn-ai-debug {
    background: #e0f8fb; color: #006e80; border-color: #a0e6ef;
}
.action-bar .btn-ai:hover, .action-bar .btn-ai-debug:hover {
    background: #c0eef5; color: #005a6a; border-color: #6ed4e0;
    transform: none; box-shadow: none;
}

/* Misc Buttons */
.btn-refresh {
    background: transparent; border: 1px solid var(--border-light); color: #64748b;
    width: 36px; height: 36px; border-radius: 50%; font-size: 18px; margin-right: 15px;
}
.btn-refresh:hover { background: #f1f5f9; color: var(--uvoria-blue); border-color: var(--uvoria-blue); }
.btn-refresh.spinning { animation: spin 1s linear infinite; opacity: 0.7; pointer-events: none; }
.btn-attachment-plus {
    width: 40px; height: 40px; background: #fff; border: 1px solid var(--input-border);
    border-radius: var(--radius-md); cursor: pointer; color: #6b7280; font-size: 20px;
    display: flex; align-items: center; justify-content: center;
}
.btn-attachment-plus:hover { background: var(--bg-hover); color: var(--primary-color); }

/* --- MAIN LAYOUT --- */
.main {
    flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 0 0 1px rgba(27,63,160,0.04), 4px 0 24px rgba(27,63,160,0.06);
}

/* ─── Sidebar ──────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid #dce6f5;
    color: #374151;
    display: flex; flex-direction: column; flex-shrink: 0;
    transition: transform 0.3s ease; z-index: 2000;
    box-shadow: 2px 0 16px rgba(27,63,160,0.08);
}

/* Logo balk – wit met subtiele tint */
.sidebar-header {
    padding: 0 16px;
    height: 60px;
    display: flex; align-items: center;
    background: linear-gradient(135deg, rgba(255,255,255,1) 0%, rgba(240,244,255,0.9) 100%);
    border-bottom: 1px solid #dce6f5;
}

.sidebar-section { padding: 10px 8px 4px 8px; }
.sidebar-section-divider {
    border-bottom: 1px solid #e8edf4;
    margin-bottom: 6px; padding-bottom: 6px;
}
.sidebar-footer {
    margin-top: auto; padding: 12px 10px 16px;
    border-top: 1px solid #dce6f5;
    background: linear-gradient(180deg, rgba(240,244,255,0.6) 0%, rgba(235,242,255,0.9) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex; flex-direction: column; gap: 2px;
    box-shadow: 0 -4px 16px rgba(27,63,160,0.06);
}
.btn-logout { color: #dc2626 !important; }
.btn-logout:hover { background: #fef2f2 !important; color: #b91c1c !important; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(15,37,96,0.35); z-index: 1999; backdrop-filter: blur(3px); }
.sidebar-overlay.show { display: block; }

/* ─── Folder Tree ──────────────────────────────────────────── */
.folder-tree-container { flex: 1; overflow-y: auto; padding: 4px 0; }
.folder-row {
    display: flex; align-items: stretch; transition: var(--transition);
    min-height: 34px; margin: 1px 6px; border-radius: 8px;
}
.folder-row:hover { background: #f0f4ff; }
.folder-link {
    flex: 1; display: flex; align-items: center; padding: 5px 10px;
    color: #4b5563; text-decoration: none; font-size: 13.5px;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-radius: 8px;
    transition: color 0.15s, background 0.15s;
}
.folder-link:hover { color: #1B3FA0; text-decoration: none; }
.folder-link.active {
    background: #eef2ff;
    color: #1B3FA0; font-weight: 700;
}
.folder-link.active::before {
    content: ''; display: block; flex-shrink: 0;
    width: 3px; height: 16px;
    background: linear-gradient(180deg, #1B3FA0, #00B8CC);
    border-radius: 2px; margin-right: 10px;
}
.folder-toggle {
    width: 24px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: #9ca3af; font-size: 10px; transition: var(--transition);
}
.folder-toggle:hover { color: #1B3FA0; }
.folder-toggle.expanded .arrow { transform: rotate(90deg); }
.sub-menu { display: none; background: #f8f9fc; margin: 2px 6px; border-radius: 8px; }
.sub-menu.open { display: block; }
.sub-menu .folder-link { padding-left: 20px; font-size: 13px; color: #6b7280; }
.sub-menu .sub-menu .folder-link { padding-left: 35px; }

/* Badge Queue */
.badge-queue {
    background: var(--uvoria-orange);
    color: #fff; padding: 2px 8px;
    border-radius: var(--radius-pill); font-size: 10px; font-weight: 700; margin-left: auto;
}

/* User Profile box – nu in sidebar-footer */
.user-profile-box {
    padding: 8px 10px;
    background: rgba(255,255,255,0.75);
    color: #374151; font-size: 13px;
    border-radius: var(--radius-md); border: 1px solid #c8d4ee;
    margin-bottom: 6px;
}

/* Sidebar select */
.sidebar select {
    background: #fff; border: 1px solid #dce4f8; color: #374151;
    font-size: 12px; padding: 5px 8px; margin-top: 6px;
    border-radius: 8px; width: 100%;
}
.sidebar select:focus { border-color: var(--uvoria-blue); box-shadow: 0 0 0 2px rgba(27,63,160,0.12); }
.sidebar .mailbox-single-label { font-size: 12px; color: #6b7280; margin-top: 4px; }
.sidebar-section-tight { padding: 4px 8px 8px 8px; }

/* Toolbar & Search */
.toolbar {
    padding: 10px 24px; border-bottom: 1px solid #dce6f5;
    background: rgba(255,255,255,0.90);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 64px; flex-shrink: 0;
}
.hamburger-btn { display: none; font-size: 24px; background: none; border: none; cursor: pointer; padding: 0 10px 0 0; color: #333; }
.search-form {
    display: flex; flex: 1; max-width: 560px;
    background: #f5f8ff;
    border: 1px solid #c8d4ee;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.search-form:focus-within {
    border-color: #1B3FA0;
    box-shadow: 0 0 0 3px rgba(27,63,160,0.10);
    background: #fff;
}
.search-form input {
    flex: 1; padding: 10px 14px;
    border: none; background: transparent;
    font-size: 13.5px; color: var(--text-color);
    outline: none; margin-top: 0;
    box-shadow: none;
}
.search-form input::placeholder { color: #9ca3af; }
.search-form button[type="submit"] {
    padding: 0 16px;
    background: #f4f6fb; color: #4b5563;
    border: none; border-left: 1px solid #dde3ef;
    cursor: pointer;
    font-size: 13px; font-weight: 600;
    border-radius: 0;
    transition: background 0.18s, color 0.18s;
    white-space: nowrap;
    display: flex; align-items: center; gap: 6px;
}
.search-form button[type="submit"]:hover {
    background: #eaeff8; color: #1e293b;
}
.reset-search {
    display: flex; align-items: center; justify-content: center;
    width: 32px; color: #9ca3af; font-size: 18px; cursor: pointer;
    border: none; background: transparent; padding: 0; flex-shrink: 0;
}
.reset-search:hover { color: var(--danger-color); }

/* View Tabs */
.view-tabs { padding: 0 24px; background: var(--white); border-bottom: 1px solid var(--border-color); display: flex; gap: 20px; }
.view-tab { text-decoration: none; color: var(--text-muted); padding: 12px 4px; font-size: 14px; font-weight: 500; border-bottom: 2px solid transparent; transition: var(--transition); }
.view-tab.active { color: var(--uvoria-blue); border-bottom-color: var(--uvoria-blue); font-weight: 600; }
.view-tab:hover:not(.active) { color: var(--text-color); }

/* --- EMAIL LIST --- */
.email-list-container { flex: 1; overflow-y: auto; position: relative; background: #fff; }
.bulk-bar { background: var(--info-bg); padding: 10px 24px; border-bottom: 1px solid var(--info-border); display: none; align-items: center; justify-content: space-between; height: 50px; color: #0c4a6e; }

table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
th {
    text-align: left; background: var(--surface-gray); padding: 12px 16px;
    border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 10;
    font-size: 12px; color: var(--text-muted); text-transform: uppercase; font-weight: 600;
}
td { padding: 14px 16px; border-bottom: 1px solid #f3f4f6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; font-size: 14px; color: var(--text-color); vertical-align: middle; }
tr:hover td { background: var(--surface-gray); }

/* Columns */
.col-status { width: 100px; } .col-status-lg { width: 130px; }
.col-from-lg { width: 180px; } .col-action { width: 60px; text-align: center;} .col-action-lg { width: 140px; }
.col-action-narrow { width: 36px; text-align: center; padding: 4px !important; }
.mail-action-unread { cursor: pointer; opacity: 0.6; font-size: 14px; display: inline-block; padding: 4px; border-radius: var(--radius-sm); }
.mail-action-unread:hover { opacity: 1; background: rgba(0,0,0,0.06); }
.col-date { width: 120px; color: var(--text-muted); font-size: 13px; text-align: right; }
.col-from { width: 220px; font-weight: 500; color: #111; }
.chk-col { width: 40px; text-align: center; cursor: default; }

/* Row States */
.email-row-unread td { background-color: #f7f9ff; font-weight: 700; color: #0d1a3a; }
.email-row-unread td.col-from { color: var(--uvoria-blue); }
.email-row-read td { background-color: #fafbfd; color: var(--text-muted); }
.email-row-priority td { background-color: #eef3ff; }
.email-row-priority td:first-child { border-left: 3px solid #1B3FA0; }
.email-row-processing { opacity: 0.85; background-color: #f8f9fa !important; }
.email-row-processing td { color: #999 !important; }

/* Pagination */
.pagination { padding: 10px 24px; background: var(--white); border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 5px; flex-shrink: 0; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-md); font-size: 13px; background: var(--white); color: var(--text-color); }
.pagination a:hover { background: var(--bg-hover); }
.pagination .active { background: var(--uvoria-blue); color: white; border-color: var(--uvoria-blue); }
.pagination .disabled { color: #ccc; cursor: default; }

/* --- DETAIL VIEW & INLINE COMPOSER --- */
.detail-container { display: flex; flex: 1; overflow: hidden; height: 100%; background: #fff; }

/* Main Content Container (Scrollable) */
.email-content {
    flex: 1; display: flex; flex-direction: column;
    overflow-y: auto !important; /* Hele kolom scrollt */
    height: 100%; position: relative; background: #fff; padding: 0;
}

/* Inline Composer */
#inlineComposer {
    display: none; 
    flex-direction: column;
    background: #fff;
    border-bottom: 5px solid #f1f5f9; 
    padding: 20px 30px;
    z-index: 100; /* Zorg dat hij bovenop ligt */
    
    /* In lijst-weergave: Full Overlay */
    position: absolute; 
    top: 0; left: 0; right: 0; bottom: 0;
    overflow-y: auto;
}

#inlineComposer.show { display: flex; }

/* Als we in de detail-view zitten (waar .email-content parent is), 
   moet hij gewoon in de flow zitten, niet absoluut. */
.email-content #inlineComposer {
    position: static; /* Reset naar normaal gedrag in detail view */
    flex-shrink: 0;
    height: auto;
    bottom: auto;
    overflow-y: visible;
}

/* Header sectie */
.composer-header { 
    display: flex; justify-content: space-between; align-items: flex-start; 
    margin-bottom: 15px; gap: 20px; 
}
.composer-controls { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.composer-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }

/* Grid correcties voor TagInput */
.composer-grid { 
    display: grid; grid-template-columns: 80px 1fr; 
    align-items: center; gap: 10px; width: 100%; 
}
.composer-grid label { 
    text-align: right; font-size: 13px; color: var(--text-muted); font-weight: 500; margin-bottom: 0;
}

/* Input Styles */
.input-composer {
    width: 100%; padding: 8px 10px;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm); font-size: 14px; transition: all 0.2s;
}
.input-composer:focus { border-color: var(--primary-color); outline: none; }

/* Editor */
.composer-editor {
    flex: 1; /* Pak alle ruimte in de overlay */
    min-height: 400px; 
    border: 1px solid var(--border-light); border-radius: var(--radius-md);
    display: flex; flex-direction: column;
    margin-bottom: 10px;
}

/* Bijlagen */
.composer-attachments {
    padding: 10px; background: var(--surface-gray);
    border-radius: var(--radius-md); border: 1px dashed #cbd5e1;
    flex-shrink: 0;
}

/* Reading View (Original Mail) */
.original-mail-container {
    flex: 1; display: flex; flex-direction: column;
    overflow-y: auto; overflow-x: hidden;
    transition: opacity 0.3s; min-height: 0;
}
.original-mail-container.dimmed { opacity: 0.6; filter: grayscale(100%); pointer-events: auto; }

/* Inhoud onder de sticky action-bar */
.email-content-inner {
    flex: 1; display: flex; flex-direction: column;
    padding: 24px 28px; min-height: 0;
}

/* AI & Headers */
.ai-input-bar { display: flex; gap: 10px; margin-bottom: 20px; background: #fff; padding: 12px; border: 1px solid var(--border-light); border-radius: var(--radius-md); align-items: center; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.ai-input-bar input { background: var(--surface-gray); border: 1px solid var(--input-border); }
.email-header { border-bottom: 1px solid var(--border-color); padding-bottom: 15px; margin-bottom: 20px; }
.header-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 4px; }
.email-subject { margin: 0; color: #111; font-size: 20px; font-weight: 700; line-height: 1.3; flex: 1; }
.email-date { white-space: nowrap; color: var(--text-muted); font-size: 13px; background: var(--surface-gray); padding: 4px 8px; border-radius: var(--radius-sm); border: 1px solid var(--border-light); }
.header-meta-row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #333; }
.sender-name { font-weight: 600; color: #1e293b; }
.details-toggle { cursor: pointer; color: var(--primary-color); font-size: 12px; background: none; border: none; padding: 2px 6px; border-radius: var(--radius-sm); }
.details-toggle:hover { background: #eff6ff; }
.header-extended-details { display: none; margin-top: 8px; padding: 8px 12px; background: var(--surface-gray); border-radius: var(--radius-md); border: 1px solid var(--border-light); font-size: 13px; color: #475569; }
.header-extended-details.show { display: block; }

/* Email Status Banner (processing / vertaling beschikbaar) */
.email-status-banner { margin-top: 16px; margin-bottom: 0; }
.banner-processing { background: #eef2ff; border: 1px solid #c7d4f5; color: #1B3FA0; padding: 12px 16px; border-radius: var(--radius-md); display: flex; align-items: center; gap: 10px; font-size: 14px; }
.banner-translation { background: #dbeafe; border: 1px solid #3b82f6; color: #1e40af; padding: 12px 16px; border-radius: var(--radius-md); display: flex; align-items: center; gap: 10px; font-size: 14px; }
.banner-translation .btn-sm { margin-left: 8px; }

/* Email Body */
.email-body {
    flex: 1; display: flex; flex-direction: column; min-height: 0;
    border: 1px solid var(--border-color); background: #fff;
    border-radius: var(--radius-md); box-shadow: var(--shadow-sm); margin-top: 20px;
}
.email-iframe { width: 100%; flex: 1; border: none; display: block; min-height: 400px; }
.attachments { margin-top: 24px; padding: 16px; background: var(--surface-gray); border-radius: var(--radius-md); border: 1px solid var(--border-color); }

/* Delegations */
/* ─── Delegation & info banners ───────────────────────────── */
.delegation-block {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; margin-bottom: 16px;
    border-radius: var(--radius-lg);
    font-size: 13.5px;
    border: 1px solid transparent;
}
.delegation-icon {
    flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
}
.delegation-body { flex: 1; }
.delegation-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Te doen – zacht groen-blauw */
.delegation-todo {
    background: linear-gradient(90deg, #f0fdf4, #f7feff);
    border-color: #bbf7d0;
    color: #14532d;
}
.delegation-todo .delegation-icon { background: #dcfce7; color: #059669; }

/* Toegewezen aan jou – zacht blauw */
.delegation-warning {
    background: linear-gradient(90deg, #eff6ff, #f5f8ff);
    border-color: #bfdbfe;
    color: #1e3a8a;
}
.delegation-warning .delegation-icon { background: #dbeafe; color: #1B3FA0; }

/* Gedelegeerd aan collega – cyaan/grijs */
.delegation-info {
    background: linear-gradient(90deg, #f0f9ff, #f8faff);
    border-color: #bae6fd;
    color: #0c4a6e;
}
.delegation-info .delegation-icon { background: #e0f2fe; color: #0284c7; }

.reply-info-block {
    background: #f0f4ff; border: 1px solid #c7d4f5; color: #1e3a8a;
    padding: 11px 16px; margin-bottom: 16px;
    border-radius: var(--radius-lg);
    display: flex; align-items: center; gap: 12px; font-size: 13.5px;
}
.alert-box { background: #fff1f2; border: 1px solid #fecdd3; color: #991b1b; padding: 16px; border-radius: var(--radius-md); font-size: 14px; }

/* --- ORDER SIDEBAR --- */
.order-sidebar {
    width: var(--order-sidebar-width); background: var(--surface-gray); padding: 24px;
    overflow-y: auto; border-left: 1px solid var(--border-color);
    display: flex; flex-direction: column; gap: 16px; flex-shrink: 0;
    position: static; transform: none;
}
.close-order-sidebar, .mobile-order-toggle { display: none; }
.order-card { background: #fff; padding: 16px; border-radius: var(--radius-lg); border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); font-size: 13px; transition: var(--transition); }
.order-card:hover { box-shadow: var(--shadow-md); }
.order-card.border-left-accent { border-left: 4px solid var(--teal-color); }
.order-card h4 { margin: 0 0 12px 0; border-bottom: 1px solid #f1f5f9; padding-bottom: 8px; color: #111; font-weight: 700; }
.order-row { display: flex; justify-content: space-between; margin-bottom: 8px; }
.lbl { color: var(--text-muted); } .val { font-weight: 600; text-align: right; color: #111; }
.product-item { display: flex; gap: 10px; border-bottom: 1px solid #f1f5f9; padding: 10px 0; }
.product-qty { font-weight: 700; color: var(--primary-color); min-width: 24px; }
.stock-info { font-size: 11px; margin-top: 4px; color: #4b5563; background: var(--bg-hover); padding: 2px 6px; border-radius: var(--radius-sm); display: inline-block; }

/* Timeline */
.pnl-shipment { margin-bottom: 15px; border-bottom: 1px dashed #e2e8f0; padding-bottom: 12px; }
.pnl-timeline { margin-top: 12px; padding-left: 12px; border-left: 2px solid #e2e8f0; }
.pnl-event { font-size: 12px; margin-bottom: 8px; position: relative; padding-left: 12px; color: var(--text-muted); }
.pnl-event.active { color: #111; font-weight: 600; }
.pnl-dot { width: 8px; height: 8px; background: #e2e8f0; border-radius: 50%; position: absolute; left: -17px; top: 4px; border: 2px solid #fff; }
.pnl-event.active .pnl-dot { background: var(--success-color); border-color: var(--success-color); }

/* --- SETTINGS & AUTH --- */
.settings-container { flex:1; display:flex; flex-direction:column; padding:32px; overflow-y:auto; max-width: 1000px; margin: 0 auto; width: 100%; }
.settings-header { margin-bottom:24px; border-bottom:1px solid var(--border-color); padding-bottom:16px; display:flex; justify-content:space-between; align-items:center;}
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 20px; }

.tabs { display:flex; gap:2px; margin-bottom:24px; border-bottom:1px solid var(--border-color); flex-wrap: wrap; }
.tab { padding: 10px 20px; cursor:pointer; background: transparent; border-bottom: 2px solid transparent; color: var(--text-muted); font-weight: 500; transition: var(--transition); }
.tab.active { color: var(--primary-color); border-bottom-color: var(--primary-color); font-weight: 600; }
.tab:hover:not(.active) { color: var(--text-color); background: #f9fafb; }
.tab-content { display:none; background:white; animation: fadeIn 0.3s; }
.tab-content.active { display:block; }

/* Auth Pages & Index Setup */
body.auth-body {
    align-items: center; justify-content: center; overflow: auto;
    background: linear-gradient(135deg, #0f2560 0%, #1B3FA0 55%, #00B8CC 100%);
    min-height: 100vh;
}
body.index-setup-body { background: linear-gradient(135deg, #0f2560 0%, #1B3FA0 55%, #00B8CC 100%); font-family: 'Inter', sans-serif; }
.auth-card {
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 48px; border-radius: var(--radius-xl);
    box-shadow: 0 24px 64px rgba(0,0,0,0.28), 0 0 0 1px rgba(255,255,255,0.4);
    width: 100%; max-width: 450px; margin: 20px;
}
.auth-header { text-align: center; margin-bottom: 32px; }
.auth-header h2 { margin: 0; color: #111; font-weight: 800; font-size: 24px; }

/* Wizard */
.wizard-wrapper { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; background: linear-gradient(135deg, #0f2560 0%, #1B3FA0 55%, #00B8CC 100%); width: 100%; flex-grow: 1; }
.wizard-card { background: rgba(255,255,255,0.96); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); width: 100%; max-width: 480px; padding: 40px; border-radius: var(--radius-xl); box-shadow: 0 24px 64px rgba(0,0,0,0.28), 0 0 0 1px rgba(255,255,255,0.4); }
.wizard-header { text-align: center; margin-bottom: 30px; }

/* Password Strength */
.strength-meter-container { height: 4px; background: #e5e7eb; border-radius: 2px; margin-top: 8px; overflow: hidden; }
.strength-meter-fill { height: 100%; width: 0%; transition: width 0.3s, background-color 0.3s; }
.strength-meter-fill[data-score="0"], .strength-meter-fill[data-score="1"] { background-color: #ef4444; }
.strength-meter-fill[data-score="2"], .strength-meter-fill[data-score="3"] { background-color: #f59e0b; }
.strength-meter-fill[data-score="4"] { background-color: #10b981; }
.password-requirements { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.req-item { font-size: 11px; color: #9ca3af; display: flex; align-items: center; gap: 4px; }
.req-item.valid { color: #10b981; font-weight: 500; }

/* Prompts & Managers */
.prompt-card { background: var(--surface-gray); border: 1px solid var(--border-color); padding: 20px; border-radius: var(--radius-md); margin-bottom: 20px; transition: var(--transition); }
.prompt-card:focus-within { border-color: var(--primary-color); box-shadow: var(--shadow-sm); background: #fff; }
.folder-manager-list { border: 1px solid var(--border-color); border-radius: var(--radius-md); background: #fff; overflow: hidden; }
.folder-mgr-item { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid #f1f5f9; }
.folder-handle { cursor: grab; margin-right: 15px; color: #cbd5e1; }
.badge-imap { background: #e6fafd; color: #006e80; padding: 2px 6px; border-radius: var(--radius-sm); font-size: 10px; font-weight: 700; text-transform:uppercase; }

/* --- MODALS (Used for Settings/Confirms/Move) --- */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    z-index: 10000; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s; backdrop-filter: blur(4px);
}
.modal-overlay.show { display: flex; opacity: 1; }

.modal {
    display: flex; flex-direction: column; background-color: #ffffff;
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    overflow: hidden; position: relative; z-index: 10001;
    animation: slideUp 0.2s ease-out; width: 600px; max-width: 95vw; max-height: 90vh;
}
.modal-confirm { width: 400px !important; text-align: center; padding: 30px; }
.modal-narrow { width: 450px !important; }

.modal h3 { padding: 16px 24px; margin: 0; background-color: #fff; border-bottom: 1px solid var(--border-color); font-size: 18px; display: flex; justify-content: space-between; align-items: center; }
.modal-body-content { flex: 1; display: flex; flex-direction: column; padding: 24px; overflow-y: auto; gap: 15px; }
.modal-footer { padding: 16px 24px; background: #f9fafb; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 12px; }

/* Editor & Toolbar (Fallback/Legacy support) */
.editor-section { flex: 1; display: flex; flex-direction: column; border: 1px solid var(--input-border); border-radius: var(--radius-md); overflow: hidden; min-height: 200px; }
.toolbar-row { display: flex; align-items: center; justify-content: space-between; padding-left: 90px; }

/* Attachments */
.attachment-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; width: 100%; }
.attachment-chip { display: flex; align-items: center; background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 6px 10px; box-shadow: var(--shadow-sm); min-width: 280px; max-width: 320px; }
.attachment-preview { width: 32px; height: 32px; flex-shrink: 0; border-radius: var(--radius-sm); overflow: hidden; background: #f1f5f9; display: flex; align-items: center; justify-content: center; margin-right: 10px; }
.attachment-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.attachment-name { white-space: nowrap; }
.attachment-remove:hover { color: var(--danger-color); background-color: #fee2e2; }

/* Move List Modal */
.move-list-container { max-height: 60vh; overflow-y: auto; border: 1px solid var(--border-color); border-radius: var(--radius-md); background-color: #fff; margin-bottom: 20px; }
.move-list-item { padding: 10px 16px; cursor: pointer; border-bottom: 1px solid #f1f5f9; font-size: 14px; display: flex; align-items: center; white-space: pre; }
.move-list-item:hover { background-color: #f0f9ff; color: var(--primary-color); padding-left: 20px; font-weight: 500; }

/* --- BADGES & STATUS --- */
.folder-badge { display: inline-block; background: #f1f5f9; color: #475569; border: 1px solid var(--input-border); border-radius: var(--radius-sm); padding: 2px 6px; font-size: 11px; margin-right: 6px; vertical-align: middle; }
.reply-badge { display:inline-block; background: var(--info-bg); color: var(--info-color); border-radius: 3px; padding: 2px 5px; margin-right: 5px; font-size: 11px; font-weight:bold; text-transform: uppercase; }
.status-badge { padding: 4px 10px; border-radius: var(--radius-pill); color: white; font-size: 11px; font-weight: 600; text-transform: uppercase; display: inline-block; }
.status-paid, .status-completed { background: var(--success-color); }
.status-shipped { background: var(--info-color); }
.status-pending { background: var(--warning-color); color: #78350f; }
.badge-urgent { background: var(--danger-color); color: white; font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 3px 8px; border-radius: var(--radius-sm); vertical-align: middle; margin-right: 8px; }
.processing-badge { background: #e8eeff; color: #1B3FA0; border: 1px solid #b0c0e8; font-size: 10px; padding: 2px 6px; border-radius: var(--radius-sm); font-weight: 600; text-transform: uppercase; display: inline-flex; align-items: center; gap: 4px; }

/* --- THIRD PARTY / MISC --- */
/* Pas alleen 100% hoogte toe in de e-mail composer, niet overal! */
.composer-editor .tox-tinymce { 
    height: 100% !important; 
    flex: 1 !important; 
    border: none !important; 
}

.tox-tinymce-aux, .tox-dialog-wrap, .tox-dialog { 
    z-index: 9999999 !important; 
}
/* Toasts & Alerts */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 10001; display: flex; flex-direction: column; gap: 12px; pointer-events: none; }
.toast { background: #1f2937; color: white; padding: 16px 20px; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); font-size: 14px; min-width: 300px; display: flex; align-items: center; animation: slideIn 0.3s forwards; pointer-events: auto; }
.toast.success { background: #065f46; } .toast.error { background: #991b1b; } .toast.info { background: #075985; }
#new-mail-alert {
    display: none;
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #1B3FA0;
    padding: 10px 22px;
    border-radius: 50px;
    box-shadow: 0 4px 24px rgba(27,63,160,0.18), 0 0 0 1px rgba(27,63,160,0.12);
    cursor: pointer; z-index: 100000;
    font-weight: 600; font-size: 13.5px;
    animation: slideDownFade 0.4s ease;
    display: none;
    align-items: center; gap: 8px;
}

/* Loaders */
.loader-spinner { border: 3px solid #f3f3f3; border-top: 3px solid var(--primary-color); border-radius: 50%; width: 24px; height: 24px; animation: spin 0.8s linear infinite; margin: 0 auto; }
.ai-spinner { display: inline-block; animation: ai-pulse 1.5s infinite ease-in-out; margin-right: 5px; font-size: 14px; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDownFade { from { top: -60px; opacity: 0; } to { top: 20px; opacity: 1; } }
@keyframes pulse-dot { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.4); } }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes ai-pulse { 0% { transform: scale(0.9); opacity: 0.7; } 50% { transform: scale(1.1); opacity: 1; text-shadow: 0 0 5px #8b5cf6; } 100% { transform: scale(0.9); opacity: 0.7; } }

/* --- RESPONSIVE / MOBILE --- */
@media (max-width: 768px) {
    /* Layout */
    .detail-container { flex-direction: column; position: relative; }
    .email-content { border-right: none; width: 100%; padding: 15px; }
    .form-row-aligned { flex-direction: column; align-items: stretch; gap: 12px; }
    .form-col.auto { width: 100% !important; }
    .move-list-item { padding: 14px 16px; font-size: 16px; }

    /* Mobile Sidebar (Hamburger) */
    .hamburger-btn { display: block; }
    .sidebar { position: fixed; height: 100%; top: 0; left: 0; transform: translateX(-100%); box-shadow: 5px 0 15px rgba(0,0,0,0.2); width: 280px; }
    .sidebar.open { transform: translateX(0); }
    
    /* Order Sidebar Overlay */
    .order-sidebar {
        position: fixed; top: 0; right: 0; width: 85%; max-width: 350px; height: 100%;
        background: var(--surface-gray); border-left: 1px solid #e2e8f0; box-shadow: -5px 0 20px rgba(0,0,0,0.15);
        z-index: 2050; transform: translateX(100%); padding-top: 60px !important;
    }
    .order-sidebar.open { transform: translateX(0); }
    .mobile-order-toggle { display: flex !important; }
    .close-order-sidebar {
        display: flex !important; align-items: center; justify-content: center;
        position: absolute; top: 15px; right: 15px; width: 36px; height: 36px;
        background: #e2e8f0; border-radius: 50%; color: #333; font-weight: bold;
        font-size: 20px; line-height: 1; cursor: pointer; z-index: 9999;
    }

    /* Modals */
    .modal { width: 100%; height: 100%; border-radius: 0; max-width: 100%; max-height: 100%; }

    /* Mobile Email List (Cards instead of Table) */
    .email-list-container table, .email-list-container tbody, .email-list-container tr { display: block; width: 100%; }
    .email-list-container thead { display: none; }
    
    .email-list-container tr {
        display: grid; grid-template-columns: 40px 1fr auto; grid-template-rows: auto auto;
        gap: 2px 10px; padding: 12px 10px; border-bottom: 1px solid #e5e7eb; background: #fff; height: auto;
    }

    /* Checkbox */
    .email-list-container tr > td:nth-child(1) { grid-column: 1; grid-row: 1 / span 2; display: flex; align-items: center; padding: 0; border: none; }
    /* Sender */
    .email-list-container tr > td:nth-child(2) { grid-column: 2; grid-row: 1; padding: 0; border: none; font-weight: 700; font-size: 14px; color: #1e293b; background: transparent !important; }
    /* Date (last-child or col-date) */
    .email-list-container tr > td:last-child, .email-list-container tr > td.col-date { grid-column: 3; grid-row: 1; padding: 0; border: none; text-align: right; font-size: 11px; color: #64748b; background: transparent !important; }
    /* Subject + Badges */
    .email-list-container tr > td:nth-child(3) {
        grid-column: 2 / 4; grid-row: 2; padding: 0; border: none; font-size: 13px; color: #4b5563;
        margin-top: 4px; white-space: normal; line-height: 1.5; display: block; background: transparent !important;
    }
    .folder-badge, .status-badge, .reply-badge { margin-bottom: 4px; margin-right: 4px; }
}

/* --- PHISHING OVERLAY (ex-inline from detail.php) --- */
.phishing-overlay { position: fixed; inset: 0; background: rgba(139,0,0,0.98); display: flex; justify-content: center; align-items: center; z-index: 999999; }
.phishing-overlay-box { background: var(--white); padding: 40px; border-radius: 15px; text-align: center; max-width: 500px; border: 8px solid #ffc107; box-shadow: 0 0 50px rgba(0,0,0,0.5); }
.phishing-overlay-icon { font-size: 80px; margin-bottom: 20px; }
.phishing-overlay-title { color: var(--danger-color); font-size: 32px; margin-bottom: 10px; font-family: sans-serif; }
.phishing-overlay-msg { font-size: 20px; font-weight: 600; color: #333; margin-bottom: 20px; font-family: sans-serif; }
.phishing-overlay-actions { display: flex; flex-direction: column; gap: 15px; }
.phishing-btn-delete { background: var(--danger-color); color: var(--white); border: none; padding: 15px; font-weight: 600; border-radius: var(--radius-md); cursor: pointer; font-size: 16px; }
.phishing-btn-trust { background: #6c757d; color: var(--white); border: none; padding: 12px; border-radius: var(--radius-md); cursor: pointer; font-size: 14px; }

/* --- TOOLBAR & LAYOUT (ex-inline) --- */
.toolbar-group { display: flex; align-items: center; }
.subject-original-hint { font-weight: 400; margin-top: 2px; }
.col-date-sub { font-size: 10px; }
.text-unknown { font-style: italic; opacity: 0.7; }
.text-unknown-muted { font-style: italic; }
.link-inherit { color: var(--text-color); text-decoration: none; }
.link-inherit:hover { color: var(--primary-color); }
.text-sub { font-size: 11px; }
.attachment-icon { font-size: 14px; margin-right: 4px; color: var(--text-muted); }
.order-nr-badge { vertical-align: text-bottom; }
.subject-original-wrap { font-weight: 400; }

/* --- COMPOSER (ex-inline from viewer.php) --- */
.composer-form { display: flex; flex-direction: column; height: 100%; }
.composer-row { display: flex; gap: 10px; align-items: center; width: 100%; }
.composer-row .input-composer { flex: 1; }
.composer-row .input-composer.input-subject { flex: 1; }
.ai-composer-bar { display: flex; gap: 10px; margin-bottom: 10px; background: #f0fdf4; padding: 10px; border-radius: var(--radius-md); border: 1px solid #bbf7d0; align-items: center; }
.ai-composer-bar .input-composer { flex: 1; border: 1px solid #86efac; background: var(--white); }
.ai-composer-bar .ai-icon { font-size: 16px; }
.input-composer.input-lang { width: 100px; flex: none; }
#translationNotice.translation-notice { font-size: 12px; color: #666; margin-left: 8px; white-space: nowrap; }
.ai-composer-bar .btn { white-space: nowrap; }
.composer-send-btn { padding: 10px 25px; font-size: 14px; }
.composer-cc-toggle { white-space: nowrap; }
.composer-replyall-label { white-space: nowrap; margin-left: 10px; }
.composer-priority-label { white-space: nowrap; }
.reply-preview-box { display: none; height: 0; overflow: hidden; }
.attachment-list-inline { margin: 0; display: inline-flex; }
.detail-col { flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; overflow: hidden; }
.order-sidebar-inner { position: static; transform: none; border-left: 1px solid var(--border-light); width: 360px; flex-shrink: 0; background: var(--surface-gray); overflow-y: auto; }
.btn-edit-draft { background-color: var(--primary-color); border-color: var(--primary-color); }
.btn-ai-debug { margin-left: 10px; }
.mobile-order-btn { justify-content: center; }

/* --- AUTH PAGES (ex-inline) --- */
.auth-blocked-icon { font-size: 60px; margin-bottom: 10px; }
.auth-blocked-title { color: var(--danger-color); }
.auth-blocked-box { background-color: #fff5f5; border-left: 4px solid var(--danger-color); padding: 15px; color: #b91c1c; font-size: 14px; line-height: 1.5; margin-bottom: 20px; }
.auth-blocked-reason { font-size: 12px; color: #7f1d1d; }
.auth-blocked-footer { text-align: center; color: #666; font-size: 13px; }
.resend-box { margin-top: 10px; padding: 12px; background: #f0f9ff; border-radius: var(--radius-md); border: 1px solid var(--info-border); }
.resend-box p { margin: 0 0 8px 0; font-size: 14px; color: #0369a1; }
.resend-btn { font-size: 13px; padding: 8px 16px; }
.resend-status { margin-left: 8px; font-size: 13px; }
.auth-verify-card { text-align: center; }
.auth-verify-icon { font-size: 40px; margin-bottom: 20px; }
.auth-verify-msg { color: #666; margin: 20px 0; }
.auth-verify-btn { display: inline-block; text-decoration: none; width: 100%; }

/* --- WIZARD & SETTINGS (ex-inline) --- */
.wizard-intro { color: var(--secondary-color); font-size: 14px; line-height: 1.5; }
.wizard-hint { color: #94a3b8; margin-top: 5px; display: block; }
.inline-error { margin-bottom: 20px; }
.wizard-hr { margin: 0 0 20px 0; border-top: 1px solid var(--border-light); }
.wizard-section-title { margin-bottom: 15px; font-size: 16px; }
.wizard-section-spaced { margin: 25px 0 15px 0; font-size: 16px; }
.wizard-checkbox-group { margin-bottom: 15px; }
.wizard-checkbox-label { display: flex; align-items: center; cursor: pointer; font-weight: 400; }
.wizard-checkbox-label input { width: auto; margin-right: 10px; }
.wizard-actions { margin-top: 30px; display: flex; gap: 10px; }
.wizard-actions .btn { width: auto; }
.wizard-actions .btn-primary { flex: 1; }
.settings-span-2 { grid-column: span 2; }
.sender-name-box { background: var(--surface-gray); padding: 15px; border: 1px solid var(--border-light); border-radius: var(--radius-md); }
.sender-name-option { margin-bottom: 10px; }
.sender-name-label { display: flex; align-items: center; cursor: pointer; font-weight: 400; margin-bottom: 5px; }
.sender-name-label span { margin-left: 8px; }
.custom-name-box { margin-top: 10px; }
.custom-name-label { font-size: 12px; color: var(--secondary-color); display: block; margin-bottom: 4px; }
.settings-actions { display: flex; gap: 10px; }
.settings-grid-2fr1fr { grid-template-columns: 2fr 1fr; }
.btn-danger-outline { background-color: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.textarea-rule-desc { height: 80px; }
.input-readonly { background: var(--bg-hover); }
.register-intro { font-size: 13px; line-height: 1.4; color: var(--text-muted); }
.honeypot-field { opacity: 0; position: absolute; top: 0; left: 0; height: 0; width: 0; z-index: -1; }
.label-inline { display: inline; font-weight: normal; }

/* --- ATTACHMENT PREVIEW --- */
.attachment-preview-img { width: 100%; height: 100%; object-fit: cover; }

/* Sync Status Notification */
#sync-status { 
    position: fixed; 
    bottom: 20px; 
    right: 20px; 
    background: rgba(0, 0, 0, 0.8); 
    color: white; 
    padding: 10px 20px; 
    border-radius: 30px; 
    font-size: 13px; 
    font-weight: 500;
    z-index: 9999; 
    display: none; /* Standaard verborgen! */
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideUpFade 0.3s ease-out;
    pointer-events: none; /* Klikken gaat er doorheen */
}

@keyframes slideUpFade { 
    from { opacity: 0; transform: translateY(20px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* ═══════════════════════════════════════════════════════════
   DARK MODE — [data-theme="dark"]
   Overschrijft :root-variabelen + hardcoded kleuren.
   ═══════════════════════════════════════════════════════════ */

[data-theme="dark"] {
    /* Layout & achtergronden */
    --body-bg:      #0d1117;
    --sidebar-bg:   #161b22;
    --white:        #1c2128;
    --surface-gray: #21262d;
    --bg-hover:     #2d333b;

    /* Borders */
    --border-color: #30363d;
    --border-light: #30363d;
    --input-border: #3d4a5c;

    /* Tekst */
    --text-color:   #e6edf3;
    --text-muted:   #8b949e;

    /* Semantische kleuren (achtergronden) iets donkerder */
    --primary-light: #1a2744;
    --success-bg:   #0d2818;
    --danger-bg:    #2c1010;
    --warning-bg:   #2a1400;
    --info-bg:      #0d2030;
    --shadow-sm:    0 1px 3px rgba(0,0,0,0.4);
    --shadow-md:    0 4px 8px rgba(0,0,0,0.5);
    --shadow-lg:    0 10px 20px rgba(0,0,0,0.6);
}

/* Body achtergrond */
[data-theme="dark"] body {
    background: linear-gradient(135deg, #0d1117 0%, #101620 50%, #0d1a22 100%);
}

/* Scrollbars */
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #3d4a5c; }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #4d5e72; }

/* ── Formulieren & inputs ── */
[data-theme="dark"] .form-group label,
[data-theme="dark"] .input-grid label { color: #adb5bd; }

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] .input-select,
[data-theme="dark"] .input-modal,
[data-theme="dark"] .input-composer {
    background-color: #21262d;
    color: #e6edf3;
    border-color: #3d4a5c;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] .input-modal:focus,
[data-theme="dark"] .input-composer:focus {
    background-color: #2d333b;
    box-shadow: 0 0 0 3px rgba(27,63,160,0.25);
}

[data-theme="dark"] .input-group .btn-addon {
    background: #21262d; color: #adb5bd; border-color: #3d4a5c;
}
[data-theme="dark"] .input-group .btn-addon:hover { background: #2d333b; color: #e6edf3; }

[data-theme="dark"] .autocomplete-list { background: #21262d; border-color: #3d4a5c; }
[data-theme="dark"] .autocomplete-item { color: #adb5bd; border-bottom-color: #30363d; }
[data-theme="dark"] .autocomplete-item:hover,
[data-theme="dark"] .autocomplete-item.selected { background: #2d333b; }

[data-theme="dark"] .toggle-label { color: #adb5bd; }
[data-theme="dark"] .toggle-switch { background-color: #3d4a5c; }
[data-theme="dark"] .toggle-sm { color: #8b949e; }

/* ── Knoppen ── */
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .btn-gray,
[data-theme="dark"] .btn-cancel {
    background: #21262d; color: #adb5bd; border-color: #3d4a5c;
}
[data-theme="dark"] .btn-secondary:hover,
[data-theme="dark"] .btn-gray:hover,
[data-theme="dark"] .btn-cancel:hover {
    background: #2d333b; color: #e6edf3; border-color: #4d5e72;
}

[data-theme="dark"] .btn-compose {
    background: #21262d; color: #adb5bd; border-color: #3d4a5c !important;
}
[data-theme="dark"] .btn-compose:hover {
    background: #2d333b; color: #e6edf3; border-color: #4d5e72 !important;
}

/* ── Hoofd layout ── */
[data-theme="dark"] .main {
    background: rgba(28,33,40,0.97);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.3), 4px 0 24px rgba(0,0,0,0.3);
}

/* ── Sidebar ── */
[data-theme="dark"] .sidebar {
    background: rgba(22,27,34,0.97);
    border-right-color: #30363d;
    box-shadow: 2px 0 16px rgba(0,0,0,0.4);
}
[data-theme="dark"] .sidebar-header {
    background: linear-gradient(135deg, #161b22 0%, #1c2436 100%);
    border-bottom-color: #30363d;
}
[data-theme="dark"] .sidebar-section-divider { border-bottom-color: #30363d; }
[data-theme="dark"] .sidebar-footer {
    border-top-color: #30363d;
    background: linear-gradient(180deg, rgba(22,27,34,0.8) 0%, rgba(13,17,23,0.95) 100%);
    box-shadow: 0 -4px 16px rgba(0,0,0,0.3);
}
[data-theme="dark"] .user-profile-box {
    background: rgba(255,255,255,0.05);
    color: #adb5bd; border-color: #30363d;
}
[data-theme="dark"] .sidebar select {
    background: #21262d; border-color: #3d4a5c; color: #adb5bd;
}
[data-theme="dark"] .sidebar .mailbox-single-label { color: #8b949e; }
[data-theme="dark"] .folder-row:hover { background: #1c2436; }
[data-theme="dark"] .folder-link { color: #8b949e; }
[data-theme="dark"] .folder-link:hover { color: #58a6ff; }
[data-theme="dark"] .folder-link.active { background: #1a2744; color: #58a6ff; }
[data-theme="dark"] .folder-toggle { color: #4d5e72; }
[data-theme="dark"] .folder-toggle:hover { color: #58a6ff; }
[data-theme="dark"] .sub-menu { background: #1a1f28; }
[data-theme="dark"] .sub-menu .folder-link { color: #6e7681; }

/* ── Toolbar & zoekveld ── */
[data-theme="dark"] .toolbar {
    background: rgba(22,27,34,0.95);
    border-bottom-color: #30363d;
}
[data-theme="dark"] .hamburger-btn { color: #adb5bd; }
[data-theme="dark"] .search-form {
    background: #21262d; border-color: #3d4a5c;
}
[data-theme="dark"] .search-form:focus-within {
    background: #2d333b; border-color: #58a6ff;
    box-shadow: 0 0 0 3px rgba(88,166,255,0.15);
}
[data-theme="dark"] .search-form input { color: #e6edf3; }
[data-theme="dark"] .search-form input::placeholder { color: #4d5e72; }
[data-theme="dark"] .search-form button[type="submit"] {
    background: #21262d; color: #8b949e; border-left-color: #30363d;
}
[data-theme="dark"] .search-form button[type="submit"]:hover {
    background: #2d333b; color: #e6edf3;
}
[data-theme="dark"] .reset-search { color: #4d5e72; }

/* ── View tabs ── */
[data-theme="dark"] .view-tabs { background: var(--white); border-bottom-color: #30363d; }
[data-theme="dark"] .tab:hover:not(.active) { background: #21262d; }
[data-theme="dark"] .tab-content { background: var(--white); }

/* ── Action bar ── */
[data-theme="dark"] .action-bar {
    background: rgba(22,27,34,0.92);
    border-bottom-color: #30363d;
}
[data-theme="dark"] .action-bar-divider { background: #30363d; }
[data-theme="dark"] .action-bar .btn {
    background: #21262d; color: #adb5bd; border-color: #3d4a5c;
}
[data-theme="dark"] .action-bar .btn:hover {
    background: #2d333b; color: #e6edf3; border-color: #4d5e72;
}
[data-theme="dark"] .action-bar .btn-back {
    background: #1c2128; color: #adb5bd; border-color: #3d4a5c;
}
[data-theme="dark"] .action-bar .btn-back:hover { background: #21262d; color: #e6edf3; }
[data-theme="dark"] .action-bar .btn-forward,
[data-theme="dark"] .action-bar .btn-reply {
    background: #1a2744; color: #58a6ff; border-color: #1f3a7a;
}
[data-theme="dark"] .action-bar .btn-forward:hover,
[data-theme="dark"] .action-bar .btn-reply:hover {
    background: #1f3066; color: #79b8ff; border-color: #2d5199;
}
[data-theme="dark"] .action-bar .btn-archive {
    background: #0d2818; color: #3fb950; border-color: #1a4d2e;
}
[data-theme="dark"] .action-bar .btn-archive:hover {
    background: #1a3d26; color: #56d364; border-color: #2ea043;
}
[data-theme="dark"] .action-bar .btn-trash {
    background: #2c1010; color: #f85149; border-color: #4d1f1f;
}
[data-theme="dark"] .action-bar .btn-trash:hover {
    background: #3d1a1a; color: #ff7b72; border-color: #6e2c2c;
}
[data-theme="dark"] .action-bar .btn-ai,
[data-theme="dark"] .action-bar .btn-ai-debug {
    background: #0d2030; color: #39d0d8; border-color: #1a404d;
}
[data-theme="dark"] .action-bar .btn-ai:hover,
[data-theme="dark"] .action-bar .btn-ai-debug:hover {
    background: #1a3040; color: #56dde0; border-color: #2d6070;
}

/* ── Email lijst ── */
[data-theme="dark"] .email-list-container { background: #1c2128; }
[data-theme="dark"] .bulk-bar { background: #0d2030; border-bottom-color: #1a404d; color: #58a6ff; }
[data-theme="dark"] th { background: #21262d; border-bottom-color: #30363d; }
[data-theme="dark"] td { border-bottom-color: #21262d; color: #adb5bd; }
[data-theme="dark"] tr:hover td { background: #21262d; }
[data-theme="dark"] .col-from { color: #c9d1d9; }
[data-theme="dark"] .email-row-unread td { background-color: #1c2436; color: #e6edf3; font-weight: 700; }
[data-theme="dark"] .email-row-unread td.col-from { color: #58a6ff; }
[data-theme="dark"] .email-row-read td { background-color: #1c2128; color: #6e7681; }
[data-theme="dark"] .email-row-priority td { background-color: #1a2030; }
[data-theme="dark"] .email-row-processing { background-color: #21262d !important; }
[data-theme="dark"] .email-row-processing td { color: #4d5e72 !important; }

/* Pagination */
[data-theme="dark"] .pagination { background: var(--white); border-top-color: #30363d; }
[data-theme="dark"] .pagination a,
[data-theme="dark"] .pagination span { background: #21262d; color: #adb5bd; border-color: #30363d; }
[data-theme="dark"] .pagination a:hover { background: #2d333b; }

/* ── Detail view ── */
[data-theme="dark"] .detail-container { background: #1c2128; }
[data-theme="dark"] .email-content { background: #1c2128; }
[data-theme="dark"] #inlineComposer { background: #1c2128; border-bottom-color: #30363d; }
[data-theme="dark"] .email-subject { color: #e6edf3; }
[data-theme="dark"] .email-date { background: #21262d; border-color: #30363d; }
[data-theme="dark"] .header-meta-row { color: #adb5bd; }
[data-theme="dark"] .sender-name { color: #c9d1d9; }
[data-theme="dark"] .details-toggle:hover { background: #21262d; }
[data-theme="dark"] .header-extended-details { background: #21262d; border-color: #30363d; color: #8b949e; }
[data-theme="dark"] .email-body { background: #fff; border-color: #30363d; }
[data-theme="dark"] .ai-input-bar { background: #21262d; border-color: #30363d; }
[data-theme="dark"] .email-header { border-bottom-color: #30363d; }

/* Delegation blokken */
[data-theme="dark"] .delegation-todo { background: linear-gradient(90deg, #0d2818, #0d2030); border-color: #1a4d2e; color: #56d364; }
[data-theme="dark"] .delegation-todo .delegation-icon { background: #1a3d26; color: #3fb950; }
[data-theme="dark"] .delegation-warning { background: linear-gradient(90deg, #1a2744, #1c2436); border-color: #1f3a7a; color: #79b8ff; }
[data-theme="dark"] .delegation-warning .delegation-icon { background: #1f3066; color: #58a6ff; }
[data-theme="dark"] .delegation-info { background: linear-gradient(90deg, #0d2030, #1a2744); border-color: #1a404d; color: #56dde0; }
[data-theme="dark"] .delegation-info .delegation-icon { background: #1a3040; color: #39d0d8; }
[data-theme="dark"] .reply-info-block { background: #1a2744; border-color: #1f3a7a; color: #79b8ff; }

/* Bijlagen */
[data-theme="dark"] .attachments { background: #21262d; border-color: #30363d; }
[data-theme="dark"] .attachment-chip { background: #21262d; border-color: #30363d; }
[data-theme="dark"] .attachment-preview { background: #2d333b; }

/* Composer */
[data-theme="dark"] .composer-attachments { background: #21262d; border-color: #3d4a5c; }
[data-theme="dark"] .ai-composer-bar { background: #0d2818; border-color: #1a4d2e; }
[data-theme="dark"] .ai-composer-bar .input-composer { border-color: #2ea043; background: #1c2128; }

/* ── Order sidebar ── */
[data-theme="dark"] .order-card { background: #21262d; border-color: #30363d; }
[data-theme="dark"] .order-card h4 { color: #c9d1d9; border-bottom-color: #30363d; }
[data-theme="dark"] .val { color: #c9d1d9; }
[data-theme="dark"] .product-item { border-bottom-color: #30363d; }
[data-theme="dark"] .pnl-shipment { border-bottom-color: #30363d; }
[data-theme="dark"] .pnl-timeline { border-left-color: #30363d; }
[data-theme="dark"] .pnl-dot { background: #30363d; border-color: #1c2128; }

/* ── Modals ── */
[data-theme="dark"] .modal { background-color: #1c2128; }
[data-theme="dark"] .modal h3 { background-color: #1c2128; border-bottom-color: #30363d; color: #e6edf3; }
[data-theme="dark"] .modal-footer { background: #21262d; border-top-color: #30363d; }
[data-theme="dark"] .move-list-container { background: #1c2128; border-color: #30363d; }
[data-theme="dark"] .move-list-item { border-bottom-color: #30363d; color: #adb5bd; }
[data-theme="dark"] .move-list-item:hover { background: #1a2744; color: #58a6ff; }

/* ── Settings ── */
[data-theme="dark"] .settings-container { color: #e6edf3; }
[data-theme="dark"] .settings-header { border-bottom-color: #30363d; }
[data-theme="dark"] .tabs { border-bottom-color: #30363d; }
[data-theme="dark"] .tab { color: #8b949e; }
[data-theme="dark"] .tab:hover:not(.active) { background: #21262d; color: #adb5bd; }
[data-theme="dark"] .tab.active { color: #58a6ff; border-bottom-color: #58a6ff; }
[data-theme="dark"] .tab-content { background: #1c2128; color: #e6edf3; }
[data-theme="dark"] .prompt-card { background: #21262d; border-color: #30363d; }
[data-theme="dark"] .prompt-card:focus-within { background: #2d333b; }
[data-theme="dark"] .folder-manager-list { background: #1c2128; border-color: #30363d; }
[data-theme="dark"] .folder-mgr-item { border-bottom-color: #30363d; color: #adb5bd; }
[data-theme="dark"] .folder-handle { color: #3d4a5c; }
[data-theme="dark"] .sender-name-box { background: #21262d; border-color: #30363d; }
[data-theme="dark"] .form-section { color: #e6edf3; }
[data-theme="dark"] h3, [data-theme="dark"] h4 { color: #e6edf3; }

/* Badges */
[data-theme="dark"] .folder-badge { background: #21262d; color: #8b949e; border-color: #3d4a5c; }
[data-theme="dark"] .processing-badge { background: #1a2744; color: #58a6ff; border-color: #1f3a7a; }
[data-theme="dark"] .banner-processing { background: #1a2744; border-color: #1f3a7a; color: #79b8ff; }
[data-theme="dark"] .banner-translation { background: #0d2030; border-color: #1a404d; color: #56dde0; }

/* New mail alert */
[data-theme="dark"] #new-mail-alert {
    background: rgba(28,33,40,0.97);
    color: #58a6ff;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5), 0 0 0 1px rgba(88,166,255,0.2);
}

/* Loader */
[data-theme="dark"] .loader-spinner { border-color: #30363d; border-top-color: #58a6ff; }

/* Mobile email list cards */
[data-theme="dark"] .email-list-container tr { background: #1c2128; border-bottom-color: #30363d; }
[data-theme="dark"] .email-list-container tr > td:nth-child(2) { color: #c9d1d9; }
[data-theme="dark"] .email-list-container tr > td:last-child,
[data-theme="dark"] .email-list-container tr > td.col-date { color: #6e7681; }
[data-theme="dark"] .email-list-container tr > td:nth-child(3) { color: #8b949e; }
