body {
    background:
        radial-gradient(circle at top left, rgba(13, 148, 136, 0.08), transparent 36%),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 34%),
        linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
    min-height: 100vh;
}

.alerts-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 20px 44px;
}

.alerts-hero,
.alerts-panel,
.placeholder-panel {
    background: rgba(30, 41, 59, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 28px;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.3);
}

.alerts-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
    gap: 24px;
    padding: 28px;
    margin-bottom: 24px;
    align-items: stretch;
}

.alerts-eyebrow,
.panel-kicker {
    margin: 0 0 10px;
    color: #0f766e;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.alerts-title,
.placeholder-title {
    margin: 0 0 12px;
    color: #f8fafc;
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1.06;
    font-weight: 800;
}

.alerts-copy {
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1.7;
}

.alerts-copy strong {
    color: #f1f5f9;
}

.alerts-control-card {
    padding: 24px;
    border-radius: 24px;
    background: linear-gradient(180deg, #0f172a 0%, #12243d 100%);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    height: 100%;
}

.alerts-control-card h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.alerts-control-card p {
    margin: 0;
    color: rgba(226, 232, 240, 0.8);
    line-height: 1.6;
}

.alert-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alert-control label {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(226, 232, 240, 0.86);
}

.alert-control select {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    padding: 13px 40px 13px 16px;
    background: rgba(15, 23, 42, 0.48) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") no-repeat right 16px center;
    background-size: 18px;
    color: #f8fafc;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 200ms ease;
}

.alert-control select:hover {
    border-color: rgba(148, 163, 184, 0.4);
    background-color: rgba(30, 41, 59, 0.6);
}

.alert-control select:focus {
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.2);
}

.alert-control select option {
    background-color: #0f172a;
    color: #f8fafc;
    padding: 12px;
}

.alerts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
}

.alerts-left-col,
.alerts-right-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.alerts-panel {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.panel-heading h2,
.panel-heading h3 {
    margin: 0;
    color: #f8fafc;
    font-weight: 800;
    font-size: 1.4rem;
}

.panel-heading p,
.panel-subtext {
    margin: 8px 0 0;
    color: #94a3b8;
    line-height: 1.6;
    font-size: 0.95rem;
}

.source-chip {
    align-self: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: 0.84rem;
    font-weight: 700;
    white-space: nowrap;
    margin-top: 4px;
}

#imd-alert-image {
    width: 100%;
    max-height: 72vh;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(0, 0, 0, 0.25);
}

#imd-alert-map {
    width: 100%;
    height: 560px;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.map-note {
    margin-top: 14px;
    color: #64748b;
    font-size: 0.94rem;
    line-height: 1.6;
}

.alert-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 0;
}

.summary-card {
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.8) 100%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 90px;
    justify-content: center;
}

.summary-card strong {
    display: block;
    color: #f8fafc;
    font-size: 1.8rem;
    line-height: 1;
    font-weight: 900;
}

.summary-card span {
    display: block;
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 500;
}

.selected-alert-card {
    padding: 20px;
    border-radius: 22px;
    background: linear-gradient(180deg, #0f172a 0%, #172554 100%);
    color: #f8fafc;
}

.selected-alert-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.selected-alert-head h3 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
}

.selected-alert-head p {
    margin: 8px 0 0;
    color: rgba(226, 232, 240, 0.8);
}

.severity-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #0f172a;
    flex-shrink: 0;
}

.warning-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0 18px;
}

.warning-chip {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    font-size: 0.9rem;
}

.alert-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.alert-meta-item {
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
}

.alert-meta-item span {
    display: block;
    color: rgba(226, 232, 240, 0.72);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.alert-meta-item strong {
    display: block;
    margin-top: 7px;
    font-size: 1rem;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.legend-pill {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
    font-weight: 500;
    font-size: 0.84rem;
    line-height: 1.3;
    min-height: 44px;
    transition: all 180ms ease;
}

.legend-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(148, 163, 184, 0.25);
}

.legend-pill img {
    width: 24px;
    height: 24px;
    min-width: 24px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.legend-swatch {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    flex-shrink: 0;
}

.alerts-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}

.alerts-list button {
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.6) 100%);
    border-radius: 20px;
    padding: 20px;
    text-align: left;
    transition: all 200ms ease;
    color: #f8fafc;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
}

.alerts-list button:hover,
.alerts-list button:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.3);
    border-color: rgba(14, 116, 144, 0.5);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.75) 0%, rgba(15, 23, 42, 0.75) 100%);
    outline: none;
}

.alerts-list button.active {
    border-color: rgba(15, 118, 110, 0.5);
    box-shadow: 0 18px 40px rgba(15, 118, 110, 0.12);
}

.alert-list-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.alert-list-head h3 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.1rem;
    font-weight: 800;
    flex: 1;
    min-width: 140px;
}

.alert-list-copy {
    margin: 0;
    color: #cbd5e1;
    line-height: 1.55;
}

.alert-list-warnings {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.alert-list-warnings span {
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    font-size: 0.82rem;
}

.alerts-empty-state {
    padding: 28px;
    text-align: center;
    color: #cbd5e1;
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px dashed rgba(148, 163, 184, 0.3);
}

.placeholder-panel {
    max-width: 900px;
    margin: 42px auto;
    padding: 36px 28px;
}

.placeholder-copy {
    color: #475569;
    line-height: 1.75;
    margin-bottom: 20px;
}

.placeholder-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 999px;
    background: #0f766e;
    color: #f8fafc;
    text-decoration: none;
    font-weight: 700;
}

@media (max-width: 1100px) {
    .alerts-hero,
    .alerts-grid {
        grid-template-columns: 1fr;
    }

    .alerts-control-card {
        height: auto;
    }
}

@media (max-width: 768px) {
    .alerts-shell {
        padding: 22px 16px 32px;
    }

    .alerts-hero,
    .alerts-panel,
    .placeholder-panel {
        border-radius: 22px;
    }

    .alerts-hero {
        padding: 22px;
    }

    .alerts-panel {
        padding: 18px;
    }

    #imd-alert-map {
        height: 420px;
    }

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

    .legend-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .legend-pill {
        min-height: 42px;
        padding: 9px 12px;
        font-size: 0.82rem;
    }

    .alerts-list {
        grid-template-columns: 1fr;
    }

    .alert-meta {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .alerts-hero {
        padding: 20px;
        gap: 18px;
    }

    .alerts-list button {
        padding: 16px;
        gap: 10px;
    }

    .alert-list-head h3 {
        font-size: 1rem;
    }

    .severity-badge {
        padding: 6px 12px;
        font-size: 0.78rem;
    }
}

.leaflet-popup-content {
    margin: 12px 14px;
    line-height: 1.5;
}

.leaflet-popup-content h4 {
    margin: 0 0 8px;
    font-size: 1rem;
}

/* Custom Scrollbar for sidebar list */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

/* Compact Legend */
.legend-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    background: rgba(15, 23, 42, 0.4);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.legend-pill-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.1);
    color: #cbd5e1;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.legend-pill-sm img {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.legend-swatch-sm {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
