@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root{
  --bg: #0A0F1C; --panel: #10182B; --panel-2: #141F38; --line: #223052;
  --text: #E9EEF7; --muted: #8493B0; --green: #2FBF71; --amber: #E8A33D;
  --red: #E85D5D; --pulse: #3DDC97; --accent: #4C8DFF;
}
*{box-sizing:border-box; margin:0; padding:0;}
html,body{background:var(--bg); color:var(--text); font-family:'IBM Plex Sans', sans-serif; width:100%; height:100vh; overflow:hidden;}
body{display:flex; flex-direction:column;}
.mono{font-family:'IBM Plex Mono', monospace;}
a{color:inherit;}
img{max-width:100%;}

.topbar{flex:none; display:flex; align-items:center; justify-content:space-between; padding:8px 28px; border-bottom:1px solid var(--line); background:linear-gradient(180deg, var(--panel-2), var(--bg));}
.brand{display:flex; align-items:center; gap:12px; text-decoration:none; color:var(--text);}
.crest{width:34px; height:34px; border-radius:9px; background:radial-gradient(circle at 30% 30%, #2FBF71, #103a29 70%); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:11px; color:#0A0F1C; box-shadow:0 0 0 1px rgba(47,191,113,.25); flex:none;}
.brand h1{font-size:16px; font-weight:700; letter-spacing:.2px;}
.brand p{font-size:10.5px; color:var(--muted); margin-top:1px;}
.topbar-actions{flex:none; display:flex; flex-direction:column; gap:6px; margin-right:24px;}
.focal-btn{flex:none; font-family:'IBM Plex Sans', sans-serif; font-size:11.5px; font-weight:700; background:transparent; border:1px solid var(--line); color:var(--text); padding:8px 14px; border-radius:8px; cursor:pointer; white-space:nowrap; text-decoration:none; display:inline-block;}
.focal-btn:hover{border-color:var(--accent);}

.clock{text-align:right;}
.clock .time{font-size:20px; font-weight:700; letter-spacing:1px;}
.clock .date{font-size:11px; color:var(--muted); margin-top:1px;}

/* Emergency helplines — always visible, never gated behind a click */
.emergency{flex:none; background:var(--panel-2); border-bottom:1px solid var(--line); padding:7px 28px;}
.emergency .eyebrow{color:var(--muted); font-size:11.5px; text-transform:uppercase; letter-spacing:1.2px; margin-bottom:5px;}
.em-grid{display:grid; grid-template-columns:repeat(6,1fr); gap:8px;}
.em-card{background:var(--panel); border:1px solid var(--line); border-radius:8px; padding:6px 8px; text-align:center; text-decoration:none; color:var(--text); transition:border-color .15s;}
.em-card:hover{border-color:var(--accent);}
.em-card .num{font-family:'IBM Plex Mono'; font-size:17px; font-weight:700; color:var(--green);}
.em-card .lbl{font-size:11px; margin-top:2px; color:var(--muted);}

.wrap{flex:1; min-height:0; display:flex; flex-direction:column; padding:10px 20px; gap:8px;}

.alert-banner{flex:none; display:flex; gap:10px; align-items:flex-start; background:var(--panel-2); border:1px solid var(--amber); color:var(--text); padding:8px 14px; border-radius:10px; font-size:12px; line-height:1.4;}
.alert-banner .ic{font-size:15px;}

.kpi-row{flex:none; display:grid; grid-template-columns:repeat(3,1fr); gap:10px;}
.kpi{background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:9px 14px; position:relative; overflow:hidden; box-shadow:0 2px 10px rgba(0,0,0,.18); display:flex; flex-direction:column;}
.kpi::after{content:''; position:absolute; left:0; top:0; bottom:0; width:3px;}
.kpi.ok::after{background:var(--green);} .kpi.watch::after{background:var(--amber);} .kpi.alert::after{background:var(--red);}
.kpi .label{font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:.7px; font-weight:600;}
.kpi .value{font-size:19px; font-weight:700; margin-top:3px; line-height:1.15;}
.kpi .sub{font-size:10px; color:var(--muted); margin-top:3px;}
.kpi-detail-btn{
  margin-top:8px; align-self:flex-start; font-size:9.5px; font-weight:700;
  background:transparent; border:1px solid var(--line); color:var(--text);
  padding:4px 10px; border-radius:6px; cursor:pointer;
}
.kpi-detail-btn:hover{border-color:var(--accent);}

.updated-tag{font-size:9px; color:var(--muted); margin-top:4px; text-transform:uppercase; letter-spacing:.3px;}

.body-grid{flex:1; min-height:0; display:grid; grid-template-columns:1fr 1fr 1fr; gap:10px;}
.col{display:flex; flex-direction:column; min-height:0; gap:8px;}
.panel{background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:10px 14px; box-shadow:0 2px 12px rgba(0,0,0,.2); display:flex; flex-direction:column; min-height:0;}
.panel h3{font-size:12.5px; font-weight:700; margin-bottom:2px; flex:none;}
.panel .hint{font-size:10px; color:var(--muted); margin-bottom:6px; flex:none;}
.panel-scroll{flex:1; min-height:110px; overflow-y:auto; padding-right:2px;}
.panel-scroll::-webkit-scrollbar{width:5px;}
.panel-scroll::-webkit-scrollbar-thumb{background:var(--line); border-radius:3px;}

.search-input{
  flex:none; width:100%; margin-bottom:6px; padding:6px 10px;
  background:var(--panel-2); border:1px solid var(--line); border-radius:8px;
  color:var(--text); font-family:'IBM Plex Sans', sans-serif; font-size:12px;
}
.search-input::placeholder{color:var(--muted);}
.search-input:focus{outline:none; border-color:var(--accent);}

.dept-grid{display:grid; grid-template-columns:repeat(2,1fr); gap:6px;}
.dept{border:1px solid var(--line); border-radius:9px; padding:7px 9px; background:var(--panel-2); display:flex; flex-direction:column; gap:4px;}
.dept .name{font-size:11.5px; font-weight:600;}
.dept .status{font-size:10px; color:var(--muted);}
.dept-detail-btn{align-self:flex-start; font-size:9px; font-weight:700; background:transparent; border:1px solid var(--line); color:var(--muted); padding:3px 8px; border-radius:5px; cursor:pointer;}
.dept-detail-btn:hover{border-color:var(--accent); color:var(--text);}

.place-thumb{
  height:64px; border-radius:7px; background-color:var(--panel);
  background-size:cover; background-position:center;
  display:flex; align-items:center; justify-content:center; font-size:22px;
}

.list-simple{list-style:none; display:flex; justify-content:space-between; font-size:12px;}
.list-simple .k{color:var(--muted);} .list-simple .v{font-weight:700;}
.progress{height:5px; border-radius:3px; background:var(--line); margin-top:5px; margin-bottom:6px; overflow:hidden;}
.progress > div{height:100%; background:var(--accent);}
.proj-row{margin-bottom:12px;}
.proj-detail-btn{font-size:9px; font-weight:700; background:transparent; border:1px solid var(--line); color:var(--muted); padding:3px 8px; border-radius:5px; cursor:pointer; margin-top:4px;}
.proj-detail-btn:hover{border-color:var(--accent); color:var(--text);}

.stat-row{display:grid; grid-template-columns:repeat(2,1fr); gap:6px;}
.stat{border:1px solid var(--line); border-radius:9px; padding:7px; background:var(--panel-2); text-align:center;}
.stat .n{font-size:17px; font-weight:700;} .stat .l{font-size:9px; color:var(--muted); margin-top:2px; text-transform:uppercase; letter-spacing:.4px;}

.hosp-list{margin-top:16px; display:flex; flex-direction:column; gap:10px;}
.hosp-row{border:1px solid var(--line); border-radius:9px; padding:10px 12px; background:var(--panel-2);}
.hosp-top{display:flex; justify-content:space-between; font-size:12.5px; font-weight:600;}
.hosp-nums{font-size:11px; color:var(--muted); margin-top:2px;}

/* Directory + notices rows reuse the same simple-list-row look */
.dir-row, .notice-row{border-bottom:1px solid var(--line); padding:6px 0; font-size:12px;}
.dir-row:last-child, .notice-row:last-child{border-bottom:none;}
.dir-row .name{font-weight:600; font-size:12.5px;}
.dir-row .meta{color:var(--muted); font-size:11px; margin-top:2px;}
.dir-row .phone{font-family:'IBM Plex Mono'; color:var(--pulse); margin-top:3px; font-size:11px;}
.notice-row{display:flex; justify-content:space-between; align-items:center; gap:10px;}
.notice-row .notice-date{font-size:10.5px; color:var(--muted); font-family:'IBM Plex Mono'; min-width:80px;}
.notice-link{color:var(--accent); font-weight:700; text-decoration:none; font-size:11.5px; white-space:nowrap;}

.feed{list-style:none; display:flex; flex-direction:column; gap:7px;}
.feed li{display:flex; gap:8px; align-items:flex-start; font-size:11.5px; padding-bottom:7px; border-bottom:1px solid var(--line);}
.feed li:last-child{border-bottom:none;}
.feed .t{color:var(--muted); font-size:10px; min-width:36px;}
.feed .badge{font-size:8.5px; padding:2px 5px; border-radius:5px; text-transform:uppercase; font-weight:700; min-width:42px; text-align:center;}
.badge.high{background:rgba(232,93,93,.15); color:var(--red);} .badge.med{background:rgba(232,163,61,.15); color:var(--amber);} .badge.low{background:rgba(47,191,113,.15); color:var(--green);}

.modal-backdrop{display:none; position:fixed; inset:0; background:rgba(5,8,16,.72); z-index:100; align-items:center; justify-content:center; padding:20px;}
.modal-backdrop.open{display:flex;}
.modal{width:100%; max-width:600px; max-height:85vh; overflow-y:auto; background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:24px;}
.modal-top{display:flex; justify-content:space-between; align-items:flex-start; gap:12px;}
.modal-title{font-size:17px; font-weight:700;}
.modal-meta{font-size:11.5px; color:var(--muted); margin-top:4px;}
.modal-close{background:none; border:1px solid var(--line); color:var(--muted); width:28px; height:28px; border-radius:7px; cursor:pointer; font-size:14px; flex:none;}
.modal-close:hover{color:var(--text); border-color:var(--accent);}
.modal-desc{font-size:13px; color:#C4CCDC; line-height:1.6; margin-top:16px;}
.modal-gallery{display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:16px;}
.modal-gallery .gimg{position:relative; border-radius:8px; overflow:hidden; aspect-ratio:4/3;}
.modal-gallery img{width:100%; height:100%; object-fit:cover; display:block;}
.modal-footer{display:flex; gap:10px; margin-top:20px;}
.modal-btn{flex:1; text-align:center; text-decoration:none; font-family:'IBM Plex Sans', sans-serif; font-size:12.5px; font-weight:700; padding:11px; border-radius:9px; cursor:pointer; border:1px solid var(--line);}
.modal-btn.ghost{background:transparent; color:var(--text);}

footer{flex:none; text-align:center; font-size:10px; color:var(--muted); padding-top:2px;}

/* Responsive fallback — mirrors the DNC Situation Dashboard exactly: a
   fixed-height, non-scrolling, 3-column layout on the primary desktop/big-
   screen target, collapsing to a normal stacked, scrolling page below this
   width for tablets, small laptop windows, and phones. */
@media (max-width: 1100px){
  html,body{height:auto; min-height:100vh; overflow:visible;}
  .wrap{flex:none; min-height:auto;}
  .em-grid{grid-template-columns:repeat(3,1fr);}
  .kpi-row{grid-template-columns:repeat(3,1fr);}
  .body-grid{grid-template-columns:1fr;}
  .col{gap:14px;}
  .panel{flex:none !important;}
  .panel-scroll{flex:none; overflow-y:visible; max-height:none;}
}

@media (max-width: 640px){
  .topbar{padding:14px 16px; flex-wrap:wrap; row-gap:10px;}
  .emergency{padding:12px 16px;}
  .wrap{padding:14px 16px;}
  .clock{text-align:left;}
  .topbar-actions{margin-right:0;}
  .em-grid{grid-template-columns:repeat(2,1fr);}
  .kpi-row{grid-template-columns:repeat(2,1fr);}
  .dept-grid{grid-template-columns:1fr;}
  .modal{padding:18px;}
  .modal-gallery{grid-template-columns:repeat(2,1fr);}
}
