/* Admin Page Scoped Styles */
.admin-page {
    padding: 40px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.admin-page__header {
    margin-bottom: 30px;
    text-align: center;
}

.admin-page__title {
    font-size: 28px;
    margin: 0 0 10px;
    color: #333;
}

.admin-page__subtitle {
    font-size: 16px;
    color: #666;
    margin: 0;
}

.admin-table-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 20px;
    border: 1px solid #eaeaea;
}

.admin-table-scroll {
    overflow-x: auto;
}

.admin-clinics-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.admin-clinics-table th {
    background-color: #f5f7fb;
    padding: 12px 16px;
    border-bottom: 2px solid #e1e4e8;
    color: #495057;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}

.admin-clinics-table th.text-center {
    text-align: center;
}

.admin-clinics-table th.text-right {
    text-align: right;
}

.admin-clinics-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    color: #333;
    font-size: 14px;
}

.admin-clinics-table td.text-center {
    text-align: center;
}

.admin-clinics-table td.text-right {
    text-align: right;
}

.admin-clinics-table td.text-nowrap {
    white-space: nowrap;
}

.admin-clinics-table tr:hover td {
    background-color: #f8f9fa;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.badge--solo {
    background-color: #e3f2fd;
    color: #0d6efd;
}

.badge--multi {
    background-color: #f3e5f5;
    color: #6f42c1;
}

.badge--status-active {
    background-color: #d1e7dd;
    color: #0f5132;
}

.badge--status-trialing {
    background-color: #fff3cd;
    color: #856404;
}

.badge--status-canceled {
    background-color: #f8d7da;
    color: #842029;
}

.badge--status-past_due {
    background-color: #f8d7da;
    color: #842029;
}

.badge--status-incomplete {
    background-color: #e2e3e5;
    color: #41464b;
}

.badge--status-none {
    background-color: #e2e3e5;
    color: #41464b;
}

.badge--health-ok {
    background-color: #d1e7dd;
    color: #0f5132;
    padding: 4px 8px;
}

/* Health Issues List */
.health-issues {
    list-style: none;
    margin: 0;
    padding: 0;
}

.health-issues__item {
    font-size: 12px;
    color: #dc3545;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.health-issues__item::before {
    content: "●";
    color: #dc3545;
    font-size: 8px;
}


/* Global Templates Accordion UI */
.page.page--narrow {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 16px 48px;
}

.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #333;
}

.page-subtitle {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.template-groups {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.template-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: box-shadow 150ms ease, transform 150ms ease;
}

.template-card.is-open {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
}

.template-card__header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: #f9fafb;
    border: none;
    cursor: pointer;
}

.template-card__title-wrap {
    text-align: left;
}

.template-card__title {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 600;
    color: #111;
}

.template-card__description {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

.template-card__chevron {
    margin-left: 16px;
    display: flex;
    align-items: center;
}

.chevron-icon {
    display: inline-block;
    transition: transform 150ms ease;
    font-size: 18px;
    color: #6b7280;
}

.template-card__body {
    padding: 16px 20px 18px;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
    overflow: hidden;
    max-height: 0;
    transition: max-height 200ms ease;
}

.template-card__section {
    margin-bottom: 16px;
}

.template-card__section-title {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.template-card__hint {
    margin: 0 0 10px;
    font-size: 13px;
    color: #6b7280;
}

.template-card__languages {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
}

.pill--lang {
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #e0e7ff;
}

.pill--lang:hover {
    background: #e0e7ff;
}

.template-card__footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.btn.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    border: none;
    background: #4f46e5;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.btn.btn-primary:hover {
    background: #4338ca;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 150ms ease;
}

.btn.btn-secondary {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
}

.btn.btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn.btn-outline {
    background: transparent;
    border: 1px solid transparent;
    color: #4b5563;
}

.btn.btn-outline:hover {
    background: #f3f4f6;
    color: #111827;
}

/* Input Styles to match card aesthetic */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.form-hint {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    display: block;
}

.form-input,
.form-textarea {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus,
.form-textarea:focus {
    border-color: #4f46e5;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-textarea {
    min-height: 120px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Newsletter Sections Grid */
.newsletter-sections-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

/* Make sure cards behave nicely inside the grid */
.newsletter-section-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.4);
    overflow: hidden;
    display: flex;
    align-items: stretch;
    /* override any existing full-width rules */
    width: auto !important;
}

.newsletter-section-image img {
    display: block;
    width: 96px;
    height: 96px;
    object-fit: cover;
}

.newsletter-section-content {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.newsletter-section-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.newsletter-section-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 4px;
}

.newsletter-section-price {
    font-weight: 600;
    color: #111827;
}

@media (max-width: 640px) {
    .newsletter-sections-grid {
        grid-template-columns: 1fr;
    }
}