/* ============================================================
   Family Heritage — Phase 11 & 12 Styles
   Search, Notifications, Statistics, Dark Mode, Backup, Health
   ============================================================ */

/* ---- Search Overlay ---- */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 10vh;
    animation: searchOverlayIn 0.15s ease;
}

@keyframes searchOverlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.search-modal {
    background: var(--bg-card, #fff);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 640px;
    max-height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: searchModalIn 0.2s ease;
}

@keyframes searchModalIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.search-input-wrapper {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border, #E5DDD5);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-input-wrapper input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.1rem;
    background: transparent;
    color: var(--text, #2C2C2C);
    font-family: var(--font-body, sans-serif);
}

.search-input-wrapper input::placeholder {
    color: var(--text-muted, #999);
}

.search-input-wrapper .search-icon {
    color: var(--text-muted, #999);
    flex-shrink: 0;
}

.search-shortcut {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border: 1px solid var(--border, #E5DDD5);
    border-radius: 4px;
    color: var(--text-muted, #999);
    font-family: monospace;
    flex-shrink: 0;
}

.search-voice-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--text-muted, #999);
    transition: color 0.2s;
    flex-shrink: 0;
}

.search-voice-btn:hover {
    color: var(--primary, #5B4A3F);
}

.search-voice-btn.listening {
    color: var(--danger, #A94442);
    animation: voicePulse 1s infinite;
}

@keyframes voicePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.search-results {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.search-filters {
    display: flex;
    gap: 0.4rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border, #E5DDD5);
    flex-wrap: wrap;
}

.search-filter-pill {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.78rem;
    border: 1px solid var(--border, #E5DDD5);
    background: transparent;
    color: var(--text-light, #666);
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-body, sans-serif);
}

.search-filter-pill:hover {
    border-color: var(--accent, #C19A6B);
    color: var(--primary, #5B4A3F);
}

.search-filter-pill.active {
    background: var(--accent, #C19A6B);
    border-color: var(--accent, #C19A6B);
    color: #fff;
}

.search-category {
    padding: 0.5rem 1.25rem;
}

.search-category-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-light, #666);
    margin-bottom: 0.5rem;
    letter-spacing: 0.03em;
}

.search-category-showall {
    font-size: 0.75rem;
    color: var(--accent, #C19A6B);
    cursor: pointer;
    float: right;
    font-weight: 500;
}

.search-category-showall:hover {
    text-decoration: underline;
}

.search-result {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    color: inherit;
}

.search-result:hover,
.search-result.focused {
    background: var(--bg, #FAF8F5);
}

.search-result-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg, #FAF8F5);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary, #5B4A3F);
    font-size: 0.9rem;
}

.search-result-icon img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-desc {
    font-size: 0.8rem;
    color: var(--text-light, #666);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-light, #666);
}

.search-empty svg {
    display: block;
    margin: 0 auto 0.75rem;
    color: var(--text-muted, #999);
}

.search-history {
    padding: 0.5rem 1.25rem;
}

.search-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.search-history-title {
    font-size: 0.75rem;
    color: var(--text-muted, #999);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.search-history-clear {
    font-size: 0.7rem;
    color: var(--text-muted, #999);
    cursor: pointer;
    background: none;
    border: none;
    font-family: var(--font-body, sans-serif);
}

.search-history-clear:hover {
    color: var(--danger, #A94442);
}

.search-history-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--text-light, #666);
    transition: color 0.15s;
}

.search-history-item:hover {
    color: var(--primary, #5B4A3F);
}

.search-history-item svg {
    flex-shrink: 0;
    opacity: 0.5;
}

/* Search page */
.search-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.search-page-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border, #E5DDD5);
    border-radius: 12px;
    background: var(--bg-card, #fff);
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.search-page-input-wrapper:focus-within {
    border-color: var(--accent, #C19A6B);
}

.search-page-input-wrapper input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.1rem;
    background: transparent;
    color: var(--text, #2C2C2C);
    font-family: var(--font-body, sans-serif);
}

.search-page-results {
    margin-top: 1rem;
}

/* Nav search trigger */
.nav-search-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border, #E5DDD5);
    border-radius: 8px;
    background: var(--bg, #FAF8F5);
    cursor: pointer;
    color: var(--text-muted, #999);
    font-size: 0.8rem;
    transition: all 0.15s;
    white-space: nowrap;
}

.nav-search-trigger:hover {
    border-color: var(--accent, #C19A6B);
    color: var(--text-light, #666);
}

/* ---- Notifications ---- */
.notification-bell {
    position: relative;
    cursor: pointer;
    padding: 0.4rem;
    background: none;
    border: none;
    color: var(--text, #2C2C2C);
    display: flex;
    align-items: center;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger, #A94442);
    color: white;
    font-size: 0.6rem;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    line-height: 1;
}

.notification-panel {
    position: absolute;
    top: 100%;
    right: 0;
    width: 360px;
    max-height: 480px;
    background: var(--bg-card, #fff);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    overflow: hidden;
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.notification-panel-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border, #E5DDD5);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-panel-header h3 {
    font-size: 0.95rem;
    font-family: var(--font-heading, Georgia, serif);
    color: var(--primary, #5B4A3F);
    margin: 0;
}

.notification-mark-all {
    font-size: 0.75rem;
    color: var(--accent, #C19A6B);
    cursor: pointer;
    background: none;
    border: none;
    font-family: var(--font-body, sans-serif);
}

.notification-mark-all:hover {
    text-decoration: underline;
}

.notification-panel-list {
    max-height: 400px;
    overflow-y: auto;
    flex: 1;
}

.notification-group-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted, #999);
    padding: 0.5rem 1rem 0.25rem;
    letter-spacing: 0.03em;
}

.notification-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border, #E5DDD5);
    cursor: pointer;
    transition: background 0.15s;
}

.notification-item:hover {
    background: var(--bg, #FAF8F5);
}

.notification-item.unread {
    background: rgba(193, 154, 107, 0.06);
}

.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.notification-icon.birthday { background: #E3F0FF; color: #3B7DD8; }
.notification-icon.event { background: rgba(193, 154, 107, 0.15); color: var(--accent, #C19A6B); }
.notification-icon.social { background: #E8F5E9; color: var(--success, #4A7C59); }
.notification-icon.system { background: var(--bg, #FAF8F5); color: var(--text-light, #666); }
.notification-icon.badge-earned { background: #FFF3E0; color: #E6A817; }

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 500;
    font-size: 0.85rem;
}

.notification-message {
    font-size: 0.8rem;
    color: var(--text-light, #666);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-time {
    font-size: 0.7rem;
    color: var(--text-muted, #999);
    margin-top: 0.15rem;
}

.notification-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent, #C19A6B);
    flex-shrink: 0;
    align-self: center;
}

.notification-panel-footer {
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border, #E5DDD5);
    text-align: center;
}

.notification-panel-footer a {
    font-size: 0.8rem;
    color: var(--accent, #C19A6B);
    text-decoration: none;
    font-weight: 500;
}

.notification-panel-footer a:hover {
    text-decoration: underline;
}

/* Full notification page */
.notifications-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.notifications-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.notifications-filter-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.notifications-filter-tab {
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.82rem;
    border: 1px solid var(--border, #E5DDD5);
    background: transparent;
    color: var(--text-light, #666);
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-body, sans-serif);
}

.notifications-filter-tab:hover {
    border-color: var(--accent, #C19A6B);
}

.notifications-filter-tab.active {
    background: var(--accent, #C19A6B);
    border-color: var(--accent, #C19A6B);
    color: #fff;
}

.notification-full-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border, #E5DDD5);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    background: var(--bg-card, #fff);
    cursor: pointer;
    transition: all 0.15s;
}

.notification-full-item:hover {
    box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,0.08));
}

.notification-full-item.unread {
    border-left: 3px solid var(--accent, #C19A6B);
    background: rgba(193, 154, 107, 0.03);
}

.notification-full-content {
    flex: 1;
}

.notification-full-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.notification-full-message {
    font-size: 0.85rem;
    color: var(--text-light, #666);
}

.notification-full-time {
    font-size: 0.75rem;
    color: var(--text-muted, #999);
    margin-top: 0.35rem;
}

.notification-actions {
    display: flex;
    gap: 0.5rem;
}

/* ---- Statistics ---- */
.stats-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.stats-page .page-header {
    margin-bottom: 2rem;
}

.stats-summary-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stats-summary-card {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #E5DDD5);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
}

.stats-summary-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary, #5B4A3F);
    font-family: var(--font-heading, Georgia, serif);
}

.stats-summary-label {
    font-size: 0.8rem;
    color: var(--text-light, #666);
    margin-top: 0.25rem;
}

.stats-chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.stats-chart-card {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #E5DDD5);
    border-radius: 12px;
    padding: 1.25rem;
}

.stats-chart-title {
    font-family: Georgia, serif;
    font-size: 1rem;
    color: var(--primary, #5B4A3F);
    margin-bottom: 1rem;
}

.stats-chart-container {
    position: relative;
}

.stats-chart-container svg {
    width: 100%;
    display: block;
}

/* SVG chart styles */
.chart-bar {
    fill: var(--accent, #C19A6B);
    transition: fill 0.2s;
}

.chart-bar:hover {
    fill: var(--primary, #5B4A3F);
}

.chart-label {
    font-size: 11px;
    fill: var(--text-light, #666);
    font-family: var(--font-body, sans-serif);
}

.chart-value {
    font-size: 10px;
    fill: var(--text, #2C2C2C);
    font-weight: 600;
    font-family: var(--font-body, sans-serif);
}

.chart-line {
    fill: none;
    stroke: var(--accent, #C19A6B);
    stroke-width: 2;
}

.chart-dot {
    fill: var(--accent, #C19A6B);
}

.chart-axis {
    stroke: var(--border, #E5DDD5);
}

.chart-grid-line {
    stroke: var(--border, #E5DDD5);
    stroke-dasharray: 2 4;
    stroke-width: 0.5;
}

.stats-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stats-list-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border, #E5DDD5);
    font-size: 0.9rem;
}

.stats-list-item:last-child {
    border-bottom: none;
}

.stats-list-rank {
    color: var(--text-muted, #999);
    font-size: 0.8rem;
    min-width: 1.5rem;
}

.stats-list-name {
    flex: 1;
    color: var(--text, #2C2C2C);
}

.stats-list-value {
    font-weight: 600;
    color: var(--primary, #5B4A3F);
}

.stats-chart-card.full-width {
    grid-column: 1 / -1;
}

.stats-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted, #999);
    border: 1px solid var(--border, #E5DDD5);
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s;
    float: right;
    font-family: var(--font-body, sans-serif);
}

.stats-export-btn:hover {
    border-color: var(--accent, #C19A6B);
    color: var(--primary, #5B4A3F);
}

/* ---- Dark Mode ---- */
.dark-mode-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    color: var(--text, #2C2C2C);
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.dark-mode-toggle:hover {
    color: var(--accent, #C19A6B);
}

.dark-mode-label {
    font-size: 0.7rem;
    color: var(--text-muted, #999);
    margin-left: 0.25rem;
}

[data-theme="dark"] {
    --primary: #C19A6B;
    --primary-light: #D4B896;
    --primary-dark: #8B7355;
    --accent: #E0B87A;
    --accent-light: #7A6548;
    --bg: #1A1A1A;
    --bg-card: #252525;
    --bg-input: #2A2A2A;
    --text: #E0E0E0;
    --text-light: #AAAAAA;
    --text-muted: #777777;
    --border: #3A3A3A;
    --border-focus: #C19A6B;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.35);
    --success: #5FA36E;
    --success-light: #1E3A25;
    --danger: #D06060;
    --danger-light: #3A1E1E;
    --info: #5A9AE8;
    --info-light: #1E2A3A;
    --tree-male: #1A2D3D;
    --tree-male-border: #4A8BC2;
    --tree-female: #3D1A2D;
    --tree-female-border: #C2638D;
    --tree-other: #2A2A2A;
    --tree-other-border: #777777;
    --tree-link: #D4B896;
    --tree-spouse-link: #C19A6B;
}

[data-theme="dark"] body {
    background: var(--bg);
    color: var(--text);
}

[data-theme="dark"] .nav-bar {
    background: #252525;
    border-bottom-color: #3A3A3A;
}

[data-theme="dark"] .nav-brand {
    color: var(--accent);
}

[data-theme="dark"] .nav-link {
    color: var(--text-light);
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
    color: var(--accent);
}

[data-theme="dark"] .auth-wrapper {
    background: linear-gradient(135deg, #1A1A1A 0%, #252525 100%);
}

[data-theme="dark"] .tree-container {
    background: linear-gradient(135deg, #1A1A1A 0%, #222 100%);
}

[data-theme="dark"] .btn-secondary {
    background: #333;
    border-color: #444;
    color: var(--text);
}

[data-theme="dark"] .btn-secondary:hover {
    background: #3A3A3A;
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea {
    background: var(--bg-input);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .card,
[data-theme="dark"] .person-card,
[data-theme="dark"] .story-card,
[data-theme="dark"] .photo-card {
    background: var(--bg-card);
    border-color: var(--border);
}

[data-theme="dark"] img {
    opacity: 0.9;
}

[data-theme="dark"] .calendar-grid {
    background: #3A3A3A;
}

[data-theme="dark"] .page-container {
    color: var(--text);
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3 {
    color: var(--accent);
}

[data-theme="dark"] .search-overlay {
    background: rgba(0,0,0,0.7);
}

[data-theme="dark"] .notification-item.unread {
    background: rgba(224, 184, 122, 0.08);
}

[data-theme="dark"] .notification-icon.birthday { background: #1E2A3A; }
[data-theme="dark"] .notification-icon.event { background: #3A2D1E; }
[data-theme="dark"] .notification-icon.social { background: #1E3A25; }
[data-theme="dark"] .notification-icon.system { background: #2A2A2A; }

/* Print: always light */
@media print {
    [data-theme="dark"] {
        --primary: #5B4A3F;
        --bg: #FAF8F5;
        --bg-card: #fff;
        --text: #2C2C2C;
        --text-light: #6B6B6B;
        --border: #E5DDD5;
    }
}

/* ---- Backup & Health ---- */
.backup-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.backup-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.backup-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.backup-info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.backup-info-card {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #E5DDD5);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.backup-info-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary, #5B4A3F);
    font-family: var(--font-heading, Georgia, serif);
}

.backup-info-label {
    font-size: 0.8rem;
    color: var(--text-light, #666);
    margin-top: 0.25rem;
}

.backup-table-wrapper {
    overflow-x: auto;
}

.backup-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card, #fff);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border, #E5DDD5);
}

.backup-table th,
.backup-table td {
    padding: 0.65rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border, #E5DDD5);
    font-size: 0.9rem;
}

.backup-table th {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-light, #666);
    background: var(--bg, #FAF8F5);
    letter-spacing: 0.03em;
}

.backup-table tr:last-child td {
    border-bottom: none;
}

.backup-status {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.backup-status.success { background: #E8F5E9; color: #4A7C59; }
.backup-status.failed { background: #FDECEC; color: #A94442; }
.backup-status.verified { background: #E3F0FF; color: #3B7DD8; }
.backup-status.in-progress { background: #FFF3E0; color: #E6A817; }

/* Health checks */
.health-section {
    margin-top: 2.5rem;
}

.health-section-title {
    font-family: Georgia, serif;
    font-size: 1.25rem;
    color: var(--primary, #5B4A3F);
    margin-bottom: 1rem;
}

.health-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.health-last-run {
    font-size: 0.8rem;
    color: var(--text-muted, #999);
}

.health-checks {
    display: grid;
    gap: 1rem;
}

.health-check-card {
    border: 1px solid var(--border, #E5DDD5);
    border-radius: 8px;
    padding: 1rem;
    background: var(--bg-card, #fff);
    transition: box-shadow 0.2s;
}

.health-check-card:hover {
    box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,0.08));
}

.health-check-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.health-check-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.health-check-status.pass { background: #4A7C59; }
.health-check-status.warning { background: #E6A817; }
.health-check-status.error { background: #A94442; }
.health-check-status.running {
    background: var(--accent, #C19A6B);
    animation: healthPulse 1s infinite;
}

@keyframes healthPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.health-check-name {
    font-weight: 600;
    font-size: 0.95rem;
    flex: 1;
}

.health-check-count {
    font-size: 0.8rem;
    color: var(--text-light, #666);
    margin-left: auto;
}

.health-check-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted, #999);
    padding: 0.25rem;
    transition: transform 0.2s;
}

.health-check-toggle.expanded {
    transform: rotate(180deg);
}

.health-check-desc {
    font-size: 0.82rem;
    color: var(--text-light, #666);
    margin-top: 0.25rem;
    margin-left: 1.5rem;
}

.health-check-issues {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border, #E5DDD5);
    max-height: 250px;
    overflow-y: auto;
    display: none;
}

.health-check-issues.visible {
    display: block;
}

.health-check-issue {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.35rem 0;
    font-size: 0.85rem;
    color: var(--text-light, #666);
}

.health-check-issue-icon {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.health-check-issue-icon.warning { color: #E6A817; }
.health-check-issue-icon.error { color: #A94442; }

.health-check-fix-btn {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--accent, #C19A6B);
    background: transparent;
    color: var(--accent, #C19A6B);
    cursor: pointer;
    margin-left: auto;
    flex-shrink: 0;
    font-family: var(--font-body, sans-serif);
}

.health-check-fix-btn:hover {
    background: var(--accent, #C19A6B);
    color: #fff;
}

.health-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.health-summary-card {
    text-align: center;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border, #E5DDD5);
    background: var(--bg-card, #fff);
}

.health-summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-heading, Georgia, serif);
}

.health-summary-value.pass { color: #4A7C59; }
.health-summary-value.warning { color: #E6A817; }
.health-summary-value.error { color: #A94442; }

.health-summary-label {
    font-size: 0.75rem;
    color: var(--text-light, #666);
}

/* Import backup modal */
.import-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.import-modal {
    background: var(--bg-card, #fff);
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.import-modal h3 {
    font-family: Georgia, serif;
    color: var(--primary, #5B4A3F);
    margin-bottom: 1rem;
}

.import-dropzone {
    border: 2px dashed var(--border, #E5DDD5);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
    margin-bottom: 1rem;
}

.import-dropzone:hover,
.import-dropzone.dragover {
    border-color: var(--accent, #C19A6B);
}

.import-dropzone svg {
    color: var(--text-muted, #999);
    margin-bottom: 0.5rem;
}

.import-progress {
    margin-top: 1rem;
}

.import-progress-bar {
    height: 6px;
    background: var(--border, #E5DDD5);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.import-progress-fill {
    height: 100%;
    background: var(--accent, #C19A6B);
    border-radius: 3px;
    transition: width 0.3s;
}

.import-progress-text {
    font-size: 0.8rem;
    color: var(--text-light, #666);
    text-align: center;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .search-modal {
        max-width: 100%;
        margin: 0 1rem;
        max-height: 80vh;
    }

    .notification-panel {
        width: 100vw;
        position: fixed;
        top: var(--nav-height, 60px);
        right: 0;
        border-radius: 0 0 8px 8px;
    }

    .stats-chart-grid {
        grid-template-columns: 1fr;
    }

    .stats-summary-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .backup-actions {
        flex-direction: column;
    }

    .search-shortcut {
        display: none;
    }

    .nav-search-trigger span {
        display: none;
    }
}
