/* ===== CSS Variables ===== */
:root {
    --primary-color: #0f766e;
    --primary-dark: #0d5d56;
    --primary-light: #14b8a6;
    --secondary-color: #475569;
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --info-color: #0284c7;
    
    --bg-color: #f8fafc;
    --nav-bg: #ffffff;
    --nav-text: #334155;
    --nav-accent: #0f766e;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-color: #1e293b;
    --text-muted: #64748b;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    --nav-height: 72px;
}

/* ===== Base Styles ===== */
html, body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    line-height: 1.6;
}

* {
    box-sizing: border-box;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ===== App Layout ===== */
.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== Top Navigation ===== */
.top-nav {
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-logo {
    height: 44px;
    width: auto;
    transition: opacity 0.2s;
}

.nav-brand:hover .brand-logo {
    opacity: 0.85;
}

.nav-brand:hover {
    text-decoration: none;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.top-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    color: var(--nav-text);
    font-weight: 500;
    font-size: 0.9375rem;
    border-radius: var(--radius);
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.top-nav .nav-link:hover {
    background: var(--bg-color);
    color: var(--primary-color);
    text-decoration: none;
}

.top-nav .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.top-nav .nav-link.active:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: white;
}

.top-nav .nav-link-secondary {
    color: var(--text-muted);
}

.top-nav .nav-link-secondary:hover {
    color: var(--primary-color);
    background: var(--bg-color);
}

.nav-icon {
    font-size: 1.125rem;
    line-height: 1;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    box-sizing: border-box;
}

/* ===== Footer ===== */
.site-footer {
    background: var(--nav-bg);
    border-top: 1px solid var(--border-color);
    padding: 1rem 2rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-separator {
    opacity: 0.5;
}

/* ===== Legacy Sidebar Styles (kept for compatibility) ===== */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-section {
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 1rem;
}

.header-info {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.page-container {
    flex: 1;
    padding: 2rem;
}

/* ===== Page Content ===== */
.page-content {
    max-width: 1400px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.page-header .subtitle {
    color: var(--text-muted);
    margin: 0;
}

/* ===== Base Card Style ===== */
.card {
    display: block !important;
    flex-direction: unset !important;
    background: var(--card-bg) !important;
    border-radius: var(--radius-lg) !important;
    padding: 1.5rem !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-sm) !important;
    width: auto !important;
    min-width: 0 !important;
}

.card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--text-color);
}

/* Newsletter specific card - avoids Bootstrap conflicts */
.newsletter-card {
    display: block;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
    overflow: hidden;
}

.newsletter-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--text-color);
}

.newsletter-card .editor-toolbar {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 0.5rem;
}

.newsletter-card .editor-toolbar .toolbar-btn {
    display: inline-flex !important;
    flex: 0 0 auto !important;
}

/* Newsletter top row layout */
.newsletter-top-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
    align-items: stretch;
}

/* Newsletter editor top grid - high specificity */
.newsletter-editor-grid {
    display: grid !important;
    grid-template-columns: 1fr 350px !important;
    gap: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    width: 100% !important;
}

.newsletter-editor-grid > .newsletter-editor-card {
    background: var(--card-bg) !important;
    border-radius: 12px !important;
    padding: 1.5rem !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.newsletter-editor-card h3 {
    font-size: 1rem !important;
    font-weight: 600 !important;
    margin: 0 0 1rem 0 !important;
}

.newsletter-editor-card .form-control {
    width: 100% !important;
    box-sizing: border-box !important;
}

@media (max-width: 900px) {
    .newsletter-editor-grid {
        grid-template-columns: 1fr !important;
    }
}

.newsletter-subject-col {
    flex: 1 1 0 !important;
    min-width: 200px !important;
    width: auto !important;
}

.newsletter-recipients-col {
    flex: 0 0 350px !important;
    min-width: 350px !important;
    max-width: 350px !important;
}

.newsletter-subject-col > .newsletter-card {
    width: 100% !important;
    box-sizing: border-box !important;
    height: 100%;
}

.newsletter-recipients-col > .newsletter-card {
    width: 100% !important;
    box-sizing: border-box !important;
    height: 100%;
}

/* Ensure form controls inside newsletter-card expand */
.newsletter-card .form-control {
    width: 100% !important;
    box-sizing: border-box !important;
}

.newsletter-card .form-group {
    width: 100%;
}

@media (max-width: 900px) {
    .newsletter-top-row {
        flex-wrap: wrap !important;
    }
    .newsletter-subject-col,
    .newsletter-recipients-col {
        flex: 1 1 100% !important;
        min-width: 100% !important;
    }
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--secondary-color);
    font-size: 0.875rem;
}

/* ===== Dashboard ===== */
.dashboard h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.dashboard .subtitle {
    color: var(--text-muted);
    margin: 0 0 2rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.stat-card.members { border-left: 4px solid var(--primary-color); }
.stat-card.active { border-left: 4px solid var(--success-color); }
.stat-card.donations { border-left: 4px solid var(--warning-color); }
.stat-card.revenue { border-left: 4px solid var(--info-color); }

/* ===== KPI Cards ===== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    border-left: 4px solid var(--primary-color);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-card.success { border-left-color: var(--success-color); }
.kpi-card.warning { border-left-color: var(--warning-color); }
.kpi-card.danger { border-left-color: var(--danger-color); }
.kpi-card.info { border-left-color: var(--info-color); }
.kpi-card.muted { border-left-color: var(--text-muted); opacity: 0.85; }

.kpi-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
}

.kpi-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-color);
}

.kpi-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.kpi-subtext {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    opacity: 0.8;
}

/* ===== Filter Notice ===== */
.filter-notice {
    background: var(--primary-light);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.filter-notice .filter-count {
    background: rgba(255,255,255,0.2);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius);
    font-weight: 500;
}

/* ===== Dashboard Row ===== */
.dashboard-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.dashboard-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
}

.month-stats, .subscription-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.month-stat, .sub-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.month-stat:last-child, .sub-stat:last-child {
    border-bottom: none;
}

.month-stat .label, .sub-stat .label {
    color: var(--text-muted);
}

.month-stat .value, .sub-stat .value {
    font-weight: 600;
}

.sub-stat .value.active { color: var(--success-color); }
.sub-stat .value.pending { color: var(--warning-color); }
.sub-stat .value.inactive { color: var(--secondary-color); }

/* ===== Data Card & Table ===== */
.data-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    padding-right: 1.75rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.data-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.history-header h3 {
    margin: 0;
}

.history-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.history-filter {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.8rem;
    background: var(--card-bg);
    color: var(--text-color);
    min-width: 120px;
}

.history-summary {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.summary-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.entity-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
}

.row-error {
    background: rgba(239, 68, 68, 0.1);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.pagination .btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pagination .btn-sm:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination .btn-sm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0 1rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.data-table th {
    text-align: left;
    padding: 0.4rem 0.35rem;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.data-table th.sortable:hover {
    background: var(--bg-color);
    color: var(--text-color);
}

.data-table th.sortable.sorted {
    background: var(--bg-color);
    color: var(--primary-color);
}

.data-table th .sort-indicator {
    margin-left: 0.15rem;
    opacity: 0.4;
    font-size: 0.65rem;
}

.data-table th .sort-indicator.active {
    opacity: 1;
    color: var(--primary-color);
}

.data-table td {
    padding: 0.4rem 0.35rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table td:first-child,
.data-table td:nth-child(2) {
    white-space: nowrap;
}

/* Action column */
.data-table th:last-child,
.data-table td:last-child {
    text-align: center;
    white-space: nowrap;
    overflow: visible;
}

.data-table tbody tr:hover {
    background: var(--bg-color);
}

.data-table .amount {
    font-weight: 600;
    font-family: 'Monaco', 'Consolas', monospace;
}

/* ===== Status Badge ===== */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
}

.status-badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.status-badge.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.status-badge.info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
}

.status-badge.secondary {
    background: rgba(100, 116, 139, 0.1);
    color: var(--secondary-color);
}

/* ===== Type Badge ===== */
.type-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
}

.type-badge.individual {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
}

.type-badge.business {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

/* ===== Status Badge ===== */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.status-badge.success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
}

.status-badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.status-badge.muted {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* ===== Toolbar ===== */
.toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    gap: 0.5rem;
}

.search-box input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    min-width: 300px;
}

.filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.filters select,
.filters input[type="date"] {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--card-bg);
}

.age-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.age-filter label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.age-filter select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--card-bg);
}

/* ===== Bulk Actions ===== */
.bulk-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    padding: 0.5rem 1rem;
    background: var(--primary-light);
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.1), rgba(20, 184, 166, 0.1));
    border-radius: var(--radius);
    border: 1px solid var(--primary-color);
}

.bulk-actions .selected-count {
    font-weight: 600;
    color: var(--primary-color);
}

.bulk-actions .btn-link {
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    text-decoration: underline;
}

.bulk-actions .btn-link:hover {
    color: var(--text-color);
}

/* Checkbox cells */
.checkbox-cell {
    width: 40px;
    text-align: center !important;
}

.checkbox-cell input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Selected row highlight */
.data-table tbody tr.selected-row {
    background: rgba(15, 118, 110, 0.08);
}

.data-table tbody tr.selected-row:hover {
    background: rgba(15, 118, 110, 0.12);
}

/* ===== Buttons ===== */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-secondary:hover {
    background: var(--bg-color);
    text-decoration: none;
}

.btn-icon {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-icon:hover {
    opacity: 0.7;
}

.btn-danger-icon {
    color: var(--danger-color);
}

.btn-danger-icon:hover {
    color: #b91c1c;
}

.btn-info-icon {
    color: var(--info-color);
}

.btn-info-icon:hover {
    color: #0369a1;
}

.action-col {
    text-align: right;
    overflow: visible !important;
    white-space: nowrap !important;
}

/* Delete member info */
.delete-member-info {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.delete-member-info strong {
    font-size: 1rem;
    color: var(--text-color);
}

.delete-member-info span {
    font-size: 0.875rem;
    color: var(--muted-color);
}

/* Restart member info */
.restart-member-info {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.restart-member-info strong {
    font-size: 1rem;
    color: var(--text-color);
}

.restart-member-info span {
    font-size: 0.875rem;
    color: var(--muted-color);
}

/* Restart option in email wizard */
.restart-option {
    margin: 1rem 0;
    padding: 1rem;
    background: #e0f2fe;
    border-radius: var(--radius);
    border: 1px solid #7dd3fc;
}

.option-hint {
    display: block;
    margin-top: 0.375rem;
    margin-left: 1.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.btn-search {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.btn-page {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-page:hover:not(:disabled) {
    background: var(--bg-color);
}

.btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.page-size-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.page-size-selector label {
    margin: 0;
}

.page-size-selector select {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--card-bg);
    font-size: 0.875rem;
    cursor: pointer;
}

.page-size-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 3rem;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.empty-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
}

.empty-state p {
    color: var(--text-muted);
    margin: 0 0 1rem 0;
}

/* ===== Loading ===== */
.loading-spinner {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* ===== Detail Grid ===== */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.detail-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.detail-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
}

.detail-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.detail-item .value {
    font-size: 0.9375rem;
}

.monospace {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.8125rem;
}

.muted {
    color: var(--text-muted);
}

/* ===== Agreements Grid ===== */
.agreements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.agreement-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.agreement-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.agreement-header h3 {
    margin: 0;
    font-size: 1.125rem;
}

.agreement-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.agreement-details {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-bottom: 1rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.detail-row .label {
    color: var(--text-muted);
}

.detail-row .value {
    font-weight: 600;
}

.agreement-actions {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

/* ===== Sync Page ===== */
.sync-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.sync-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.sync-card h3 {
    margin: 0 0 0.5rem 0;
}

.sync-card > p {
    color: var(--text-muted);
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
}

.sync-date-filter {
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: var(--radius);
}

.sync-date-filter label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.sync-date-filter .form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    background: var(--card-bg);
    color: var(--text-color);
}

.sync-date-filter .form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.sync-date-filter .date-hint {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.sync-options {
    margin-bottom: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.sync-actions {
    margin-bottom: 1rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.sync-message {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.sync-message.success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
}

.sync-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* ===== Sync Progress Bar ===== */
.sync-progress-container {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.progress-section {
    margin-bottom: 1.5rem;
}

.progress-section.current-step {
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.progress-title {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9375rem;
}

.progress-percentage {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1rem;
}

.progress-bar-container {
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s ease-out;
}

.progress-bar.overall {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

.progress-bar.step {
    background: linear-gradient(90deg, var(--info-color) 0%, #38bdf8 100%);
}

.progress-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.time-remaining {
    color: var(--warning-color);
    font-weight: 500;
}

.progress-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: var(--radius);
}

.progress-stats .stat {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
}

.progress-stats .stat-label {
    color: var(--text-muted);
}

.progress-stats .stat-value {
    font-weight: 600;
    color: var(--text-color);
}

.progress-stats .stat.created .stat-value {
    color: var(--success-color);
}

.progress-stats .stat.updated .stat-value {
    color: var(--info-color);
}

.progress-stats .stat.skipped .stat-value {
    color: var(--warning-color);
}

.progress-message {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Steps Overview */
.steps-overview {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    flex: 1;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.step-indicator.active {
    background: rgba(14, 165, 233, 0.1);
}

.step-indicator.completed {
    opacity: 0.7;
}

.step-indicator.pending {
    opacity: 0.4;
}

.step-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
}

.step-indicator.active .step-icon {
    border-color: var(--info-color);
    background: rgba(14, 165, 233, 0.1);
}

.step-indicator.completed .step-icon {
    border-color: var(--success-color);
    background: var(--success-color);
    color: white;
}

.step-name {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
}

.step-indicator.active .step-name {
    color: var(--info-color);
    font-weight: 600;
}

.step-indicator.completed .step-name {
    color: var(--success-color);
}

/* Spinner animation */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--info-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .steps-overview {
        flex-wrap: wrap;
    }
    
    .step-indicator {
        min-width: 60px;
    }
    
    .progress-stats {
        gap: 0.5rem;
    }
    
    .progress-stats .stat {
        flex-basis: calc(50% - 0.25rem);
    }
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stats-list.with-limits {
    gap: 1rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-row.with-progress {
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--surface-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.stat-row.with-progress .stat-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-row.with-progress .stat-limit {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-row.with-progress .limit-bar-container {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.stat-row.with-progress .limit-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.stat-row.with-progress .limit-bar.ok {
    background: linear-gradient(90deg, #22c55e, #4ade80);
}

.stat-row.with-progress .limit-bar.warning {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.stat-row.with-progress .limit-bar.danger {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.stat-row.with-progress .limit-bar.exceeded {
    background: linear-gradient(90deg, #991b1b, #dc2626);
    animation: pulse-exceeded 1.5s ease-in-out infinite;
}

@keyframes pulse-exceeded {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.stat-row.with-progress .limit-text {
    font-size: 0.75rem;
    white-space: nowrap;
    min-width: 140px;
    text-align: right;
}

.stat-row.with-progress .limit-text.ok {
    color: #22c55e;
}

.stat-row.with-progress .limit-text.warning {
    color: #f59e0b;
}

.stat-row.with-progress .limit-text.danger {
    color: #ef4444;
    font-weight: 600;
}

.stat-row.with-progress .limit-text.exceeded {
    color: #991b1b;
    font-weight: 700;
}

.stat-row.with-progress .limit-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
    color: #ef4444;
    font-size: 0.8125rem;
}

.stat-row.with-progress .limit-warning.exceeded {
    background: rgba(153, 27, 27, 0.15);
    border: 1px solid rgba(153, 27, 27, 0.3);
    color: #991b1b;
    font-weight: 600;
}

.limit-info {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.limit-info .info-icon {
    flex-shrink: 0;
}

.limit-info code {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

/* ===== Auto-Sync Section ===== */
.auto-sync-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.auto-sync-card,
.notification-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.auto-sync-settings {
    margin-top: 1rem;
}

.setting-row {
    margin-bottom: 1rem;
}

.setting-row label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: var(--text-color);
}

.setting-row .form-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    background: var(--card-bg);
    color: var(--text-color);
}

.setting-row .time-input {
    width: auto;
    min-width: 120px;
}

.interval-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.interval-input {
    width: 80px !important;
    min-width: unset !important;
    text-align: center;
}

.interval-unit {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.email-always-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.setting-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.last-sync-info {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Toggle Switch */
.setting-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .slider {
    background-color: var(--primary-color);
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(24px);
}

.toggle-label {
    font-weight: 500;
}

.status-active {
    color: var(--success-color);
}

.status-inactive {
    color: var(--text-muted);
}

/* Notification Recipients */
.notification-settings {
    margin-top: 1rem;
}

.recipients-section label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.recipients-list {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    min-height: 60px;
}

.recipient-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
}

.recipient-item:last-child {
    margin-bottom: 0;
}

.recipient-email {
    font-size: 0.875rem;
    color: var(--text-color);
}

.btn-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger-color);
}

.no-recipients {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.5rem;
}

.add-recipient {
    display: flex;
    gap: 0.5rem;
}

.add-recipient .form-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.add-recipient .form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.1);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.test-notification {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.test-message {
    font-size: 0.875rem;
}

.test-message.success {
    color: var(--success-color);
}

.test-message.error {
    color: var(--danger-color);
}

/* Database Stats Section - Full Width Horizontal Layout */
.database-stats-section {
    margin-bottom: 2rem;
}

.database-stats-section .stats-card {
    width: 100%;
}

.stats-horizontal-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stats-horizontal-layout .max-pages-config {
    margin-top: 0;
    max-width: 400px;
}

.stats-grid-horizontal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-item-horizontal {
    background: var(--bg-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.stat-item-horizontal:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.stat-item-horizontal .stat-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.stat-item-horizontal .stat-emoji {
    font-size: 1.25rem;
}

.stat-item-horizontal .stat-name {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.stat-item-horizontal .stat-count {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin-left: auto;
}

.stat-item-horizontal .stat-progress {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.stat-item-horizontal .limit-bar-container {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.stat-item-horizontal .limit-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.stat-item-horizontal .limit-bar.ok {
    background: linear-gradient(90deg, #22c55e, #4ade80);
}

.stat-item-horizontal .limit-bar.warning {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.stat-item-horizontal .limit-bar.danger {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.stat-item-horizontal .limit-bar.exceeded {
    background: linear-gradient(90deg, #991b1b, #dc2626);
}

.stat-item-horizontal .limit-text-small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stat-item-horizontal .limit-text-small.warning {
    color: #d97706;
}

.stat-item-horizontal .limit-text-small.danger {
    color: #dc2626;
}

.stat-item-horizontal .limit-text-small.exceeded {
    color: #991b1b;
    font-weight: 600;
}

@media (max-width: 768px) {
    .stats-grid-horizontal {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-grid-horizontal {
        grid-template-columns: 1fr;
    }
}

/* Max Pages Configuration */
.max-pages-config {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-md);
}

.max-pages-config label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.max-pages-input-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.max-pages-input-group input[type="number"] {
    width: 120px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--text-color);
}

.max-pages-input-group input[type="number"]:focus {
    outline: none;
    border-color: var(--link-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.max-pages-hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.card-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row .label {
    color: var(--text-muted);
}

.stat-row .value {
    font-weight: 600;
}

.error-text {
    color: var(--danger-color);
    font-size: 0.8125rem;
}

.no-data {
    color: var(--text-muted);
    font-style: italic;
}

/* ===== Sync Result Summary ===== */
.sync-result-summary {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.sync-result-summary h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: var(--text-color);
}

.sync-result-stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(34, 197, 94, 0.2);
}

.result-stat {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.result-stat.total {
    padding: 0.5rem 1rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.result-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.result-value {
    font-weight: 600;
    font-size: 0.9375rem;
}

.result-value.created {
    color: var(--success-color);
}

.result-value.updated {
    color: var(--info-color);
}

.result-entity-section {
    margin-top: 0.75rem;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.entity-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 500;
}

.entity-header:hover {
    background: #f8fafc;
}

.entity-counts {
    margin-left: auto;
    display: flex;
    gap: 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
}

.count-created {
    color: var(--success-color);
}

.count-updated {
    color: var(--info-color);
}

.toggle-icon {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.entity-items {
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-top: 1px solid var(--border-color);
}

.new-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 0.8125rem;
}

.new-item:last-child {
    border-bottom: none;
}

.item-name {
    font-weight: 500;
    color: var(--text-color);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-amount {
    font-weight: 600;
    color: var(--success-color);
    white-space: nowrap;
}

.item-desc {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
}

.item-date {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
}

.more-items {
    padding: 0.5rem 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-style: italic;
}

/* ===== Settings Page ===== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.settings-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.settings-card.full-width {
    grid-column: 1 / -1;
}

.settings-card h3 {
    margin: 0 0 0.5rem 0;
}

.card-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.card-description code {
    background: var(--bg-color);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.8125rem;
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.setting-item .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.setting-item .warning {
    color: var(--warning-color);
}

/* Provider options */
.provider-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

.radio-label {
    cursor: pointer;
    display: flex;
    align-items: start;
    gap: 0.75rem;
}

.radio-label input[type="radio"] {
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.provider-option {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.radio-label input[type="radio"]:checked + .provider-option {
    border-color: var(--primary-color);
    background: rgba(15, 118, 110, 0.05);
}

.provider-option strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.provider-option p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.help-content {
    font-size: 0.9375rem;
}

.help-content ol {
    padding-left: 1.5rem;
}

.help-content li {
    margin-bottom: 1.5rem;
}

.help-content li strong {
    display: block;
    margin-bottom: 0.5rem;
}

.help-content li p {
    margin: 0.5rem 0;
    color: var(--text-muted);
}

.help-content pre {
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: 0.8125rem;
}

/* ===== Stats Summary ===== */
.stats-summary {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.summary-item {
    display: flex;
    gap: 0.5rem;
}

.summary-item .label {
    color: var(--text-muted);
}

.summary-item .value {
    font-weight: 600;
}

/* ===== Recent Activity ===== */
.recent-activity {
    margin-top: 1.5rem;
}

/* ===== Newsletter Statistics ===== */
.newsletter-stats {
    margin-top: 1.5rem;
}

.newsletter-stats .stat-with-rate {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.newsletter-stats .rate {
    font-size: 0.75rem;
    font-weight: 500;
}

.newsletter-stats .rate.good {
    color: var(--success-color);
}

.newsletter-stats .rate.ok {
    color: var(--warning-color);
}

.newsletter-stats .rate.low {
    color: var(--text-muted);
}

.newsletter-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1rem;
}

.newsletter-summary .summary-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.newsletter-summary .label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.newsletter-summary .value {
    font-weight: 600;
    font-size: 0.9rem;
}

.newsletter-summary .value.good {
    color: var(--success-color);
}

.newsletter-summary .value.ok {
    color: var(--warning-color);
}

.newsletter-summary .value.low {
    color: var(--text-muted);
}

/* ===== Year-over-Year Chart ===== */
.chart-card {
    margin-top: 1.5rem;
}

.chart-container {
    padding: 1rem 0;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1.5rem;
    height: 250px;
    padding: 0 1rem;
}

.bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 80px;
}

.bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 200px;
    justify-content: flex-end;
    width: 100%;
}

.bar {
    width: 100%;
    max-width: 50px;
    background: linear-gradient(180deg, var(--primary-color) 0%, #2563eb 100%);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: height 0.5s ease-out, background 0.3s ease;
    min-height: 4px;
}

.bar:hover {
    background: linear-gradient(180deg, #60a5fa 0%, var(--primary-color) 100%);
}

.bar-value {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.bar-label {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.chart-legend {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.legend-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.legend-value {
    font-weight: 600;
    font-size: 0.875rem;
}

.legend-value.positive {
    color: var(--success-color);
}

.legend-value.negative {
    color: var(--danger-color);
}

.legend-value.highlight {
    color: var(--primary-color);
    font-size: 1rem;
}

/* Donation bar specific styling */
.bar.donation-bar {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
}

.bar.donation-bar:hover {
    background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
}

/* Top donors table styling */
.top-donors .data-table {
    margin-bottom: 0;
}

.top-donors .rank {
    width: 50px;
    text-align: center;
}

.top-donors .medal {
    font-size: 1.25rem;
}

.top-donors .amount {
    font-weight: 600;
    color: var(--success-color);
}

.top-donors .amount.highlight {
    color: var(--primary-color);
}

.top-donors tfoot .total-row {
    background-color: var(--bg-color);
    border-top: 2px solid var(--border-color);
}

.top-donors tfoot .total-row td {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* ===== Validation & Error Styles (Bootstrap overrides) ===== */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--primary-color);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--success-color);
}

.invalid {
    outline: 1px solid var(--danger-color);
}

.validation-message {
    color: var(--danger-color);
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-row {
        grid-template-columns: 1fr;
    }
    
    .toolbar {
        flex-direction: column;
    }
    
    .search-box input {
        min-width: unset;
        width: 100%;
    }
    
    .data-table {
        display: block;
        overflow-x: auto;
    }
}

/* ===== Danger Zone ===== */
.danger-zone {
    border: 2px solid var(--danger-color);
    border-radius: var(--radius-lg);
}

.danger-zone h3 {
    color: var(--danger-color);
}

.danger-zone-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.danger-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #fef2f2;
    border-radius: var(--radius);
    border: 1px solid #fecaca;
}

.danger-info {
    flex: 1;
}

.danger-info strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.danger-info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ===== Modal Dialog ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    backdrop-filter: blur(4px);
}

.modal-dialog {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    overflow: hidden;
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

.modal-header.warning {
    background: #fef3c7;
    border-bottom-color: #fcd34d;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-icon {
    font-size: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    margin: 0 0 1rem 0;
}

.deletion-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem 0;
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 1rem;
}

.deletion-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.deletion-list li:last-child {
    border-bottom: none;
}

.warning-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    padding: 1rem;
    color: var(--danger-color);
    font-size: 0.875rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--bg-color);
    border-color: var(--text-muted);
}

/* ===== Email Reminder Modal ===== */
.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 600px;
    width: 90%;
    overflow: hidden;
    animation: modalSlideIn 0.2s ease-out;
}

.modal-content .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

.modal-content .modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-content .modal-body {
    padding: 1.5rem;
}

.modal-content .modal-body ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.modal-content .modal-body li {
    margin-bottom: 0.5rem;
}

.modal-content .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
}

/* Alert boxes */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-warning {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    color: #92400e;
}

.alert-info {
    background: #e0f2fe;
    border: 1px solid #7dd3fc;
    color: #075985;
}

.alert strong {
    display: block;
    margin-bottom: 0.5rem;
}

.alert pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.75rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    overflow-x: auto;
    margin: 0.75rem 0 0 0;
}

.alert code {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

/* Sending progress */
.sending-progress {
    text-align: center;
    padding: 2rem 1rem;
}

.sending-progress .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.progress-stats {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Email result */
.email-result h3 {
    margin: 0 0 1rem 0;
}

.result-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.result-stats .stat {
    flex: 1;
    text-align: center;
    padding: 1rem;
    border-radius: var(--radius);
}

.result-stats .stat.success {
    background: #d1fae5;
}

.result-stats .stat.danger {
    background: #fee2e2;
}

.result-stats .stat.info {
    background: #dbeafe;
}

.result-stats .stat.warning {
    background: #fef3c7;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.error-list {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.error-list h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
}

.error-list ul {
    margin: 0;
    padding-left: 1.25rem;
}

.error-list li {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

/* Send reminder button in filter notice */
.btn-send-reminder {
    margin-left: auto;
}

.filter-notice {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    background: #e0f2fe;
    border: 1px solid #7dd3fc;
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #075985;
}

/* ===== Email Wizard / Recipient Selection ===== */
.modal-large {
    max-width: 800px !important;
}

.modal-small {
    max-width: 450px !important;
}

.email-wizard {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.wizard-step h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Radio option styling */
.recipient-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.radio-option:hover {
    background: var(--bg-color);
    border-color: var(--primary-light);
}

.radio-option.selected {
    background: #f0fdfa;
    border-color: var(--primary-color);
}

.radio-option input[type="radio"] {
    margin-top: 2px;
    accent-color: var(--primary-color);
}

.radio-label {
    display: flex;
    flex-direction: column;
}

.radio-label strong {
    font-weight: 600;
}

.radio-label small {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* Recipient selector */
.recipient-selector {
    margin-top: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8125rem;
}

.selector-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.8125rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.btn-link:hover {
    background: var(--bg-color);
    text-decoration: none;
}

.recipient-list {
    max-height: 250px;
    overflow-y: auto;
}

.recipient-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.recipient-item:last-child {
    border-bottom: none;
}

.recipient-item:hover {
    background: var(--bg-color);
}

.recipient-item.selected {
    background: #f0fdfa;
}

.recipient-item input[type="checkbox"] {
    accent-color: var(--primary-color);
}

.recipient-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.recipient-info strong {
    font-size: 0.875rem;
    font-weight: 500;
}

.recipient-info small {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.more-notice {
    padding: 0.5rem 0.75rem;
    background: var(--bg-color);
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-style: italic;
}

.loading-small {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
}

/* Email customizer */
.email-customizer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.email-customizer .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.email-customizer .form-group label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-color);
}

.email-customizer .form-control {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.email-customizer .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.1);
}

.template-textarea {
    font-family: 'Consolas', 'Monaco', monospace;
    resize: vertical;
    min-height: 150px;
}

.template-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-color);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
}

.template-hint code {
    background: white;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    font-size: 0.6875rem;
    margin: 0 0.125rem;
}

/* Wizard summary */
.wizard-summary {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    display: flex;
    gap: 2rem;
}

.summary-item {
    display: flex;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.summary-label {
    color: var(--text-muted);
}

.summary-value {
    font-weight: 500;
}

/* ===== Table Checkbox Selection ===== */
.checkbox-col {
    width: 30px !important;
    min-width: 30px;
    max-width: 30px;
    text-align: center;
}

.checkbox-col input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* ===== Members Table Column Widths ===== */
.members-table {
    table-layout: fixed;
}

.members-table .col-name {
    width: 11%;
}

.members-table .col-email {
    width: 13%;
}

.members-table .col-phone {
    width: 7%;
}

.members-table .col-type {
    width: 5%;
}

.members-table .col-membership {
    width: 5%;
}

.members-table .col-status {
    width: 12%;
}

.members-table .col-payment {
    width: 6%;
}

.members-table .col-date {
    width: 7%;
}

.members-table .col-actions {
    width: 120px;
    min-width: 120px;
    overflow: visible;
}

.selected-row {
    background: #f0fdfa !important;
}

.selected-row:hover {
    background: #e6faf5 !important;
}

.filter-notice .btn-secondary {
    margin-left: 0.5rem;
}

/* ===== Email Preview ===== */
.template-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.email-preview {
    margin-top: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: white;
    overflow: hidden;
}

.email-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

.email-preview-header h4 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
}

.btn-close-sm {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.btn-close-sm:hover {
    color: var(--text-color);
}

.email-preview-content {
    padding: 1rem;
}

.email-header-fields {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.email-field {
    display: flex;
    gap: 0.5rem;
    font-size: 0.8125rem;
}

.email-field .field-label {
    font-weight: 600;
    color: var(--text-muted);
    min-width: 50px;
}

.email-field .field-value {
    color: var(--text-color);
    word-break: break-all;
}

.email-divider {
    margin: 0.75rem 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

.email-body-preview {
    background: #fafafa;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.email-body-preview pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-color);
}

/* Inline email preview (members list page) */
.inline-email-preview {
    margin-top: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--primary-color);
    border-radius: var(--radius);
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.inline-email-preview .preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-dark, #0056b3));
    color: white;
}

.inline-email-preview .preview-header h4 {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: white;
}

.inline-email-preview .preview-header .btn-close-sm {
    color: white;
    opacity: 0.8;
}

.inline-email-preview .preview-header .btn-close-sm:hover {
    opacity: 1;
}

.inline-email-preview .preview-content {
    padding: 1rem;
}

.inline-email-preview .email-field {
    display: flex;
    gap: 0.5rem;
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
}

.inline-email-preview .email-field .field-label {
    font-weight: 600;
    color: var(--text-muted);
    min-width: 50px;
}

.inline-email-preview .email-field .field-value {
    color: var(--text-color);
    word-break: break-all;
}

.inline-email-preview .email-body-preview {
    margin-top: 0.75rem;
}

.inline-email-preview .email-body-preview .field-label {
    display: block;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
}

.inline-email-preview .body-content {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    max-height: 250px;
    overflow-y: auto;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-color);
}

.inline-email-preview .preview-note {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.inline-email-preview .no-preview {
    color: var(--text-muted);
    font-style: italic;
}

/* ===== Newsletter Page Styles ===== */

.newsletter-editor-view {
    width: 100%;
    max-width: none;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
}

.editor-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.editor-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .editor-grid {
        grid-template-columns: 1fr;
    }
}

.editor-main .card {
    height: 100%;
}

.editor-toolbar {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    width: 100%;
}

.toolbar-btn {
    display: inline-block !important;
    padding: 0.375rem 0.75rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    color: var(--text-color);
}

.toolbar-btn:hover {
    background: #0d6efd;
    color: white !important;
    border-color: #0d6efd;
}

/* Embedded image delete button */
.btn-delete-image {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-delete-image:hover {
    background: #c82333;
}

.embedded-image-item {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px;
    background: white;
}

/* Resizable images in WYSIWYG editor */
.wysiwyg-editable img.resizable-image {
    cursor: move;
    position: relative;
    max-width: 100%;
    height: auto;
    /* Allow drag for repositioning */
    -webkit-user-select: none;
    user-select: none;
    box-sizing: border-box;
}

.wysiwyg-editable img.resizable-image:hover {
    outline: 2px dashed #3b82f6;
    outline-offset: 2px;
}

.wysiwyg-editable img.resizable-image:active {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Resize handle wrapper */
.image-resize-wrapper {
    display: inline-block;
    position: relative;
}

.image-resize-wrapper .resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    background: #3b82f6;
    cursor: nwse-resize;
    border-radius: 2px 0 0 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.image-resize-wrapper:hover .resize-handle {
    opacity: 1;
}

.image-resize-wrapper .resize-handle::after {
    content: '';
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 8px;
    height: 8px;
    border-right: 2px solid white;
    border-bottom: 2px solid white;
}

.code-editor {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    min-height: 450px;
    max-height: none;
    resize: vertical;
    overflow-y: auto;
}

/* WYSIWYG Split View - Full Width */
.wysiwyg-container-wide {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* WYSIWYG Stacked View - Editors on top of each other */
.wysiwyg-container-stacked {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.wysiwyg-section-full {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.wysiwyg-section-full textarea {
    flex: 1;
    min-height: 300px;
    font-size: 0.8rem;
    width: 100%;
    overflow: auto;
}

.wysiwyg-section-full .wysiwyg-preview-content {
    min-height: 400px;
}

@media (max-width: 1000px) {
    .wysiwyg-container-wide {
        grid-template-columns: 1fr;
    }
}

.wysiwyg-editor-wide {
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevent overflow from breaking grid */
    overflow: hidden;
}

.wysiwyg-editor-wide textarea {
    flex: 1;
    min-height: 500px;
    font-size: 0.8rem;
    width: 100%;
    overflow: auto;
}

.wysiwyg-preview-wide {
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevent overflow from breaking grid */
    overflow: hidden;
}

.wysiwyg-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    display: inline-block;
}

.wysiwyg-preview-content {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: white;
    overflow: visible;
    min-height: 200px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.wysiwyg-preview-content > * {
    max-width: 100%;
}

.wysiwyg-preview-content img {
    max-width: 100%;
    height: auto;
}

/* WYSIWYG Editable Preview */
.wysiwyg-editable {
    min-height: 450px;
    padding: 1rem;
    outline: none;
    cursor: text;
}

.wysiwyg-editable:focus {
    box-shadow: inset 0 0 0 2px var(--primary-light);
}

.wysiwyg-editable:empty::before {
    content: 'Start typing here...';
    color: var(--text-muted);
}

/* Formatting Toolbar */
.formatting-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.5rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    align-items: center;
}

.toolbar-group {
    display: flex;
    gap: 0.125rem;
    align-items: center;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 0.375rem;
}

.format-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.875rem;
}

.format-btn:hover {
    background: var(--card-bg);
    border-color: var(--border-color);
}

.format-btn:active {
    background: var(--border-color);
}

.format-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.format-select {
    height: 32px;
    padding: 0 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    font-size: 0.8125rem;
    cursor: pointer;
}

.format-select:hover {
    border-color: var(--primary-light);
}

.color-picker {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: transparent;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 3px;
}

.color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

.wysiwyg-preview-content.has-toolbar {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* Editor top grid - Subject and Recipients */
.editor-top-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 1.5rem;
    margin-bottom: 0;
    align-items: start;
}

.editor-top-grid > .newsletter-card {
    width: 100%;
    min-width: 0;
}

@media (max-width: 900px) {
    .editor-top-grid {
        grid-template-columns: 1fr;
    }
}

/* Compact variables help */
.variables-help-compact {
    padding: 0.75rem;
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-md);
}

.variables-help-compact summary {
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
}

.variables-help {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-md);
}

.variables-help h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    color: var(--text-color);
}

.variables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.5rem;
}

.variable-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.variable-item:hover {
    border-color: var(--link-color);
    background: rgba(59, 130, 246, 0.05);
}

.variable-item code {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.variable-item span {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.recipient-summary {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: var(--radius-md);
}

.recipient-stat {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
}

.recipient-stat.warning {
    background: rgba(245, 158, 11, 0.1);
}

.recipient-stat .stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.recipient-stat .stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.selected-recipients {
    padding: 1rem;
    background: rgba(34, 197, 94, 0.1);
    border-radius: var(--radius-md);
}

.selected-recipients h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    color: #22c55e;
}

/* Selected group info */
.selected-group-info {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.group-name-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.group-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 500;
}

.group-members-list {
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius);
    max-height: 250px;
    overflow-y: auto;
}

.group-member-item {
    display: flex;
    flex-direction: column;
    padding: 0.375rem 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.8125rem;
}

.group-member-item:last-child {
    border-bottom: none;
}

.group-member-item .member-name {
    font-weight: 500;
    color: var(--text-color);
}

.group-member-item .member-email {
    font-size: 0.75rem;
}

.more-members {
    padding: 0.5rem;
    font-size: 0.8125rem;
    font-style: italic;
    text-align: center;
}

.recipient-list {
    max-height: 200px;
    overflow-y: auto;
}

.recipient-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.recipient-item:last-child {
    border-bottom: none;
}

.recipient-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.recipient-name {
    font-weight: 500;
}

.recipient-email {
    font-size: 0.8125rem;
}

.recipient-source {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    background: var(--bg-color);
    border-radius: var(--radius);
}

.recipients-list-modal {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.5rem;
}

.more-recipients {
    font-style: italic;
    font-size: 0.875rem;
}

/* Large modal variant */
.modal-lg {
    max-width: 700px;
}

.modal-dialog.modal-lg {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 700px;
    width: 90%;
    z-index: 10001;
}

/* Newsletter status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-draft {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.status-scheduled {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.status-sending {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.status-sent {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.status-partial {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.status-failed {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.newsletter-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
}

.newsletter-link:hover {
    color: var(--link-color);
}

/* Preview frame */
.preview-frame {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.preview-header {
    padding: 1rem;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

.preview-content {
    padding: 1rem;
    background: white;
    min-height: 400px;
}

/* Modal overlay for sending */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    margin: 0 0 1.5rem 0;
}

.progress-container {
    margin: 1.5rem 0;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.progress-current {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Toast messages */
.toast-message {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    background: var(--card-bg);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1001;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-message.success {
    border-left: 4px solid #22c55e;
}

.toast-message.error {
    border-left: 4px solid #ef4444;
}

.toast-message.warning {
    border-left: 4px solid #f59e0b;
}

.toast-message.info {
    border-left: 4px solid #3b82f6;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    margin-top: 2rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Form inline */
.form-inline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ml-2 {
    margin-left: 0.5rem;
}

/* Button block */
.btn-block {
    width: 100%;
}

/* Button success */
.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-success:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Button icon */
.btn-icon {
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-icon:hover {
    opacity: 1;
}

.actions-cell {
    white-space: nowrap;
}

.actions-fixed {
    display: inline-flex;
    gap: 0.35rem;
    justify-content: flex-end;
    align-items: center;
}

.action-slot {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Groups grid */
.groups-grid {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 1.5rem;
}

@media (max-width: 992px) {
    .groups-grid {
        grid-template-columns: 1fr;
    }
}

.selected-row {
    background-color: #f0fdf4 !important;
}

/* Group badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
}

.badge-mandatory {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.badge-normal {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #7dd3fc;
}

.badge-composite {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.badge-system {
    background-color: #f3e8ff;
    color: #7c3aed;
    border: 1px solid #c4b5fd;
}

.all-members-row {
    background-color: #faf5ff;
}

/* Info icon for description tooltip */
.info-icon {
    margin-left: 0.35rem;
    cursor: help;
    opacity: 0.6;
    font-size: 0.85em;
}

.info-icon:hover {
    opacity: 1;
}

/* Groups table - better formatting */
.groups-grid .data-table {
    width: 100%;
}

.groups-grid .data-table th,
.groups-grid .data-table td {
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
}

.groups-grid .data-table th:nth-child(3),
.groups-grid .data-table td:nth-child(3) {
    white-space: normal;
    word-wrap: break-word;
    max-width: 250px;
}

/* Group form styles */
.group-form .form-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.group-settings-form .form-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.group-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.group-edit-header h3 {
    margin: 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
}

.form-label {
    font-weight: 500;
    color: var(--text-color);
    min-width: 120px;
}

/* Included groups section */
.included-groups-section {
    background-color: #f8fafc;
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.included-groups-section h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.compact-table {
    font-size: 0.9rem;
}

.compact-table td,
.compact-table th {
    padding: 0.5rem 0.75rem;
}

.help-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-info {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #7dd3fc;
}

/* Mt utilities */
.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

/* Modal Dialog */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.15s ease-out;
    pointer-events: auto;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-dialog {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 450px;
    margin: 1rem;
    animation: slideIn 0.2s ease-out;
    position: relative;
    z-index: 10000;
    pointer-events: auto;
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.15s;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 1.25rem;
    background: white;
}

.modal-body .form-group {
    margin-bottom: 0;
}

.modal-body .form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-color);
}

.modal-body .form-control {
    width: 100%;
    pointer-events: auto;
    position: relative;
    z-index: 10001;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.modal-footer button {
    pointer-events: auto;
    position: relative;
    z-index: 10001;
}
/* Newsletter Template Settings Layout */
.settings-layout {
    max-width: 100%;
}

.settings-layout .card {
    margin-bottom: 0;
}

.settings-layout .card-description {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.settings-layout .variables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.settings-layout .variable-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.2s;
}

.settings-layout .variable-item:hover {
    background: var(--primary-light);
    color: white;
}

.settings-layout .variable-item:hover code {
    background: rgba(255,255,255,0.2);
    color: white;
}

.settings-layout .variable-item code {
    font-size: 0.75rem;
    background: var(--border-color);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: monospace;
}

.settings-layout .variable-item span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.settings-layout .variable-item:hover span {
    color: rgba(255,255,255,0.9);
}

/* Sync Details Modal */
.sync-details-modal {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 800px;
    max-height: 80vh;
    margin: 1rem;
    animation: slideIn 0.2s ease-out;
    position: relative;
    z-index: 10000;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
}

.sync-details-modal .modal-body {
    overflow-y: auto;
    flex: 1;
}

.sync-details-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    background: var(--bg-color);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.detail-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 500;
}

.detail-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.sync-details-list h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.data-table.compact {
    font-size: 0.875rem;
}

.data-table.compact th,
.data-table.compact td {
    padding: 0.5rem 0.75rem;
}

.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    color: var(--text-muted);
}

/* Button Link Style */
.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    text-decoration: none;
    transition: color 0.2s;
}

.btn-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Close button for modals */
.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.15s;
}

.btn-close:hover {
    color: var(--text-color);
}

/* Text utilities */
.text-muted {
    color: var(--text-muted);
}

.text-muted.small {
    font-size: 0.75rem;
}

/* Count styles in table */
.data-table .count-created {
    color: var(--success-color);
    font-weight: 500;
    margin-right: 0.5rem;
}

.data-table .count-updated {
    color: var(--primary-color);
    font-weight: 500;
}

/* Sync result items section header */
.items-section-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0.75rem 0 0.5rem 0;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-color);
}

.items-section-header:first-child {
    margin-top: 0;
}

/* Updated item styling */
.updated-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    background: var(--bg-color);
    border-radius: var(--radius);
    margin-bottom: 0.25rem;
    border-left: 3px solid var(--primary-color);
}

.updated-item .item-name {
    font-weight: 500;
    color: var(--text-color);
}

.updated-item .item-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.updated-item .item-amount {
    font-weight: 600;
    color: var(--primary-color);
}

/* ===== MobilePay Styles ===== */
.mobilepay-btn {
    background: #5a78ff;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.mobilepay-btn:hover {
    background: #4361ee;
    transform: scale(1.05);
}

.btn-mobilepay {
    background: linear-gradient(135deg, #5a78ff, #4361ee);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-mobilepay:hover {
    background: linear-gradient(135deg, #4361ee, #3651d4);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.mobilepay-modal {
    max-width: 500px;
    width: 90%;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.2s ease-out;
}

.mobilepay-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #5a78ff, #4361ee);
    color: white;
    border-bottom: none;
}

.mobilepay-modal .modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.mobilepay-modal .modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    transition: background 0.2s;
}

.mobilepay-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.mobilepay-modal .modal-body {
    padding: 1.5rem;
}

.payment-info {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.payment-info .info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.payment-info .info-row:last-child {
    border-bottom: none;
}

.payment-info .info-row.error {
    color: var(--danger-color);
}

.payment-info .label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.payment-info .value {
    font-weight: 500;
}

.payment-info .value.amount {
    font-size: 1.25rem;
    color: var(--primary-color);
    font-weight: 600;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.loading-spinner {
    text-align: center;
    padding: 2rem;
}

.loading-spinner .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: #5a78ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.success-message, .error-message {
    text-align: center;
    padding: 1rem;
}

.success-icon, .error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.success-message .success-icon {
    color: var(--success-color);
}

.error-message .error-icon {
    color: var(--danger-color);
}

.error-detail {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.payment-link-box {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 1rem;
    margin: 1rem 0;
    text-align: left;
}

.payment-link-box label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.link-container {
    display: flex;
    gap: 0.5rem;
}

.link-input {
    flex: 1;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
    background: var(--card-bg);
}

.btn-copy {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.email-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.email-section p {
    margin-bottom: 1rem;
}

/* QR Code section */
.qr-code-section {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
}

.qr-code-section label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.qr-code-container {
    background: white;
    border-radius: var(--radius);
    padding: 1rem;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.qr-code-image {
    width: 180px;
    height: 180px;
    display: block;
}

.qr-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

/* Email recipient override */
.email-recipient {
    margin-bottom: 1rem;
}

.email-recipient label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.email-input {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
    background: var(--card-bg);
}

.email-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(90, 120, 255, 0.1);
}

.email-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.email-options {
    margin-bottom: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.actions-cell {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ===== Refund Styles ===== */
.refund-btn {
    background: var(--warning-color);
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.refund-btn:hover {
    background: #c9a227;
    transform: scale(1.05);
}

.refund-modal {
    max-width: 480px;
    width: 90%;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.2s ease-out;
}

.refund-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #e6a700, #d4950c);
    color: white;
    border-bottom: none;
}

.refund-modal .modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.refund-modal .modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    transition: background 0.2s;
}

.refund-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.refund-modal .modal-body {
    padding: 1.5rem;
}

.refund-amount-section {
    margin: 1.5rem 0;
}

.refund-amount-section label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.amount-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.amount-input {
    flex: 1;
    padding: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    text-align: right;
    max-width: 150px;
}

.amount-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.amount-input-group .currency {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-muted);
}

.amount-shortcuts {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-small:hover {
    background: var(--border-color);
}

.warning-box {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(230, 167, 0, 0.1);
    border: 1px solid rgba(230, 167, 0, 0.3);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.warning-box .warning-icon {
    font-size: 1.25rem;
}

.warning-box strong {
    color: #c9a227;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.payment-info .value.warning {
    color: var(--warning-color);
}

/* ===== Payment History Replacement Styles ===== */
.replaced-payment {
    background-color: #f8f9fa;
    opacity: 0.75;
}

.replaced-payment td {
    color: var(--text-muted);
}

.status-badge.strikethrough {
    text-decoration: line-through;
    opacity: 0.7;
}

.payment-note {
    font-size: 0.85rem;
}

.replacement-info {
    color: var(--success-color);
    font-weight: 500;
}

.replaced-info {
    color: var(--text-muted);
    font-style: italic;
}

/* Blazored Toast - ensure it's above everything */
.blazored-toast-container {
    z-index: 99999 !important;
}

/* ===== Audit Log Styles ===== */
.audit-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.stat-card.warning {
    border-left: 4px solid var(--warning-color);
}

.stat-card.danger {
    border-left: 4px solid var(--danger-color);
}

.stat-icon {
    font-size: 2rem;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.suspicious-alert {
    background: rgba(217, 119, 6, 0.1);
    border: 1px solid var(--warning-color);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.suspicious-alert ul {
    margin: 0.5rem 0 0 1.5rem;
    padding: 0;
}

.suspicious-alert li {
    margin: 0.25rem 0;
}

.suspicious-alert code {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
}

.audit-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.audit-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.audit-filters .filter-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

.audit-filters .filter-group input,
.audit-filters .filter-group select {
    min-width: 180px;
}

.audit-filters .filter-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.audit-table-container {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.audit-table {
    width: 100%;
}

.audit-table .timestamp-cell {
    white-space: nowrap;
}

.audit-table .timestamp-cell .date {
    display: block;
    font-weight: 500;
}

.audit-table .timestamp-cell .time {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.audit-table .failed-row {
    background-color: rgba(220, 38, 38, 0.05);
}

.event-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.event-badge.event-success {
    background: rgba(5, 150, 105, 0.15);
    color: var(--success-color);
}

.event-badge.event-danger {
    background: rgba(220, 38, 38, 0.15);
    color: var(--danger-color);
}

.event-badge.event-warning {
    background: rgba(217, 119, 6, 0.15);
    color: var(--warning-color);
}

.event-badge.event-info {
    background: rgba(2, 132, 199, 0.15);
    color: var(--info-color);
}

.event-badge.event-default {
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-muted);
}

.ip-address {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    background: var(--bg-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.user-id {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 0.25rem;
}

.status-success {
    color: var(--success-color);
    font-weight: 500;
}

.status-failed {
    color: var(--danger-color);
    font-weight: 500;
}

.details-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.details-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.btn-icon.small {
    padding: 0.25rem;
    font-size: 0.75rem;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-pagination {
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-pagination:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-pagination:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-number {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.user-agent-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-agent-info .info-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-agent-info .info-row strong {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.user-agent-text {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8rem;
    word-break: break-all;
    background: var(--bg-color);
    padding: 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.modal-dialog.small {
    max-width: 500px;
}

/* Opt-out section styling */
.opt-out-section {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    padding: 1rem;
}

.opt-out-section h4 {
    margin-bottom: 0.75rem;
    color: #991b1b;
}

.opt-out-category {
    background-color: white;
    border-radius: var(--radius);
    padding: 0.75rem;
    border: 1px solid #fecaca;
}

.opt-out-category h5 {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: #b91c1c;
}

.opt-out-info {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
}

.info-box {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    padding: 0.75rem;
    color: #1e40af;
}

.info-box strong {
    display: block;
    margin-bottom: 0.25rem;
}