/* WSI Dashboard — Paper Journal Theme */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Inter:wght@400;500;600;700&display=swap');

*{box-sizing:border-box;margin:0;padding:0}

#wsi-app{font-family:'Inter','helvetica neue',helvetica,arial;background:#fafaf8;color:#0f0f0f;border:1px solid #1a1a1a;border-radius:2px;overflow:hidden;max-width:1200px;margin:0 auto}
#wsi-header{padding:1.75rem 2rem 1.5rem;border-bottom:1px solid #1a1a1a;background:#ffffff}
.wsi-title{font-family:'Playfair Display',Georgia,serif;font-size:1.75rem;font-weight:700;color:#0f0f0f;letter-spacing:-0.01em;line-height:1.2}
.wsi-subtitle{font-size:0.78rem;color:#6b6860;margin-top:0.3rem;letter-spacing:0.04em;text-transform:uppercase}
#wsi-tabs{display:flex;background:#ffffff;border-bottom:1px solid #1a1a1a;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none}
#wsi-tabs::-webkit-scrollbar{display:none}
.wsi-tab-btn{padding:0.85rem 1.3rem;border:none;background:none;color:#6b6860;cursor:pointer;font-family:'Inter',sans-serif;font-size:0.72rem;font-weight:600;text-transform:uppercase;letter-spacing:0.1em;border-bottom:2px solid transparent;white-space:nowrap;transition:color 0.15s,border-color 0.15s;margin-bottom:-1px}
.wsi-tab-btn:hover{color:#0f0f0f}
.wsi-tab-btn.active{color:#0f0f0f;border-bottom-color:#1a1a1a}
#wsi-content{padding:1.75rem 2rem;min-height:500px;background:#fafaf8}
.wsi-kpi-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:0;margin-bottom:1.75rem;border:1px solid #1a1a1a;border-radius:2px;overflow:hidden}
.wsi-kpi{background:#ffffff;padding:1.1rem 1rem;text-align:center;border-right:1px solid #1a1a1a}
.wsi-kpi:last-child{border-right:none}
.wsi-kpi-val{font-size:2rem;font-weight:700;line-height:1;font-variant-numeric:tabular-nums;color:#0f0f0f}
.wsi-kpi-label{font-size:0.62rem;color:#6b6860;margin-top:0.35rem;text-transform:uppercase;letter-spacing:0.1em}
.wsi-card{background:#ffffff;border:1px solid #1a1a1a;border-radius:2px;padding:1.25rem;margin-bottom:1rem}
.wsi-card-title{font-size:0.62rem;font-weight:600;color:#6b6860;text-transform:uppercase;letter-spacing:0.1em;margin-bottom:1rem;padding-bottom:0.6rem;border-bottom:1px solid #e5e3de}
.wsi-grid2{display:grid;grid-template-columns:1fr 1fr;gap:1rem}
.wsi-grid3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:1rem}
.wsi-table{width:100%;border-collapse:collapse;font-size:0.83rem}
.wsi-table th{padding:0.55rem 0.75rem;text-align:left;font-size:0.62rem;font-weight:600;color:#6b6860;text-transform:uppercase;letter-spacing:0.08em;border-bottom:1px solid #1a1a1a;cursor:pointer;user-select:none;background:#ffffff}
.wsi-table th:hover{color:#0f0f0f}
.wsi-table td{padding:0.5rem 0.75rem;border-bottom:1px solid #e5e3de;color:#0f0f0f}
.wsi-table tr:nth-child(even) td{background:#f4f3ef}
.wsi-table tr:hover td{background:#f0ede8}
.risk-critical{color:#b91c1c}.risk-high{color:#c2410c}.risk-medium{color:#a16207}.risk-low{color:#15803d}.risk-stable{color:#166534}
.wsi-badge{display:inline-block;padding:0.15rem 0.5rem;border-radius:2px;font-size:0.68rem;font-weight:600;text-transform:uppercase;letter-spacing:0.06em;border:1px solid currentColor;background:transparent}
.wsi-btn{background:#ffffff;border:1px solid #1a1a1a;color:#0f0f0f;padding:0.4rem 0.9rem;border-radius:2px;cursor:pointer;font-family:'Inter',sans-serif;font-size:0.75rem;font-weight:500;letter-spacing:0.04em;transition:all 0.15s}
.wsi-btn:hover{background:#1a1a1a;color:#ffffff}
.wsi-btn.active{background:#1a1a1a;color:#ffffff}
.wsi-select{background:#ffffff;border:1px solid #1a1a1a;color:#0f0f0f;padding:0.45rem 0.75rem;border-radius:2px;font-family:'Inter',sans-serif;font-size:0.83rem;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%231a1a1a'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 0.6rem center;padding-right:2rem}
.wsi-search{background:#ffffff;border:1px solid #1a1a1a;color:#0f0f0f;padding:0.45rem 0.75rem;border-radius:2px;font-family:'Inter',sans-serif;font-size:0.83rem;width:100%;max-width:280px}
.wsi-search:focus,.wsi-select:focus{outline:2px solid #1a1a1a;outline-offset:1px}
#wsi-map-container{width:100%;height:520px;border:1px solid #1a1a1a;border-radius:2px;overflow:hidden}
.wsi-tooltip .leaflet-tooltip{background:#ffffff;border:1px solid #1a1a1a;border-radius:2px;color:#0f0f0f;box-shadow:0 2px 8px rgba(0,0,0,0.1)}
.wsi-bar-wrap{background:#f4f3ef;border-radius:2px;height:8px;overflow:hidden;border:1px solid #e5e3de}
.wsi-bar{height:100%;border-radius:2px;transition:width 0.5s}
.wsi-divider{border:none;border-top:1px solid #1a1a1a;margin:1.5rem 0}
canvas{background:transparent}
.leaflet-tooltip{background:#ffffff !important;border:1px solid #1a1a1a !important;border-radius:2px !important;color:#0f0f0f !important;box-shadow:0 2px 8px rgba(0,0,0,0.08) !important;font-family:'Inter',sans-serif !important;font-size:0.8rem !important}
.leaflet-tooltip-top:before{border-top-color:#1a1a1a !important}
@media(max-width:768px){#wsi-header{padding:1.2rem}#wsi-content{padding:1rem}.wsi-grid2,.wsi-grid3{grid-template-columns:1fr}.wsi-kpi-grid{grid-template-columns:repeat(3,1fr)}.wsi-kpi{border-right:1px solid #1a1a1a;border-bottom:1px solid #e5e3de}.wsi-tab-btn{padding:0.7rem 0.9rem;font-size:0.66rem}#wsi-map-container{height:380px}.wsi-title{font-size:1.35rem}.wsi-kpi-val{font-size:1.6rem}}
@media(max-width:480px){.wsi-kpi-grid{grid-template-columns:repeat(2,1fr)}#wsi-header{padding:1rem}#wsi-content{padding:0.9rem}}

/* Layout: sidebar + content */
#wsi-layout { display: flex; min-height: 600px; }
#wsi-sidebar { width: 160px; flex-shrink: 0; background: #ffffff; border-right: 1px solid #1a1a1a; padding: 1rem 0; display: flex; flex-direction: column; }
.wsi-nav-section-label { font-size: 0.58rem; font-weight: 700; color: #6b6860; letter-spacing: 0.14em; text-transform: uppercase; padding: 0.25rem 1rem 0.5rem; }
#wsi-sidebar .wsi-tab-btn { display: flex; align-items: center; gap: 0.5rem; padding: 0.65rem 1rem; text-align: left; border-bottom: none; border-left: 2px solid transparent; border-radius: 0; font-size: 0.78rem; letter-spacing: 0.04em; text-transform: none; width: 100%; position: relative; }
#wsi-sidebar .wsi-tab-btn:hover { background: #f4f3ef; }
#wsi-sidebar .wsi-tab-btn.active { border-left-color: #1a1a1a; background: #f4f3ef; color: #0f0f0f; font-weight: 600; }
.wsi-nav-icon { font-size: 0.9rem; width: 1.1rem; text-align: center; flex-shrink: 0; }
.wsi-nav-label { flex: 1; }
.wsi-nav-badge { font-size: 0.55rem; font-weight: 700; padding: 0.1rem 0.3rem; border-radius: 2px; letter-spacing: 0.06em; }
.wsi-badge-new { background: #1a1a1a; color: #ffffff; }
#wsi-content { flex: 1; padding: 1.75rem; min-width: 0; background: #fafaf8; overflow-x: hidden; }
#wsi-bottom-bar { display: none; }
#wsi-country-quick { display: flex; align-items: center; gap: 0.5rem; }
#wsi-tabs { display: none; } /* hide old tab bar */

@media (max-width: 768px) {
  #wsi-sidebar { display: none; }
  #wsi-bottom-bar { display: flex; border-top: 1px solid #1a1a1a; background: #ffffff; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #wsi-bottom-bar .wsi-tab-btn { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; padding: 0.6rem 0.8rem; font-size: 0.65rem; border-bottom: none; border-top: 2px solid transparent; flex: 1; min-width: 60px; text-transform: none; letter-spacing: 0; }
  #wsi-bottom-bar .wsi-tab-btn.active { border-top-color: #1a1a1a; color: #0f0f0f; }
  #wsi-bottom-bar .wsi-tab-btn span { font-size: 1.1rem; }
  #wsi-bottom-bar .wsi-tab-btn small { font-size: 0.6rem; color: #6b6860; }
  #wsi-layout { flex-direction: column; }
  #wsi-content { padding: 1rem; }
  #wsi-header { flex-direction: column; gap: 0.75rem; }
}
