/* Layout + Components for your existing index.html structure */

.wrap{
  width:min(1320px, calc(100% - 40px));
  margin:18px auto 24px;
}

.topbar{
  position:sticky; top:0; z-index:50;
  background:linear-gradient(180deg, rgba(17,31,47,.92), rgba(17,31,47,.72));
  backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(148,163,184,.16);
}
.topbar-inner{
  width:min(1320px, calc(100% - 40px));
  margin:0 auto;
  padding:14px 0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.brand{display:flex; align-items:center; gap:14px}
.logo-dot{
  width:44px; height:44px; border-radius:14px;
  background: linear-gradient(135deg, rgba(19,127,236,.95), rgba(19,127,236,.35));
  box-shadow: 0 10px 30px rgba(19,127,236,.28);
  border:1px solid rgba(255,255,255,.18);
}
.brand h1{margin:0; font-size:18px; letter-spacing:.2px}
.brand .sub{margin-top:2px; font-size:12px; color:rgba(226,232,240,.72); font-weight:700}

.top-actions{display:flex; align-items:center; gap:10px; flex-wrap:wrap}

.user-menu{position:relative}
.user-btn{padding:8px 12px}
.user-dropdown{
  position:absolute; right:0; top:44px;
  min-width:180px;
  display:none;
  background: rgba(15,26,42,.98);
  border:1px solid rgba(148,163,184,.18);
  border-radius:14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  overflow:hidden;
}
.user-dropdown a{
  display:block; padding:10px 12px;
  font-weight:800; color:rgba(226,232,240,.92);
}
.user-dropdown a:hover{background:rgba(19,127,236,.12)}
.user-menu.open .user-dropdown{display:block}

/* Dashboard grid */
.dashboard-layout{
  display:grid;
  grid-template-columns: 1fr 420px;
  gap:16px;
  align-items:start;
}
@media (max-width: 1100px){
  .dashboard-layout{grid-template-columns:1fr}
  .side-col{order:2}
}

.kpis{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:12px;
  margin-bottom:12px;
}
@media (max-width: 1100px){ .kpis{grid-template-columns:repeat(2,1fr)} }
@media (max-width: 640px){ .kpis{grid-template-columns:1fr} }

.kpi{padding:16px 16px}
.kpi .label{color:rgba(226,232,240,.70); font-weight:800; font-size:12px; letter-spacing:.4px; text-transform:uppercase}
.kpi .value{margin-top:8px; font-size:34px; font-weight:900}

.controls{padding:14px}
.controls-grid{
  display:grid;
  grid-template-columns: 1.2fr 160px 160px 130px 160px 140px;
  gap:10px;
  align-items:end;
}
@media (max-width: 1100px){
  .controls-grid{grid-template-columns:1fr 1fr; }
  .controls-grid #btnReset{grid-column:1/-1}
}
.field label{
  display:block;
  font-size:12px;
  font-weight:900;
  color:rgba(226,232,240,.75);
  margin:0 0 6px;
}
.field input, .field select{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(148,163,184,.18);
  background:rgba(255,255,255,.03);
  color:rgba(226,232,240,.92);
  outline:none;
}
.field input::placeholder{color:rgba(226,232,240,.42)}
.field input:focus, .field select:focus{
  border-color:rgba(19,127,236,.45);
  box-shadow:0 0 0 4px rgba(19,127,236,.12);
}

.table-card{overflow:hidden}
.table-head{
  padding:14px 16px;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px solid rgba(148,163,184,.14);
}
.table-title{display:flex; align-items:center; gap:10px}
.table-title b{font-size:14px}
.table-wrap{overflow:auto}
table{width:100%; border-collapse:separate; border-spacing:0}
thead th{
  position:sticky; top:0;
  background:rgba(15,26,42,.92);
  backdrop-filter: blur(8px);
  border-bottom:1px solid rgba(148,163,184,.14);
  padding:12px 12px;
  text-align:left;
  font-size:12px;
  letter-spacing:.4px;
  text-transform:uppercase;
  color:rgba(226,232,240,.72);
}
tbody td{
  padding:14px 12px;
  border-bottom:1px solid rgba(148,163,184,.10);
  vertical-align:top;
}
tbody tr:hover{background:rgba(255,255,255,.03)}
.state{padding:18px 12px; text-align:center; color:rgba(226,232,240,.65); font-weight:800}

.row-fail{
  background: linear-gradient(90deg, rgba(239,68,68,.18), rgba(239,68,68,.06));
  border-left:4px solid rgba(239,68,68,.75);
}

/* Shift panel (right column) */
.shift-card{padding:0; overflow:hidden}
.shift-list{padding:12px; display:flex; flex-direction:column; gap:12px}

.shift-item{
  display:flex;
  gap:12px;
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(148,163,184,.16);
  background: rgba(255,255,255,.03);
}
.shift-item .badge{
  height:28px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:0 12px;
  border-radius:999px;
  font-weight:900;
  border:1px solid rgba(148,163,184,.18);
  background:rgba(255,255,255,.03);
  white-space:nowrap;
}
.shift-item.working{border-left:4px solid rgba(16,185,129,.75)}
.shift-item.working .badge{border-color:rgba(16,185,129,.35); background:rgba(16,185,129,.10)}
.shift-item.absent{border-left:4px solid rgba(245,158,11,.75)}
.shift-item.absent .badge{border-color:rgba(245,158,11,.35); background:rgba(245,158,11,.10)}
.shift-item.error{border-left:4px solid rgba(239,68,68,.8)}
.shift-item.error .badge{border-color:rgba(239,68,68,.35); background:rgba(239,68,68,.12)}

/* progress bar (optional if you add later) */
.prog{
  height:10px; border-radius:999px;
  background:rgba(255,255,255,.06);
  overflow:hidden;
  border:1px solid rgba(148,163,184,.12);
}
.prog > i{
  display:block; height:100%;
  background: linear-gradient(90deg, rgba(19,127,236,.95), rgba(19,127,236,.25));
}

/* Shift filter actions (your markup uses .shift-actions / .shift-btn) */
.shift-actions{display:flex; justify-content:flex-end; gap:10px; margin-top:12px}
.shift-btn{
  padding:10px 14px;
  border-radius:12px;
  border:1px solid rgba(148,163,184,.18);
  background:rgba(255,255,255,.03);
  color:rgba(226,232,240,.92);
  font-weight:900;
  cursor:pointer;
}
.shift-btn:hover{border-color:rgba(19,127,236,.45); background:rgba(19,127,236,.12)}
.shift-btn.primary{
  border-color:rgba(19,127,236,.45);
  background:rgba(19,127,236,.16);
}
/* ===== NET METRICS (PING/LOSS/JITTER) ===== */
.net-metrics{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.net-box{
  min-width:72px;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
  line-height:1.1;
}

.net-box .lbl{
  font-size:11px;
  letter-spacing:.6px;
  font-weight:700;
  opacity:.75;
}

.net-box .val{
  margin-top:6px;
  font-weight:800;
  font-size:13px;
}

.net-box.ok{
  background: rgba(16,185,129,.10);
  border-color: rgba(16,185,129,.22);
}
.net-box.warn{
  background: rgba(245,158,11,.12);
  border-color: rgba(245,158,11,.24);
}
.net-box.bad,
.net-box.down{
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.24);
}
