:root{
  --bg:#070a10;
  --panel:#0c1220;
  --panel2:#0a1020;
  --border:rgba(255,255,255,.08);
  --text:#e9eef8;
  --muted:rgba(233,238,248,.65);
  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --r:18px;

  --primary:#3b82f6;
  --success:#22c55e;
  --danger:#ef4444;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background: radial-gradient(1200px 700px at 20% -10%, rgba(59,130,246,.20), transparent 60%),
              radial-gradient(900px 600px at 80% 0%, rgba(34,197,94,.12), transparent 55%),
              var(--bg);
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  overflow-x:hidden;
}

a{ color:inherit; text-decoration:none; }

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

.sidebar{
  padding:18px;
  border-right:1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent 40%);
}

.brand{
  display:flex;
  gap:10px;
  align-items:center;
  padding:12px;
  border:1px solid var(--border);
  border-radius: var(--r);
  background: rgba(255,255,255,.03);
  box-shadow: var(--shadow);
}

.logo{
  width:40px;height:40px;
  display:grid;place-items:center;
  border-radius:12px;
  background: rgba(59,130,246,.18);
}

.brand-name{ font-weight:800; letter-spacing:.3px; }
.brand-sub{ font-size:12px; color:var(--muted); margin-top:2px; }

.nav{ margin-top:14px; display:flex; flex-direction:column; gap:8px; }
.nav-item{
  padding:10px 12px;
  border-radius:14px;
  border:1px solid transparent;
  color:var(--muted);
}
.nav-item:hover{ background: rgba(255,255,255,.04); color:var(--text); }
.nav-item.active{
  background: rgba(59,130,246,.14);
  border-color: rgba(59,130,246,.35);
  color: var(--text);
}

.sidebar-footer{
  margin-top:18px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  color:var(--muted);
}

.main{ padding:18px 22px; overflow-x:hidden; }

.topbar{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  margin-bottom:14px;
}

.page-title h1{
  margin:0;
  font-size:34px;
  letter-spacing:.2px;
}
.subtitle{ color:var(--muted); margin-top:6px; }

.search-wrap{ width:320px; }
.search{
  width:100%;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.22);
  color:var(--text);
  outline:none;
}

.content{ display:flex; flex-direction:column; gap:14px; }

.cards{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:12px;
}

.card{
  border:1px solid var(--border);
  border-radius: var(--r);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  box-shadow: var(--shadow);
}

.metric{ padding:14px; }
.metric-label{ color:var(--muted); font-size:12px; }
.metric-value{ font-size:28px; font-weight:800; margin-top:6px; }
.metric-value.small{ font-size:18px; font-weight:700; }

.block{ padding:14px; }
.block-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:12px;
}
.block-title{ font-size:18px; font-weight:800; }
.block-body{ color:var(--text); }

.muted{ color:var(--muted); }
.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

.grid-2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
}

.table-wrap{
  width:100%;
  overflow:hidden;
}

.table{
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;
}

.table thead th{
  text-align:left;
  font-weight:700;
  color:var(--muted);
  padding:10px 8px;
  border-bottom:1px solid var(--border);
}

.table td{
  padding:12px 8px;
  border-bottom:1px solid rgba(255,255,255,.06);
  vertical-align:middle;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.row-title{ font-weight:800; font-size:16px; }
.linkish{ color: rgba(96,165,250,.95); }

.key-row{
  display:flex;
  gap:8px;
  align-items:center;
}

.input{
  width:100%;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.22);
  color:var(--text);
  outline:none;
}

.actions{
  display:flex;
  gap:8px;
  justify-content:flex-end;
  flex-wrap:wrap;
}

.btn{
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.05);
  color:var(--text);
  cursor:pointer;
  font-weight:700;
}
.btn:hover{ background: rgba(255,255,255,.08); }
.btn.primary{ background: rgba(59,130,246,.85); border-color: rgba(59,130,246,.55); }
.btn.success{ background: rgba(34,197,94,.78); border-color: rgba(34,197,94,.55); }
.btn.danger{ background: rgba(239,68,68,.78); border-color: rgba(239,68,68,.55); }
.btn.full{ width:100%; }

.badge{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  font-weight:800;
  font-size:12px;
}
.badge.ok{ background: rgba(34,197,94,.18); border-color: rgba(34,197,94,.35); }
.badge.bad{ background: rgba(239,68,68,.18); border-color: rgba(239,68,68,.35); }
.badge.info{ background: rgba(59,130,246,.18); border-color: rgba(59,130,246,.35); }

.pill{
  display:inline-flex;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  font-weight:800;
  font-size:12px;
}

.list{ margin:0; padding-left:18px; color:var(--muted); }
.list li{ margin:8px 0; }


.icon-btn{
  width:36px;height:36px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color:var(--text);
  cursor:pointer;
}

@media (max-width: 1100px){
  .cards{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-2{ grid-template-columns: 1fr; }
  .app{ grid-template-columns: 1fr; }
  .sidebar{ position:sticky; top:0; z-index:10; }
}

/* ===== Modal form (Schedule) ===== */
.modal-body .form-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:14px;
}

.modal-body .form-field{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.modal-body .form-field label{
  font-size:12px;
  color:rgba(255,255,255,.72);
}

.modal-body .form-field input,
.modal-body .form-field select{
  width:100%;
  height:38px;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(10,14,20,.65);
  color:#fff;
  outline:none;
}

.modal-body .form-field input:focus,
.modal-body .form-field select:focus{
  border-color:rgba(99,102,241,.65);
  box-shadow:0 0 0 3px rgba(99,102,241,.18);
}

.modal-body .form-span-2{ grid-column: 1 / -1; }

.modal-body .form-help{
  font-size:12px;
  color:rgba(255,255,255,.68);
  line-height:1.4;
  margin-bottom:10px;
}

.modal-body .modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:16px;
}

@media (max-width: 900px){
  .modal-body .form-grid{ grid-template-columns: 1fr; }
  .modal-body .form-span-2{ grid-column:auto; }
}

/* ===== Modal fix: lebih solid & tidak tembus ===== */
.modal-backdrop{
  position: fixed;
  inset: 0;
  z-index: 9999; /* di atas semua */
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(10px);
}

.modal-backdrop.show{
  display: flex;
}

.modal{
  width: min(920px, 96vw);
  max-height: 86vh;
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background: #0f1620; /* solid (tidak transparan) */
  box-shadow: 0 25px 70px rgba(0,0,0,.6);
}

.modal-head{
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0f1620; /* solid juga */
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.modal-body{
  background: #0f1620; /* pastikan body modal juga solid */
}


/* ===== Modal FINAL (override) ===== */
.modal-backdrop{
  z-index: 99999;
  background: rgba(0,0,0,.82);
  backdrop-filter: blur(10px);
  align-items: flex-start;
  padding-top: 70px;
}

.modal{
  background: #0f1620;
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 25px 80px rgba(0,0,0,.75);
}

.modal-head{
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0f1620;
  border-bottom: 1px solid rgba(255,255,255,.10);
}

.modal-title{ font-weight: 900; }

.modal-body{
  padding: 14px;
  background: #0f1620;
}

/* biar input time/select nggak jadi putih */
.modal, .modal *{
  color-scheme: dark;
}


/* ===== Responsive Streams Table (No more 80% zoom) ===== */
.table-wrap{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table{
  min-width: 980px; /* allow scroll on small screen */
}

.btn-row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;  /* prevent overlap */
  justify-content:flex-end;
}

code.code{
  display:inline-block;
  max-width: 340px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* Make sidebar collapse-friendly and reduce paddings on smaller screens */
@media (max-width: 1200px){
  .main{ padding: 18px; }
  .card.block{ padding: 14px; }
  code.code{ max-width: 260px; }
}

@media (max-width: 980px){
  .cards{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .topbar h1{ font-size: 20px; }
  .block-head{ flex-direction:column; align-items:flex-start; gap:10px; }
  .block-head .btn{ width:auto; }
}

@media (max-width: 720px){
  .cards{ grid-template-columns: 1fr; }
  .sidebar{ position: sticky; top: 0; z-index: 50; }
  .main{ padding: 14px; }
  .table{ min-width: 900px; } /* still scroll, but smaller */
  .btn-row{ justify-content:flex-start; }
}

/* ===== Modal HARD OVERRIDE (anti transparan) ===== */
.modal-backdrop{
  background: rgba(0,0,0,.78) !important;
  backdrop-filter: blur(12px) !important;
}

.modal{
  background: #0f1620 !important;
  background-image: none !important;
  box-shadow: 0 25px 70px rgba(0,0,0,.70) !important;
}

.modal-head,
.modal-body{
  background: #0f1620 !important;
}
