/* AMR Dashboard styles */

:root {
    --navy: #0b1c3d;
    --navy-2: #0f2451;
    --green: #1b7a3d;
    --green-2: #0e5c2b;
    --blue: #1d4e89;
    --blue-2: #163d6d;
    --purple: #5b2a86;
    --purple-2: #431f66;
    --teal: #0e4f5c;
    --teal-2: #0a3a44;
    --red: #dc2626;
    --orange: #ea580c;
    --yellow: #ca8a04;
    --border: #e5e7eb;
    --bg: #f4f6f9;
    --text: #1f2937;
    --muted: #6b7280;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* ===== Top bar ===== */
.topbar {
    background: var(--navy);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.logo-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%;
    border: 2px solid #fff; font-weight: bold; flex-shrink: 0;
}
.logo-text strong { display: block; font-size: 16px; }
.logo-text small { color: #b9c4dd; font-size: 11px; }

.topbar-nav { display: flex; gap: 4px; flex-wrap: wrap; background: rgba(255,255,255,0.06); padding: 4px; border-radius: 10px; }
.topbar-nav a {
    color: #cbd5e1; text-decoration: none; font-size: 14px; font-weight: 700;
    padding: 8px 18px; border-radius: 8px;
}
.topbar-nav a:hover { color: #fff; }
.topbar-nav a.active { background: #fff; color: var(--navy); }

.topbar-right { display: flex; align-items: center; gap: 14px; }
.icon-btn { position: relative; cursor: pointer; font-size: 16px; }
.icon-btn .badge {
    position: absolute; top: -8px; right: -10px;
    background: var(--red); color: #fff; font-size: 10px;
    border-radius: 50%; padding: 1px 5px;
}

/* ===== Layout ===== */
.app-body { padding: 0; margin: 0; max-width: none; }

.dash-layout { display: flex; gap: 0; align-items: stretch; min-height: calc(100vh - 68px); }

.dash-sidebar {
    width: 220px; flex-shrink: 0;
    background: var(--navy);
    border-radius: 0;
    overflow: hidden;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
}
.sidebar-menu { list-style: none; margin: 0; padding: 0; }
.sidebar-menu li a {
    display: flex; align-items: center; gap: 10px;
    color: #cbd5e1; text-decoration: none; font-size: 13px; font-weight: 600;
    padding: 11px 18px;
}
.sidebar-menu li a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-menu li.active a { color: #fff; }
.sidebar-icon { font-size: 15px; width: 18px; text-align: center; }

.sidebar-green .sidebar-menu li.active a { background: linear-gradient(90deg, var(--green), var(--green-2)); }
.sidebar-blue .sidebar-menu li.active a { background: linear-gradient(90deg, var(--blue), var(--blue-2)); }
.sidebar-purple .sidebar-menu li.active a { background: linear-gradient(90deg, var(--purple), var(--purple-2)); }
.sidebar-teal .sidebar-menu li.active a { background: linear-gradient(90deg, var(--teal), var(--teal-2)); }

.dash-main { flex: 1; min-width: 0; padding: 16px 20px; }

@media (max-width: 900px) {
    .dash-layout { flex-direction: column; min-height: 0; }
    .dash-sidebar { width: 100%; }
    .sidebar-menu { display: flex; flex-wrap: wrap; }
    .sidebar-menu li a { padding: 8px 12px; }
}

.dashboard-section {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.section-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 18px; color: #fff; font-weight: 700; letter-spacing: 0.4px;
}
.section-header .hicon { margin-right: 8px; }
.header-green { background: linear-gradient(90deg, var(--green), var(--green-2)); }
.header-blue { background: linear-gradient(90deg, var(--blue), var(--blue-2)); }
.header-purple { background: linear-gradient(90deg, var(--purple), var(--purple-2)); }
.header-teal { background: linear-gradient(90deg, var(--teal), var(--teal-2)); }

.section-body { padding: 18px; }

/* ===== Filter bar ===== */
.filter-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 18px;
    background: #fff; border: 1px solid var(--border); border-radius: 8px;
    padding: 14px 16px; margin-bottom: 18px;
}
.filter-field { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.filter-field label { font-size: 13px; color: var(--navy); font-weight: 700; white-space: nowrap; }
.filter-field select, .filter-field input[type="date"], .filter-field input[type="text"] {
    padding: 7px 10px; border: 1px solid #dbe3fb; border-radius: 6px; font-size: 13px; min-width: 130px;
    background: #eef2ff; color: var(--text);
}
.filter-btn {
    background: #2f5fff; color: #fff; border: none; border-radius: 6px;
    padding: 9px 20px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.filter-btn:hover { background: #1e46d6; }
.filter-reset { font-size: 13px; color: #334155; text-decoration: underline; font-weight: 600; }
.filter-reset:hover { color: var(--navy); }

.cards-row { display: grid; gap: 16px; margin-bottom: 16px; }
.cards-row:last-child { margin-bottom: 0; }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) {
    .cards-3, .cards-4 { grid-template-columns: repeat(2, 1fr); }
    .landing-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .cards-2, .cards-3, .cards-4 { grid-template-columns: 1fr; }
}

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
}
.card h4 { margin: 0 0 10px; font-size: 14px; }
.card.center { text-align: center; }

/* ===== Tables ===== */
.kv-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.kv-table td { padding: 4px 0; border-bottom: 1px dashed #f0f0f0; color: var(--muted); vertical-align: top; }
.kv-table td.value-strong { color: var(--text); font-weight: 600; }
.kv-table td.tright { text-align: right; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
    text-align: left; font-size: 11px; text-transform: uppercase;
    color: var(--muted); border-bottom: 1px solid var(--border); padding: 6px 4px;
}
.data-table td { padding: 6px 4px; border-bottom: 1px solid #f5f5f5; }

/* ===== Text helpers ===== */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.big { font-size: 22px; font-weight: 700; margin: 2px 0; }
.center { text-align: center; }
.text-red { color: var(--red); font-weight: 600; }
.text-orange { color: var(--orange); font-weight: 600; }
.text-green { color: var(--green); font-weight: 600; }
.text-yellow { color: var(--yellow); font-weight: 600; }
.value-strong { font-weight: 600; color: var(--text); }
.green { color: var(--green); }

/* ===== Clinician ===== */
.organism-row { display: flex; align-items: center; justify-content: space-between; }
.organism-name { font-size: 15px; }
.prob-circle {
    width: 46px; height: 46px; border-radius: 50%;
    background: #ecfdf3; color: var(--green);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px; border: 2px solid var(--green);
}
.organism-image-placeholder {
    text-align: center; font-size: 46px; padding: 10px 0;
    background: #f8fafc; border-radius: 6px; margin: 8px 0;
}
.drug-name { color: var(--green); font-weight: 700; font-size: 15px; margin: 4px 0 10px; }
.check-list { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.check-list li { padding: 3px 0; color: var(--text); }

.gauge {
    width: 110px; height: 110px; border-radius: 50%; margin: 0 auto 8px;
    background: conic-gradient(var(--green) 0deg 120deg, var(--yellow) 120deg 240deg, var(--red) 240deg 360deg);
    display: flex; align-items: center; justify-content: center; position: relative;
}
.gauge::before { content: ""; position: absolute; width: 78px; height: 78px; border-radius: 50%; background: #fff; }
.gauge-value { position: relative; font-size: 26px; font-weight: 800; z-index: 1; }
.gauge-unit { position: absolute; bottom: 22px; font-size: 11px; color: var(--muted); z-index: 1; }

.stats-bar {
    display: flex; justify-content: space-around; flex-wrap: wrap; gap: 10px;
    background: #f8fafc; border-radius: 8px; padding: 12px; margin-top: 4px; font-size: 13px;
}
.stats-icon { margin-right: 6px; }

/* ===== Laboratory ===== */
.progress { background: #e5e7eb; border-radius: 6px; height: 8px; overflow: hidden; margin: 4px 0; }
.progress-bar { height: 100%; border-radius: 6px; }
.bar-blue { background: var(--blue); }
.bar-grey { background: #9ca3af; }
.tag { font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 700; }
.tag-blue { background: #dbeafe; color: var(--blue); }
.tag-grey { background: #e5e7eb; color: #4b5563; }

.pill { font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 10px; text-transform: uppercase; }
.pill-high, .pill-high-risk { background: #fee2e2; color: var(--red); }
.pill-medium, .pill-moderate { background: #ffedd5; color: var(--orange); }
.pill-low { background: #dcfce7; color: var(--green); }

.alert-box {
    background: #fef2f2; color: var(--red); border: 1px solid #fecaca;
    border-radius: 6px; padding: 8px 10px; font-size: 12.5px; font-weight: 600; margin-bottom: 8px;
}

/* ===== Hospital ===== */
.projection-row { display: flex; justify-content: space-around; text-align: center; margin-top: 8px; }

/* ===== Pagination ===== */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pagination a {
    display: inline-block; min-width: 30px; text-align: center;
    padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px;
    font-size: 12px; color: var(--navy); text-decoration: none; background: #fff;
}
.pagination a:hover { background: #f1f5f9; }
.pagination a.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ===== Public Health ===== */
.leaflet-map { height: 220px; border-radius: 6px; margin-bottom: 8px; z-index: 0; }
.legend-row { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.dot-green { background: var(--green); }
.dot-yellow { background: var(--yellow); }
.dot-orange { background: var(--orange); }
.dot-red { background: var(--red); }
.dot-purple { background: var(--purple); }

.outbreak-item { display: flex; justify-content: space-between; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid #f3f4f6; }
.outbreak-item:last-of-type { border-bottom: none; }

.onehealth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; }
.onehealth-diagram svg { width: 100%; max-width: 220px; height: auto; display: block; margin: 0 auto; }

.link-more { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--blue); text-decoration: none; }

/* ===== Status bar (footer) ===== */
.statusbar {
    background: var(--navy);
    color: #cbd5e1;
    font-size: 12px;
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 10px 20px;
    flex-wrap: wrap;
}
.statusbar-right { margin-left: auto; }