/* .river-monitor-wrapper {
    background: #fff;
    border-radius: 20px; */
/* padding: 30px; */
/* box-shadow: 0 10px 30px rgba(0, 0, 0, .08); */
/* } */

.river-header {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 30px;
}

.river-icon {
    width: 60px;
    height: 60px;
    background: #eef7f6;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.river-header h2 {
    margin: 0;
    font-size: 28px;
}

.river-header p {
    margin: 5px 0 0;
    color: #64748b;
}

.river-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
}

.river-card {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    /* padding: 20px; */
    background: #fff;
}

.river-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.river-top h3 {
    margin: 0;
}

.status-badge {
    padding: 8px 14px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
}

.safe {
    background: #dcfce7;
    color: #166534;
}

.warning {
    background: #fef3c7;
    color: #92400e;
}

.danger {
    background: #fee2e2;
    color: #991b1b;
}

.river-meter {
    margin: 20px 0;
    background: linear-gradient(180deg,
            #203c2d,
            #6f8574);
    border-radius: 18px;
    padding: 40px 20px;
    text-align: center;
    color: white;
}

.level-display {
    font-size: 42px;
    font-weight: 700;
}

.current-status {
    margin-top: 10px;
    display: inline-block;
    padding: 6px 16px;
    background: white;
    color: #374151;
    border-radius: 20px;
    font-size: 12px;
}

.river-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    /* margin-bottom: 20px; */
}

.river-info div {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 15px;
}

.river-info label {
    display: block;
    color: #64748b;
}

.river-info strong {
    display: block;
    margin-top: 8px;
    color: #ef4444;
}

.river-discharge {
    display: flex;
    justify-content: space-between;
    /* margin-bottom: 20px; */
    font-weight: 600;
}

canvas {
    width: 100% !important;
}

/* ==========================================================================
   Powerful River Monitoring Dashboard UI
   ========================================================================== */

:root {
    --dash-bg: transparent;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;

    /* Status Colors */
    --safe-text: #059669;
    --safe-bg: #d1fae5;
    --warning-text: #b45309;
    --warning-bg: #fef3c7;
    --danger-text: #b91c1c;
    --danger-bg: #fee2e2;
    --danger-glow: rgba(220, 38, 38, 0.4);

    /* Accents */
    --accent-blue: #0ea5e9;
    --accent-bg: #f0f9ff;
    --meter-bg: #f8fafc;
}

/* 1. Main Wrapper */
.river-monitor-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--dash-bg);
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 0;
}

/* 2. Premium Header Section */
.river-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
    padding: 24px;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -2px rgba(0, 0, 0, 0.02);
}

.river-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    width: 80px;
    height: 80px;
    background: var(--accent-bg);
    border-radius: 20px;
    box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.1);
}

.river-header h2 {
    margin: 0 0 8px 0 !important;
    font-size: 1.75rem;
    color: var(--text-primary);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.river-header p {
    margin: 0 !important;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

/* 3. Responsive Grid */
.river-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 24px;
}

/* 4. Dashboard Cards */
.river-card {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 20px 10px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.river-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

/* 5. Card Top & Badges */
.river-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}


.river-top span {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.status-badge.safe {
    background: var(--safe-bg);
    color: var(--safe-text);
}

.status-badge.warning {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.status-badge.danger {
    background: var(--danger-bg);
    color: var(--danger-text);
    /* Pulse effect for Danger State */
    animation: pulse-danger 2s infinite;
}

@keyframes pulse-danger {
    0% {
        box-shadow: 0 0 0 0 var(--danger-glow);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    }
}

/* 6. Level Display (The Main Focus) */
.river-meter {
    text-align: center;
    padding: 28px 20px;
    background: var(--meter-bg);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.level-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}

.level-display .level {
    font-size: 3.5rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.03em;
}

.level-display .unit {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.current-status {
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* 7. Threshold Information */
.river-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: space-between;
    padding: 0 0 16px 0;
    border-bottom: 1px dashed var(--border-color);
}

.river-info div {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.river-info div:last-child {
    text-align: right;
}

.river-info label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.river-info strong {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* 8. Discharge Metric Container */
.river-discharge {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    padding: 16px;
    border-radius: 10px;
    border: 2px solid var(--accent-bg);
}

.river-discharge span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.river-discharge strong {
    font-size: 1.1rem;
    color: var(--accent-blue);
    font-weight: 800;
}

/* 9. Chart Styling */
.river-card canvas {
    width: 100% !important;
    margin-top: 8px;
    border-radius: 8px;
}

/* 10. Responsive Adjustments */
@media (max-width: 768px) {
    .river-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .river-icon {
        width: 64px;
        height: 64px;
        font-size: 2rem;
    }

    .river-header h2 {
        font-size: 1.5rem;
    }
}