/* =========================================================================
   bijtketting-app stylesheet
   Geen framework — gewoon CSS die werkt. Eenvoud > kunst.
   ========================================================================= */

:root {
    --text: #1f2328;
    --muted: #6e7781;
    --border: #d1d9e0;
    --bg: #ffffff;
    --bg-soft: #f6f8fa;
    --accent: #0969da;
    --accent-hover: #0860c5;
    --error: #cf222e;
    --success: #1f883d;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
    background: var(--bg-soft);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 13px;
}

/* --- Topbar --------------------------------------------------------- */
.topbar {
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
}
.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.brand a {
    font-weight: 600;
    color: var(--text);
}
.brand a:hover { text-decoration: none; color: var(--accent); }
.version-tag {
    color: var(--muted);
    font-size: 12px;
    margin-left: 8px;
}
.nav { display: flex; align-items: center; gap: 16px; }
.nav a { color: var(--text); }
.link-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    padding: 0;
}
.link-btn:hover { text-decoration: underline; }

/* --- Main / containers --------------------------------------------- */
.main { min-height: calc(100vh - 100px); }
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.footer {
    text-align: center;
    color: var(--muted);
    padding: 24px 0;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

/* --- Empty state --------------------------------------------------- */
.empty-state {
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 40px 24px;
    text-align: center;
    margin-top: 40px;
}
.empty-state h2 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
}
.muted { color: var(--muted); }

/* --- Login --------------------------------------------------------- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-soft);
}
.login-box {
    background: var(--bg);
    padding: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    width: 100%;
    max-width: 400px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.login-box h1 {
    margin: 0 0 4px 0;
    font-size: 22px;
    font-weight: 600;
}
.login-box label {
    display: block;
    margin-top: 20px;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}
.login-box input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 15px;
}
.login-box input[type="password"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(9,105,218,0.15);
}

/* --- Buttons ------------------------------------------------------- */
.btn {
    display: inline-block;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-weight: 500;
    text-decoration: none;
    margin-top: 16px;
}
.btn:hover { background: var(--bg-soft); }
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    width: 100%;
}
.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* --- Alerts -------------------------------------------------------- */
.alert {
    padding: 10px 14px;
    border-radius: 6px;
    margin-top: 16px;
    font-size: 14px;
}
.alert-error {
    background: #ffebe9;
    border: 1px solid #ffcecb;
    color: var(--error);
}
.alert-success {
    background: #dcffe4;
    border: 1px solid #aceebb;
    color: var(--success);
}

/* --- Inbox: filter-tabs --------------------------------------------- */
.filter-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin: 24px 0 0 0;
    flex-wrap: wrap;
}
.filter-tab {
    padding: 8px 14px;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: -1px;
}
.filter-tab:hover {
    color: var(--text);
    background: var(--bg-soft);
    text-decoration: none;
}
.filter-tab.active {
    color: var(--text);
    background: var(--bg);
    border-color: var(--border);
    border-bottom-color: var(--bg);
    font-weight: 500;
}
.filter-count {
    color: var(--muted);
    font-size: 12px;
    margin-left: 4px;
}
.filter-tab.active .filter-count { color: var(--text); }

/* --- Inbox: mail-lijst ---------------------------------------------- */
.mail-list {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 14px;
}
.mail-list th {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.mail-list td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.mail-row { cursor: pointer; }
.mail-row:hover { background: var(--bg-soft); }

.col-date { width: 100px; color: var(--muted); white-space: nowrap; }
.col-tag { width: 140px; }
.col-sender { width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.sender-name { font-weight: 500; }
.col-subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Tags (prefilter-resultaat) ------------------------------------- */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    text-transform: lowercase;
    border: 1px solid transparent;
}
.tag-customer            { background: #ddf4ff; color: #0969da; border-color: #54aeff66; }
.tag-unknown             { background: #ddf4ff; color: #0969da; border-color: #54aeff66; }
.tag-supplier            { background: #fff8c5; color: #7d4e00; border-color: #d4a72c66; }
.tag-newsletter          { background: #f6f8fa; color: var(--muted); border-color: var(--border); }
.tag-order_notification  { background: #dafbe1; color: #1a7f37; border-color: #4ac26b66; }
.tag-auto_reply          { background: #f6f8fa; color: var(--muted); border-color: var(--border); }
.tag-spam                { background: #ffebe9; color: var(--error); border-color: #ffcecb; }

/* --- Mail-detail ---------------------------------------------------- */
.mail-detail h1 { margin-bottom: 16px; }
.mail-meta {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px 18px;
    margin-bottom: 24px;
    font-size: 14px;
}
.mail-meta-row { padding: 2px 0; }
.mail-attachments { margin-bottom: 24px; }
.mail-body h3, .mail-attachments h3 {
    font-size: 15px; font-weight: 600; margin: 0 0 8px 0;
}
.mail-body-text {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.55;
    max-height: 600px;
    overflow-y: auto;
}
.mail-headers {
    margin-top: 28px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}
.mail-headers summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 13px;
}
.mail-headers pre {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    font-size: 12px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 12px;
}
