/* Admin /superadmin UI — aligned with account area (teal, Outfit, cards) */
:root {
    --primary: #0f766e;
    --primary-hover: #0d9488;
    --primary-dark: #115e59;
    --primary-light: #ccfbf1;
    --primary-faint: #f0fdfa;
    --accent: #f59e0b;
    --success: #059669;
    --error: #dc2626;
    --bg-page: #ecfeff;
    --bg-card: #ffffff;
    --bg-muted: #f1f5f9;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(15, 118, 110, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 8px 30px rgba(15, 23, 42, 0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --admin-warning-bg: #fffbeb;
    --admin-warning-border: #fcd34d;
    --admin-ok-bg: #ecfdf5;
    --admin-ok-border: #6ee7b7;
    --admin-err-bg: #fef2f2;
    --admin-err-border: #fecaca;
}

html { scroll-behavior: smooth; }

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-page);
    background-image:
        radial-gradient(ellipse 120% 80% at 100% 0%, rgba(20, 184, 166, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 80% 60% at 0% 100%, rgba(14, 116, 144, 0.08) 0%, transparent 45%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0.5rem;
    z-index: 100;
    padding: 0.5rem 1rem;
    background: #fff;
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-weight: 600;
}
.skip-link:focus { left: 0.5rem; outline: 2px solid var(--primary); }

.page-header {
    background: linear-gradient(145deg, #0f766e 0%, #0e7490 42%, #134e4a 100%);
    color: white;
    padding: 1.25rem 1.25rem 3.5rem;
    position: relative;
    overflow: hidden;
}
.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}
.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: linear-gradient(to top, var(--bg-page), transparent);
    pointer-events: none;
}

.container { max-width: 1400px; margin: 0 auto; position: relative; padding: 0 1.25rem; }

.header-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.92);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}
.back-link:hover { color: #fff; border-bottom-color: rgba(255,255,255,0.5); }

.lang-pills { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.lang-pills a {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-decoration: none;
    color: rgba(255,255,255,0.88);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    transition: background 0.2s, border-color 0.2s;
}
.lang-pills a:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.55);
}

.header-section { text-align: center; max-width: 560px; margin: 0 auto; position: relative; z-index: 1; }

.header-white-box {
    background: rgba(255,255,255,0.98);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1.25rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(255,255,255,0.6);
}
.header-white-box .logo-container { display: flex; align-items: center; gap: 0.55rem; margin: 0; }
.header-white-box .logo-container img { height: 34px; width: auto; border-radius: 8px; }
.header-white-box .routing-favicon { height: 30px; }
.header-white-box .logo-divider { width: 2px; height: 26px; background: var(--border); }
.header-white-box .logo-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
}

.header-section h1 {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.65rem, 4.5vw, 2.35rem);
    font-weight: 700;
    margin-bottom: 0.35rem;
    letter-spacing: -0.03em;
}
.header-section .tagline { font-size: 0.98rem; opacity: 0.92; max-width: 28rem; margin: 0 auto; }

.admin-section {
    padding: 0 0 3.5rem;
    margin-top: -2.5rem;
    position: relative;
    z-index: 2;
}

.admin-banner-error {
    display: none;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 0.9rem;
    font-weight: 500;
}

.admin-loading-panel {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    color: var(--text-muted);
    font-size: 0.95rem;
}

.admin-tabs-bar {
    padding: 0.45rem;
    margin-bottom: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.admin-page-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    list-style: none;
}

.admin-page-tab {
    padding: 0.55rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-family: inherit;
    transition: background 0.15s, color 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}
.admin-page-tab i { font-size: 0.85rem; opacity: 0.9; }
.admin-page-tab:hover {
    color: var(--primary-dark);
    background: var(--primary-faint);
}
.admin-page-tab.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.25);
}
.admin-page-tab.active i { color: rgba(255,255,255,0.95); }

.admin-tab-panel { display: none; }
.admin-tab-panel.active { display: block; }

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 0;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.card > h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, var(--primary-faint) 0%, #fff 100%);
}
.card > h2 i {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.card > .filters-row,
.card > .table-wrap,
.card > .pagination-row,
.card > .admin-subsection,
.card > .row,
.card > form,
.card > p.row {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}
.card > .filters-row { padding-top: 1rem; padding-bottom: 0; }
.card > .table-wrap { margin-top: 0; padding-top: 0; }
.card > .pagination-row { padding-bottom: 1.25rem; }
.card > .admin-subsection:last-child,
.card > form:last-child { padding-bottom: 1.25rem; }
.card > .admin-subsection:first-of-type { padding-top: 1rem; }
.card > h2 + .filters-row { padding-top: 1rem; }

.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.filters-row.filter-toolbar,
.filter-toolbar {
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--bg-muted);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.card > .filters-row.filter-toolbar {
    margin-left: 1.25rem;
    margin-right: 1.25rem;
    max-width: calc(100% - 2.5rem);
    box-sizing: border-box;
}

.form-group { margin-bottom: 0; min-width: 0; }
.form-group label {
    display: block;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
}
.form-group input, .form-group select {
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:hover, .form-group select:hover { border-color: #cbd5e1; }
.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}
.filters-row .form-group input, .filters-row .form-group select { min-width: 120px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    font-family: inherit;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.25);
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(15, 118, 110, 0.3);
}
.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-muted); border-color: #cbd5e1; }
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: none;
}
.btn-outline:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.2);
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

#admin-content { display: none; }

.table-wrap {
    overflow-x: auto;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    position: relative;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fff;
}
.table-wrap.loading { min-height: 80px; }
.table-wrap.loading .admin-users-table tbody { opacity: 0.5; pointer-events: none; }

.admin-users-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.admin-users-table thead { position: sticky; top: 0; z-index: 1; background: var(--primary-faint); }
.admin-users-table th, .admin-users-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--border);
}
.admin-users-table th {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    text-align: left;
}
.admin-users-table th.sortable { cursor: pointer; }
.admin-users-table th.sortable:hover { color: var(--primary); }
.admin-users-table tbody tr { transition: background 0.12s; }
.admin-users-table tbody tr:nth-child(even) { background: #fafafa; }
.admin-users-table tbody tr:hover { background: var(--primary-faint); }
.admin-users-table td.num { text-align: right; }

table:not(.admin-users-table) { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table:not(.admin-users-table) th, table:not(.admin-users-table) td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
table:not(.admin-users-table) th {
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-muted);
}
table:not(.admin-users-table) th.sortable { cursor: pointer; }
table:not(.admin-users-table) th.sortable:hover { color: var(--primary); }

.pagination-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.badge-active { background: #d1fae5; color: var(--success); }
.badge-inactive { background: #fee2e2; color: var(--error); }
.badge-admin { background: var(--primary-light); color: var(--primary-dark); }

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.2);
    border: 1px solid var(--border);
}
.modal-header {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, var(--primary-faint) 0%, #fff 100%);
}
.modal-header h3 { font-family: 'Outfit', sans-serif; font-size: 1.1rem; font-weight: 700; }
.modal-close {
    background: var(--bg-muted);
    border: none;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-sm);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    transition: background 0.15s, color 0.15s;
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-body { padding: 1.25rem; overflow-y: auto; flex: 1; min-height: 0; }
.modal-footer {
    flex-shrink: 0;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.65rem;
    justify-content: flex-end;
    background: #fafafa;
}
.modal-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.modal-tab {
    padding: 0.45rem 0.85rem;
    background: var(--bg-muted);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: inherit;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.modal-tab:hover { color: var(--primary); border-color: var(--border); }
.modal-tab.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}
.modal-tab-content { display: none; }
.modal-tab-content.active { display: block; }

.form-group.full { margin-bottom: 0.75rem; min-width: 0; }
.form-group.full input, .form-group.full select { width: 100%; }

.error-msg { color: var(--error); font-size: 0.88rem; margin-top: 0.5rem; font-weight: 500; }
.success-msg { color: var(--success); font-size: 0.88rem; margin-top: 0.5rem; font-weight: 500; }

.admin-subsection { margin-bottom: 1.25rem; }
.subsection-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.35rem;
}
.row { margin-bottom: 0.75rem; font-size: 0.95rem; }

.admin-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
}
.admin-card-full { grid-column: 1 / -1; }
.admin-cards-grid .card { margin-bottom: 0; min-width: 0; }

.translations-kv-list {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-muted);
}
.translations-kv-list .kv-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    text-align: left;
    font-size: 0.85rem;
}
.translations-kv-list .kv-row:last-child { border-bottom: none; }
.translations-kv-list .kv-row:hover { background: var(--primary-light); }
.translations-kv-list .kv-row .kv-key {
    flex: 0 0 220px;
    min-width: 0;
    font-family: ui-monospace, monospace;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.translations-kv-list .kv-row .kv-val {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.admin-section .container { max-width: 100%; overflow-x: hidden; }

.form-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.75rem; }
.form-group.full input, .form-group.full select { max-width: 100%; box-sizing: border-box; }
#tier-config-edit-container { min-width: 0; }
#tier-config-display { min-width: 0; }

.tier-checkboxes-box {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem;
    background: var(--bg-muted);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.tier-checkboxes-box.tier-features { max-height: none; }
.tier-checkboxes-box label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.35rem 0;
    min-width: 0;
    white-space: normal;
}
.tier-checkboxes-box label span,
.tier-checkboxes-box label div { min-width: 0; flex: 1; white-space: normal; word-wrap: break-word; overflow-wrap: break-word; }
.tier-checkboxes-box input[type="checkbox"] { flex-shrink: 0; width: 1.1rem; height: 1.1rem; }
.tier-checkboxes-box::-webkit-scrollbar { width: 8px; }
.tier-checkboxes-box::-webkit-scrollbar-track { background: var(--border); border-radius: 4px; }
.tier-checkboxes-box::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 4px; }
.tier-checkboxes-box::-webkit-scrollbar-thumb:hover { background: var(--primary); }
#tier-config-display::-webkit-scrollbar { width: 8px; }
#tier-config-display::-webkit-scrollbar-track { background: var(--border); border-radius: 4px; }
#tier-config-display::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 4px; }

/* —— Admin: pricing & tier / Stripe alignment —— */
.card.admin-card-pricing {
    border-top: 3px solid var(--primary);
}

.admin-pricing-stripe-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: linear-gradient(90deg, var(--primary-faint) 0%, transparent 100%);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
}

.admin-pricing-callout {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.08) 0%, rgba(14, 116, 144, 0.06) 100%);
    border: 1px solid rgba(15, 118, 110, 0.2);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.admin-pricing-callout--compact {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}
.admin-pricing-callout__icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
}
.admin-pricing-callout__title {
    display: block;
    font-size: 0.95rem;
    color: var(--primary-dark);
    margin-bottom: 0.35rem;
}
.admin-pricing-callout__text {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem 0;
    line-height: 1.5;
}
.admin-pricing-callout__text--only {
    margin-bottom: 0;
}
.admin-pricing-callout__link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s, color 0.15s;
}
.admin-pricing-callout__link:hover {
    color: var(--primary-hover);
    border-bottom-color: var(--primary);
}

.admin-tier-preview-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin: 0 0 0.5rem 0;
}
.admin-tier-preview {
    font-size: 0.85rem;
    padding: 0;
    margin-bottom: 1rem;
    max-height: none;
    overflow: visible;
    background: transparent;
    border-radius: 0;
}
.admin-tier-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.65rem;
}
.admin-tier-stat-tile {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.75rem;
    box-shadow: var(--shadow);
    min-height: 4.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
}
.admin-tier-stat-tile--wide {
    grid-column: 1 / -1;
}
.admin-tier-stat-tile__icon {
    font-size: 0.75rem;
    color: var(--primary);
    margin-bottom: 0.15rem;
}
.admin-tier-stat-tile__label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    line-height: 1.2;
}
.admin-tier-stat-tile__value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
    word-break: break-word;
}
.admin-tier-stat-tile--accent {
    border-color: rgba(15, 118, 110, 0.35);
    background: linear-gradient(160deg, var(--primary-faint) 0%, var(--bg-card) 65%);
}

.admin-stripe-align-panel {
    margin-top: 1rem;
    padding: 1.1rem 1.15rem;
    background: var(--bg-muted);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.admin-stripe-align-panel--ok {
    border-color: var(--admin-ok-border);
    background: linear-gradient(180deg, var(--admin-ok-bg) 0%, var(--bg-muted) 55%);
}
.admin-stripe-align-panel--warn {
    border-color: var(--admin-warning-border);
    background: linear-gradient(180deg, var(--admin-warning-bg) 0%, var(--bg-muted) 50%);
}
.admin-stripe-align-panel__title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.admin-stripe-align-panel__title {
    font-size: 1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
}
.admin-align-status-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.admin-align-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.admin-align-badge--ok {
    background: var(--admin-ok-bg);
    color: var(--success);
    border: 1px solid var(--admin-ok-border);
}
.admin-align-badge--warn {
    background: var(--admin-warning-bg);
    color: #b45309;
    border: 1px solid var(--admin-warning-border);
}
.admin-align-counts {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}
.admin-stripe-align-summary {
    font-size: 0.9rem;
    margin: 0 0 0.85rem 0;
    line-height: 1.55;
    color: var(--text);
}
.admin-stripe-align-panel--warn .admin-stripe-align-summary {
    font-weight: 500;
}
.admin-align-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.65rem;
}
.admin-align-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.85rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--border);
}
.admin-align-card--ok {
    border-left-color: var(--success);
}
.admin-align-card--mismatch {
    border-left-color: #d97706;
    background: linear-gradient(90deg, var(--admin-warning-bg) 0%, var(--bg-card) 100%);
}
.admin-align-card--err {
    border-left-color: var(--error);
    background: linear-gradient(90deg, var(--admin-err-bg) 0%, var(--bg-card) 100%);
}
.admin-align-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px dashed var(--border);
}
.admin-align-card__tier {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text);
    font-family: ui-monospace, monospace;
}
.admin-align-card__period {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.admin-align-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
.admin-align-compare__cell {
    text-align: center;
    padding: 0.4rem;
    background: var(--bg-muted);
    border-radius: 6px;
}
.admin-align-compare__label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}
.admin-align-compare__value {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
}
.admin-align-card__foot {
    margin-top: 0.55rem;
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.admin-align-card__foot--ok { color: var(--success); }
.admin-align-card__foot--warn { color: #b45309; }
.admin-align-card__foot--err { color: var(--error); }
.admin-align-card__errmsg {
    font-size: 0.82rem;
    color: var(--text);
    margin: 0;
    line-height: 1.45;
}

.admin-card-stripe {
    border-top: 3px solid #6366f1;
}

/* —— Admin: Referral program (dedicated tab) —— */
.admin-referral-shell {
    max-width: 1100px;
    margin: 0 auto;
}
.admin-referral-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.75rem 1.65rem;
    margin-bottom: 1rem;
    background: linear-gradient(118deg, #701a75 0%, #9d174d 38%, #c2410c 100%);
    color: #fff;
    box-shadow: 0 12px 40px rgba(120, 53, 15, 0.22), 0 4px 14px rgba(127, 29, 29, 0.12);
}
.admin-referral-hero__blobs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 70% 55% at 85% 20%, rgba(253, 230, 138, 0.35) 0%, transparent 55%),
        radial-gradient(ellipse 50% 45% at 10% 80%, rgba(192, 38, 211, 0.45) 0%, transparent 50%),
        radial-gradient(ellipse 40% 35% at 60% 95%, rgba(255, 255, 255, 0.12) 0%, transparent 45%);
}
.admin-referral-hero__content {
    position: relative;
    z-index: 1;
}
.admin-referral-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.88;
    margin: 0 0 0.35rem 0;
}
.admin-referral-hero__title {
    font-family: Outfit, 'DM Sans', sans-serif;
    font-size: clamp(1.5rem, 4vw, 1.95rem);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}
.admin-referral-hero__lead {
    font-size: 0.95rem;
    line-height: 1.55;
    opacity: 0.92;
    max-width: 38rem;
    margin: 0 0 1.15rem 0;
}
.admin-referral-hero__switch-row {
    margin-top: 0.25rem;
}
.admin-referral-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    cursor: pointer;
    user-select: none;
}
.admin-referral-switch__input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.admin-referral-switch__track {
    width: 3.1rem;
    height: 1.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.35);
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s;
}
.admin-referral-switch__knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(1.7rem - 4px);
    height: calc(1.7rem - 4px);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.22s ease;
}
.admin-referral-switch__input:checked + .admin-referral-switch__track {
    background: rgba(52, 211, 153, 0.55);
    border-color: rgba(167, 243, 208, 0.8);
}
.admin-referral-switch__input:checked + .admin-referral-switch__track .admin-referral-switch__knob {
    transform: translateX(1.35rem);
}
.admin-referral-switch__input:focus-visible + .admin-referral-switch__track {
    outline: 2px solid #fff;
    outline-offset: 3px;
}
.admin-referral-switch__label {
    font-size: 1rem;
    font-weight: 600;
}
.admin-referral-tip {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    margin: 0 0 1.15rem 0;
    padding: 0.85rem 1.1rem;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-muted);
    background: linear-gradient(90deg, rgba(192, 38, 211, 0.07) 0%, rgba(245, 158, 11, 0.05) 100%);
    border: 1px solid rgba(192, 38, 211, 0.16);
    border-radius: var(--radius);
}
.admin-referral-tip i {
    color: #a21caf;
    margin-top: 0.15rem;
    flex-shrink: 0;
}
.admin-referral-form {
    display: block;
}
.admin-referral-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
}
.admin-referral-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.35rem 1.4rem 1.5rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.admin-referral-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.admin-referral-panel--rules::before {
    background: linear-gradient(90deg, #c026d3, #db2777);
}
.admin-referral-panel--connect::before {
    background: linear-gradient(90deg, #6366f1, #0f766e);
}
.admin-referral-panel__head {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    margin-bottom: 1.15rem;
}
.admin-referral-panel__icon {
    width: 2.65rem;
    height: 2.65rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #fae8ff 0%, #fce7f3 100%);
    color: #a21caf;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.admin-referral-panel__icon--stripe {
    background: linear-gradient(145deg, #e0e7ff 0%, #ccfbf1 100%);
    color: #4f46e5;
}
.admin-referral-panel__title {
    font-family: Outfit, 'DM Sans', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.2rem 0;
}
.admin-referral-panel__subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.45;
}
.admin-referral-select {
    width: 100%;
    max-width: 100%;
}
.admin-referral-input-full {
    width: 100%;
    max-width: 100%;
}
.admin-referral-input-narrow {
    max-width: 10rem;
    width: 100%;
}
.admin-referral-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    margin: 0.5rem 0 1rem 0;
}
.admin-referral-metric {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
}
.admin-referral-metric__label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.admin-referral-metric__input-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.admin-referral-metric__input {
    font-family: Outfit, 'DM Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    width: 4rem;
    padding: 0.25rem 0.4rem;
    text-align: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: var(--primary-dark);
    line-height: 1.2;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.admin-referral-metric__input:hover { border-color: #cbd5e1; }
.admin-referral-metric__input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}
.admin-referral-metric__unit {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}
.admin-referral-field-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-top: 0.35rem;
    line-height: 1.4;
}
.admin-referral-check-card {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-top: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px dashed rgba(192, 38, 211, 0.35);
    background: rgba(250, 232, 255, 0.35);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.admin-referral-check-card:hover {
    border-color: rgba(192, 38, 211, 0.55);
    background: rgba(250, 232, 255, 0.55);
}
.admin-referral-check-card input[type="checkbox"] {
    flex-shrink: 0;
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.2rem;
}
.admin-referral-check-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}
.admin-referral-check-card__title {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text);
}
.admin-referral-check-card__hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.admin-referral-footer {
    margin-top: 1.35rem;
    padding: 1.15rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.admin-referral-footer__msg {
    flex: 1 1 100%;
    margin: 0;
}
.admin-referral-footer__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.admin-referral-events {
    margin-top: 2rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border);
    max-width: 100%;
}
.admin-referral-events__head {
    margin-bottom: 1rem;
}
.admin-referral-events__title {
    font-family: Outfit, 'DM Sans', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.35rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.admin-referral-events__title i { color: #a21caf; }
.admin-referral-events__desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0 0 1rem 0;
    max-width: 52rem;
}
.referral-events-toolbar {
    margin-bottom: 0;
    align-items: flex-end;
}
.admin-referral-events__loading {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0.5rem 0;
}
.admin-referral-events__empty {
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 1.25rem;
    text-align: center;
    background: var(--bg-muted);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border);
}
.admin-referral-events-table {
    font-size: 0.82rem;
}
.admin-referral-events-table th,
.admin-referral-events-table td {
    vertical-align: top;
}
.admin-referral-events-table td {
    word-break: break-word;
    max-width: 14rem;
}
.admin-referral-events-table td:first-child {
    max-width: 4rem;
    font-variant-numeric: tabular-nums;
}
.admin-referral-events .pagination-row {
    margin-top: 1rem;
}
.admin-referral-events .referral-events-page-info {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.int-admin { display: flex; flex-direction: column; gap: 1.25rem; }
.int-admin-hero {
    background: linear-gradient(135deg, #0f766e 0%, #134e4a 55%, #0c4a6e 100%);
    color: #fff;
    border-radius: 16px;
    padding: 1.5rem 1.6rem;
    box-shadow: 0 12px 28px rgba(15, 118, 110, 0.22);
}
.int-admin-kicker {
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.85;
    font-weight: 700;
}
.int-admin-hero h2 { margin: 0 0 0.4rem; font-size: 1.55rem; color: #fff; }
.int-admin-hero p { margin: 0; max-width: 62rem; color: rgba(255,255,255,0.92); line-height: 1.5; }
.int-admin-help {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.int-admin-help > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.9rem 1.05rem;
    font-weight: 700;
    color: #0f766e;
    user-select: none;
}
.int-admin-help > summary::-webkit-details-marker { display: none; }
.int-admin-help > summary > span { flex: 1; min-width: 0; }
.int-admin-help-chevron {
    color: #64748b;
    font-size: 0.8rem;
    transition: transform 0.18s ease;
}
.int-admin-help[open] .int-admin-help-chevron { transform: rotate(180deg); }
.int-admin-help > summary:hover { background: #f8fffe; }
.int-admin-steps {
    list-style: none;
    margin: 0;
    padding: 0 1rem 1rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}
.int-admin-steps li {
    display: flex;
    gap: 0.75rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.95rem 1rem;
}
.int-admin-steps li > span {
    flex: 0 0 1.7rem;
    height: 1.7rem;
    border-radius: 999px;
    background: #ccfbf1;
    color: #0f766e;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.int-admin-steps strong { display: block; margin-bottom: 0.35rem; color: #0f172a; }
.int-admin-steps p { margin: 0; color: var(--text-muted); font-size: 0.88rem; line-height: 1.5; }
.int-admin-steps code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8em;
    background: #e2e8f0;
    color: #334155;
    border-radius: 4px;
    padding: 0.05rem 0.28rem;
}
.int-admin-list { display: flex; flex-direction: column; gap: 1rem; }
.int-admin-summary {
    margin: 0;
    padding: 0.85rem 1rem;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 12px;
    color: #065f46;
    font-size: 0.95rem;
    line-height: 1.45;
}
.int-admin-summary strong { font-size: 1.05rem; }
.int-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}
.int-card-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.1rem 1.2rem 0.9rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #f8fffe 0%, #fff 100%);
}
.int-card-head h3 { margin: 0 0 0.2rem; font-size: 1.15rem; }
.int-card-slug {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
    background: #f1f5f9;
    color: #334155;
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    margin-left: 0.35rem;
}
.int-card-head p { margin: 0.35rem 0 0; color: var(--text-muted); font-size: 0.9rem; }
.int-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: flex-end; }
.int-badge {
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    background: #f1f5f9;
    color: #475569;
}
.int-badge.is-ok { background: #dcfce7; color: #166534; }
.int-badge.is-warn { background: #fef3c7; color: #92400e; }
.int-card-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 0;
}
.int-pane { padding: 1.1rem 1.2rem 1.2rem; }
.int-pane + .int-pane { border-left: 1px solid var(--border); }
.int-pane h4 { margin: 0 0 0.65rem; font-size: 0.95rem; }
.int-help {
    margin: 0 0 0.85rem;
    padding: 0.7rem 0.8rem;
    background: #f8fafc;
    border-radius: 10px;
    color: #334155;
    font-size: 0.86rem;
    line-height: 1.45;
}
.int-field label { display: block; font-weight: 600; font-size: 0.86rem; margin-bottom: 0.3rem; }
.int-field input[type="url"],
.int-field input[type="password"],
.int-field input[type="search"] {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
    font: inherit;
}
.int-field small { display: block; margin-top: 0.3rem; color: var(--text-muted); font-size: 0.8rem; line-height: 1.4; }
.int-field { margin-bottom: 0.75rem; }
.int-grants, .int-search-results { display: flex; flex-direction: column; gap: 0.4rem; }
.int-user-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}
.int-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: #ccfbf1;
    color: #0f766e;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 0.78rem;
}
.int-user-row span { flex: 1; min-width: 0; }
.int-user-row strong { display: block; font-size: 0.9rem; }
.int-user-row em { font-style: normal; color: var(--text-muted); font-size: 0.78rem; }
.int-admin-empty { color: var(--text-muted); }

@media (max-width: 900px) {
    .int-admin-steps, .int-card-grid { grid-template-columns: 1fr; }
    .int-pane + .int-pane { border-left: 0; border-top: 1px solid var(--border); }
}

.btn:focus-visible, .btn-outline:focus-visible, .form-group input:focus-visible, .form-group select:focus-visible,
.admin-page-tab:focus-visible, .modal-tab:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .page-header { padding: 1rem 1rem 3rem; }
    .header-top { flex-direction: column; align-items: stretch; }
    .lang-pills { justify-content: flex-start; }
    .admin-cards-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .tier-checkboxes-box { max-height: 280px; }
    .filters-row { flex-direction: column; align-items: stretch; }
    .filters-row .form-group { min-width: 0; }
    .filters-row .form-group input, .filters-row .form-group select { min-width: 0; }
    #btn-apply-filters { width: 100%; justify-content: center; }
    .admin-page-tab { flex: 1 1 auto; justify-content: center; min-width: calc(50% - 0.2rem); }
    .admin-stripe-align-panel__title-row { flex-direction: column; align-items: flex-start; }
    .admin-align-compare { grid-template-columns: 1fr; }
    .admin-tier-stat-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-referral-hero { padding: 1.35rem 1.15rem; }
    .admin-referral-footer { flex-direction: column; align-items: stretch; }
    .admin-referral-footer__actions { width: 100%; justify-content: stretch; }
    .admin-referral-footer__actions .btn { flex: 1; justify-content: center; }
}

@media (max-width: 900px) {
    .admin-referral-panels { grid-template-columns: 1fr; }
    .admin-referral-metrics { grid-template-columns: 1fr; }
}

/* Platform stats tab — hero + KPI + explained panels */
.admin-stats-shell {
    max-width: 1120px;
    margin: 0 auto;
}
.admin-stats-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.75rem 1.55rem;
    margin-bottom: 1rem;
    background: linear-gradient(118deg, #0f766e 0%, #0e7490 48%, #134e4a 100%);
    color: #fff;
    box-shadow: 0 12px 40px rgba(15, 118, 110, 0.22), 0 4px 14px rgba(15, 23, 42, 0.1);
}
.admin-stats-hero__blobs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 70% 55% at 88% 18%, rgba(153, 246, 228, 0.35) 0%, transparent 55%),
        radial-gradient(ellipse 50% 45% at 8% 85%, rgba(14, 165, 233, 0.35) 0%, transparent 50%),
        radial-gradient(ellipse 40% 35% at 55% 95%, rgba(255, 255, 255, 0.1) 0%, transparent 45%);
}
.admin-stats-hero__content {
    position: relative;
    z-index: 1;
}
.admin-stats-hero__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.admin-stats-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.88;
    margin: 0 0 0.35rem 0;
}
.admin-stats-hero__title {
    font-family: Outfit, 'DM Sans', sans-serif;
    font-size: clamp(1.45rem, 3.5vw, 1.9rem);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.12);
}
.admin-stats-hero__lead {
    font-size: 0.95rem;
    line-height: 1.55;
    opacity: 0.92;
    max-width: 40rem;
    margin: 0 0 0.65rem 0;
}
.admin-stats-hero .admin-stats-updated {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.78;
    color: #fff;
}
.admin-stats-refresh-btn {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    font-weight: 600;
    white-space: nowrap;
}
.admin-stats-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.55);
}
.admin-stats-refresh-btn.is-spinning i {
    animation: admin-stats-spin 0.8s linear infinite;
}
@keyframes admin-stats-spin {
    to { transform: rotate(360deg); }
}

.admin-stats-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    margin-bottom: 1rem;
}
.admin-stats-kpi {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.15rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 7.5rem;
}
.admin-stats-kpi__icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-faint);
    color: var(--primary);
    font-size: 0.9rem;
}
.admin-stats-kpi__value {
    font-family: Outfit, 'DM Sans', sans-serif;
    font-size: clamp(1.55rem, 3vw, 1.9rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--primary-dark);
    letter-spacing: -0.02em;
}
.admin-stats-kpi__label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
}
.admin-stats-kpi__hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.admin-stats-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.admin-stats-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.3rem 1.35rem;
    box-shadow: var(--shadow);
}
.admin-stats-panel--wide {
    grid-column: 1 / -1;
}
.admin-stats-panel__head {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}
.admin-stats-panel__icon {
    flex-shrink: 0;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--primary-light) 0%, var(--primary-faint) 100%);
    color: var(--primary-dark);
    font-size: 1rem;
}
.admin-stats-panel__title {
    margin: 0 0 0.25rem;
    font-family: Outfit, 'DM Sans', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}
.admin-stats-panel__intro {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.admin-stats-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.7rem;
}
.admin-stats-metric {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.8rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-height: 5.5rem;
}
.admin-stats-metric--accent {
    background: linear-gradient(160deg, var(--primary-faint) 0%, #fff 70%);
    border-color: rgba(15, 118, 110, 0.28);
}
.admin-stats-metric__value {
    font-family: Outfit, 'DM Sans', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.15;
    letter-spacing: -0.02em;
}
.admin-stats-metric__label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
}
.admin-stats-metric__hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.35;
    margin-top: 0.1rem;
}

.admin-stats-breakdowns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    margin-top: 1rem;
}
.admin-stats-breakdown-card {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
}
.admin-stats-breakdown-card__title {
    margin: 0 0 0.25rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.admin-stats-breakdown-card__hint {
    margin: 0 0 0.75rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.35;
}
.admin-stats-bar {
    display: grid;
    grid-template-columns: minmax(4.5rem, 28%) 1fr auto;
    align-items: center;
    gap: 0.5rem 0.65rem;
    margin-bottom: 0.45rem;
}
.admin-stats-bar:last-child {
    margin-bottom: 0;
}
.admin-stats-bar__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-stats-bar__track {
    height: 0.45rem;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}
.admin-stats-bar__fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary) 0%, #14b8a6 100%);
    min-width: 2px;
}
.admin-stats-bar__value {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    text-align: right;
    min-width: 1.75rem;
}

@media (max-width: 900px) {
    .admin-stats-kpi-grid { grid-template-columns: 1fr 1fr; }
    .admin-stats-panels { grid-template-columns: 1fr; }
    .admin-stats-panel--wide { grid-column: auto; }
    .admin-stats-breakdowns { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .admin-stats-hero { padding: 1.35rem 1.15rem; }
    .admin-stats-kpi-grid { grid-template-columns: 1fr; }
    .admin-stats-bar { grid-template-columns: 1fr auto; }
    .admin-stats-bar__track { grid-column: 1 / -1; order: 3; }
}

/* —— System code map (superadmin) —— */
.admin-system-map-shell {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.admin-system-map-hero {
    padding: 1.35rem 1.5rem;
    border-radius: 14px;
    background: linear-gradient(135deg, #0f766e 0%, #134e4a 55%, #0f172a 100%);
    color: #ecfdf5;
    box-shadow: 0 10px 28px rgba(15, 118, 110, 0.22);
}
.admin-system-map-hero__eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.9;
}
.admin-system-map-hero__eyebrow i { margin-right: 0.35rem; }
.admin-system-map-hero__title {
    margin: 0 0 0.4rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
}
.admin-system-map-hero__lead {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.45;
    opacity: 0.92;
    max-width: 52rem;
}
.admin-system-map {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.admin-system-map-band {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    background: var(--bg-card, #fff);
    padding: 0.85rem 1rem 1rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.admin-system-map-band__head {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.admin-system-map-band__title {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 650;
    color: var(--text, #0f172a);
}
.admin-system-map-band__flow {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
}
.admin-system-map-nodes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}
.admin-system-map-node {
    flex: 1 1 11.5rem;
    max-width: 18rem;
    text-align: left;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--border, #e2e8f0);
    background: var(--bg-muted, #f8fafc);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.admin-system-map-node:hover,
.admin-system-map-node:focus-visible {
    border-color: var(--primary, #0f766e);
    background: #f0fdfa;
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.15);
    outline: none;
}
.admin-system-map-node.is-active {
    border-color: var(--primary, #0f766e);
    background: #ccfbf1;
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.2);
}
.admin-system-map-node__name {
    display: block;
    font-weight: 650;
    font-size: 0.92rem;
    color: var(--text, #0f172a);
    margin-bottom: 0.25rem;
}
.admin-system-map-node__blurb {
    display: block;
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--text-muted, #64748b);
}
.admin-system-map-detail {
    border: 1px solid var(--primary, #0f766e);
    border-radius: 12px;
    background: #f0fdfa;
    padding: 1rem 1.15rem;
    display: none;
}
.admin-system-map-detail.is-open {
    display: block;
}
.admin-system-map-detail__title {
    margin: 0 0 0.35rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-dark, #134e4a);
}
.admin-system-map-detail__role {
    margin: 0 0 0.85rem;
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--text, #0f172a);
}
.admin-system-map-detail__section {
    margin: 0 0 0.75rem;
}
.admin-system-map-detail__label {
    margin: 0 0 0.3rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}
.admin-system-map-detail__list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--text, #0f172a);
}
.admin-system-map-detail__list code {
    font-size: 0.8rem;
    background: rgba(15, 23, 42, 0.06);
    padding: 0.05rem 0.35rem;
    border-radius: 4px;
}
.admin-system-map-detail__close {
    margin-top: 0.35rem;
}
@media (max-width: 640px) {
    .admin-system-map-node {
        flex: 1 1 100%;
        max-width: none;
    }
}

/* —— Geocoding admin panel —— */
.geo-admin {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}
.geo-admin-hero {
    display: flex;
    justify-content: space-between;
    gap: 1.25rem;
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 1.45rem 1.55rem;
    border-radius: 18px;
    color: #f8fafc;
    background:
        radial-gradient(1200px 280px at 12% -20%, rgba(56, 189, 248, 0.28), transparent 55%),
        radial-gradient(900px 240px at 90% 0%, rgba(45, 212, 191, 0.22), transparent 50%),
        linear-gradient(135deg, #0f172a 0%, #134e4a 48%, #0f766e 100%);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.22);
    position: relative;
    overflow: hidden;
}
.geo-admin-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
    pointer-events: none;
    opacity: 0.55;
}
.geo-admin-hero__copy,
.geo-admin-hero__meta {
    position: relative;
    z-index: 1;
}
.geo-admin-kicker {
    margin: 0 0 0.35rem;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.85;
}
.geo-admin-kicker i { margin-right: 0.35rem; }
.geo-admin-hero h2 {
    margin: 0 0 0.4rem;
    font-family: Outfit, 'DM Sans', sans-serif;
    font-size: clamp(1.35rem, 2.4vw, 1.7rem);
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}
.geo-admin-hero p {
    margin: 0;
    max-width: 46rem;
    color: rgba(248, 250, 252, 0.9);
    line-height: 1.5;
    font-size: 0.95rem;
}
.geo-admin-hero__meta {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    align-items: flex-end;
}
.geo-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    max-width: 22rem;
    overflow: hidden;
    text-overflow: ellipsis;
}
.geo-status-pill--ok {
    background: rgba(34, 197, 94, 0.2);
    color: #bbf7d0;
    border: 1px solid rgba(134, 239, 172, 0.35);
}
.geo-status-pill--warn {
    background: rgba(251, 191, 36, 0.2);
    color: #fde68a;
    border: 1px solid rgba(252, 211, 77, 0.4);
}
.geo-status-pill--muted,
.geo-status-pill--ghost {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(248, 250, 252, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.geo-admin-alert {
    margin: 0;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #9a3412;
    font-size: 0.9rem;
    line-height: 1.45;
}
.geo-admin-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.15rem;
}
.geo-card {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
    overflow: hidden;
    min-width: 0;
}
.geo-card--wide { width: 100%; }
.geo-card__head {
    padding: 1.1rem 1.25rem 0.95rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    background: linear-gradient(180deg, #f8fffe 0%, #fff 100%);
}
.geo-card__head h3 {
    margin: 0 0 0.3rem;
    font-family: Outfit, 'DM Sans', sans-serif;
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--text, #0f172a);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.geo-card__head h3 i { color: #0f766e; font-size: 0.95rem; }
.geo-card__head p {
    margin: 0;
    color: var(--text-muted, #64748b);
    font-size: 0.88rem;
    line-height: 1.45;
}
.geo-card__body { padding: 1.1rem 1.25rem 1.25rem; }
.geo-card__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}
.geo-card__actions--center { justify-content: center; }
.geo-inline-msg {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #047857;
}
.geo-inline-msg.is-error { color: #b91c1c; }

.geo-toggle {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    background: #f8fafc;
    cursor: pointer;
    margin: 0 0 0.65rem;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.geo-toggle:hover {
    border-color: #99f6e4;
    background: #f0fdfa;
}
.geo-toggle:has(input:checked) {
    border-color: #5eead4;
    background: #ecfdf5;
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.08);
}
.geo-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.geo-toggle__ui {
    flex: 0 0 2.6rem;
    width: 2.6rem;
    height: 1.45rem;
    margin-top: 0.15rem;
    border-radius: 999px;
    background: #cbd5e1;
    position: relative;
    transition: background 0.18s ease;
}
.geo-toggle__ui::after {
    content: '';
    position: absolute;
    top: 0.15rem;
    left: 0.15rem;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
    transition: transform 0.18s ease;
}
.geo-toggle input:checked + .geo-toggle__ui { background: #0f766e; }
.geo-toggle input:checked + .geo-toggle__ui::after { transform: translateX(1.15rem); }
.geo-toggle input:focus-visible + .geo-toggle__ui {
    outline: 2px solid var(--primary, #0f766e);
    outline-offset: 2px;
}
.geo-toggle__copy { flex: 1; min-width: 0; }
.geo-toggle__copy strong {
    display: block;
    font-size: 0.92rem;
    color: var(--text, #0f172a);
    margin-bottom: 0.2rem;
}
.geo-toggle__copy small {
    display: block;
    color: var(--text-muted, #64748b);
    font-size: 0.8rem;
    line-height: 1.4;
}

.geo-search {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}
.geo-search:focus-within {
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.geo-search i { color: #64748b; }
.geo-search input {
    border: 0;
    outline: none;
    width: 100%;
    font: inherit;
    background: transparent;
    color: var(--text, #0f172a);
}
.geo-results { margin-top: 0.9rem; }
.geo-empty {
    margin: 0;
    padding: 1.25rem 1rem;
    text-align: center;
    color: var(--text-muted, #64748b);
    font-size: 0.9rem;
    background: #f8fafc;
    border: 1px dashed var(--border, #e2e8f0);
    border-radius: 12px;
}
.geo-table-wrap {
    overflow: auto;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    background: #fff;
}
.geo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}
.geo-table th {
    text-align: left;
    padding: 0.7rem 0.85rem;
    background: #f8fafc;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border, #e2e8f0);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}
.geo-table td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text, #0f172a);
    vertical-align: top;
}
.geo-table tr:last-child td { border-bottom: 0; }
.geo-table tr:hover td { background: #f8fffe; }
.geo-table__addr {
    font-weight: 600;
    max-width: 22rem;
}
.geo-table__mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8rem;
    color: #334155;
}
.geo-table__text {
    max-width: 18rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.geo-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #475569;
    white-space: nowrap;
}
.geo-chip--google { background: #dbeafe; color: #1d4ed8; }
.geo-chip--pin { background: #fef3c7; color: #92400e; }
.geo-chip--shared { background: #d1fae5; color: #065f46; }
.geo-chip--blocked { background: #fee2e2; color: #991b1b; }
.geo-chip--private { background: #f3f4f6; color: #374151; }
.geo-chip--agree { background: #e0e7ff; color: #3730a3; }
.geo-chip--conflict { background: #ffedd5; color: #9a3412; }
.geo-chip--nominatim { background: #dcfce7; color: #166534; }
.geo-chip--used { background: #dcfce7; color: #166534; }
.geo-chip--error { background: #fee2e2; color: #991b1b; }
.geo-chip--not_better,
.geo-chip--no_result { background: #fef3c7; color: #92400e; }
.geo-chip--low { background: #ffedd5; color: #9a3412; margin-left: 0.25rem; }

.geo-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.15rem;
}
.geo-kpi {
    position: relative;
    padding: 1rem 1.05rem;
    border-radius: 14px;
    border: 1px solid var(--border, #e2e8f0);
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    min-height: 7.2rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.geo-kpi::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #0f766e;
}
.geo-kpi--today::before { background: #0ea5e9; }
.geo-kpi--month::before { background: #0f766e; }
.geo-kpi--prev::before { background: #64748b; }
.geo-kpi--errors::before { background: #ef4444; }
.geo-kpi--avoided::before { background: #22c55e; }
.geo-kpi__icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ecfdf5;
    color: #0f766e;
    font-size: 0.85rem;
    margin-bottom: 0.45rem;
}
.geo-kpi--today .geo-kpi__icon { background: #e0f2fe; color: #0369a1; }
.geo-kpi--errors .geo-kpi__icon { background: #fee2e2; color: #b91c1c; }
.geo-kpi--avoided .geo-kpi__icon { background: #dcfce7; color: #15803d; }
.geo-kpi--prev .geo-kpi__icon { background: #f1f5f9; color: #475569; }
.geo-kpi__value {
    font-family: Outfit, 'DM Sans', sans-serif;
    font-size: clamp(1.4rem, 2.5vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
    line-height: 1.1;
}
.geo-kpi__label {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
}
.geo-kpi__hint {
    margin-top: 0.15rem;
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.35;
}

.geo-series-wrap {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 14px;
    padding: 1rem 1.1rem 1.15rem;
    background: linear-gradient(180deg, #f8fffe 0%, #fff 55%);
    margin-bottom: 1.15rem;
}
.geo-series-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}
.geo-series-head h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}
.geo-legend {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
}
.geo-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.geo-dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
    display: inline-block;
}
.geo-dot--google { background: #0ea5e9; }
.geo-dot--avoided { background: #22c55e; }
.geo-series {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 120px;
    padding: 0.35rem 0.15rem 0;
    border-bottom: 1px solid #e2e8f0;
}
.geo-series__col {
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 2px;
    position: relative;
}
.geo-series__bar {
    width: 100%;
    border-radius: 3px 3px 1px 1px;
    min-height: 0;
    transition: height 0.25s ease, opacity 0.15s ease;
}
.geo-series__bar--google {
    background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
}
.geo-series__bar--avoided {
    background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
}
.geo-series__col:hover .geo-series__bar { opacity: 0.85; }
.geo-series__tip {
    display: none;
}
.geo-breakdown {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}
.geo-breakdown .admin-stats-breakdown-card {
    margin: 0;
    border-radius: 12px;
    border: 1px solid var(--border, #e2e8f0);
    background: #fff;
    padding: 0.9rem 1rem;
}

.geo-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--border, #e2e8f0);
}
.geo-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 8.5rem;
    flex: 1 1 8.5rem;
}
.geo-field span {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}
.geo-field input,
.geo-field select {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    padding: 0.5rem 0.65rem;
    font: inherit;
    background: #fff;
    color: var(--text, #0f172a);
}
.geo-field input:focus,
.geo-field select:focus {
    outline: none;
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.geo-filters__actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-left: auto;
}

@media (max-width: 1100px) {
    .geo-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .geo-breakdown { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .geo-admin-top { grid-template-columns: 1fr; }
    .geo-admin-hero__meta { align-items: flex-start; }
}
@media (max-width: 640px) {
    .geo-kpi-grid { grid-template-columns: 1fr 1fr; }
    .geo-filters__actions { margin-left: 0; width: 100%; }
    .geo-filters__actions .btn { flex: 1; }
}
