:root {
    --primary: #0c918d;
    --primary-dk: #087e83;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --bg: #f6f7f8;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    font-size: 15px;
}

a { color: var(--primary-dk); }
h1 { font-size: 24px; margin: 0 0 20px; }
h2 { font-size: 17px; margin: 0 0 14px; }

.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 24px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--muted); font-weight: 600; }
.brand img { height: 32px; }
.topbar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.topbar nav a { padding: 6px 12px; border-radius: 6px; text-decoration: none; color: var(--text); }
.topbar nav a.active { background: #e6f5f4; color: var(--primary-dk); font-weight: 600; }
.topbar form { margin: 0; }

.page { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }

.card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 20px; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.stat-value { font-size: 22px; font-weight: 700; }
.stat-label { font-size: 13px; color: var(--muted); }
.stat--alert { border-color: #fca5a5; background: #fef2f2; }

.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafafa; }
.card .table { border: none; margin-top: 16px; }
.num { text-align: right !important; white-space: nowrap; }
.muted { color: var(--muted); font-size: 13px; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge--ok { background: #dcfce7; color: #166534; }
.badge--warn { background: #fef3c7; color: #92400e; }
.badge--overdue { background: #ffedd5; color: #9a3412; }
.badge--blocked { background: #fee2e2; color: #991b1b; }
.badge--muted { background: #f3f4f6; color: #4b5563; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; margin-bottom: 12px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
input, select, textarea {
    font: inherit;
    color: var(--text);
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
}
input:disabled { background: #f3f4f6; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }

.btn { padding: 8px 18px; border: 1px solid var(--primary); background: var(--primary); color: #fff; border-radius: 6px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--primary-dk); }
.btn--ghost { background: #fff; color: var(--primary-dk); }
.btn--ghost:hover { background: #e6f5f4; }
.btn--danger { background: #dc2626; border-color: #dc2626; }
.btn--danger:hover { background: #b91c1c; }
.link { background: none; border: none; padding: 4px 6px; color: var(--primary-dk); cursor: pointer; font: inherit; }
.link--danger { color: #dc2626; font-weight: 600; }

.error, .validation-message, .validation-errors { color: #b91c1c; }
.ok-text { color: #166534; font-weight: 600; }
.warn-text { color: #92400e; font-weight: 600; }

.settings { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 8px; overflow-x: auto; font-size: 13px; white-space: pre; }

.checks { margin: 0; padding-left: 20px; }
.checks .good { color: #166534; }
.checks .bad { color: #92400e; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 28px; display: flex; flex-direction: column; }
.login-logo { height: 40px; align-self: flex-start; margin-bottom: 12px; }
.login-card h1 { font-size: 20px; }
.login-card .btn { margin-top: 8px; }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: 10px 16px; background: #fef3c7; }

.title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.title-row h1 { margin: 0; }
.title-row .actions { margin-top: 0; }
a.btn { display: inline-block; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.neg { color: #b91c1c; font-weight: 600; }

.progress { width: 160px; height: 8px; background: #e5e7eb; border-radius: 999px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 8px; }
.progress > div { height: 100%; background: var(--primary); }

.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.step { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; margin-bottom: 10px; }
.step--done { background: #f0fdf4; border-color: #bbf7d0; }
.step-head .check { display: flex; flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 15px; margin: 0; }
.step-head input { width: 18px; height: 18px; }
.auto { display: inline-block; width: 18px; text-align: center; color: #166534; font-weight: 700; }
.step-help { margin: 6px 0 0 26px; color: var(--muted); font-size: 14px; }
.step .settings { margin: 10px 0 0 26px; }

.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.plan--inactive { opacity: .75; }
.plan-head { display: flex; align-items: center; gap: 10px; }
.plan-head h2 { margin: 0; }
.plan-price { font-size: 28px; font-weight: 700; margin: 8px 0; }
label.inline { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }

.grid--colors { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.color-field { display: flex; align-items: center; gap: 8px; }
.color-field input { flex: 1; min-width: 0; }
.swatch { width: 22px; height: 22px; flex: none; border-radius: 6px; border: 1px solid var(--border); }
.import { margin: 8px 0 16px; }
.import summary { cursor: pointer; color: var(--primary-dk); font-weight: 600; }
.import textarea { width: 100%; margin-top: 8px; font-family: ui-monospace, monospace; font-size: 13px; }
