:root {
    color-scheme: light;
    --bg: #f6f8f7;
    --panel: #ffffff;
    --panel-soft: #f9fbfa;
    --ink: #17201d;
    --muted: #60706b;
    --line: #dbe4e1;
    --line-strong: #c7d4d0;
    --green: #0b5a46;
    --green-strong: #073d31;
    --green-soft: #e8f3ef;
    --red: #b71f2a;
    --red-soft: #fde9eb;
    --amber: #9a6700;
    --amber-soft: #fff3d6;
    --grey-soft: #eef2f1;
    --shadow: 0 10px 28px rgba(20, 43, 36, 0.07);
    --radius: 8px;
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.45;
}

a {
    color: var(--green);
    text-decoration: none;
    font-weight: 650;
}

a:hover {
    color: var(--red);
}

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

.sidebar {
    background: linear-gradient(180deg, var(--green-strong) 0%, #052d25 100%);
    color: #f8fbfa;
    padding: 22px 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
    padding: 4px 8px 22px;
    margin-bottom: 10px;
    font-size: 17px;
    font-weight: 820;
    letter-spacing: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand span {
    display: block;
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.64);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.nav {
    display: grid;
    gap: 18px;
}

.nav-group {
    display: grid;
    gap: 5px;
}

.nav-label {
    padding: 0 10px 3px;
    color: rgba(255, 255, 255, 0.48);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.nav a {
    display: flex;
    align-items: center;
    min-height: 40px;
    color: rgba(255, 255, 255, 0.78);
    padding: 9px 10px 9px 13px;
    border-radius: 7px;
    border-left: 3px solid transparent;
    font-size: 14px;
    font-weight: 720;
}

.nav a.active {
    background: rgba(255, 255, 255, 0.12);
    border-left-color: var(--red);
    color: #ffffff;
}

.nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.main {
    min-width: 0;
    padding: 24px 26px 34px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.eyebrow {
    color: var(--red);
    font-size: 13px;
    font-weight: 760;
}

h1 {
    font-size: 25px;
    line-height: 1.18;
    margin: 2px 0 0;
    letter-spacing: 0;
}

h2 {
    font-size: 17px;
    line-height: 1.25;
    margin: 0 0 14px;
    font-weight: 780;
}

.muted {
    color: var(--muted);
}

.helper-text {
    color: var(--muted);
    margin: -4px 0 14px;
    max-width: 780px;
    font-size: 14px;
}

.user-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 14px;
}

.user-menu > span:first-child {
    color: var(--ink);
    font-weight: 740;
}

.role-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green);
    font-size: 12px;
    font-weight: 780;
}

.grid {
    display: grid;
    gap: 16px;
}

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

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

.panel,
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}

.card strong {
    display: block;
    font-size: 27px;
    line-height: 1.1;
    margin-top: 8px;
}

.metric-card {
    color: inherit;
    min-height: 116px;
    border-top: 3px solid var(--green);
}

.metric-card:nth-child(4n) {
    border-top-color: var(--red);
}

.filters {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 150px 176px 106px auto auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.quick-filter-section {
    margin: -2px 0 16px;
}

.system-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    row-gap: 10px;
    align-items: center;
}

.system-filter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    margin: 0 10px 10px 0;
    padding: 9px 15px;
    border: 1px solid #cad8d4;
    border-radius: 8px;
    background: #ffffff;
    color: #20332e;
    font-size: 13.5px;
    font-weight: 780;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(20, 43, 36, 0.04);
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.system-filter-bar .system-filter-button:last-child {
    margin-right: 0;
}

.system-filter-button:hover {
    border-color: rgba(11, 90, 70, 0.34);
    background: var(--green-soft);
    color: var(--green-strong);
    transform: translateY(-1px);
}

.system-filter-button.active {
    border-color: var(--green);
    background: var(--green);
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(11, 90, 70, 0.2);
}

.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table th,
.table td {
    text-align: left;
    border-bottom: 1px solid var(--line);
    padding: 12px 13px;
    vertical-align: top;
    font-size: 14px;
}

.table th {
    background: #eef3f1;
    color: #2d3c38;
    font-size: 11px;
    font-weight: 820;
    text-transform: uppercase;
    letter-spacing: .055em;
}

.table td {
    background: #ffffff;
}

.table tbody tr:hover td {
    background: #fbfdfc;
}

.table tbody tr.gender-row-male td {
    background: #f2f8ff;
}

.table tbody tr.gender-row-female td {
    background: #fff5f9;
}

.table tbody tr.gender-row-male:hover td {
    background: #eaf4ff;
}

.table tbody tr.gender-row-female:hover td {
    background: #ffeef5;
}

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

.table td a {
    color: var(--green-strong);
    font-weight: 780;
}

.table td a:hover {
    color: var(--red);
}

.client-name-button {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--green-strong);
    padding: 0;
    font: inherit;
    font-weight: 780;
    cursor: pointer;
    text-align: left;
}

.client-name-button:hover {
    color: var(--red);
}

.verify-tick {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    margin-left: 5px;
    border-radius: 999px;
    background: #e7f1ff;
    color: #1e63b6;
    border: 1px solid #bfdbfe;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    vertical-align: text-bottom;
}

.verification-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-soft);
}

.verification-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--grey-soft);
    color: #52615d;
    font-size: 12px;
    font-weight: 820;
    line-height: 1;
}

.verification-status.verified {
    background: #e7f1ff;
    color: #1e63b6;
    border: 1px solid #bfdbfe;
}

.verification-status .verify-tick {
    margin-left: 6px;
}

.verification-meta {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 640;
}

.verify-btn {
    flex: 0 0 auto;
}

.identity-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.identity-override-box {
    margin-top: 12px;
    padding: 13px;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    background: #f4f8ff;
}

.identity-override-box[hidden] {
    display: none;
}

.lock-label {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    margin-left: 6px;
    padding: 3px 7px;
    border-radius: 999px;
    border: 1px solid #bfdbfe;
    background: #e7f1ff;
    color: #1e63b6;
    font-size: 11px;
    font-weight: 820;
    line-height: 1;
}

.identity-locked-input {
    background: #f8fafc;
    border-color: #d5dee7;
    color: #263238;
}

.gender-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.gender-badge.male {
    background: #e5f2ff;
    color: #195c92;
    border: 1px solid #c9e3fb;
}

.gender-badge.female {
    background: #fdebf3;
    color: #9f2f5f;
    border: 1px solid #f7d0df;
}

.gender-badge.neutral {
    background: var(--grey-soft);
    color: #52615d;
    border: 1px solid var(--line);
}

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

.field {
    display: grid;
    gap: 6px;
}

.field.full {
    grid-column: 1 / -1;
}

.field-message {
    min-height: 18px;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 650;
}

.field-message.ok {
    color: var(--green);
}

.field-message.error {
    color: var(--red);
}

label {
    font-size: 13px;
    font-weight: 720;
    color: #31423d;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid #cbd8d4;
    border-radius: 6px;
    padding: 10px 11px;
    font: inherit;
    background: #ffffff;
    color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
    outline: 0;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(11, 90, 70, 0.12);
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(183, 31, 42, 0.12);
}

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

.actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: var(--green);
    color: #ffffff;
    padding: 10px 14px;
    font-weight: 780;
    cursor: pointer;
    line-height: 1;
}

.btn:hover {
    background: var(--green-strong);
    color: #ffffff;
}

.btn.secondary {
    background: #ffffff;
    color: var(--ink);
    border-color: var(--line-strong);
}

.btn.secondary:hover {
    border-color: var(--green);
    color: var(--green);
    background: var(--green-soft);
}

.btn.danger {
    background: var(--red);
}

.btn.danger:hover {
    background: #8f1720;
}

.status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 800;
    background: var(--grey-soft);
    color: #52615d;
    line-height: 1;
}

.status.ok {
    background: var(--green-soft);
    color: var(--green);
}

.status.warn {
    background: var(--amber-soft);
    color: var(--amber);
}

.status.error {
    background: var(--red-soft);
    color: var(--red);
}

.assignment {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    display: grid;
    gap: 10px;
    background: var(--panel-soft);
}

.assignment-choice,
.brand-assignment-grid {
    display: grid;
    gap: 10px;
}

.assignment-choice {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 14px;
}

.brand-assignment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: column;
    grid-template-rows: repeat(3, auto);
    column-gap: 16px;
    row-gap: 10px;
    max-width: 760px;
}

.brand-choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 58px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
    cursor: pointer;
}

.brand-choice:hover {
    border-color: rgba(11, 90, 70, 0.36);
    background: #fbfdfc;
}

.brand-choice:has(input:checked) {
    border-color: var(--green);
    background: var(--green-soft);
    box-shadow: 0 0 0 2px rgba(11, 90, 70, 0.1);
}

.brand-choice input {
    width: auto;
    min-height: 0;
    margin: 3px 0 0;
    flex: 0 0 auto;
}

.brand-choice-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.brand-choice-copy strong {
    color: var(--green-strong);
    font-size: 14px;
    font-weight: 820;
    line-height: 1.1;
}

.brand-choice-copy small {
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 620;
    line-height: 1.25;
}

.modal-association-grid,
.modal-system-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.modal-brand-choice {
    min-height: 54px;
}

.association-subheading {
    margin-top: 18px !important;
}

.association-choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 54px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
    cursor: pointer;
}

.association-choice:hover {
    border-color: rgba(11, 90, 70, 0.36);
    background: #fbfdfc;
}

.association-choice:has(input:checked) {
    border-color: var(--green);
    background: var(--green-soft);
    box-shadow: 0 0 0 2px rgba(11, 90, 70, 0.1);
}

.association-choice input {
    width: auto;
    min-height: 0;
    margin: 3px 0 0;
    flex: 0 0 auto;
}

.association-choice span {
    display: grid;
    gap: 2px;
}

.association-choice strong {
    color: var(--green-strong);
    font-size: 13.5px;
}

.association-choice small {
    color: var(--muted);
    font-size: 12.5px;
}

.modal-brand-choice:has(input:disabled),
.association-choice:has(input:disabled) {
    cursor: default;
    opacity: 0.78;
}

.choice-pill {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 11px 12px;
    background: #ffffff;
    display: flex;
    gap: 8px;
    align-items: center;
    min-height: 46px;
}

.choice-pill:hover {
    border-color: var(--green);
}

.choice-pill small {
    display: block;
    color: var(--muted);
    font-weight: 680;
    margin-top: 2px;
}

.choice-pill:has(input:checked) {
    border-color: var(--green);
    background: var(--green-soft);
    box-shadow: 0 0 0 2px rgba(11, 90, 70, 0.1);
}

.brand-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(11, 90, 70, 0.18);
    background: var(--green-soft);
    color: var(--green-strong);
    font-size: 12px;
    font-weight: 780;
    line-height: 1;
}

.access-badge,
.access-required {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 820;
    line-height: 1;
}

.access-badge.all-access {
    background: var(--green);
    color: #ffffff;
}

.access-required {
    border: 1px solid rgba(183, 31, 42, 0.18);
    background: var(--red-soft);
    color: var(--red);
}

.access-meta {
    margin-top: 7px;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 650;
}

.access-editor {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-soft);
}

.access-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.access-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 58px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
    cursor: pointer;
}

.access-card:hover {
    border-color: rgba(11, 90, 70, 0.36);
    background: #fbfdfc;
}

.access-card:has(input:checked) {
    border-color: var(--green);
    background: var(--green-soft);
    box-shadow: 0 0 0 2px rgba(11, 90, 70, 0.1);
}

.access-card input {
    width: auto;
    min-height: 0;
    margin: 3px 0 0;
}

.access-card span {
    display: grid;
    gap: 2px;
}

.access-card strong {
    color: var(--green-strong);
    font-size: 14px;
    font-weight: 820;
    line-height: 1.1;
}

.access-card small {
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 620;
    line-height: 1.25;
}

.company-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 160px 150px 130px auto;
    gap: 12px;
    align-items: end;
}

.compact-actions {
    margin-top: 0;
}

.toggle-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.notice {
    border: 1px solid rgba(154, 103, 0, 0.22);
    background: var(--amber-soft);
    color: #664400;
    padding: 11px 13px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-weight: 650;
}

.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.tabs button {
    min-height: 36px;
    border: 1px solid var(--line-strong);
    background: #ffffff;
    color: var(--ink);
    border-radius: 6px;
    padding: 8px 10px;
    font-weight: 760;
}

.tabs button:hover {
    border-color: var(--green);
    color: var(--green);
}

.tabs button.active {
    background: var(--green);
    color: #ffffff;
    border-color: var(--green);
}

.login {
    width: min(100% - 32px, 460px);
    max-width: 460px;
    margin: 11vh auto;
    padding: 24px;
}

.login h1 {
    margin-bottom: 8px;
}

.login-description {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 650;
    line-height: 1.5;
}

.login-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin: 24px 0 22px;
    padding: 4px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: #f4f7f6;
}

.login-tabs a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 11px 12px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 780;
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;
}

.login-tabs a:hover {
    border-color: rgba(11, 90, 70, 0.18);
    background: var(--green-soft);
    color: var(--green-strong);
}

.login-tabs a.active {
    border-color: var(--green);
    background: var(--green);
    color: #ffffff;
    box-shadow: 0 5px 14px rgba(11, 90, 70, 0.18);
}

.login form {
    display: grid;
    gap: 16px;
}

.login .field {
    gap: 8px;
}

.login input {
    min-height: 46px;
}

.login-actions {
    width: 100%;
    margin-top: 2px;
}

.login-primary,
.login-secondary {
    width: 100%;
}

.otp-form h2 {
    margin-top: 4px;
}

.otp-inputs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin: 14px 0 12px;
}

.otp-inputs input {
    min-height: 48px;
    padding: 8px 4px;
    text-align: center;
    font-size: 22px;
    font-weight: 820;
}

.btn:disabled {
    opacity: .62;
    cursor: not-allowed;
}

.whatsapp-settings {
    display: grid;
    gap: 14px;
}

.whatsapp-number-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-soft);
}

.whatsapp-number-summary.pending {
    border-color: rgba(154, 103, 0, 0.22);
    background: #fffaf0;
}

.whatsapp-number-summary strong {
    display: inline-block;
    margin-top: 3px;
    color: var(--green-strong);
    font-size: 15px;
    font-weight: 800;
}

.whatsapp-number-form {
    align-items: end;
}

.whatsapp-number-form .actions,
.settings-otp-form .actions {
    margin-top: 0;
}

.settings-otp-form {
    padding-top: 2px;
}

.settings-otp-form h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 780;
}

@media (max-width: 480px) {
    .login {
        width: min(100% - 24px, 460px);
        margin: 8vh auto;
        padding: 20px;
    }

    .login-tabs {
        gap: 4px;
    }

    .login-tabs a {
        min-height: 40px;
        padding: 10px 8px;
        font-size: 12.5px;
    }
}

.event-detail {
    max-width: 360px;
    overflow-wrap: anywhere;
    color: var(--muted);
}

body.modal-open {
    overflow: hidden;
}

.client-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(5, 22, 18, 0.54);
}

.client-modal-backdrop[hidden] {
    display: none;
}

.client-modal {
    width: min(980px, 100%);
    max-height: min(88vh, 940px);
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    box-shadow: 0 28px 72px rgba(5, 22, 18, 0.32);
}

.client-modal form {
    min-height: 0;
    display: contents;
}

.modal-header,
.modal-actions {
    padding: 18px 20px;
    background: #ffffff;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
}

.modal-header h2 {
    margin-bottom: 0;
}

.modal-close {
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--ink);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.modal-close:hover {
    border-color: var(--green);
    color: var(--green);
}

.modal-body {
    overflow: auto;
    padding: 18px 20px;
    display: grid;
    gap: 18px;
    background: var(--bg);
}

.modal-body section {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
}

.modal-body h3 {
    margin: 0 0 12px;
    color: var(--green-strong);
    font-size: 15px;
    font-weight: 820;
}

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

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--line);
    position: sticky;
    bottom: 0;
    z-index: 2;
}

.modal-notice {
    margin: 0;
}

.modal-notice.error {
    border-color: rgba(183, 31, 42, 0.22);
    background: var(--red-soft);
    color: var(--red);
}

.section-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-heading-row h3 {
    margin-bottom: 0;
}

.small-btn {
    min-height: 34px;
    padding: 8px 11px;
    font-size: 13px;
}

.emergency-contact-list {
    display: grid;
    gap: 12px;
}

.emergency-contact-card {
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-soft);
}

.card-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.page-toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 70;
    max-width: min(360px, calc(100vw - 32px));
    padding: 12px 14px;
    border: 1px solid rgba(11, 90, 70, 0.18);
    border-radius: var(--radius);
    background: var(--green);
    color: #ffffff;
    box-shadow: 0 16px 36px rgba(5, 22, 18, 0.22);
    font-size: 14px;
    font-weight: 760;
}

.page-toast[hidden] {
    display: none;
}

@media (max-width: 1040px) {
    .filters {
        grid-template-columns: minmax(220px, 1fr) 145px 170px;
    }
}

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

    .sidebar {
        position: static;
    }

    .main {
        padding: 20px 16px 28px;
    }

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

    .user-menu {
        justify-content: flex-start;
    }

    .grid.two,
    .grid.three,
    .assignment-choice,
    .brand-assignment-grid,
    .access-grid,
    .company-form,
    .modal-grid,
    .modal-association-grid,
    .modal-system-grid,
    .form-grid,
    .filters {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .client-modal-backdrop {
        padding: 10px;
        align-items: end;
    }

    .client-modal {
        max-height: 94vh;
    }

    .modal-header,
    .modal-actions {
        padding: 14px;
    }

    .modal-body {
        padding: 14px;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

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

    .verification-box {
        align-items: stretch;
        flex-direction: column;
    }

    .verify-btn {
        width: 100%;
    }

    .modal-actions .btn {
        width: 100%;
    }

    .table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .system-filter-button {
        flex: 1 1 auto;
        justify-content: center;
    }
}
