:root {
    --brand-blue: #1B6FC9;
    --brand-blue-dark: #0E4C8A;
    --brand-green: #3FAE49;
    --brand-green-dark: #1E7A33;
    --gradient: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-green) 100%);
    --ink: #33383E;
    --ink-soft: #6B7178;
    --bg: #F6F7F9;
    --card: #FFFFFF;
    --border: #E3E6EA;
    --amber: #F0A93A;
    --red: #C0392B;
    --red-bg: #FBEAE8;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-blue-dark); }

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 16px 48px;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}
.topbar-inner {
    max-width: 760px;
    margin: 0 auto;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 32px; }
.brand-name { font-weight: 700; font-size: 15px; color: var(--ink); line-height: 1.1; }
.brand-sub { font-size: 11px; color: var(--ink-soft); line-height: 1.1; }
.topbar a.action { font-size: 13px; color: var(--ink-soft); text-decoration: none; }
.topbar a.action:hover { color: var(--brand-blue-dark); }

h1 { font-size: 21px; margin: 0 0 4px; color: var(--ink); }
p.lead { color: var(--ink-soft); font-size: 14px; margin-top: 0; }

label.field-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 4px;
}

select, input[type=text], input[type=tel], input[type=password], input[type=date] {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    background: #fff;
    color: var(--ink);
    font-family: inherit;
}
select:focus, input:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(27,111,201,0.12);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: 8px;
    padding: 11px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary { background: var(--gradient); color: #fff; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-secondary { background: #fff; border: 1px solid var(--border); color: var(--ink); }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 16px;
}

.number-row {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    background: #fff;
}
.number-row.dup { border-color: var(--red); background: var(--red-bg); }
.number-row-flex {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
@media (min-width: 640px) {
    .number-row-flex { flex-direction: row; align-items: flex-start; }
    .number-row-flex .phone-col { flex: 1; }
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}
@media (min-width: 640px) {
    .check-grid { grid-template-columns: repeat(11, 28px); }
}
.check-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.check-cell input { width: 18px; height: 18px; accent-color: var(--brand-green-dark); }
.check-cell.ob input { accent-color: var(--amber); }
.check-cell span { font-size: 10px; color: var(--ink-soft); }

.remove-link {
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 18px;
    line-height: 1;
    padding: 4px 6px;
}
.remove-link:hover { color: var(--red); }

.flash {
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 16px;
}
.flash-error { background: var(--red-bg); color: var(--red); border: 1px solid #f0c6c1; }
.flash-success { background: #E9F7EC; color: var(--brand-green-dark); border: 1px solid #c9ecd0; }

.progress-track {
    height: 12px;
    border-radius: 999px;
    background: #EEF0F3;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--gradient);
}

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px; text-align: center; }
.stat-value { font-size: 22px; font-weight: 700; color: var(--brand-blue-dark); }
.stat-label { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a {
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.tabs a.active { color: var(--brand-blue-dark); border-bottom-color: var(--brand-blue); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; color: var(--ink-soft); text-transform: uppercase; padding: 8px 10px; background: #FAFBFC; }
td { padding: 9px 10px; border-top: 1px solid var(--border); }
td.num { text-align: right; }

.pill {
    display: inline-block;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #EEF0F3;
    color: var(--ink-soft);
    margin: 2px 3px 0 0;
}
.pill.ob { background: #FDF1DE; color: #8a5a12; }

.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-top: 1px solid var(--border);
}
.list-row:first-child { border-top: none; }

.empty-state { color: var(--ink-soft); font-size: 13px; text-align: center; padding: 24px 0; }

.login-wrap { max-width: 360px; margin: 60px auto 0; }
.login-wrap .brand-icon { display: block; margin: 0 auto 10px; height: 44px; }
