/* ============================================
   RTA DASHBOARD - MINISTERIAL PROFESSIONAL DESIGN
   ============================================ */

/* Base Container */
.dashboard-home {
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
    padding: 0;
}

/* Hero Section - Enhanced */
.hero-section {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #60a5fa 100%);
    padding: 48px 64px;
    border-radius: 16px;
    margin-bottom: 32px;
    box-shadow: 0 20px 60px rgba(30, 58, 138, 0.3);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    color: white;
    font-size: 42px;
    font-weight: 700;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.hero-section h1 i {
    font-size: 48px;
    opacity: 0.9;
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: 18px;
    margin: 0 0 24px 0;
    font-weight: 400;
}

.hero-meta {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.meta-item {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    backdrop-filter: blur(10px);
}

.meta-item i {
    font-size: 16px;
}

/* Main Dashboard Grid - Balanced Layout */
.dashboard-main-grid {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 32px;
    margin-bottom: 32px;
}

.dashboard-left {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.dashboard-right {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Section Cards - Premium Design */
.section-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 36px;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.section-card:hover {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.section-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header h2 i {
    font-size: 24px;
    color: #3b82f6;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #f8fafc;
    color: #3b82f6;
    border-color: #3b82f6;
}

/* Badges */
.badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
}

.badge-critical {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, #ea580c, #f97316);
    color: white;
}

.badge-pulse {
    background: #dc2626;
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Metrics Grid V2 */
.metrics-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.metric-card-v2 {
    background: #ffffff;
    padding: 24px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.metric-card-v2:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

.metric-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.metric-icon.vehicles {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
}

.metric-icon.trips {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.metric-icon.uptime {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
}

.metric-icon.violations {
    background: linear-gradient(135deg, #ef4444, #f87171);
}

.metric-data {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.metric-label {
    font-size: 12px;
    color: #475569;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
    margin-bottom: 6px;
}

.metric-change {
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.metric-change.positive {
    color: #059669;
}

.metric-change.negative {
    color: #dc2626;
}

.metric-change.neutral {
    color: #475569;
}

/* Assessment Cards - Professional Hierarchy */
.assessment-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 32px;
    border-left: 6px solid #3b82f6;
}

.assessment-card.institutional {
    border-left-color: #f59e0b;
}

.assessment-intro {
    background: #dbeafe;
    padding: 18px 22px;
    border-radius: 10px;
    margin-bottom: 24px;
    border-left: 5px solid #2563eb;
}

.assessment-intro p {
    margin: 0;
    color: #1e40af;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.5;
}

.institutional .assessment-intro {
    background: #fef3c7;
    border-left-color: #f59e0b;
}

.institutional .assessment-intro p {
    color: #92400e;
}

/* Violation Categories */
.violation-category {
    margin-bottom: 28px;
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    border: 3px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.violation-category.severe {
    border-color: #dc2626;
    background: #ffffff;
}

.violation-category.medium {
    border-color: #f97316;
    background: #ffffff;
}

.violation-category.simple {
    border-color: #eab308;
    background: #ffffff;
}

.violation-category.serious {
    border-color: #dc2626;
    background: #ffffff;
}

.violation-category.medium-inst {
    border-color: #f97316;
    background: #ffffff;
}

.violation-category.simple-inst {
    border-color: #fbbf24;
    background: #ffffff;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 3px solid rgba(0, 0, 0, 0.1);
}

.category-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.severe .category-icon {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.medium .category-icon,
.medium-inst .category-icon {
    background: linear-gradient(135deg, #f97316, #fb923c);
}

.simple .category-icon,
.simple-inst .category-icon {
    background: linear-gradient(135deg, #eab308, #fbbf24);
}

.serious .category-icon {
    background: linear-gradient(135deg, #b91c1c, #dc2626);
}

.category-title h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}

.category-weight {
    background: rgba(0, 0, 0, 0.08);
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
}

.count-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    color: #666;
    background: #f3f4f6;
}

/* Violation Items */
.violation-items {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.violation-item {
    background: #f8fafc;
    padding: 18px 20px;
    border-radius: 10px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    border: 2px solid #e2e8f0;
    transition: all 0.2s ease;
}

.violation-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 3px 12px rgba(59, 130, 246, 0.15);
    transform: translateX(4px);
    background: #ffffff;
}

.item-number {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.item-content {
    flex: 1;
}

.item-description {
    margin: 0 0 12px 0;
    color: #1e293b;
    font-size: 15px;
    line-height: 1.6;
    font-weight: 500;
}

.item-meta {
    display: flex;
    gap: 16px;
    align-items: center;
}

.item-priority {
    background: #dbeafe;
    color: #1e40af;
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.item-status {
    color: #475569;
    font-size: 13px;
    font-weight: 600;
}

/* Charts Section */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.chart-card {
    padding: 28px;
}

.chart-container {
    height: 300px;
    position: relative;
    margin-bottom: 20px;
}

.chart-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-color.severe {
    background: #dc2626;
}

.legend-color.medium {
    background: #f97316;
}

.legend-color.simple {
    background: #eab308;
}

.legend-label {
    color: #475569;
    font-weight: 600;
}

.legend-value {
    color: #0f172a;
    font-weight: 700;
}

.chart-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.info-label {
    color: #475569;
    font-size: 14px;
    font-weight: 600;
}

.info-value {
    color: #0f172a;
    font-size: 16px;
    font-weight: 700;
}

/* Primary Action Cards - Right Column */
.primary-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ============================
   Real-time Alerts Redesign
   ============================ */
.alerts-section {
    margin-top: 12px;
}

.alerts-section > h2 {
    margin-bottom: 16px;
}

.alert-cards {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.alert-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.alert-card:hover {
    transform: translateY(-2px);
    border-color: #3b82f6;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.15);
}

.alert-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 20px;
    flex-shrink: 0;
}

.alert-card.critical .alert-icon { background: linear-gradient(135deg, #dc2626, #ef4444); }
.alert-card.warning  .alert-icon { background: linear-gradient(135deg, #f97316, #fb923c); }
.alert-card.info     .alert-icon { background: linear-gradient(135deg, #3b82f6, #60a5fa); }

.alert-content h4 {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.alert-content p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
}

.alert-time {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.alert-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.alert-btn {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
}

.alert-btn.primary {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: #ffffff;
    border-color: #334155;
}

.alert-btn.secondary:hover,
.alert-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

/* ============================
   KPI (Textual) Redesign
   ============================ */
.performance-metrics {
    margin-top: 24px;
}

.performance-metrics > h2 {
    margin-bottom: 16px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.metrics-grid .metric-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.metrics-grid .metric-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 6px 16px rgba(59,130,246,0.15);
    transform: translateY(-2px);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.metric-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.metric-trend {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
}
.metric-trend.positive { background: linear-gradient(135deg, #059669, #10b981); }
.metric-trend.negative { background: linear-gradient(135deg, #dc2626, #ef4444); }
.metric-trend.neutral  { background: linear-gradient(135deg, #64748b, #94a3b8); }

.metrics-grid .metric-value {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    margin: 6px 0 8px;
}

.metric-description {
    color: #475569;
    font-size: 13px;
    margin-bottom: 12px;
}

.metric-progress .progress-bar {
    height: 10px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.metric-progress .progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
}

.primary-action-card {
    background: white;
    padding: 28px;
    border-radius: 14px;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.primary-action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.primary-action-card:hover::before {
    transform: scaleY(1);
}

.primary-action-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.2);
    transform: translateY(-4px);
}

.violations-action::before {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.violations-action:hover {
    border-color: #dc2626;
    box-shadow: 0 8px 32px rgba(220, 38, 38, 0.2);
}

.performance-action::before {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.performance-action:hover {
    border-color: #10b981;
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.2);
}

.action-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    margin-bottom: 20px;
}

.violations-action .action-card-icon {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.performance-action .action-card-icon {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.primary-action-card h3 {
    margin: 0 0 12px 0;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
}

.primary-action-card p {
    margin: 0 0 20px 0;
    color: #475569;
    font-size: 15px;
    line-height: 1.6;
}

.action-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.action-stat {
    background: #f1f5f9;
    padding: 14px 18px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-num {
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
}

.stat-lbl {
    font-size: 12px;
    color: #475569;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.action-button {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.action-button:hover {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.3);
}

/* Compact Chart Cards */
.chart-card-small {
    padding: 24px;
}

.chart-container-small {
    height: 200px;
    position: relative;
    margin-top: 16px;
}

.sector-stats-mini {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.sector-stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.sector-stat-item.taxi i {
    color: #3b82f6;
    font-size: 16px;
}

.sector-stat-item.bus i {
    color: #10b981;
    font-size: 16px;
}

.sector-stat-item.marine i {
    color: #06b6d4;
    font-size: 16px;
}

/* Compact Alerts */
.alerts-compact {
    padding: 24px;
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.alert-item {
    background: #ffffff;
    padding: 18px;
    border-radius: 10px;
    display: flex;
    gap: 14px;
    border-left: 4px solid #3b82f6;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.alert-item:hover {
    background: #f8fafc;
    transform: translateX(2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.alert-item.critical {
    border-left-color: #dc2626;
    background: #ffffff;
}

.alert-item.warning {
    border-left-color: #f97316;
    background: #ffffff;
}

.alert-item.info {
    border-left-color: #3b82f6;
    background: #ffffff;
}

.alert-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #3b82f6;
    margin-top: 6px;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

.alert-item.critical .alert-indicator {
    background: #dc2626;
}

.alert-item.warning .alert-indicator {
    background: #f97316;
}

.alert-details {
    flex: 1;
}

.alert-details h4 {
    margin: 0 0 6px 0;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.alert-details p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
}

.alert-timestamp {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.view-all-btn {
    width: 100%;
    padding: 12px 20px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.view-all-btn:hover {
    background: #f8fafc;
    border-color: #3b82f6;
    color: #3b82f6;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr 380px;
    }
    
    .metrics-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .alert-cards { grid-template-columns: 1fr 1fr; }
    .metrics-grid  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    
    .hero-section {
        padding: 40px 48px;
    }
    
    .hero-section h1 {
        font-size: 36px;
    }
    
    .section-card {
        padding: 28px;
    }
}

@media (max-width: 1200px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-right {
        grid-column: 1;
    }
    
    .charts-row {
        grid-template-columns: 1fr;
    }
    .metrics-grid { grid-template-columns: 1fr 1fr; }
    .alert-cards { grid-template-columns: 1fr; }
    .comparison-table { overflow-x: auto; }
    .comparison-table table { min-width: 800px; }
    
    .section-card {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 32px 24px;
    }
    
    .hero-section h1 {
        font-size: 28px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .metrics-grid-4 {
        grid-template-columns: 1fr;
    }
    
    .section-card {
        padding: 20px;
    }
    
    .section-header h2 {
        font-size: 22px;
    }
    
    .metric-card-v2 {
        padding: 20px;
    }
    
    .metric-value {
        font-size: 28px;
    }
    
    .violation-category {
        padding: 20px;
    }
    .metrics-grid { grid-template-columns: 1fr; }
    .alert-cards { grid-template-columns: 1fr; }
}
