/**
 * Protected Pages - Unified, Clean, Modern Design System
 * Single source of truth for all protected page styling
 */

/* ============================================
   ROOT VARIABLES & THEMING
   ============================================ */

:root {
    /* Color System */
    --primary-green: #006400;
    --secondary-green: #16601a;
    --accent-green: #28a745;
    --dark-bg: #0f1419;
    --darker-bg: #1a1f2e;
    --card-bg: #ffffff;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --hover-bg: #f3f4f6;
    
    /* Layout */
    --sidebar-width: 260px;
    --header-height: 64px;
    --content-max-width: 1400px;
    --spacing-unit: 1rem;
    
    /* Transitions */
    --transition-speed: 0.3s;
    --transition-ease: cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* Dark mode adjustments */
[data-theme="dark"] {
    --card-bg: #1e293b;
    --text-dark: #f1f5f9;
    --text-light: #94a3b8;
    --border-color: #334155;
    --hover-bg: #334155;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */

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

body.protected-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f8fafc;
    color: var(--text-dark);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
    margin: 0;
}

[data-theme="dark"] body.protected-page {
    background: #0f172a;
}

/* ============================================
   SIDEBAR NAVIGATION
   ============================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--darker-bg) 0%, var(--dark-bg) 100%);
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    transition: transform var(--transition-speed) var(--transition-ease);
}

/* Sidebar Header */
.sidebar-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
}

.sidebar-logo img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

/* User Profile in Sidebar */
.sidebar-user {
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.user-details {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-weight: 600;
    color: white;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Navigation Menu */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.05em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all var(--transition-speed) var(--transition-ease);
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--accent-green);
    transition: height var(--transition-speed) var(--transition-ease);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item:hover::before,
.nav-item.active::before {
    height: 100%;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: 600;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-footer .nav-item {
    padding: 0.5rem 0;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Header */
.top-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .top-header {
    background: #1e293b;
    border-bottom-color: #334155;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--text-light);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--primary-green);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-action {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-dark);
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.header-action:hover {
    background: var(--hover-bg);
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.header-action.primary {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
}

.header-action.primary:hover {
    background: var(--secondary-green);
    border-color: var(--secondary-green);
}

/* Content Container */
.content-container {
    flex: 1;
    padding: 2rem;
    max-width: var(--content-max-width);
    width: 100%;
    margin: 0 auto;
}

/* Content Section (legacy layout) - works alongside main-content without additional wrapper */
.main-content > .content-section {
    flex: 1;
    padding-top: calc(var(--header-height) + 1rem);
}

/* ============================================
   CARDS & CONTAINERS
   ============================================ */

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: box-shadow var(--transition-speed);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.card-body {
    color: var(--text-dark);
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* ============================================
   FORMS & INPUTS
   ============================================ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-size: 0.875rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-dark);
    background: white;
    transition: all var(--transition-speed);
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea {
    background: #334155;
    border-color: #475569;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(0, 100, 0, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-speed);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-green);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-green);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--hover-bg);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: white;
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.btn-outline {
    background: transparent;
    color: var(--primary-green);
    border: 1px solid var(--primary-green);
}

.btn-outline:hover {
    background: var(--primary-green);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* ============================================
   TABLES
   ============================================ */

.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--hover-bg);
    border-bottom: 2px solid var(--border-color);
}

[data-theme="dark"] thead {
    background: #334155;
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-dark);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--hover-bg);
}

/* ============================================
   BADGES & ALERTS
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-error {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: #d1fae5;
    border-color: #10b981;
    color: #065f46;
}

.alert-warning {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.alert-error {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

.alert-info {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1e40af;
}

/* ============================================
   STATS & METRICS
   ============================================ */

.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-green), var(--accent-green));
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
}

.stat-change {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.stat-change.positive {
    color: #10b981;
}

.stat-change.negative {
    color: #ef4444;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-toggle {
        display: block;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .top-header {
        padding: 0 1rem;
    }
    
    .content-container {
        padding: 1rem;
    }
}

@media (max-width: 640px) {
    .page-title {
        font-size: 1.25rem;
    }
    
    .breadcrumb {
        display: none;
    }
    
    .header-right {
        gap: 0.5rem;
    }
    
    .header-action span {
        display: none;
    }
}

/* ============================================
   UTILITIES
   ============================================ */

/* Text alignment */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

/* Margins - top */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

/* Margins - bottom */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

/* Margins - horizontal */
.mx-auto { margin-left: auto; margin-right: auto; }
.ml-1 { margin-left: 0.5rem; }
.mr-1 { margin-right: 0.5rem; }

/* Padding */
.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
.px-2 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 1rem; padding-bottom: 1rem; }

/* Flexbox utilities */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* Width/Height */
.w-full { width: 100%; }
.w-auto { width: auto; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }
.max-w-container { max-width: var(--content-max-width, 1400px); }

/* Display */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }

/* Visibility */
.invisible { visibility: hidden; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Text styles */
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-normal { font-weight: 400; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-primary { color: var(--primary-green); }
.text-muted { color: var(--text-light); }
.text-dark { color: var(--text-dark); }
.text-error { color: #ef4444; }
.text-success { color: #10b981; }
.text-warning { color: #f59e0b; }
.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }
.tracking-wide { letter-spacing: 0.05em; }

/* Borders */
.rounded { border-radius: 8px; }
.rounded-lg { border-radius: 12px; }
.rounded-xl { border-radius: 20px; }
.rounded-full { border-radius: 9999px; }
.border { border: 1px solid var(--border-color); }
.border-primary { border-color: var(--primary-green); }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.1)); }
.shadow { box-shadow: var(--shadow-md, 0 4px 6px rgba(0,0,0,0.1)); }
.shadow-lg { box-shadow: var(--shadow-lg, 0 10px 20px rgba(0,0,0,0.15)); }

/* Background */
.bg-white { background-color: white; }
.bg-card { background-color: var(--card-bg); }
.bg-hover { background-color: var(--hover-bg); }
.bg-primary { background-color: var(--primary-green); color: white; }
.bg-gradient { background: linear-gradient(135deg, var(--primary-green), var(--secondary-green)); }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-help { cursor: help; }

/* Overflow */
.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* Z-index */
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }
.z-100 { z-index: 100; }

/* Transitions */
.transition { transition: all var(--transition-speed, 0.3s) var(--transition-ease, ease); }
.transition-fast { transition: all 0.15s ease; }

/* Interactive states */
.hover\:scale:hover { transform: scale(1.02); }
.hover\:lift:hover { transform: translateY(-2px); }
.hover\:shadow:hover { box-shadow: var(--shadow-lg); }

/* Common component patterns */
.mini-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-light);
    margin-bottom: 0.35rem;
    display: block;
}

.status-message {
    margin-top: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.page-container {
    max-width: var(--content-max-width, 1400px);
    margin: 0 auto;
    padding: 2rem 1rem;
}

.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-green);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
}

/* Action button styles already in theme, but add ghost variant */
.action-btn.ghost {
    background: transparent;
    color: var(--primary-green);
    border: 1px solid var(--primary-green);
}

.action-btn.ghost:hover {
    background: var(--primary-green);
    color: white;
}

.action-btn.danger {
    background: #ef4444;
    color: white;
}

.action-btn.danger:hover {
    background: #dc2626;
}

/* Modal overlay shared styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 15000;
    overflow-y: auto;
    padding: 2rem;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close-btn:hover {
    background: #dc2626;
}

/* Empty state styling */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-light);
}

.empty-state i {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1.1rem;
}

/* ============================================
   METRIC TOOLTIPS
   ============================================ */

/* Tooltip Container */
.metric-tooltip {
    position: fixed;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    max-width: 400px;
    z-index: 10000;
    transform: translate(-50%, -100%);
    margin-top: -15px;
    border: 2px solid var(--primary-green);
    animation: tooltip-fade-in 0.2s ease-out;
    pointer-events: none;
}

[data-theme="dark"] .metric-tooltip {
    background: var(--card-bg);
    border-color: var(--accent-green);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Tooltip arrow pointing down */
.metric-tooltip::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--primary-green);
}

[data-theme="dark"] .metric-tooltip::after {
    border-top-color: var(--accent-green);
}

/* When tooltip is shown below element */
.metric-tooltip.tooltip-below {
    transform: translate(-50%, 0);
    margin-top: 15px;
}

.metric-tooltip.tooltip-below::after {
    bottom: auto;
    top: -10px;
    border-top: none;
    border-bottom: 10px solid var(--primary-green);
}

[data-theme="dark"] .metric-tooltip.tooltip-below::after {
    border-bottom-color: var(--accent-green);
}

/* Tooltip fade-in animation */
@keyframes tooltip-fade-in {
    from {
        opacity: 0;
        transform: translate(-50%, -90%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -100%);
    }
}

/* Tooltip title */
.tooltip-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

/* Tooltip sections */
.tooltip-section {
    margin-bottom: 1rem;
}

.tooltip-section:last-child {
    margin-bottom: 0;
}

.tooltip-section strong {
    display: block;
    color: var(--primary-green);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

[data-theme="dark"] .tooltip-section strong {
    color: var(--accent-green);
}

.tooltip-section p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Formula styling */
.tooltip-formula {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 6px;
    border-left: 3px solid var(--primary-green);
}

[data-theme="dark"] .tooltip-formula {
    background: #0f1419;
    border-left-color: var(--accent-green);
}

/* Stat card hover effects for tooltips */
.stat-card {
    cursor: help;
    transition: all var(--transition-speed) var(--transition-ease);
}

.stat-card:hover,
.stat-card:focus {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

[data-theme="dark"] .stat-card:hover,
[data-theme="dark"] .stat-card:focus {
    outline-color: var(--accent-green);
}

.stat-card:focus {
    outline: 2px solid var(--primary-green);
}

/* Health score card tooltip support */
#healthScoreCard {
    cursor: help;
    transition: transform 0.2s ease;
}

#healthScoreCard:hover,
#healthScoreCard:focus {
    transform: translateY(-3px);
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 3px;
}

/* Responsive tooltip adjustments */
@media (max-width: 768px) {
    .metric-tooltip {
        max-width: 90vw;
        font-size: 0.9rem;
        padding: 1rem;
    }

    .tooltip-title {
        font-size: 1rem;
    }

    .tooltip-section p {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .metric-tooltip {
        max-width: 85vw;
        padding: 0.875rem;
    }

    .tooltip-title {
        font-size: 0.95rem;
    }

    .tooltip-section p {
        font-size: 0.85rem;
    }
}
