/* Invoice Reminder — plain CSS, no build step required. */
:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --border: #e2e5ea;
    --text: #1c2128;
    --muted: #6a7280;
    --primary: #2f5bea;
    --primary-dark: #2447c0;
    --green: #0f7a4d;
    --green-bg: #e6f5ee;
    --red: #b42318;
    --red-bg: #fdecea;
    --blue: #1d4ed8;
    --blue-bg: #e8eefc;
    --amber: #92610a;
    --amber-bg: #fdf3e2;
    --gray: #4b5563;
    --gray-bg: #eef0f3;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .05);
}

* { box-sizing: border-box; }

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

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

.topbar {
    background: #101828;
    color: #fff;
    border-bottom: 1px solid #0b1220;
}
.topbar-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 26px;
    height: 58px;
}
.brand { font-weight: 700; font-size: 16px; color: #fff; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a {
    color: #c9d1dc;
    padding: 7px 12px;
    border-radius: 7px;
    font-size: 14px;
}
.nav a:hover { background: #1d2939; color: #fff; text-decoration: none; }
.nav a.active { background: var(--primary); color: #fff; }

.container { max-width: 1140px; margin: 0 auto; padding: 26px 20px 60px; }

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.page-head h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.02em; }
.page-head p { margin: 0; color: var(--muted); font-size: 14px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.card-head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.card-head h2 { margin: 0; font-size: 15px; font-weight: 650; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
}
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.stat .value { font-size: 24px; font-weight: 680; margin-top: 6px; letter-spacing: -.02em; }
.stat .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.stat.danger .value { color: var(--red); }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 18px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
th { background: #fafbfc; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 650; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfd; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 620;
    line-height: 1.7;
    white-space: nowrap;
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-gray { background: var(--gray-bg); color: var(--gray); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 560;
    cursor: pointer;
    line-height: 1.3;
    font-family: inherit;
}
.btn:hover { background: #f3f4f7; text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { color: var(--red); border-color: #f3c2bd; background: #fff; }
.btn-danger:hover { background: var(--red-bg); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.inline-form { display: inline; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
label { font-size: 13px; font-weight: 600; color: #344054; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #cfd4dc;
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
    background: #fff;
    color: var(--text);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 91, 234, .12);
}
textarea { min-height: 84px; resize: vertical; }
.hint { font-size: 12px; color: var(--muted); }
.error { font-size: 12.5px; color: var(--red); }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: 16px; height: 16px; }
.check label { font-weight: 500; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }

/* Filters */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { min-width: 150px; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; font-size: 14px; border: 1px solid transparent; }
.alert-success { background: var(--green-bg); color: var(--green); border-color: #bfe5d2; }
.alert-error { background: var(--red-bg); color: var(--red); border-color: #f5c6c2; }

/* Misc */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty { padding: 40px 18px; text-align: center; color: var(--muted); }
.pagination-wrap { padding: 14px 18px; border-top: 1px solid var(--border); }
.pagination-wrap nav { font-size: 14px; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px 24px; }
.detail-grid dt { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; }
.detail-grid dd { margin: 4px 0 0; font-size: 14.5px; }
.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

@media (max-width: 860px) {
    .form-grid, .two-col { grid-template-columns: 1fr; }
    .topbar-inner { height: auto; padding: 10px 16px; flex-wrap: wrap; }
    .nav { margin-left: 0; width: 100%; }
}

/* Auth screen */
.auth-body { display: flex; min-height: 100vh; }
.auth-shell { width: 100%; max-width: 400px; margin: auto; padding: 40px 20px; }
.auth-brand {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.01em;
    text-align: center;
    margin-bottom: 18px;
}
.auth-shell .card { margin-bottom: 14px; }
.auth-shell .form-actions .btn { width: 100%; text-align: center; }

.topbar-user { display: flex; align-items: center; gap: 10px; margin-left: 18px; }
.topbar-user .who { color: #c9d1dc; font-size: 13px; white-space: nowrap; }
.btn-signout {
    background: transparent;
    border-color: #344054;
    color: #c9d1dc;
    padding: 5px 10px;
    font-size: 13px;
}
.btn-signout:hover { background: #1d2939; color: #fff; }

/* Pagination */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pager-summary { color: var(--muted); font-size: 13px; }
.pager-links { display: flex; gap: 4px; flex-wrap: wrap; }
.pager-link {
    display: inline-block;
    padding: 5px 11px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 13.5px;
    background: #fff;
    color: var(--text);
}
.pager-link:hover { background: #f3f4f7; text-decoration: none; }
.pager-link.current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager-link.disabled { color: #9aa1ab; background: #fafbfc; }
