:root {
    --bg: #f5f7f8;
    --panel: #ffffff;
    --panel-2: #f0f7f6;
    --ink: #151718;
    --muted: #687070;
    --line: #dce3e5;
    --line-strong: #c5d0d3;
    --accent: #0f766e;
    --accent-strong: #0b5f59;
    --accent-soft: #d7f1ed;
    --blue: #1d4ed8;
    --amber: #a16207;
    --green: #15803d;
    --danger: #b42318;
    --shadow: 0 18px 45px rgba(28, 30, 32, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(245, 247, 248, 0.96)),
        var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 24px 18px;
    background: #111513;
    color: #f9f6ee;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 8px;
    background: #d9f99d;
    color: #111513;
    font-weight: 900;
}

.brand strong {
    display: block;
    font-size: 17px;
}

.brand small,
.sidebar-footer span {
    display: block;
    color: rgba(249, 246, 238, 0.62);
    font-size: 12px;
    margin-top: 2px;
    overflow-wrap: anywhere;
}

.nav {
    display: grid;
    gap: 6px;
}

.nav a {
    border-radius: 8px;
    color: rgba(249, 246, 238, 0.72);
    padding: 11px 12px;
    font-weight: 700;
}

.nav a:hover,
.nav a.active {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 10px;
}

.workspace {
    padding: 32px;
    min-width: 0;
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: 34px;
    line-height: 1.08;
}

h2 {
    font-size: 22px;
}

h3 {
    font-size: 15px;
}

.subtle {
    color: var(--muted);
}

.actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0 14px;
    background: var(--ink);
    color: #ffffff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.button:hover,
button:hover {
    background: #2a2f30;
}

.button.secondary {
    background: var(--accent);
}

.button.secondary:hover {
    background: var(--accent-strong);
}

.button.ghost,
button.ghost {
    background: transparent;
    border-color: var(--line-strong);
    color: var(--ink);
}

.sidebar .button.ghost {
    border-color: rgba(249, 246, 238, 0.2);
    color: #f9f6ee;
}

.full {
    width: 100%;
}

.grid {
    display: grid;
    gap: 16px;
}

.stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.panel.pad {
    padding: 22px;
}

.stat {
    display: grid;
    gap: 8px;
}

.stat span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.stat strong {
    font-size: 30px;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
    gap: 16px;
    margin-top: 16px;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    border-bottom: 1px solid var(--line);
    padding: 14px 16px;
    text-align: left;
    vertical-align: middle;
}

.table th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.table tr:last-child td {
    border-bottom: 0;
}

.link {
    color: var(--accent-strong);
    font-weight: 900;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 0 10px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 900;
}

.badge.concept {
    background: #fef3c7;
    color: var(--amber);
}

.badge.definitief {
    background: #dcfce7;
    color: var(--green);
}

.form-grid {
    display: grid;
    gap: 14px;
}

.field {
    display: grid;
    gap: 7px;
}

.field label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}

input,
select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    padding: 0 12px;
}

input:focus,
select:focus {
    outline: 3px solid rgba(15, 118, 110, 0.18);
    border-color: var(--accent);
}

.line-items {
    display: grid;
    gap: 10px;
}

.line-item {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) 110px 130px 110px;
    gap: 10px;
    align-items: end;
}

.invoice-total {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.invoice-total strong {
    display: block;
    font-size: 28px;
}

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

.logo-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: 10px;
}

.logo-preview img {
    max-width: 120px;
    max-height: 58px;
    object-fit: contain;
}

.auth-page {
    background: #111513;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 0.85fr) minmax(360px, 1fr);
}

.auth-brand {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 44px;
    color: #f9f6ee;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.35), rgba(17, 21, 19, 0.92)),
        #111513;
}

.auth-brand .brand-mark {
    margin-bottom: 36px;
}

.auth-brand h1 {
    font-size: 58px;
}

.auth-copy {
    max-width: 500px;
    color: rgba(249, 246, 238, 0.72);
    font-size: 18px;
    line-height: 1.55;
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: var(--bg);
}

.auth-card {
    width: min(100%, 460px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 28px;
    box-shadow: var(--shadow);
}

.error {
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff1f2;
    color: var(--danger);
    padding: 10px 12px;
    font-weight: 800;
}

@media (max-width: 900px) {
    .app-shell,
    .auth-shell,
    .split,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .workspace {
        padding: 20px;
    }

    .page-head {
        display: grid;
    }

    .line-item {
        grid-template-columns: 1fr;
    }
}
