:root {
  --bg: #0B1220;
  --bs-body-bg : var(--bg);
  --bs-body-color: #f5f5f5; 
  --panel: #111826;
  --ink: #e7f0ff;
  --muted: #9ab;
  --accent: #59b1ff;
  --grid: #293241;
  --good: #22c55e;   /* Ready (Green) */
  --pending: #3b82f6;/* Pending (Blue) */
  --over: #a78bfa;   /* Overloaded (Purple) */
  --empty: #ef4444;  /* Empty (Red) */
  --unknown: #9ca3af;/* Unknown (Grey) */
  --friend: #34d399; /* IFF Friend */
  --neutral: #f59e0b;/* IFF Neutral */
  --hostile: #ef4444;/* IFF Hostile */
}
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans"; }
header { padding: 14px 18px; background: #0a111a; border-bottom: 1px solid #1a2633; display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
header h1 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: .2px; }
header .actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
header .actions a { color:#b7d5ff; text-decoration:none; border:1px solid #204065; padding:6px 10px; border-radius:999px; }

.wrap { display: grid; grid-template-columns: 320px 1fr; gap: 14px; padding: 14px; }
.card { background: var(--panel); color:#fff; border: 1px solid #1a2532; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.card .head { padding: 12px 14px; border-bottom: 1px solid #1a2532; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card .head h2 { margin: 0; font-size: 14px; font-weight: 800; color: #d8e4ff; letter-spacing: .3px; text-transform: uppercase; }
.card .body { padding: 14px; }
.btnbar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
button {
  background: #0e1520; color: var(--ink); border: 1px solid #203044; border-radius: 10px;
  padding: 9px 12px; cursor: pointer; font-weight: 700; letter-spacing: .15px;
}
button.primary { background: linear-gradient(180deg, #0a6cff, #0052cc); border-color: #0045a8; }
input[type=file], input[type=text], select {
  width: 100%; background: #0e1520; color: var(--ink); border: 1px solid #203044; padding: 10px; border-radius: 10px;
}
.container{ margin: 50px auto;}
.pill { display: inline-block; background: #0a111a; border: 1px solid #1f2c3b; border-radius: 999px; padding: 3px 8px; font-size: 11px; color: #cfe4ff; }
.kvs { margin: 6px 0 0 0; padding-left: 16px; font-size: 12px; color: var(--muted); }
.kvs li { margin: 4px 0; }
.tabs { display:flex; gap:8px; align-items:center; }
.tab { padding:8px 12px; border:1px solid #234; border-radius:999px; cursor:pointer; color:#bcd0f3; }
.tab.active { background:#0a6cff; border-color:#0a6cff; color:white; }
.mapBox { aspect-ratio: 1/1; }
.mapWide { width:100%; height:540px; }
canvas { width: 100%; height: 100%; background: #04080d; border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; }

.legend { display:flex; flex-wrap:wrap; gap:10px; align-items:center; font-size:12px; color:var(--muted); }
.swatch { display:inline-flex; gap:6px; align-items:center; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1px solid rgba(255,255,255,.25); }
.status-green{ background: var(--good); box-shadow: 0 0 12px rgba(34,197,94,.5); }
.status-blue{  background: var(--pending); box-shadow: 0 0 12px rgba(59,130,246,.5); }
.status-purple{background: var(--over); box-shadow: 0 0 12px rgba(167,139,250,.5); }
.status-red{   background: var(--empty); box-shadow: 0 0 12px rgba(239,68,68,.5); }
.status-grey{  background: var(--unknown); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.footer { padding: 12px 14px; color: var(--muted); font-size: 11px; border-top: 1px solid #1a2532; }
/* Tiered nav */
.tree { list-style:none; margin:0; padding:0; }
.tree li { margin:2px 0; }
.tree .node { display:flex; align-items:center; gap:6px; cursor:pointer; }
.tree .toggle { width:16px; height:16px; display:inline-flex; align-items:center; justify-content:center; border:1px solid #2b3c52; border-radius:3px; font-size:12px; color:#bcd0f3; }
.tree .children { margin-left:18px; margin-top:4px; display:none; }
.tree .node .label { color:#cfe4ff; }
.tree .node .meta { color:#9ab; font-size:11px; }
.tree .node.active .label { color:white; font-weight:800; }
.tree .status { font-size:10px; padding:1px 6px; border:1px solid #1f2c3b; background:#0a111a; border-radius:999px; margin-left:auto; color:#bcd0f3; }

/* *********************** */
/*         Tooltip         */
/* *********************** */

#tooltip, .sb-tooltip {
  opacity:1 !important;
  position: fixed;        
  pointer-events: none;   
  z-index: 9999;
}
.tooltip {
  position: fixed; pointer-events: none; background: #0f1722; border: 1px solid #223247;
  padding: 10px 12px; border-radius: 10px; font-size: 12px; color: #eaf1ff; max-width: 360px;
  box-shadow: 0 10px 35px rgba(0,0,0,.45); display: none; z-index: 10;
}
.tooltip .name { font-weight: 800; margin-bottom: 4px; }
.tooltip img { width: 100%; max-width:100px;border-radius: 8px; margin-top: 8px; border: 1px solid #1a2532; }#tooltip, .sb-tooltip {
  position: fixed;         
  pointer-events: none;   
  z-index: 9999;
}

/* *********************** */
/*   BootStrap Overrides   */
/* *********************** */

.bg-dark-blue{  background: #0B1220;
    border-bottom: 1px solid #1C2A3C;
    color: #EAF1FF;}  

.sb-navbar{
  background:#0B1220; 
  border-bottom:1px solid #1C2A3C;
  color:#EAF1FF; 
  z-index:2000; 
  min-width:240px;
}
.sb-navbar .navbar-brand{
  color:#EAF1FF;
  font-weight:700;
  text-decoration:none;
  line-height: 20px;
}
.sb-navbar .navbar-brand:hover{ color:#EAF1FF; }
.sb-navbar .navbar-brand .navbar-logo{
    width:50px;
    height:auto;
    margin-right:10px;
    float:left;
    margin-top:-3px;
}

.sb-link{
  color:#9FB7FF !important;
  font:13px system-ui;
  text-decoration:none;
}
.sb-link:hover{ color:#EAF1FF !important; }

/* =====================================================================
   Admin shell (Bootstrap-friendly)
   ===================================================================== */

.admin-shell{
  display:flex;
  min-height: calc(100vh - 56px); /* default navbar height */
}

/* Sidebar */
.admin-sidebar{
  width: 280px;
  border-right: 1px solid rgba(255,255,255,.08);
  background: #0f1318;
  color: rgba(255,255,255,.85);
}
.admin-sidebar-inner{
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 12px;
}

/* Main content */
.admin-main{
  flex: 1 1 auto;
  min-width: 0;
  background: #0b0e12;
}
.admin-content{ padding: 16px; }

/* Admin nav */
.admin-nav{ display:flex; flex-direction:column; gap: 4px; }
.admin-nav-section{
  margin-top: 10px;
  margin-bottom: 6px;
  padding: 8px 10px;
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
}
.admin-link{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 10px;
  color: rgba(255,255,255,.85);
  text-decoration: none;
  transition: background .15s ease, color .15s ease, transform .05s ease;
}
.admin-link:hover{ background: rgba(255,255,255,.06); color: #fff; }
.admin-link:active{ transform: translateY(1px); }
.admin-link.is-active{ background: rgba(255,255,255,.12); color: #fff; }
.admin-ico{ width: 20px; text-align:center; opacity: .9; }

/* Offcanvas (dark) */
.admin-offcanvas.offcanvas{ background: #0f1318; color: rgba(255,255,255,.85); }
.admin-offcanvas .offcanvas-header{ background: #0f1318; }
.admin-offcanvas .btn-close{ filter: invert(1); }

/* Reduce navbar border glare */
.navbar.border-bottom{ border-color: rgba(255,255,255,.08) !important; }

.bg-dark-blue{    background: #0B1220;
    border-bottom: 1px solid #1C2A3C;
    color: #EAF1FF; }
.bg-brown{background:#391200; color: #ffe4b8;}
.bg-brown a{color:#ffe4b8; font-weight:bold; text-decoration:none;}
.bg-brown a:hover{ text-decoration:underline;}
.bg-red{background:#6F1D1B; color: #fff;}
.bg-red a{color:#FFE6A7; font-weight:bold; text-decoration:none;}
.bg-red a:hover{ text-decoration:underline;}
 
.header-logo{max-width:75px; height:auto;}

.home-card-wrap{width:98%; margin:1%;}  
.home-card-wrap img{height:85px; width:auto;}  
.super-admin{display:none}
.form input{color:#0B1220}
header.sticky-top nav {width:100%;}
section.card{background:#0B1220}
/* X-Small devices (portrait phones, less than 576px) */

/*  Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .home-card-wrap{width:48%;}
 }

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .home-card-wrap{width:23%;}
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .home-card-wrap{width:23%;}
}

/*  X-Large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) { 
    .home-card-wrap{width:23%;}
}

/* XX-Large devices (larger desktops, 1400px and up) */
@media (min-width: 1400px) {
    .home-card-wrap{width:18%;}
    .csg-home .home-card-wrap{width:48%;}
 }

