/* MTM Finance — minimal UI */

:root {
    --bg: #f7f7f5;
    --surface: #ffffff;
    --border: #e5e5e0;
    --text: #1a1a1a;
    --muted: #8a8a85;
    --soft: #55554f;
    --accent: #1a1a1a;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---- Nav ---- */

nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: flex-end;
    gap: 7px;
    text-decoration: none;
    margin-right: 8px;
}

.brand span { color: var(--soft); font-size: 16px; font-weight: 600; line-height: 1; }

.brand-logo { height: 22px; width: auto; display: block; }

.nav-links { display: flex; gap: 18px; flex: 1; }

.nav-links a {
    text-decoration: none;
    font-size: 14px;
    color: var(--soft);
    padding: 4px 0;
}

.nav-links a.active { color: var(--text); font-weight: 550; box-shadow: 0 14px 0 -12px var(--text); }

.nav-user { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }

/* ---- Layout ---- */

main { max-width: 860px; margin: 0 auto; padding: 32px 24px 64px; }

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

h1 { font-size: 21px; font-weight: 650; margin: 0; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

/* ---- Flash / errors ---- */

.flash {
    background: #eef6ee;
    border: 1px solid #cfe6cf;
    color: #275c31;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    margin-bottom: 20px;
}

.errors {
    background: #fdf1f1;
    border: 1px solid #f0d4d4;
    color: #8c3030;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    margin-bottom: 20px;
}

.errors ul { margin: 0; padding-left: 18px; }

/* ---- Table ---- */

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

th {
    text-align: left;
    font-size: 12px;
    font-weight: 550;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 0 14px 10px;
    border-bottom: 1px solid var(--border);
}

td { padding: 13px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }

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

tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: #fafaf8; }

td .sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }

.amount { font-variant-numeric: tabular-nums; font-weight: 550; white-space: nowrap; }

/* ---- Status badges ---- */

.badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 550;
    padding: 2px 9px;
    border-radius: 999px;
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge.pending_review   { background: #fdf6e7; border-color: #f0e2bb; color: #8a6d1f; }
.badge.pending_approval { background: #edf3fb; border-color: #d4e2f4; color: #2f5b96; }
.badge.needs_info       { background: #f8eefb; border-color: #ead4f0; color: #7b3f8f; }
.badge.approved         { background: #eef6ee; border-color: #cfe6cf; color: #2f6b3a; }
.badge.rejected         { background: #fdf1f1; border-color: #f0d4d4; color: #9c3535; }
.badge.paid             { background: #f0f0ee; border-color: #dcdcd7; color: #55554f; }

/* ---- Forms ---- */

label { display: block; font-size: 13px; font-weight: 550; margin-bottom: 6px; color: var(--soft); }

input[type="text"], input[type="email"], input[type="number"], input[type="url"],
select, textarea {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    font: inherit;
    font-size: 14px;
    color: var(--text);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #b9b9b2;
    box-shadow: 0 0 0 3px rgba(26, 26, 26, .06);
}

textarea { resize: vertical; min-height: 90px; }

.field { margin-bottom: 18px; }

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

.hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); font-weight: 400; }

.check input { width: auto; }

/* ---- Buttons ---- */

.btn {
    display: inline-block;
    white-space: nowrap;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 9px 18px;
    font: inherit;
    font-size: 14px;
    font-weight: 550;
    cursor: pointer;
    text-decoration: none;
    background: var(--accent);
    color: #fff;
}

.btn:hover { opacity: .88; }

.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: #fafaf8; opacity: 1; }

.btn.danger { background: var(--surface); color: #9c3535; border-color: #f0d4d4; }
.btn.danger:hover { background: #fdf1f1; opacity: 1; }

.btn.small { padding: 6px 13px; font-size: 13px; }

.btn-link { background: none; border: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; padding: 0; }
.btn-link:hover { color: var(--text); }

/* ---- Detail page ---- */

.detail-grid { display: grid; grid-template-columns: 1fr 280px; gap: 20px; align-items: start; }

@media (max-width: 720px) {
    .detail-grid { grid-template-columns: 1fr; }
    .field-row { grid-template-columns: 1fr; }
}

.meta { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; font-size: 14px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }

.divider { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }

/* ---- Timeline ---- */

.timeline { list-style: none; margin: 0; padding: 0; }

.timeline li { position: relative; padding: 0 0 16px 20px; }

.timeline li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--muted);
}

.timeline li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 18px;
    bottom: 2px;
    width: 1px;
    background: var(--border);
}

.timeline .t-title { font-size: 13.5px; }
.timeline .t-when { font-size: 12px; color: var(--muted); }
.timeline .t-note { font-size: 13px; color: var(--soft); margin-top: 3px; background: var(--bg); border-radius: 6px; padding: 6px 10px; }

/* ---- Comments ---- */

.comment { padding: 12px 0; border-bottom: 1px solid var(--border); }
.comment:last-of-type { border-bottom: 0; }
.comment .c-head { font-size: 13px; margin-bottom: 3px; }
.comment .c-head strong { font-weight: 550; }
.comment .c-head span { color: var(--muted); }
.comment p { margin: 0; font-size: 14px; white-space: pre-line; }

/* ---- Empty state ---- */

.empty { text-align: center; padding: 48px 20px; color: var(--muted); font-size: 14px; }

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

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-brand {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}
.login-brand span {
    color: var(--soft);
    font-size: 24px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .01em;
}
.login-logo { height: 34px; }
