/* MyPremier Admin Console — dark shell */
:root{
  --bg:#0b1016;
  --panel:#101826;
  --card:#121a23;
  --border: rgba(255,255,255,0.08);
  --muted:#9bb4c2;
  --text:#ffffff;
  --brand:#2d5c73;
  --accent:#1e8e3e;
  --danger:#d93025;
  --shadow: 0 20px 50px rgba(0,0,0,0.35);
}

*{ box-sizing:border-box; }
html,body{ height:100%; margin:0; }
body{
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
}

code{
  background: rgba(255,255,255,.06);
  padding: .12rem .35rem;
  border-radius: 6px;
}

.app{
  display:grid;
  grid-template-columns: 260px 1fr;
  height:100vh;
}

.sidebar{
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  display:flex;
  flex-direction:column;
  gap: 14px;
}

.brand{
  padding: 10px 10px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
}
.brand-title{ font-weight: 800; font-size: 18px; letter-spacing:.2px; }
.brand-sub{ color: var(--muted); font-size: 12px; margin-top:2px; }

.nav{ display:flex; flex-direction:column; gap:6px; }
.nav-item{
  padding: 10px 10px;
  border-radius: 10px;
  text-decoration:none;
  color: var(--text);
  border: 1px solid transparent;
}
.nav-item:hover{ background: rgba(255,255,255,0.03); border-color: var(--border); }
.nav-item.active{
  background: rgba(45,92,115,0.20);
  border-color: rgba(45,92,115,0.35);
}

.sidebar-footer{
  margin-top:auto;
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}
.kv{ display:flex; justify-content:space-between; margin-bottom:10px; font-size:12px; color: var(--muted); }
.hint{ color: var(--muted); font-size: 12px; margin-top: 10px; }

.main{
  display:flex;
  flex-direction:column;
  min-width:0;
}

.topbar{
  height: 56px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.page-title{ font-weight: 750; letter-spacing:.2px; }
.badge{
  margin-left: 10px;
  display:inline-flex;
  align-items:center;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: rgba(30,142,62,.10);
  border: 1px solid rgba(30,142,62,.25);
  color: var(--accent);
  font-size: 12px;
}
.topbar-left{ display:flex; align-items:center; gap:10px; }
.link{ color: #b8d4e3; text-decoration:none; border-bottom: 1px dashed rgba(184,212,227,.6); }
.link:hover{ color: white; border-bottom-color: white; }

.page{
  padding: 18px;
  overflow:auto;
}
.hidden{ display:none; }

.card{
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 14px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.card h2{ margin: 0 0 10px; font-size: 16px; }
.muted{ color: var(--muted); }

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.card.mini{ box-shadow: none; }
.mini-title{ font-weight: 700; margin-bottom: 8px; }

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: .5rem;
  padding: .55rem .75rem;
  border-radius: 10px;
  background: rgba(30,142,62,.12);
  border: 1px solid rgba(30,142,62,.25);
  color: white;
  cursor:pointer;
}
.btn:hover{ background: rgba(30,142,62,.18); }
.btn.subtle{
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.10);
}
.btn.subtle:hover{ background: rgba(255,255,255,0.07); }

.btn.icon{
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 12px;
  font-size: 18px;
}

/* Only show hamburger on small screens */
#btnMenu{ display:none; }

.split{
  display:grid;
  grid-template-columns: 520px 1fr;
  gap: 14px;
  align-items:start;
}
.panel{ min-width: 0; }
.panel.left{ }
.panel.right{ }

.filters .row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.filters label{
  display:flex;
  flex-direction:column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.filters input, .filters select{
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  color: white;
  padding: .55rem .6rem;
  outline: none;
}
.filters input:focus, .filters select:focus{
  border-color: rgba(45,92,115,0.55);
}
.row.toggles{
  grid-template-columns: 1fr;
  gap: 6px;
}
.toggle{ display:flex; flex-direction:row; align-items:center; gap:8px; color: var(--muted); }
.actions{ grid-template-columns: auto auto; justify-content:flex-start; }

.table-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.table-wrap{
  overflow:auto;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
}
.table{
  width:100%;
  border-collapse:collapse;
  font-size: 12px;
}
.table thead th{
  position: sticky;
  top: 0;
  background: rgba(10,14,20,0.95);
  text-align:left;
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
}
.table tbody td{
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  vertical-align: top;
}
.table tbody tr:hover{
  background: rgba(255,255,255,0.03);
  cursor:pointer;
}
.table-actions{
  display:flex;
  align-items:center;
  gap: 10px;
  margin-top: 10px;
}

.map-card{ padding: 12px; }
.map-header{ display:flex; align-items:center; justify-content:space-between; margin-bottom: 10px; }
.map{
  height: 640px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
}

/* Mobile sidebar overlay */
.overlay{
  display:none;
  position:fixed;
  inset:0;
  background: rgba(0,0,0,0.45);
  z-index: 40;
}

/* Responsive layout */
@media (max-width: 1200px){
  .split{ grid-template-columns: 1fr; }
  .map{ height: 420px; }
}

@media (max-width: 900px){
  .app{ grid-template-columns: 1fr; }

  .sidebar{
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 260px;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    z-index: 50;
    background: var(--panel);
  }

  body.sidebar-open .sidebar{ transform: translateX(0); }
  body.sidebar-open .overlay{ display:block; }

  .page{ padding: 12px; }
  .topbar{ padding: 0 12px; }
  .grid2{ grid-template-columns: 1fr; }

  #btnMenu{ display:inline-flex; }
}

/* Embedded mode (for MAUI WebView): hide chrome */
body.embed .sidebar{ display:none !important; }
body.embed .overlay{ display:none !important; }
body.embed .topbar{ display:none !important; }
body.embed .app{ grid-template-columns: 1fr; }
body.embed .page{ padding: 10px; }

.map-footer{ margin-top: 10px; font-size: 12px; }

.modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display:grid;
  place-items:center;
  z-index: 1000;
}
.modal.hidden{ display:none; }
.modal-card{
  width: min(520px, 92vw);
  background: #0f1723;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.modal-card h3{ margin: 0 0 8px; }
.modal-card input{
  width: 100%;
  margin-top: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  color: white;
  padding: .6rem .65rem;
}
.modal-actions{ display:flex; gap: 10px; margin-top: 12px; justify-content:flex-end; }

/* ArcGIS map container background */
.esri-view{ background: #0b1016; }

/* MultiSelect (dynamic, multi-value filters) */
.ms { position: relative; width: 100%; }
.ms-btn{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  color: white;
  padding: .55rem .6rem;
  cursor: pointer;
}
.ms-btn:hover{ border-color: rgba(45,92,115,0.55); }
.ms-btn-text{ font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ms-caret{ opacity:.8; }

.ms-pop{
  position:absolute;
  left:0; right:0;
  top: calc(100% + 6px);
  z-index: 2000;
  background: #0b1220;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
  padding: 10px;
}
.ms-pop.hidden{ display:none; }

.ms-search{
  width:100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  color: white;
  padding: .5rem .55rem;
  outline:none;
}

.ms-actions{
  display:flex;
  justify-content:space-between;
  margin-top: 8px;
}
.ms-link{
  background:none;
  border:none;
  color:#b8d4e3;
  font-size:12px;
  cursor:pointer;
  padding: 4px 6px;
}
.ms-link:hover{ color:white; }

.ms-list{
  margin-top: 8px;
  max-height: 220px;
  overflow:auto;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
}
.ms-item{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 8px 10px;
  cursor:pointer;
}
.ms-item:hover{ background: rgba(255,255,255,0.04); }
.ms-check{ transform: scale(1.05); }
.ms-label{ color: white; font-size: 13px; }
