/**
 * TradeJournal - Performance Monitoring CSS
 *
 * Styling for performance dashboard, alerts, and analytics interface
 *
 * @version 1.4.0
 */

/* Performance Dashboard */
.tjwp-performance-dashboard {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin: 20px 0;
}

.tjwp-dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.tjwp-dashboard-title {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}
.tjwp-tab-button,
.tjwp-tab-button * {
    opacity: 1 !important;
}

.tjwp-dashboard-title i {
    font-size: 32px;
    opacity: 0.9;
}
.tjwp-overview-card,
.tjwp-info-line {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    color: #1f2937;
}

.tjwp-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.tjwp-overview-label {
    color: #64748b;
    font-size: 12px;
}

.tjwp-overview-value {
    font-weight: 700;
    font-size: 18px;
    color: #0f172a;
}

.tjwp-trends-content,
.tjwp-goals-content {
    display: grid;
    gap: 10px;
}

.tjwp-dashboard-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.tjwp-period-selector {
    appearance: none;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.55);
    color: #0f172a;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    min-width: 140px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
}

.tjwp-period-selector option {
    background: #ffffff;
    color: #0f172a;
}

.tjwp-period-selector:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22);
}

[data-theme="dark"] .tjwp-period-selector,
body.tjwp-dark-mode .tjwp-period-selector {
    background: rgba(15, 23, 42, 0.88);
    border-color: rgba(148, 163, 184, 0.45);
    color: #f8fafc;
}

[data-theme="dark"] .tjwp-period-selector option,
body.tjwp-dark-mode .tjwp-period-selector option {
    background: #0f172a;
    color: #f8fafc;
}

.tjwp-dashboard-content {
    padding: 30px;
}

/* Metrics Grid */
.tjwp-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.tjwp-metric-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.tjwp-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.tjwp-metric-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.tjwp-metric-win-rate .tjwp-metric-icon {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.tjwp-metric-pnl .tjwp-metric-icon {
    background: linear-gradient(135deg, #007bff, #6610f2);
    color: white;
}

.tjwp-metric-drawdown .tjwp-metric-icon {
    background: linear-gradient(135deg, #dc3545, #fd7e14);
    color: white;
}

.tjwp-metric-trades .tjwp-metric-icon {
    background: linear-gradient(135deg, #6f42c1, #e83e8c);
    color: white;
}

.tjwp-metric-content {
    flex: 1;
}

.tjwp-metric-value {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 8px 0;
    display: block;
    transition: all 0.3s ease;
}

.tjwp-metric-value.tjwp-loading {
    color: #adb5bd;
    animation: pulse 2s infinite;
}

.tjwp-metric-label {
    font-size: 14px;
    color: #6c757d;
    margin: 0 0 8px 0;
    font-weight: 500;
}

.tjwp-metric-change {
    font-size: 14px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
}

.tjwp-metric-change.tjwp-loading {
    background: #e9ecef;
    color: #adb5bd;
}

.tjwp-trend-up {
    background: #d4edda;
    color: #155724;
}

.tjwp-trend-down {
    background: #f8d7da;
    color: #721c24;
}

.tjwp-trend-stable {
    background: #e2e3e5;
    color: #383d41;
}

/* Chart Container */
.tjwp-chart-container {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
}

.tjwp-chart-container canvas {
    max-height: 250px;
}

/* Dashboard Widgets */
.tjwp-dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.tjwp-widget {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.tjwp-widget-header {
    background: #f8f9fa;
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tjwp-widget-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tjwp-widget-header h4 i {
    color: #6c757d;
}

.tjwp-view-all-alerts,
.tjwp-view-all-promotions {
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.tjwp-view-all-alerts:hover,
.tjwp-view-all-promotions:hover {
    color: #0056b3;
}

.tjwp-alerts-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tjwp-alerts-view-state {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e0ecff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.tjwp-alerts-expanded .tjwp-alerts-view-state {
    background: #dbeafe;
    color: #1e40af;
    box-shadow: inset 0 0 0 1px #93c5fd;
}

.tjwp-alerts-expanded .tjwp-view-all-alerts {
    color: #1e40af;
    font-weight: 700;
}

.tjwp-widget-content {
    padding: 20px 25px;
}

/* Alerts */
.tjwp-alerts-list {
    max-height: 300px;
    overflow-y: auto;
}

.tjwp-alert {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 4px solid;
}

.tjwp-alert-success {
    background: #d4edda;
    border-left-color: #28a745;
}

.tjwp-alert-warning {
    background: #fff3cd;
    border-left-color: #ffc107;
    color: #7a5200;
}

.tjwp-alert-danger {
    background: #f8d7da;
    border-left-color: #dc3545;
    color: #7f1d1d;
}

.tjwp-alert-info {
    background: #d1ecf1;
    border-left-color: #17a2b8;
}

.tjwp-alert-secondary {
    background: #e2e3e5;
    border-left-color: #6c757d;
}

.tjwp-alert-content {
    flex: 1;
    color: #1f2937;
    font-size: 14px;
    line-height: 1.6;
}

.tjwp-alert-message {
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 8px 0;
    color: #495057;
}

.tjwp-alert-meta {
    font-size: 12px;
    color: #6c757d;
}

.tjwp-alert-actions {
    margin-left: 15px;
}

.tjwp-dismiss-alert {
    background: #6c757d;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.tjwp-dismiss-alert:hover {
    background: #5a6268;
}

.tjwp-no-alerts {
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
    font-style: italic;
}

/* Promotions */
.tjwp-promotions-list {
    display: grid;
    gap: 15px;
    max-height: 350px;
    overflow-y: auto;
}

.tjwp-promotion-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.tjwp-promotion-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.tjwp-promotion-card.tjwp-claimed {
    opacity: 0.7;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.tjwp-promotion-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.tjwp-promotion-title {
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    margin: 0;
    flex: 1;
}

.tjwp-promotion-discount {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-left: 15px;
    white-space: nowrap;
}

.tjwp-promotion-description {
    color: #6c757d;
    margin: 0 0 15px 0;
    line-height: 1.5;
}

.tjwp-promotion-meta {
    font-size: 12px;
    color: #868e96;
    margin-bottom: 15px;
}

.tjwp-promotion-expiry {
    display: block;
}

.tjwp-claim-promotion {
    background: linear-gradient(135deg, #007bff, #6610f2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.tjwp-claim-promotion:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.tjwp-claim-promotion:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.tjwp-no-promotions {
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
    font-style: italic;
}

/* Analytics Sections */
.tjwp-analytics-sections {
    margin-top: 50px;
}

.tjwp-analytics-tabs {
    display: flex;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 30px;
}

.tjwp-tab-button {
    background: none;
    border: none;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tjwp-tab-button:hover {
    color: #007bff;
}

.tjwp-tab-button.active {
    color: #1d4ed8;
    border-bottom-color: #1d4ed8;
    font-weight: 700;
}

.tjwp-widget,
.tjwp-analytics-sections {
    color: #111827;
}

.tjwp-tab-content {
    min-height: 300px;
}

.tjwp-tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tjwp-tab-panel.active {
    display: block;
}

/* Insights */
.tjwp-insights-content {
    display: grid;
    gap: 15px;
}

.tjwp-insight-card {
    display: flex;
    align-items: center;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid;
    transition: all 0.3s ease;
}

.tjwp-insight-success {
    background: #d4edda;
    border-color: #c3e6cb;
}

.tjwp-insight-warning {
    background: #fff3cd;
    border-color: #ffeaa7;
}

.tjwp-insight-danger {
    background: #f8d7da;
    border-color: #f5c6cb;
}

.tjwp-insight-info {
    background: #d1ecf1;
    border-color: #bee5eb;
}

.tjwp-insight-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tjwp-insight-icon {
    margin-left: 15px;
    font-size: 24px;
    color: #495057;
}

.tjwp-insight-content {
    flex: 1;
}

.tjwp-insight-message {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #495057;
}

.tjwp-no-insights {
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
    font-style: italic;
}

/* Alerts Center */
.tjwp-alerts-center {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.tjwp-alerts-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.tjwp-alerts-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tjwp-alerts-header h3 i {
    font-size: 28px;
    opacity: 0.9;
}

.tjwp-alerts-filters {
    display: flex;
    gap: 15px;
    align-items: center;
}

.tjwp-alerts-filter {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    min-width: 160px;
}

/* Promotions Widget */
.tjwp-promotions-widget {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.tjwp-promotions-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 25px;
    text-align: center;
}

.tjwp-promotions-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

/* Goals Section */
.tjwp-goals-setup {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    border: 1px solid #e9ecef;
}

.tjwp-goals-setup h4 {
    margin: 0 0 25px 0;
    font-size: 20px;
    font-weight: 600;
    color: #495057;
    text-align: center;
}

.tjwp-goals-form {
    display: grid;
    gap: 20px;
    max-width: 500px;
    margin: 0 auto;
}

.tjwp-form-group {
    display: flex;
    flex-direction: column;
}

.tjwp-form-group label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 8px;
}

.tjwp-form-group input {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.tjwp-form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Trends and Detailed Insights */
.tjwp-trends-content,
.tjwp-detailed-insights {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    border: 1px solid #e9ecef;
}

.tjwp-trends-chart {
    margin-bottom: 25px;
}

.tjwp-trends-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.tjwp-trend-stat {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.tjwp-trend-label {
    display: block;
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 8px;
}

.tjwp-trend-value {
    display: block;
    font-size: 24px;
    font-weight: 600;
    color: #495057;
}

.tjwp-detailed-insight {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.tjwp-detailed-insight:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.tjwp-insight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.tjwp-insight-header h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #495057;
}

.tjwp-insight-type {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.tjwp-insight-success .tjwp-insight-type {
    background: #d4edda;
    color: #155724;
}

.tjwp-insight-warning .tjwp-insight-type {
    background: #fff3cd;
    color: #856404;
}

.tjwp-insight-danger .tjwp-insight-type {
    background: #f8d7da;
    color: #721c24;
}

.tjwp-insight-body {
    margin-bottom: 20px;
}

.tjwp-insight-body p {
    margin: 0 0 15px 0;
    line-height: 1.6;
    color: #6c757d;
}

.tjwp-insight-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tjwp-metric {
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    color: #495057;
    border: 1px solid #e9ecef;
}

.tjwp-insight-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tjwp-insight-action {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(29, 78, 216, 0.08);
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 600;
}

/* Loading States */
.tjwp-loading-spinner {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.tjwp-loading-spinner::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tjwp-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Notifications */
.tjwp-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
}

.tjwp-notification-success {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

.tjwp-notification-error {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
}

.tjwp-notification-content {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tjwp-notification-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
}

.tjwp-notification-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    margin-left: 15px;
}

.tjwp-notification-close:hover {
    color: #495057;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .tjwp-dashboard-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .tjwp-dashboard-title {
        font-size: 24px;
    }

    .tjwp-metrics-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .tjwp-dashboard-widgets {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .tjwp-analytics-tabs {
        flex-direction: column;
    }

    .tjwp-tab-button {
        padding: 12px 15px;
        text-align: center;
    }

    .tjwp-alert {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .tjwp-alert-actions {
        margin-left: 0;
        align-self: flex-end;
    }

    .tjwp-promotion-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .tjwp-promotion-discount {
        margin-left: 0;
    }

    .tjwp-trends-summary {
        grid-template-columns: 1fr;
    }
}

/* Dark Mode Support */
[data-theme="dark"] .tjwp-performance-dashboard,
[data-theme="dark"] .tjwp-alerts-center,
[data-theme="dark"] .tjwp-promotions-widget,
body.tjwp-dark-mode .tjwp-performance-dashboard,
body.tjwp-dark-mode .tjwp-alerts-center,
body.tjwp-dark-mode .tjwp-promotions-widget {
    background: #2d3748;
    color: #e2e8f0;
}

[data-theme="dark"] .tjwp-dashboard-header,
[data-theme="dark"] .tjwp-alerts-header,
[data-theme="dark"] .tjwp-promotions-header,
body.tjwp-dark-mode .tjwp-dashboard-header,
body.tjwp-dark-mode .tjwp-alerts-header,
body.tjwp-dark-mode .tjwp-promotions-header {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

[data-theme="dark"] .tjwp-metric-card,
body.tjwp-dark-mode .tjwp-metric-card {
    background: #4a5568;
    border-color: #718096;
}

[data-theme="dark"] .tjwp-metric-value,
body.tjwp-dark-mode .tjwp-metric-value {
    color: #e2e8f0;
}

[data-theme="dark"] .tjwp-metric-label,
body.tjwp-dark-mode .tjwp-metric-label {
    color: #a0aec0;
}

[data-theme="dark"] .tjwp-widget,
body.tjwp-dark-mode .tjwp-widget {
    background: #2d3748;
    border-color: #718096;
}

[data-theme="dark"] .tjwp-widget-header,
body.tjwp-dark-mode .tjwp-widget-header {
    background: #4a5568;
    border-color: #718096;
}

[data-theme="dark"] .tjwp-widget-header h4,
body.tjwp-dark-mode .tjwp-widget-header h4 {
    color: #e2e8f0;
}

[data-theme="dark"] .tjwp-promotion-card,
body.tjwp-dark-mode .tjwp-promotion-card {
    background: linear-gradient(135deg, #4a5568 0%, #718096 100%);
    border-color: #718096;
}

[data-theme="dark"] .tjwp-promotion-title,
body.tjwp-dark-mode .tjwp-promotion-title {
    color: #e2e8f0;
}

[data-theme="dark"] .tjwp-promotion-description,
body.tjwp-dark-mode .tjwp-promotion-description {
    color: #a0aec0;
}

[data-theme="dark"] .tjwp-alert-message,
body.tjwp-dark-mode .tjwp-alert-message {
    color: #e2e8f0;
}

[data-theme="dark"] .tjwp-alert-meta,
body.tjwp-dark-mode .tjwp-alert-meta {
    color: #a0aec0;
}

/* RTL Support */
[dir="rtl"] .tjwp-dashboard-header,
[dir="rtl"] .tjwp-alerts-header,
[dir="rtl"] .tjwp-widget-header,
[dir="rtl"] .tjwp-promotion-header,
[dir="rtl"] .tjwp-alert {
    direction: rtl;
}

[dir="rtl"] .tjwp-metric-icon {
    margin-left: 0;
    margin-right: 20px;
}

[dir="rtl"] .tjwp-alert-actions {
    margin-left: 0;
    margin-right: 15px;
}

[dir="rtl"] .tjwp-notification {
    right: auto;
    left: 20px;
}

[dir="rtl"] .tjwp-notification-content {
    direction: rtl;
}

[dir="rtl"] .tjwp-notification-close {
    margin-left: 0;
    margin-right: 15px;
}

/* Sprint 4: Reports + Risk Management */
.tjwp-sprint4-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.tjwp-subtle-text {
    color: #64748b;
    margin: 0 0 14px;
}

.tjwp-inline-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.tjwp-inline-controls label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: #475569;
}

.tjwp-inline-controls select {
    min-width: 140px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    height: 38px;
    padding: 0 10px;
}

.tjwp-report-status,
.tjwp-risk-status {
    margin-top: 10px;
    font-size: 13px;
    color: #334155;
}

.tjwp-report-status.is-loading,
.tjwp-risk-status.is-loading {
    color: #475569;
}

.tjwp-report-status.is-success,
.tjwp-risk-status.is-success {
    color: #166534;
    font-weight: 600;
}

.tjwp-report-status.is-error,
.tjwp-risk-status.is-error {
    color: #b91c1c;
    font-weight: 600;
}

.tjwp-alert-info .tjwp-alert-content {
    color: #0f172a;
    font-weight: 500;
}

.tjwp-risk-limits-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.tjwp-risk-limits-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: #475569;
}

.tjwp-risk-limits-form input,
.tjwp-risk-limits-form select {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    height: 38px;
    padding: 0 10px;
}

.tjwp-risk-email-toggle {
    grid-column: 1 / -1;
    flex-direction: row !important;
    align-items: center;
}

.tjwp-save-risk-limits {
    grid-column: 1 / -1;
    justify-self: start;
}

.tjwp-r-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.tjwp-r-pill {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 13px;
    color: #0f172a;
}

.tjwp-breach {
    color: #b91c1c;
    font-weight: 600;
}

.tjwp-ok {
    color: #166534;
    font-weight: 600;
}

[data-theme="dark"] .tjwp-subtle-text,
body.tjwp-dark-mode .tjwp-subtle-text {
    color: #94a3b8;
}

[data-theme="dark"] .tjwp-inline-controls label,
[data-theme="dark"] .tjwp-risk-limits-form label,
body.tjwp-dark-mode .tjwp-inline-controls label,
body.tjwp-dark-mode .tjwp-risk-limits-form label {
    color: #cbd5e1;
}

[data-theme="dark"] .tjwp-inline-controls select,
[data-theme="dark"] .tjwp-risk-limits-form input,
[data-theme="dark"] .tjwp-risk-limits-form select,
body.tjwp-dark-mode .tjwp-inline-controls select,
body.tjwp-dark-mode .tjwp-risk-limits-form input,
body.tjwp-dark-mode .tjwp-risk-limits-form select {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .tjwp-r-pill,
body.tjwp-dark-mode .tjwp-r-pill {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .tjwp-alert-info,
body.tjwp-dark-mode .tjwp-alert-info {
    background: #0f172a;
    border-left-color: #3b82f6;
    border-color: #334155;
}

[data-theme="dark"] .tjwp-alert-info .tjwp-alert-content,
body.tjwp-dark-mode .tjwp-alert-info .tjwp-alert-content {
    color: #dbeafe;
}

[data-theme="dark"] .tjwp-alert .tjwp-alert-content,
body.tjwp-dark-mode .tjwp-alert .tjwp-alert-content {
    color: #e2e8f0;
}

[data-theme="dark"] .tjwp-tab-button,
body.tjwp-dark-mode .tjwp-tab-button {
    color: #d1d5db;
}

[data-theme="dark"] .tjwp-tab-button.active,
body.tjwp-dark-mode .tjwp-tab-button.active {
    color: #bfdbfe;
    border-bottom-color: #3b82f6;
}

[data-theme="dark"] .tjwp-alert-warning,
body.tjwp-dark-mode .tjwp-alert-warning {
    background: #3a2f0a;
    border-left-color: #f59e0b;
    color: #fde68a;
}

[data-theme="dark"] .tjwp-alert-danger,
body.tjwp-dark-mode .tjwp-alert-danger {
    background: #3f1f26;
    border-left-color: #f87171;
    color: #fecaca;
}

[data-theme="dark"] .tjwp-alerts-view-state,
body.tjwp-dark-mode .tjwp-alerts-view-state {
    background: rgba(59, 130, 246, 0.18);
    color: #dbeafe;
}

[data-theme="dark"] .tjwp-alerts-expanded .tjwp-alerts-view-state,
body.tjwp-dark-mode .tjwp-alerts-expanded .tjwp-alerts-view-state {
    box-shadow: inset 0 0 0 1px #60a5fa;
}

[data-theme="dark"] .tjwp-insight-action,
body.tjwp-dark-mode .tjwp-insight-action {
    background: rgba(96, 165, 250, 0.16);
    color: #dbeafe;
}

[data-theme="dark"] .tjwp-overview-card,
[data-theme="dark"] .tjwp-info-line,
body.tjwp-dark-mode .tjwp-overview-card,
body.tjwp-dark-mode .tjwp-info-line {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .tjwp-overview-label,
body.tjwp-dark-mode .tjwp-overview-label {
    color: #94a3b8;
}

[data-theme="dark"] .tjwp-overview-value,
body.tjwp-dark-mode .tjwp-overview-value {
    color: #f8fafc;
}
[data-theme="dark"] .tjwp-report-status,
[data-theme="dark"] .tjwp-risk-status,
body.tjwp-dark-mode .tjwp-report-status,
body.tjwp-dark-mode .tjwp-risk-status {
    color: #cbd5e1;
}

[data-theme="dark"] .tjwp-report-status.is-success,
[data-theme="dark"] .tjwp-risk-status.is-success,
body.tjwp-dark-mode .tjwp-report-status.is-success,
body.tjwp-dark-mode .tjwp-risk-status.is-success {
    color: #86efac;
}

[data-theme="dark"] .tjwp-report-status.is-error,
[data-theme="dark"] .tjwp-risk-status.is-error,
body.tjwp-dark-mode .tjwp-report-status.is-error,
body.tjwp-dark-mode .tjwp-risk-status.is-error {
    color: #fca5a5;
}

@media (max-width: 768px) {
    .tjwp-risk-limits-form {
        grid-template-columns: 1fr;
    }
}