/* Lomero Uren - donker werkscherm, tabellaire cijfers, alles op snelheid */

:root {
    --bg: #14201b;
    --bg-raise: #1c2b24;
    --bg-hover: #24362d;
    --line: #2c4036;
    --ink: #e8efe9;
    --ink-dim: #93a89b;
    --accent: #4fd1a0;
    --accent-ink: #0d1a14;
    --warn: #e5b04c;
    --danger: #e07070;
    --radius: 12px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
}

/* ---------- Topbar ---------- */

.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 14px calc(10px);
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}

.brand {
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.brand-mark {
    display: inline-block;
    background: var(--accent);
    color: var(--accent-ink);
    border-radius: 8px;
    padding: 2px 7px;
    margin-right: 6px;
    font-weight: 800;
}

.tabs { display: flex; gap: 4px; flex: 1; }

.tab {
    background: none;
    border: none;
    color: var(--ink-dim);
    font: inherit;
    font-weight: 600;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
}

.tab:hover { background: var(--bg-hover); }
.tab.active { color: var(--ink); background: var(--bg-raise); }

.logout {
    color: var(--ink-dim);
    font-size: 0.85rem;
    text-decoration: none;
}
.logout:hover { color: var(--ink); }

/* ---------- Panels ---------- */

.app-main { flex: 1; min-height: 0; display: flex; }

.panel {
    display: none;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    overflow-y: auto;
    padding: 16px;
    gap: 12px;
}
.panel.active { display: flex; }

#tab-log { padding: 0; }

.empty {
    color: var(--ink-dim);
    text-align: center;
    margin: auto;
    padding: 40px 24px;
    line-height: 1.6;
    max-width: 420px;
}

.muted { color: var(--ink-dim); font-size: 0.85rem; }

/* ---------- Feed ---------- */

.feed {
    flex: 1;
    overflow-y: auto;
    padding: 16px 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.day-head {
    display: flex;
    justify-content: space-between;
    color: var(--ink-dim);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0 4px 8px;
}

.day-total { font-variant-numeric: tabular-nums; }

.bubble {
    display: block;
    width: 100%;
    max-width: 560px;
    text-align: left;
    background: var(--bg-raise);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 8px;
    color: var(--ink);
    font: inherit;
    cursor: pointer;
}

.bubble:hover { background: var(--bg-hover); }

.bubble-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.bubble-hours {
    font-variant-numeric: tabular-nums;
    color: var(--accent);
    font-weight: 700;
    white-space: nowrap;
}

.bubble-desc { margin-top: 4px; color: var(--ink-dim); line-height: 1.45; }
.bubble-meta { margin-top: 8px; }

.chip {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.chip-open { background: rgba(229, 176, 76, 0.15); color: var(--warn); }
.chip-done { background: rgba(79, 209, 160, 0.15); color: var(--accent); }
.chip-muted { background: rgba(147, 168, 155, 0.15); color: var(--ink-dim); }

/* ---------- Composer ---------- */

.composer {
    border-top: 1px solid var(--line);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--bg);
}

.parse-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 8px;
}

.pv {
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--bg-raise);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 10px;
    color: var(--ink-dim);
}
.pv.ok { color: var(--accent); border-color: rgba(79, 209, 160, 0.4); }
.pv.warn { color: var(--warn); border-color: rgba(229, 176, 76, 0.4); }
.pv.desc { font-weight: 400; font-style: italic; }

#entry-form { display: flex; gap: 8px; }

#entry-input {
    flex: 1;
    background: var(--bg-raise);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    font: inherit;
    padding: 12px 18px;
    outline: none;
}
#entry-input:focus { border-color: var(--accent); }
#entry-input::placeholder { color: var(--ink-dim); }

#entry-form button {
    background: var(--accent);
    color: var(--accent-ink);
    border: none;
    border-radius: 999px;
    width: 48px;
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
}
#entry-form button:hover { filter: brightness(1.1); }

/* ---------- Factureren ---------- */

.grand {
    font-size: 1.05rem;
    color: var(--ink-dim);
    padding: 4px 2px;
}
.grand strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.card {
    background: var(--bg-raise);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    max-width: 640px;
}

.card-head { display: flex; justify-content: space-between; gap: 12px; }

.card-amount {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--accent);
    white-space: nowrap;
}

.card-lines {
    list-style: none;
    margin: 10px 0;
    padding: 10px 0 0;
    border-top: 1px solid var(--line);
    font-size: 0.9rem;
    line-height: 1.7;
}

.line-date {
    display: inline-block;
    min-width: 84px;
    color: var(--ink-dim);
}

.card-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Rijen (historie, klanten) ---------- */

.row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 640px;
    text-align: left;
    background: var(--bg-raise);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    font: inherit;
    padding: 11px 14px;
    cursor: pointer;
}
.row:hover { background: var(--bg-hover); }

.row-date { color: var(--ink-dim); font-variant-numeric: tabular-nums; font-size: 0.85rem; white-space: nowrap; }
.row-client { font-weight: 600; flex: 1; }
.row-hours { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 700; white-space: nowrap; }
.row-aliases { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { display: flex; align-items: center; gap: 6px; }

.history, .clients, .overview { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Knoppen & dialogen ---------- */

.btn-primary, .btn-secondary, .btn-danger {
    font: inherit;
    font-weight: 600;
    border-radius: 10px;
    padding: 9px 14px;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.1); }

.btn-secondary {
    background: none;
    color: var(--ink);
    border-color: var(--line);
    align-self: flex-start;
}
.btn-secondary:hover { background: var(--bg-hover); }

.btn-danger { background: none; color: var(--danger); border-color: rgba(224, 112, 112, 0.4); }
.btn-danger:hover { background: rgba(224, 112, 112, 0.1); }

dialog {
    background: var(--bg-raise);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    width: min(440px, calc(100vw - 32px));
}
dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
dialog h2 { margin: 0 0 14px; font-size: 1.05rem; }

dialog label, .login-card label {
    display: block;
    font-size: 0.85rem;
    color: var(--ink-dim);
    margin-bottom: 12px;
}

dialog input, dialog select, .login-card input {
    display: block;
    width: 100%;
    margin-top: 4px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font: inherit;
    padding: 10px 12px;
    outline: none;
}
dialog input:focus, dialog select:focus, .login-card input:focus { border-color: var(--accent); }

.dialog-actions { display: flex; gap: 8px; margin-top: 6px; }
.spacer { flex: 1; }

/* ---------- Login ---------- */

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.login-card {
    background: var(--bg-raise);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 28px;
    width: min(380px, 100%);
}

.login-card h1 { font-size: 1.2rem; margin: 18px 0 6px; }
.login-card .muted { margin: 0 0 8px; }
.login-card form { margin-top: 14px; }

.login-card button {
    width: 100%;
    background: var(--accent);
    color: var(--accent-ink);
    border: none;
    border-radius: 10px;
    font: inherit;
    font-weight: 700;
    padding: 12px;
    cursor: pointer;
}
.login-card button:hover { filter: brightness(1.1); }

.form-error { color: var(--danger); font-size: 0.9rem; }

/* ---------- Toegankelijkheid ---------- */

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

@media (max-width: 560px) {
    .topbar { gap: 8px; }
    .tabs { order: 3; width: 100%; overflow-x: auto; }
    .tab { padding: 8px 12px; white-space: nowrap; }
}

/* ---------- Pincode ---------- */

.pin-input {
    letter-spacing: 0.4em;
    font-size: 1.2rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
