:root {
    --app-ink: #172033;
    --app-muted: #647083;
    --app-line: #dce2e9;
    --app-canvas: #f4f6f8;
    --app-surface: #fff;
    --app-brand: #681744;
    --app-brand-dark: #48102f;
    --app-brand-soft: #f8edf3;
    --app-success: #176b49;
    --app-success-soft: #eaf7f1;
    --app-danger: #9d2834;
    --app-danger-soft: #fff0f1;
    --app-warning: #7c5300;
    --app-warning-soft: #fff5dc;
    --app-focus: #0e65a5;
    --app-sidebar: #182132;
    --app-sidebar-muted: #aeb9c8;
    --app-radius: 14px;
    color: var(--app-ink);
    background: var(--app-canvas);
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-width: 320px;
    min-height: 100%;
    margin: 0;
}

body {
    color: var(--app-ink);
    background: var(--app-canvas);
    line-height: 1.55;
}

button,
input,
select,
textarea {
    font: inherit;
}

.password-control {
    position: relative;
}

.password-control input {
    padding-right: 5.8rem;
}

.reveal-button {
    position: absolute;
    top: 50%;
    right: 0.35rem;
    min-height: 2rem;
    padding: 0.35rem 0.65rem;
    transform: translateY(-50%);
    border: 0;
    border-radius: 6px;
    background: var(--app-brand-soft);
    color: var(--app-brand);
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
}

.reveal-button:hover,
.reveal-button:focus-visible {
    background: var(--app-brand);
    color: #fff;
}

.phone-row {
    display: grid;
    grid-template-columns: minmax(12rem, 1.5fr) minmax(8rem, 0.8fr) auto auto auto;
    align-items: end;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.85rem;
    border: 1px solid var(--app-line);
    border-radius: 10px;
    background: var(--app-canvas);
}

.phone-row .check-field,
.phone-row .phone-remove {
    min-height: 2.75rem;
    margin: 0;
}

.phone-row .phone-remove {
    align-self: end;
}

a {
    color: var(--app-brand);
}

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

h1 {
    margin-bottom: 0.55rem;
    font-size: clamp(1.75rem, 3.2vw, 2.35rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
}

h2 {
    font-size: 1.2rem;
}

.skip-link {
    position: fixed;
    z-index: 1000;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.72rem 1rem;
    transform: translateY(-150%);
    border-radius: 8px;
    background: #fff;
    color: var(--app-ink);
    box-shadow: 0 5px 20px rgb(0 0 0 / 20%);
}

.skip-link:focus {
    transform: translateY(0);
}

.eyebrow {
    margin-bottom: 0.35rem;
    color: var(--app-brand);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.button {
    display: inline-flex;
    min-height: 2.65rem;
    align-items: center;
    justify-content: center;
    padding: 0.58rem 1rem;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 750;
    text-decoration: none;
    transition: transform 120ms ease, background 120ms ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:focus-visible,
input:focus,
select:focus,
textarea:focus,
a:focus-visible,
.menu-toggle:focus-visible {
    outline: 3px solid rgb(14 101 165 / 25%);
    outline-offset: 2px;
}

.button-primary {
    background: var(--app-brand);
    color: #fff;
    box-shadow: 0 6px 15px rgb(104 23 68 / 18%);
}

.button-primary:hover:not(:disabled) {
    background: var(--app-brand-dark);
}

.button-secondary {
    border-color: var(--app-line);
    background: #fff;
    color: var(--app-ink);
}

.button-secondary:hover:not(:disabled) {
    border-color: #b8a1ae;
    background: var(--app-brand-soft);
}

.button-quiet {
    border-color: var(--app-line);
    background: transparent;
    color: var(--app-ink);
}

.sidebar .button-quiet {
    border-color: rgb(255 255 255 / 20%);
    color: #fff;
}

.button-block {
    width: 100%;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.brand-mark {
    display: grid;
    width: 2.8rem;
    height: 2.8rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 11px;
    border: 1px solid rgb(255 255 255 / 20%);
    background-color: var(--app-brand-logo-background, var(--app-brand));
    background-image: var(--app-brand-logo, none);
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    color: var(--app-brand-logo-text, #fff);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.08em;
}

.campaign-logo-display {
    display: grid;
    width: 5rem;
    height: 5rem;
    flex: 0 0 auto;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--app-line);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgb(23 32 51 / 10%);
    background-color: var(--app-brand-logo-background, var(--app-brand));
    background-image: var(--app-brand-logo, none);
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    color: var(--app-brand-logo-text, #fff);
    font-size: 0.82rem;
    font-weight: 850;
    letter-spacing: 0.08em;
}

.dashboard-identity {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.sidebar {
    position: sticky;
    z-index: 30;
    top: 0;
    display: flex;
    height: 100vh;
    flex-direction: column;
    overflow-y: auto;
    padding: 1.2rem 0.9rem;
    background: var(--app-sidebar);
    color: #fff;
}

.brand,
.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.brand {
    padding: 0.25rem 0.35rem 1.3rem;
}

.brand > span:last-child,
.auth-brand > div {
    display: grid;
    min-width: 0;
}

.brand strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand small,
.auth-brand small {
    color: var(--app-sidebar-muted);
}

.sidebar nav {
    display: grid;
    gap: 0.22rem;
}

.sidebar nav a {
    display: grid;
    grid-template-columns: 1.45rem 1fr;
    gap: 0.65rem;
    align-items: center;
    min-height: 2.7rem;
    padding: 0.58rem 0.72rem;
    border-radius: 8px;
    color: #dbe2eb;
    font-size: 0.92rem;
    text-decoration: none;
}

.sidebar nav a:hover {
    background: rgb(255 255 255 / 7%);
    color: #fff;
}

.sidebar nav a.active {
    background: var(--app-brand);
    color: #fff;
    font-weight: 750;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
}

.sidebar-footer .button {
    width: 100%;
}

.workspace {
    min-width: 0;
}

.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: grid;
    grid-template-columns: auto 1fr auto;
    min-height: 4.25rem;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem clamp(1rem, 3vw, 2rem);
    border-bottom: 1px solid var(--app-line);
    background: rgb(255 255 255 / 94%);
    backdrop-filter: blur(10px);
}

.menu-toggle {
    display: none;
    width: 2.6rem;
    height: 2.6rem;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: #fff;
    color: var(--app-ink);
    cursor: pointer;
    font-size: 1.15rem;
}

.profile-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--app-ink);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.avatar {
    display: grid;
    width: 2.2rem;
    height: 2.2rem;
    place-items: center;
    border-radius: 50%;
    background: var(--app-brand-soft);
    color: var(--app-brand);
    font-size: 0.75rem;
    font-weight: 850;
}

.content {
    width: min(1320px, 100%);
    margin: 0 auto;
    padding: clamp(1.25rem, 3vw, 2.25rem);
}

.content:focus {
    outline: none;
}

.alert {
    margin-bottom: 1.2rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--app-line);
    border-left: 4px solid var(--app-focus);
    border-radius: 9px;
    background: #edf6fc;
}

.alert-error {
    border-color: #efb9be;
    border-left-color: var(--app-danger);
    background: var(--app-danger-soft);
    color: #721c25;
}

.alert-success {
    border-color: #addfc9;
    border-left-color: var(--app-success);
    background: var(--app-success-soft);
    color: #125438;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.6rem;
}

.page-heading p:last-child {
    margin-bottom: 0;
    color: var(--app-muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-card,
.panel {
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius);
    background: var(--app-surface);
    box-shadow: 0 8px 28px rgb(23 32 51 / 5%);
}

.stat-card {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
    padding: 1.15rem;
    color: var(--app-ink);
    text-decoration: none;
    transition: border-color 120ms ease, transform 120ms ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: #b8a1ae;
}

.stat-card span {
    overflow: hidden;
    color: var(--app-muted);
    font-size: 0.86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-card strong {
    font-size: clamp(1.65rem, 3vw, 2.2rem);
    letter-spacing: -0.04em;
}

.stat-card small {
    color: var(--app-brand);
    font-weight: 700;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

/* El perfil contiene un formulario largo con campos anidados. Mantener sus
   paneles apilados evita que la columna de contraseña cubra la captura. */
.profile-layout {
    grid-template-columns: minmax(0, 1fr);
}

.analytics-filters {
    display: grid;
    grid-template-columns: minmax(12rem, 1fr) minmax(12rem, 1fr) auto;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1rem;
}

.analytics-kpis .stat-card {
    overflow: hidden;
    position: relative;
}

.analytics-kpi::after {
    position: absolute;
    right: -1rem;
    bottom: -2.8rem;
    width: 7rem;
    height: 7rem;
    border-radius: 50%;
    background: var(--app-brand-soft);
    content: "";
    opacity: 0.65;
}

.analytics-kpi > * { position: relative; z-index: 1; }
.trend { color: var(--app-muted) !important; }
.trend-up { color: var(--app-success) !important; }
.trend-down { color: var(--app-danger) !important; }

.analytics-chart-panel { margin-bottom: 1rem; }
.chart-legend { display: flex; gap: 1rem; color: var(--app-muted); font-size: 0.85rem; font-weight: 750; }
.chart-legend span::before { display: inline-block; width: 0.75rem; height: 0.75rem; margin-right: 0.35rem; border-radius: 50%; content: ""; }
.legend-people::before { background: var(--app-brand); }
.legend-activities::before { background: var(--app-warning); }
.line-chart { min-height: 310px; margin-top: 1rem; }
.line-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid-line { stroke: var(--app-line); stroke-width: 1; }
.chart-axis-label, .chart-axis-value { fill: var(--app-muted); font-size: 11px; }
.chart-line-people, .chart-line-activities { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-line-people { stroke: var(--app-brand); }
.chart-line-activities { stroke: var(--app-warning); }
.chart-line-people-point { fill: #fff; stroke: var(--app-brand); stroke-width: 3; }
.chart-line-activities-point { fill: #fff; stroke: var(--app-warning); stroke-width: 3; }

.analytics-breakdowns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.analytics-breakdowns h2 { font-size: 1.05rem; }
.bar-chart-list { display: grid; gap: 0.85rem; margin-top: 1rem; }
.bar-chart-row { display: grid; grid-template-columns: minmax(7rem, 1fr) minmax(5rem, 1.4fr) auto; align-items: center; gap: 0.65rem; font-size: 0.82rem; }
.bar-chart-track { height: 0.65rem; overflow: hidden; border-radius: 999px; background: var(--app-canvas); }
.bar-chart-fill { display: block; width: var(--bar-size); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--app-brand), var(--app-focus)); animation: chart-grow 500ms ease-out both; }
.analytics-table { margin-top: 1rem; }
@keyframes chart-grow { from { width: 0; } }

@media (max-width: 900px) {
    .analytics-breakdowns { grid-template-columns: 1fr; }
    .analytics-filters { grid-template-columns: 1fr 1fr; }
    .analytics-filters .button { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
    .analytics-filters { grid-template-columns: 1fr; }
    .analytics-filters .button { grid-column: auto; }
    .bar-chart-row { grid-template-columns: 1fr auto; }
    .bar-chart-track { grid-column: 1 / -1; grid-row: 2; }
}

.panel {
    min-width: 0;
    padding: 1.2rem;
}

.card,
.form-section {
    padding: 1.2rem;
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius);
    background: var(--app-surface);
    box-shadow: 0 8px 28px rgb(23 32 51 / 5%);
}

.form-section > header {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.form-section > header > span {
    display: grid;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: var(--app-brand);
    color: #fff;
    font-weight: 800;
}

.form-section > header h2,
.form-section > header p {
    margin-bottom: 0.15rem;
}

.form-section > header p {
    color: var(--app-muted);
}

.workflow-choice {
    display: grid;
    justify-items: start;
    gap: 0.55rem;
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid var(--app-line);
    border-color: color-mix(in srgb, var(--app-brand) 30%, var(--app-line));
    border-radius: 10px;
    background: var(--app-brand-soft);
}

.workflow-choice p {
    margin: 0;
    color: var(--app-muted);
}

.form-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--app-muted);
    font-size: 0.9rem;
}

.form-divider::before,
.form-divider::after {
    height: 1px;
    flex: 1;
    background: var(--app-line);
    content: "";
}

.form-grid,
.grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.field {
    display: grid;
    min-width: 0;
    align-content: start;
    gap: 0.35rem;
}

.form-grid > *,
.grid-two > * {
    min-width: 0;
}

.span-2 {
    grid-column: 1 / -1;
}

.check-grid,
.button-row,
.form-actions,
.map-actions,
.location-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.form-actions {
    justify-content: flex-end;
}

.check-field {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--app-line);
    border-radius: 8px;
}

.check-field input {
    width: auto;
    min-height: 0;
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    align-items: stretch;
    margin-top: 1rem;
}

.permission-option {
    align-items: flex-start;
    background: #fff;
}

.permission-option:has(input:checked) {
    border-color: var(--app-brand);
    background: var(--app-brand-soft);
}

.permission-option small {
    color: var(--app-muted);
}

.detail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.detail-list div {
    padding: 0.75rem;
    border-radius: 8px;
    background: var(--app-canvas);
}

.detail-list dt {
    color: var(--app-muted);
    font-size: 0.78rem;
    font-weight: 750;
    text-transform: uppercase;
}

.detail-list dd {
    margin: 0.2rem 0 0;
}

.calendar-toolbar {
    display: grid;
    grid-template-columns: auto minmax(10rem, 1fr) auto;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.7rem;
}

.calendar-toolbar h2 {
    margin: 0;
    text-align: center;
    text-transform: capitalize;
}

.calendar-stepper,
.calendar-actions,
.view-switcher {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.calendar-step {
    display: grid;
    width: 2.65rem;
    height: 2.65rem;
    place-items: center;
    border: 1px solid var(--app-line);
    border-radius: 8px;
    background: #fff;
    color: var(--app-ink);
    font-size: 1.2rem;
    font-weight: 800;
    text-decoration: none;
}

.calendar-today {
    min-height: 2.65rem;
    border-color: var(--app-line);
    color: var(--app-ink);
}

.view-switcher {
    padding: 0.2rem;
    border: 1px solid var(--app-line);
    border-radius: 9px;
    background: var(--app-canvas);
}

.view-switcher a {
    padding: 0.45rem 0.7rem;
    border-radius: 6px;
    color: var(--app-muted);
    font-weight: 750;
    text-decoration: none;
}

.view-switcher a.active {
    background: #fff;
    color: var(--app-brand);
    box-shadow: 0 2px 8px rgb(23 32 51 / 10%);
}

.calendar-summary {
    margin: 0 0 0.65rem;
    color: var(--app-muted);
    font-size: 0.88rem;
}

.calendar-scroll {
    overflow-x: auto;
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius);
    background: var(--app-surface);
    box-shadow: 0 8px 28px rgb(23 32 51 / 5%);
}

.calendar-scroll:focus-visible {
    outline: 3px solid rgb(14 101 165 / 25%);
    outline-offset: 2px;
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    min-width: 820px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
    border-bottom: 1px solid var(--app-line);
    background: var(--app-canvas);
}

.calendar-weekdays span {
    padding: 0.6rem;
    color: var(--app-muted);
    font-size: 0.75rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
}

.calendar-grid--day {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
}

.calendar-day {
    min-height: 9rem;
    padding: 0.55rem;
    border-right: 1px solid var(--app-line);
    border-bottom: 1px solid var(--app-line);
    background: #fff;
}

.calendar-grid--week .calendar-day {
    min-height: 22rem;
}

.calendar-grid--day .calendar-day {
    min-height: 22rem;
}

.calendar-day--outside {
    background: #f8f9fb;
    color: var(--app-muted);
}

.calendar-day--today {
    box-shadow: inset 0 0 0 2px var(--app-brand);
}

.calendar-day > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.calendar-day > header time {
    display: grid;
    width: 1.85rem;
    height: 1.85rem;
    place-items: center;
    border-radius: 50%;
    font-weight: 800;
}

.calendar-day--today > header time {
    background: var(--app-brand);
    color: #fff;
}

.calendar-weekday {
    color: var(--app-muted);
    font-size: 0.76rem;
    text-transform: capitalize;
}

.calendar-grid--month .calendar-weekday {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.calendar-events {
    display: grid;
    gap: 0.45rem;
}

.calendar-event {
    overflow: hidden;
    border-left: 3px solid var(--app-brand);
    border-radius: 6px;
    background: var(--app-brand-soft);
}

.petition-event {
    border-left: 4px solid var(--app-focus);
}

.priority-border-high { border-left-color: var(--app-danger); }
.priority-border-medium { border-left-color: var(--app-warning); }
.priority-border-non_urgent { border-left-color: var(--app-success); }

.calendar-event > a:first-child {
    display: grid;
    gap: 0.08rem;
    padding: 0.45rem 0.5rem;
    color: var(--app-ink);
    text-decoration: none;
}

.calendar-event time,
.calendar-event small,
.calendar-empty {
    color: var(--app-muted);
    font-size: 0.72rem;
}

.calendar-event strong {
    overflow: hidden;
    font-size: 0.82rem;
    line-height: 1.25;
    text-overflow: ellipsis;
}

.calendar-map-link {
    display: block;
    padding: 0.25rem 0.5rem 0.4rem;
    font-size: 0.72rem;
    font-weight: 800;
    text-decoration: none;
}

.status-border-completed {
    border-left-color: var(--app-success);
    background: var(--app-success-soft);
}

.status-border-cancelled {
    border-left-color: var(--app-danger);
    background: var(--app-danger-soft);
}

.status-border-postponed,
.status-border-rescheduled {
    border-left-color: var(--app-warning);
    background: var(--app-warning-soft);
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-header h2,
.panel-header p {
    margin-bottom: 0;
}

.panel-header > a {
    flex: 0 0 auto;
    font-size: 0.85rem;
    font-weight: 700;
}

.empty-state {
    margin: 0;
    padding: 2rem 1rem;
    border: 1px dashed #bdc6d1;
    border-radius: 10px;
    color: var(--app-muted);
    text-align: center;
}

.timeline,
.activity-list {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.timeline li,
.activity-list li {
    display: grid;
    gap: 0.85rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--app-line);
}

.timeline li:last-child,
.activity-list li:last-child {
    border-bottom: 0;
}

.timeline li {
    grid-template-columns: minmax(5.5rem, auto) 1fr;
}

.timeline time {
    color: var(--app-brand);
    font-size: 0.82rem;
    font-weight: 780;
}

.timeline div,
.activity-list div {
    display: grid;
}

.timeline span,
.activity-list small {
    color: var(--app-muted);
    font-size: 0.84rem;
}

.activity-list li {
    grid-template-columns: 0.7rem 1fr;
}

.activity-dot {
    width: 0.58rem;
    height: 0.58rem;
    margin-top: 0.4rem;
    border-radius: 50%;
    background: var(--app-brand);
    box-shadow: 0 0 0 4px var(--app-brand-soft);
}

.auth-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 1rem;
    background:
        radial-gradient(circle at 15% 0%, rgb(104 23 68 / 11%), transparent 30rem),
        var(--app-canvas);
}

.auth-card {
    width: min(100%, 440px);
    padding: clamp(1.5rem, 5vw, 2.5rem);
    border: 1px solid var(--app-line);
    border-radius: 18px;
    box-shadow: 0 22px 70px rgb(23 32 51 / 12%);
    background: #fff;
}

.auth-brand {
    margin-bottom: 2rem;
}

.auth-brand small {
    color: var(--app-muted);
}

.auth-card header {
    margin-bottom: 1.4rem;
}

.auth-card header p:last-child {
    margin-bottom: 0;
    color: var(--app-muted);
}

.auth-card form {
    display: grid;
    gap: 0.5rem;
}

.auth-card label {
    margin-top: 0.45rem;
    font-weight: 720;
}

input,
select,
textarea {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.62rem 0.75rem;
    border: 1px solid #b9c3cf;
    border-radius: 8px;
    outline: none;
    background: #fff;
    color: var(--app-ink);
}

.profile-form input[type="checkbox"],
.profile-form input[type="radio"] {
    width: 1rem;
    height: 1rem;
    min-height: 1rem;
    padding: 0;
    flex: 0 0 auto;
    accent-color: var(--app-brand);
}

.profile-form .phone-row .check-field {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.profile-form .phone-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-form .phone-row .check-field,
.profile-form .phone-row .phone-remove {
    justify-self: start;
}

.profile-form > .form-actions {
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--app-line);
}

@media (max-width: 560px) {
    .profile-form .phone-row {
        grid-template-columns: 1fr;
    }

    .profile-form > .form-actions .button {
        width: 100%;
    }
}

textarea {
    min-height: 7rem;
    resize: vertical;
}

.auth-card .button {
    margin-top: 0.9rem;
}

.auth-help {
    margin: 1.2rem 0 0;
    text-align: center;
}

.error-page {
    max-width: 650px;
    margin: 8vh auto 0;
    padding: clamp(1.5rem, 4vw, 3rem);
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius);
    background: #fff;
    text-align: center;
}

.error-page p:not(.eyebrow) {
    color: var(--app-muted);
}

.error-page .button {
    margin-top: 0.75rem;
}

.form-stack {
    display: grid;
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.form-stack label {
    font-weight: 720;
}

.field-help {
    margin: 0;
    color: var(--app-muted);
    font-size: 0.85rem;
}

.report-import-form {
    margin: 1.25rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--app-line);
}

.inline-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
}

.responsive-table {
    width: 100%;
    overflow-x: auto;
}

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

th,
td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--app-line);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--app-muted);
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
}

.pagination > div:last-child {
    text-align: right;
}

.pagination > span {
    color: var(--app-muted);
    font-size: 0.9rem;
    font-weight: 750;
}

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

.sidebar-backdrop {
    display: none;
}

@media (max-width: 1050px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        width: min(300px, 86vw);
        transform: translateX(-105%);
        box-shadow: 18px 0 50px rgb(0 0 0 / 24%);
        transition: transform 180ms ease;
    }

    .app-shell.menu-open .sidebar {
        transform: translateX(0);
    }

    .menu-toggle {
        display: grid;
        place-items: center;
    }

    .sidebar-backdrop {
        position: fixed;
        z-index: 25;
        inset: 0;
        display: block;
        border: 0;
        background: rgb(10 15 24 / 54%);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .profile-link > span:last-child {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .page-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .inline-form {
        grid-template-columns: 1fr;
    }

    .timeline li {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

.table-avatar,
.profile-photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 0.65rem;
    border: 2px solid var(--border, #d8dde6);
    background: #f3f5f8;
}

.member-photo,
.person-photo-preview {
    width: 4.5rem;
    height: 4.5rem;
    border: 1px solid var(--app-border, #d8dde6);
    border-radius: 1rem;
    background: var(--app-brand-soft);
    color: var(--app-brand);
    object-fit: cover;
}

.council-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin: 1rem 0 2.5rem;
}

.member-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
    min-width: 0;
    padding: 1.25rem;
    border: 1px solid var(--app-border, #d8dde6);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 31, 51, 0.06);
}

.member-card h2,
.member-card h3,
.member-card p {
    margin: 0;
}

.member-card small {
    min-height: 1.25rem;
    color: var(--app-muted, #64748b);
}

.member-card a {
    margin-top: auto;
    padding-top: 0.35rem;
    font-weight: 700;
}

.government-heading {
    margin-top: 3rem;
}

.vacancy-card {
    border-style: dashed;
    background: rgba(255, 255, 255, 0.55);
}

div.member-photo {
    display: grid;
    place-items: center;
    font-weight: 800;
}

.person-photo-preview {
    display: block;
    margin-bottom: 0.75rem;
}

.profile-photo {
    width: 72px;
    height: 72px;
}

.search-result {
    display: block;
    width: 100%;
    padding: 0.7rem;
    border: 0;
    border-bottom: 1px solid var(--border, #d8dde6);
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.territory-fields {
    display: grid;
    min-width: 0;
    gap: 0.65rem;
}

.territory-status {
    margin: 0;
    color: var(--app-muted);
    font-size: 0.85rem;
}

input.territory-resolved[readonly] {
    border-color: var(--app-brand);
    background: var(--app-brand-soft);
    cursor: not-allowed;
}

@media (max-width: 1050px) {
    .calendar-toolbar {
        grid-template-columns: 1fr;
    }

    .calendar-toolbar h2 {
        grid-row: 1;
    }

    .calendar-stepper,
    .calendar-actions {
        justify-content: center;
    }
}

@media (max-width: 560px) {
    .form-grid,
    .grid-two,
    .detail-list {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: auto;
    }

    .calendar-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .view-switcher {
        justify-content: center;
    }
}
