:root {
    --navy: #005f7d;
    --teal: #005f7d;
    --sky: #51b5e1;
    --deep: #004a62;
    --paper: #f4f8fa;
    --ink: #12323c;
    --muted: #5b7380;
}

body { font-family: 'DM Sans', ui-sans-serif, system-ui, sans-serif; }

.req {
    color: #dc2626;
    font-weight: 700;
    margin-left: 0.15rem;
}

.field {
    margin-top: 0.375rem;
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid #cbd5e1;
    background: #fff;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    color: var(--ink);
    outline: none;
}

.password-wrap {
    position: relative;
}

.password-wrap .password-input {
    padding-right: 4.25rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: calc(50% + 0.15rem);
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--teal);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.field:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(81, 181, 225, 0.35);
}

.field-error { border-color: #f87171; }

.btn-primary,
.btn-secondary,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.btn-primary { background: var(--teal); color: #fff; border: 0; }
.btn-primary:hover { background: var(--deep); }
.btn-secondary { background: #fff; color: var(--ink); border: 1px solid #cbd5e1; }
.btn-secondary:hover { border-color: var(--teal); color: var(--teal); }
.btn-danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; font-size: 0.75rem; padding: 0.375rem 0.75rem; }

.card { border-radius: 1rem; border: 1px solid #e2e8f0; background: #fff; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th {
    background: #f8fafc;
    padding: 0.625rem 0.75rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}
table.data td { border-top: 1px solid #f1f5f9; padding: 0.75rem; font-size: 0.875rem; }

.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 0.125rem 0.625rem; font-size: 0.75rem; font-weight: 600; }
.badge-amber { background: #fffbeb; color: #92400e; }
.badge-green { background: #ecfdf5; color: #065f46; }
.badge-slate { background: #f1f5f9; color: #334155; }
.badge-red { background: #fef2f2; color: #b91c1c; }
.badge-sky { background: #e8f6fc; color: #005f7d; }

.actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 0;
    background: transparent;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.action-btn svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.action-btn-edit { color: var(--teal); }
.action-btn-edit:hover { color: var(--deep); }
.action-btn-delete { color: #b91c1c; }
.action-btn-delete:hover { color: #7f1d1d; }

.phone-field { margin-top: 0.375rem; }
.phone-field .iti {
    width: 100%;
    display: block;
}
.phone-field .iti__tel-input {
    width: 100%;
    height: 2.75rem;
    border-radius: 0.5rem;
    border: 1px solid #cbd5e1;
    background: #fff;
    font-size: 0.875rem;
    color: var(--ink);
    outline: none;
}
.phone-field .iti__tel-input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(81, 181, 225, 0.35);
}
.phone-field .iti__dropdown-content,
.iti--container,
.iti-container {
    z-index: 60;
}
.phone-field.is-locked .iti__tel-input {
    background: #f8fafc;
    cursor: not-allowed;
}

.terms-box {
    height: 20rem !important;
    max-height: 20rem !important;
    overflow-y: scroll !important;
    overflow-x: hidden !important;
    border-radius: 0.75rem;
    border: 1px solid #d7e3ea;
    background: #f8fbfd;
    padding: 1rem 1.1rem;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--ink);
    white-space: pre-line;
    -webkit-overflow-scrolling: touch;
}

.terms-box.terms-html {
    white-space: normal;
}

.terms-box.terms-html h2 {
    margin: 0 0 0.75rem !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: var(--navy) !important;
}

.terms-box.terms-html h3,
.terms-box.terms-html h4 {
    margin: 1rem 0 0.4rem !important;
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    color: var(--navy) !important;
}

.terms-box.terms-html p {
    margin: 0 0 0.55rem !important;
}

.terms-box.terms-html ul,
.terms-box.terms-html ol {
    display: block !important;
    margin: 0 0 0.85rem 0 !important;
    padding-left: 1.85rem !important;
    list-style-position: outside !important;
}

.terms-box.terms-html ol[type="i"],
.terms-box.terms-html ol.lower-roman,
.terms-box.terms-html .terms-attendance ol {
    list-style: lower-roman outside !important;
    list-style-type: lower-roman !important;
}

.terms-box.terms-html ol[type="I"],
.terms-box.terms-html ol.upper-roman {
    list-style: upper-roman outside !important;
    list-style-type: upper-roman !important;
}

.terms-box.terms-html li {
    display: list-item !important;
    margin: 0 0 0.4rem !important;
    padding-left: 0.25rem !important;
}

.terms-box.terms-html a {
    color: var(--teal);
    font-weight: 600;
}

.tox-tinymce {
    border-radius: 0.5rem !important;
    border-color: #cbd5e1 !important;
}

.terms-box:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(81, 181, 225, 0.35);
}

.country-search {
    position: relative;
}
.country-search-list {
    position: absolute;
    z-index: 50;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    max-height: min(18rem, 55vh);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 12px 30px rgba(18, 50, 60, 0.12);
}
.country-search-option {
    display: block;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.75rem 0.9rem;
    text-align: left;
    font-size: 0.9375rem;
    color: var(--ink);
    background: #fff;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
}
.country-search-option:last-child {
    border-bottom: 0;
}
.country-search-option:hover,
.country-search-option.is-selected {
    background: #f4f8fa;
    color: var(--teal);
}
.country-search-empty {
    margin: 0;
    padding: 0.9rem;
    font-size: 0.8125rem;
    color: var(--muted);
}

.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.pager-summary {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--muted);
}
.pager-pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.pager-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    min-height: 2.25rem;
    padding: 0 0.65rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #fff;
    color: var(--ink);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
}
.pager-link:hover {
    border-color: var(--teal);
    color: var(--teal);
}
.pager-link.is-current {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}
.pager-link.is-disabled {
    color: #94a3b8;
    cursor: default;
    pointer-events: none;
}

.notice-wrap { position: relative; }
.notice-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: var(--teal);
    cursor: pointer;
}
.notice-bell svg { width: 1.15rem; height: 1.15rem; }
.notice-bell:hover { border-color: var(--teal); }
.notice-badge {
    position: absolute;
    top: -0.2rem;
    right: -0.2rem;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.15rem;
    text-align: center;
}
.notice-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    z-index: 50;
    width: min(22rem, calc(100vw - 2rem));
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 0.9rem;
    background: #fff;
    box-shadow: 0 16px 40px rgba(18, 50, 60, 0.14);
}
.notice-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}
.notice-item {
    display: flex;
    gap: 0.65rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #f8fafc;
    text-decoration: none;
}
.notice-item:hover { background: #f4f8fa; }
.notice-item.is-unread { background: #f0f9fb; }
.notice-dot {
    width: 0.5rem;
    height: 0.5rem;
    margin-top: 0.4rem;
    flex-shrink: 0;
    border-radius: 999px;
    background: var(--sky);
}
.notice-dot.is-read { background: #cbd5e1; }
.notice-footer {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--teal);
    text-align: center;
    text-decoration: none;
}

[x-cloak] { display: none !important; }
