:root { color-scheme: light; --ui-green: #18674f; --ui-dark: #0e3324; }
body { overflow-wrap: anywhere; }
*, *::before, *::after { box-sizing: border-box; }
.grid > *, .flex > * { min-width: 0; }
img, iframe, canvas { max-width: 100%; }
input, select, textarea { max-width: 100%; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button, input:not([type="hidden"]):not([type="checkbox"]), select { min-height: 44px; }
a, button, input, select, textarea {
    transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid #2a866b; outline-offset: 3px;
}
.field-error-message { margin: .375rem 0 0; color: #b91c1c; font-size: .8125rem; line-height: 1.5; }
.field-error-message[hidden] { display: none; }
input.input-error, select.input-error, textarea.input-error { border-color: #dc2626 !important; box-shadow: 0 0 0 2px #dc262620 !important; }
input.input-error:focus, select.input-error:focus, textarea.input-error:focus { outline: 2px solid #dc2626 !important; outline-offset: 2px; }
form[data-inline-validation] input, form[data-inline-validation] select, form[data-inline-validation] textarea { scroll-margin-top: 8rem; }
.page-enter, .admin-main { animation: page-enter 350ms ease-out both; }
@keyframes page-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.admin-brand { color: #2a866b; font-size: 1.5rem; font-weight: 700; }
.admin-brand span { display: block; color: #64748b; font-size: .75rem; font-weight: 500; margin-top: .125rem; }
.admin-mobile-header { display: none; }
.admin-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; width: 16rem; background: white; border-right: 1px solid #e5e7eb; display: flex; flex-direction: column; height: 100dvh; overflow-y: auto; box-shadow: 4px 0 24px #0e332408; }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; padding: 1.5rem; border-bottom: 1px solid #f1f5f9; }
.sidebar-links { padding: 1.25rem .75rem; }
.sidebar-links a, .sidebar-footer a { display: flex; gap: .75rem; align-items: center; min-height: 48px; padding: .75rem; border-radius: .75rem; color: #374151; }
.sidebar-links a[aria-current="page"] { color: var(--ui-green); background: #edf7f1; font-weight: 700; box-shadow: inset 3px 0 var(--ui-green); }
.sidebar-links a:hover, .sidebar-footer a:hover { background: #f3fbf7; color: var(--ui-green); }
.sidebar-links i, .sidebar-footer i { font-size: 1.25rem; flex-shrink: 0; }
.sidebar-footer { margin-top: auto; padding: 1rem .75rem max(1rem, env(safe-area-inset-bottom)); border-top: 1px solid #f1f5f9; }
.menu-close, .menu-backdrop { display: none; }
.sidebar-collapse-toggle { display: none; flex-shrink: 0; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid #d6e8de; border-radius: .75rem; color: var(--ui-green); background: #f3fbf7; }
.sidebar-collapse-toggle:hover { background: #e4f3ea; }
.sidebar-collapse-toggle i { font-size: 1.25rem; }
.admin-main { margin-left: 16rem; padding: 2rem; }
@media (min-width: 1024px) {
    .navigation-ready .sidebar-collapse-toggle { display: inline-flex; }
    .admin-sidebar { transition: width 240ms ease; }
    .admin-main { transition: margin-left 240ms ease; }
    .sidebar-heading { gap: .5rem; }
    .sidebar-collapsed .admin-sidebar { width: 5rem; }
    .sidebar-collapsed .admin-main { margin-left: 5rem; }
    .sidebar-collapsed .sidebar-heading { justify-content: center; padding: 1.5rem .75rem; }
    .sidebar-collapsed .sidebar-heading .admin-brand,
    .sidebar-collapsed .sidebar-links a span,
    .sidebar-collapsed .sidebar-footer a span { display: none; }
    .sidebar-collapsed .sidebar-links a,
    .sidebar-collapsed .sidebar-footer a { justify-content: center; gap: 0; }
}
.admin-main h2 { font-size: clamp(1.75rem, 4vw, 2.25rem); }
.responsive-table { width: 100%; }
.responsive-table td { overflow-wrap: anywhere; max-width: 22rem; }
.responsive-table th { white-space: nowrap; }
.responsive-table td a { display: inline-flex; align-items: center; min-height: 44px; }
.table-actions { display: flex; flex-wrap: wrap; gap: .25rem .75rem; }
.responsive-table td .whatsapp-link { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; min-height: 32px; padding: 0; border: 1px solid #b9dfcb; border-radius: .5rem; background: #edf9f1; color: #12643b; vertical-align: middle; }
.responsive-table td .whatsapp-link:hover { background: #d8f2e2; box-shadow: 0 3px 10px #12643b14; }
.whatsapp-link i { font-size: 1.25rem; }
@media (min-width: 768px) {
    .responsive-table .whatsapp-column { width: 1%; text-align: center; }
}
@media (pointer: coarse) {
    .responsive-table td .whatsapp-link { width: 44px; height: 44px; min-height: 44px; }
}
.contact-status-control { display: inline-grid; width: max-content; max-width: 100%; vertical-align: top; }
.contact-status-select { width: auto; color: #475569; cursor: pointer; }
.contact-status-select[data-status="contacted"] { color: #166534; background-color: #f0fdf4; border-color: #bbf7d0; }
.contact-status-select[data-status="call_later"] { color: #92400e; background-color: #fffbeb; border-color: #fde68a; }
.contact-status-select[data-status="no_answer"] { color: #9f1239; background-color: #fff1f2; border-color: #fecdd3; }
.contact-status-select:disabled { cursor: wait; opacity: .7; }
.contact-status-message { display: block; contain: inline-size; min-height: 1.25rem; margin-top: .25rem; font-size: .75rem; color: #64748b; }
.contact-status-control[data-state="saved"] .contact-status-message { color: #166534; }
.contact-status-control[data-state="error"] .contact-status-message { color: #b91c1c; }
.login-heading, .admin-login-button { background: linear-gradient(135deg, #0e3324, #18674f); color: white; }
.admin-login-button:hover { background: linear-gradient(135deg, #18674f, #2a866b); box-shadow: 0 6px 18px #0e332426; }
.login-heading p { color: #c8ebca; }
.registration-filters { flex-wrap: wrap; }
.registration-filter { flex: 1 1 16rem; max-width: 100%; }
.registration-filter form, .registration-filter select { width: 100%; min-width: 0; }
.registration-filter select { text-overflow: ellipsis; }
.referral-layout { display: flex; flex-direction: column; gap: 1.5rem; }
.referral-chart { position: relative; height: 20rem; width: 100%; min-width: 0; }
.public-header-row { gap: .75rem; flex-wrap: wrap; }
.public-brand { gap: .75rem; flex: 1 1 12rem; }
.public-brand img { flex-shrink: 0; width: clamp(3rem, 10vw, 5rem); }
.public-brand h1 { font-size: clamp(1rem, 3.5vw, 1.5rem); line-height: 1.3; }
.public-header-row > a { min-height: 44px; flex-shrink: 0; }
.event-icon { flex-shrink: 0; }
@media (max-width: 1023px) {
    .admin-mobile-header { position: sticky; top: 0; z-index: 40; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 1rem; background: #fffffff2; backdrop-filter: blur(12px); border-bottom: 1px solid #e5e7eb; }
    .menu-toggle, .menu-close { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .6rem .75rem; border: 1px solid #d6e8de; border-radius: .75rem; color: var(--ui-green); background: #f3fbf7; }
    .menu-toggle i, .menu-close i { font-size: 1.4rem; }
    .admin-main { margin-left: 0; padding: 1.5rem; }
    .admin-sidebar { position: static; width: 100%; height: auto; }
    .admin-sidebar .menu-close { display: none; }
    .navigation-ready .admin-sidebar { position: fixed; width: min(19rem, 86vw); height: 100dvh; transform: translateX(-105%); visibility: hidden; transition: transform 260ms ease, visibility 260ms; }
    .navigation-ready .admin-sidebar .menu-close { display: inline-flex; }
    .navigation-ready .menu-backdrop { display: block; position: fixed; inset: 0; z-index: 45; background: #0e241a66; opacity: 0; visibility: hidden; transition: opacity 260ms ease, visibility 260ms; }
    .menu-open { overflow: hidden; }
    .menu-open .admin-sidebar { transform: translateX(0); visibility: visible; }
    .menu-open .menu-backdrop { opacity: 1; visibility: visible; }
}
@media (max-width: 767px) {
    .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; max-width: none; }
    .responsive-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .responsive-table tbody { padding: .75rem; }
    .responsive-table tbody tr { margin-bottom: .75rem; padding: .75rem; border: 1px solid #e5eee9; border-radius: .875rem; background: white; }
    .responsive-table tbody tr:last-child { margin-bottom: 0; }
    .responsive-table td[data-label] { display: grid; grid-template-columns: minmax(5rem, 30%) minmax(0, 1fr); gap: .75rem; align-items: baseline; padding: .4rem 0; }
    .responsive-table td[data-label]::before { content: attr(data-label); font-family: 'Montserrat', sans-serif; font-size: .75rem; font-weight: 600; color: #64748b; }
.responsive-table td[data-label] > * { min-width: 0; }
    .responsive-table td[data-label] a { justify-self: start; }
    .responsive-table td[colspan] { padding: 1.5rem .5rem; }
}
@media (max-width: 639px) {
    input:not([type="checkbox"]), select, textarea { font-size: 16px !important; }
    .admin-main { padding: 1rem; }
    .admin-main .p-8, .login-page .p-8 { padding: 1.25rem; }
    .admin-main .p-6 { padding: 1.25rem; }
    .public-main { padding-top: 1.25rem; padding-bottom: 1.5rem; }
    .public-main .p-8, .public-main .p-12, .public-main .p-6 { padding: 1.25rem; }
    .public-main .h-96 { height: 14rem; }
    .form-actions { flex-wrap: wrap; }
    .form-actions > * { flex: 1 1 auto; text-align: center; }
    .login-page { padding-block: 1.5rem; min-height: 100dvh; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
