/* Pinagen — Pusat Kendali Agent · UI v3 "Glass" (2026-11-26)
   Glassmorphism terang & lapang: latar gradasi pastel, kartu kaca buram besar,
   jarak lega, info padat dalam satu layar. Aksen merah Pinterest hemat.
   Nama kelas sama persis dengan v2 agar semua halaman & formulir tetap jalan. */
:root {
  --bg: #eef3fb;
  --bg2: #ffffff;
  --bg3: rgba(255, 255, 255, 0.85);
  --surface: rgba(255, 255, 255, 0.62);
  --surface2: rgba(255, 255, 255, 0.8);
  --border: rgba(255, 255, 255, 0.85);
  --border-soft: rgba(29, 36, 51, 0.08);
  --text: #1d2433;
  --muted: #5b6577;
  --muted2: #8a93a6;
  --accent: #e60023;
  --accent-hover: #c8001e;
  --accent-soft: rgba(230, 0, 35, 0.09);
  --ok: #0f9d76;
  --ok-soft: rgba(15, 157, 118, 0.12);
  --warn: #b97e0a;
  --warn-soft: rgba(217, 147, 13, 0.14);
  --err: #d81f3e;
  --err-soft: rgba(216, 31, 62, 0.09);
  --sky: #2470c9;
  --sky-soft: rgba(36, 112, 201, 0.1);
  --violet: #7c4dc4;
  --violet-soft: rgba(124, 77, 196, 0.1);
  --radius: 24px;
  --shadow: 0 18px 45px rgba(64, 84, 140, 0.13), 0 3px 10px rgba(64, 84, 140, 0.07);
  --shadow-sm: 0 8px 22px rgba(64, 84, 140, 0.1);
  --sidebar-w: 258px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background:
    radial-gradient(900px 600px at 8% -10%, rgba(255, 183, 197, 0.55), transparent 60%),
    radial-gradient(1000px 700px at 95% 0%, rgba(147, 197, 253, 0.55), transparent 60%),
    radial-gradient(800px 650px at 55% 110%, rgba(167, 243, 208, 0.5), transparent 60%),
    radial-gradient(600px 500px at 85% 85%, rgba(221, 214, 254, 0.45), transparent 60%),
    linear-gradient(160deg, #f4f7fd, #eef3fb 55%, #f7f2ee);
  background-attachment: fixed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
}

#app { min-height: 100vh; min-height: 100dvh; }
a { color: var(--sky); }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; border-radius: 4px; }

h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.6px; margin-bottom: 4px; }
h2 { font-size: 16.5px; font-weight: 800; letter-spacing: -0.2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty-state { color: var(--muted); padding: 22px 0; text-align: center; }

/* ---------- Layout ---------- */
.layout {
  display: flex; gap: 26px; align-items: flex-start;
  max-width: 1560px; margin: 0 auto; padding: 26px;
  min-height: 100vh; min-height: 100dvh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 26px 20px 18px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 26px;
  height: calc(100vh - 52px);
  height: calc(100dvh - 52px);
  overflow-y: auto;
  z-index: 50;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 22px; }
.brand .logo {
  width: 42px; height: 42px; border-radius: 14px; flex-shrink: 0;
  background: linear-gradient(135deg, #ff5a76, #e60023);
  display: grid; place-items: center;
  font-weight: 800; font-size: 20px; color: #fff;
  box-shadow: 0 8px 18px rgba(230, 0, 35, 0.35);
}
.brand .brand-name { font-size: 18px; font-weight: 800; letter-spacing: -0.2px; line-height: 1.15; }
.brand .brand-sub { color: var(--muted2); font-weight: 600; font-size: 11.5px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  color: var(--muted); text-decoration: none;
  font-weight: 600; font-size: 14.5px;
  border: 1px solid transparent;
  cursor: pointer;
}
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255, 255, 255, 0.55); color: var(--text); }
.nav-item.active {
  background: var(--surface2); color: var(--text);
  border-color: var(--border); box-shadow: var(--shadow-sm);
}
.nav-item.active svg { color: var(--accent); }

.sidebar-foot { margin-top: auto; padding: 16px 8px 2px; border-top: 1px solid var(--border-soft); color: var(--muted); font-size: 12.5px; }
.mode-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--ok-soft); color: var(--ok); margin-bottom: 12px;
  border: 1px solid rgba(15, 157, 118, 0.22);
}
.mode-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(15, 157, 118, 0.16); }

.main { flex: 1; padding: 8px 4px 50px; width: 100%; min-width: 0; }

/* ---------- Kartu & statistik ---------- */
.card {
  background: var(--surface);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.card h2 { margin-bottom: 6px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 22px; }
.stat-card {
  background: var(--surface);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow);
}
.stat-card .label { color: var(--muted2); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.7px; }
.stat-card .num { font-size: 34px; font-weight: 800; letter-spacing: -0.8px; margin: 6px 0 3px; line-height: 1.1; }
.stat-card .delta { font-size: 13px; font-weight: 600; color: var(--muted); }
.delta.up { color: var(--ok); }
.delta.warn { color: var(--warn); }

/* ---------- Tabel (halaman lama, dipercantik) ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; color: var(--muted2); font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  padding: 10px 12px; border-bottom: 1px solid var(--border-soft);
}
td { padding: 12px; border-bottom: 1px solid rgba(29, 36, 51, 0.05); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.45); }
.actions-cell { white-space: nowrap; }
.actions-cell .btn, .actions-cell .btn-secondary { margin-right: 6px; }

/* ---------- Badge ---------- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; background: rgba(29, 36, 51, 0.07); color: var(--muted);
}
.badge-sehat, .badge-active, .badge-running, .badge-succeeded, .badge-ok, .badge-success { background: var(--ok-soft); color: var(--ok); }
.badge-error, .badge-failed, .badge-infra_error, .badge-dead, .badge-locked { background: var(--err-soft); color: var(--err); }
.badge-pending, .badge-queued, .badge-idle, .badge-skipped { background: rgba(29, 36, 51, 0.07); color: var(--muted); }
.badge-warn, .badge-warning, .badge-paused, .badge-needs_link { background: var(--warn-soft); color: var(--warn); }
.badge-info, .badge-session { background: var(--sky-soft); color: var(--sky); }

/* ---------- Tombol ---------- */
.btn {
  display: inline-block; background: linear-gradient(135deg, #ff3355, var(--accent)); color: #fff; border: 1px solid transparent;
  padding: 9px 17px; border-radius: 12px; font-weight: 700; font-size: 13.5px;
  cursor: pointer; font-family: inherit; text-decoration: none;
  box-shadow: 0 8px 18px rgba(230, 0, 35, 0.25);
}
.btn:hover { background: linear-gradient(135deg, #e60023, var(--accent-hover)); }
.btn-secondary {
  display: inline-block; background: var(--surface2); color: var(--text);
  border: 1px solid var(--border-soft); padding: 9px 17px; border-radius: 12px;
  font-weight: 600; font-size: 13.5px; cursor: pointer; font-family: inherit; text-decoration: none;
  box-shadow: 0 3px 10px rgba(64, 84, 140, 0.08);
}
.btn-secondary:hover { background: #ffffff; }
.btn-danger {
  display: inline-block; background: rgba(255, 255, 255, 0.6); color: var(--err);
  border: 1px solid rgba(216, 31, 62, 0.35); padding: 9px 17px; border-radius: 12px;
  font-weight: 600; font-size: 13.5px; cursor: pointer; font-family: inherit;
}
.btn-danger:hover { background: var(--err-soft); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 9px; }

/* ---------- Formulir ---------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 7px; }
.form-group input, .form-group select, .form-group textarea,
input[type="text"], input[type="password"], input[type="number"], select, textarea {
  width: 100%; background: rgba(255, 255, 255, 0.75); border: 1px solid var(--border-soft);
  border-radius: 12px; color: var(--text); padding: 10px 13px;
  font-family: inherit; font-size: 14.5px;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus,
input:focus, select:focus, textarea:focus {
  outline: none; border-color: rgba(36, 112, 201, 0.55); box-shadow: 0 0 0 4px rgba(36, 112, 201, 0.12);
  background: #ffffff;
}
.form-group textarea { min-height: 88px; resize: vertical; }
.form-group .hint, .hint { color: var(--muted); font-size: 13px; margin-top: 5px; }
.checkbox-row { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.checkbox-row input { width: auto; }

/* ---------- Modal & toast ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(35, 45, 75, 0.38);
  backdrop-filter: blur(5px); display: grid; place-items: center; z-index: 200; padding: 16px;
}
.modal-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--border); border-radius: 22px;
  box-shadow: 0 30px 70px rgba(35, 45, 75, 0.3); width: 100%; max-width: 580px; max-height: 88vh; overflow-y: auto; padding: 26px;
}
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: rgba(29, 36, 51, 0.94); border: 1px solid rgba(255, 255, 255, 0.2); color: #fff;
  padding: 12px 20px; border-radius: 14px; box-shadow: 0 18px 40px rgba(35, 45, 75, 0.35);
  font-weight: 600; font-size: 14px; z-index: 300; max-width: 90vw;
}
.toast.error { background: rgba(150, 18, 40, 0.95); color: #ffe3e9; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card {
  background: var(--surface2);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--border); border-radius: 26px;
  box-shadow: var(--shadow); padding: 36px; width: 100%; max-width: 400px; text-align: left;
}
.login-card h1 { text-align: center; }
.login-card .brand { justify-content: center; padding-bottom: 10px; }

/* ---------- Komponen UI v2 (direstyle kaca terang) ---------- */
.attn-card {
  border-color: rgba(217, 147, 13, 0.4);
  background: linear-gradient(180deg, rgba(255, 205, 86, 0.2), rgba(255, 255, 255, 0.55));
}
.attn-item { display: flex; gap: 14px; padding: 13px 0; border-top: 1px solid var(--border-soft); }
.attn-item:first-of-type { border-top: none; }
.ico {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center;
  flex-shrink: 0; font-size: 16px; background: var(--surface2);
  border: 1px solid var(--border-soft); box-shadow: 0 3px 8px rgba(64, 84, 140, 0.08);
}
.ico.red { background: var(--err-soft); } .ico.amber { background: var(--warn-soft); }
.ico.sky { background: var(--sky-soft); } .ico.mint { background: var(--ok-soft); }
.ico.violet { background: var(--violet-soft); }

.agent-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.avatar {
  width: 58px; height: 58px; border-radius: 19px; flex-shrink: 0;
  background: linear-gradient(135deg, #ffb03a, #e60023);
  display: grid; place-items: center; font-size: 23px; font-weight: 800; color: #fff;
  box-shadow: 0 12px 24px rgba(230, 90, 60, 0.28);
}
.avatar.blue { background: linear-gradient(135deg, #4cc3ff, #9a7bff); }
.status-live { font-weight: 700; color: var(--sky); }
.status-rest { font-weight: 700; color: var(--muted); }

.strip { position: relative; height: 48px; background: rgba(29, 36, 51, 0.05); border: 1px solid var(--border-soft); border-radius: 14px; margin-top: 14px; overflow: hidden; }
.strip .sess {
  position: absolute; top: 8px; height: 32px; border-radius: 9px; padding: 0 4px;
  background: linear-gradient(135deg, rgba(36, 112, 201, 0.85), rgba(124, 77, 196, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.5); color: #ffffff;
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  white-space: nowrap; overflow: hidden;
}
.strip .sess.done { background: rgba(255, 255, 255, 0.65); border-color: var(--border-soft); color: var(--muted); }
.strip .sess.now-sess { background: linear-gradient(135deg, rgba(15, 157, 118, 0.9), rgba(36, 112, 201, 0.8)); border-color: rgba(255, 255, 255, 0.5); color: #ffffff; }
.strip .now-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); }
.strip .now-line::after { content: 'sekarang'; position: absolute; top: 2px; left: 4px; font-size: 9.5px; color: var(--accent); font-weight: 800; }
.strip .now-line.flip::after { left: auto; right: 4px; }
.hours { display: flex; justify-content: space-between; color: var(--muted2); font-size: 11px; margin-top: 6px; font-family: 'JetBrains Mono', monospace; }

.prog-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 22px; margin-top: 16px; }
.prog .row { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; }
.bar { height: 9px; border-radius: 99px; background: rgba(29, 36, 51, 0.08); overflow: hidden; margin-top: 5px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #ff5a76, #e60023); }
.bar i.mint { background: linear-gradient(90deg, #2fd48c, #0f9d76); }
.bar i.sky { background: linear-gradient(90deg, #38bdf8, #2470c9); }
.bar i.violet { background: linear-gradient(90deg, #b79aff, #7c4dc4); }
.bar i.amber { background: linear-gradient(90deg, #f5b83d, #d9930d); }

.feed-item { display: flex; gap: 15px; padding: 15px 0; border-top: 1px solid var(--border-soft); }
.feed-item:first-of-type { border-top: none; }
.feed-item .txt { flex: 1; min-width: 0; }
.feed-item .time { color: var(--muted2); font-size: 12px; white-space: nowrap; font-family: 'JetBrains Mono', monospace; }
.quote {
  margin-top: 7px; background: rgba(255, 255, 255, 0.6);
  border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0;
  padding: 9px 13px; font-size: 14px;
}
.activity-detail { color: var(--muted); font-size: 13px; }
.activity-detail a { color: var(--sky); }

.chips { display: flex; gap: 9px; flex-wrap: wrap; margin: 16px 0; }
.chip {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  background: var(--surface2); border: 1px solid var(--border-soft);
  font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text); font-family: inherit;
  box-shadow: 0 3px 8px rgba(64, 84, 140, 0.07);
}
.chip:hover { background: #ffffff; }
.chip.on { background: var(--accent-soft); color: var(--accent); border-color: rgba(230, 0, 35, 0.3); }

.bars { display: flex; align-items: flex-end; gap: 12px; height: 128px; margin-top: 14px; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.bars .col i { width: 100%; max-width: 42px; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, #2f7fd0, #7c4dc4); display: block; box-shadow: 0 6px 14px rgba(80, 90, 180, 0.25); }
.bars .col span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.bars .col b { font-size: 12px; }

.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 12px; }
.pin-card {
  border-radius: 17px; overflow: hidden; border: 1px solid var(--border);
  background: var(--surface2); box-shadow: var(--shadow-sm);
}
.pin-card img { width: 100%; height: 150px; object-fit: cover; display: block; background: rgba(29, 36, 51, 0.06); }
.pin-card .cap { padding: 11px 13px; font-size: 13px; font-weight: 600; }
.pin-card .cap small { display: block; color: var(--muted); font-weight: 500; margin-top: 2px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.grid2 > .card, .grid3 > .card { margin-bottom: 0; }
.grid-wrap { margin-bottom: 22px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

.note { background: var(--sky-soft); border: 1px solid rgba(36, 112, 201, 0.25); border-radius: 14px; padding: 13px 16px; font-size: 13.5px; margin-bottom: 22px; }

/* ---------- Notifikasi (lonceng + panel melayang, UI v3.1) ---------- */
.uname-link { color: inherit; text-decoration: none; }
.uname-link:hover { text-decoration: underline; }

.notif-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 13px; border-radius: 13px; margin-bottom: 12px;
  background: var(--surface2); border: 1px solid var(--border-soft);
  box-shadow: 0 3px 10px rgba(64, 84, 140, 0.08);
  font-family: inherit; font-weight: 700; font-size: 13.5px; color: var(--text); cursor: pointer;
}
.notif-btn:hover { background: #ffffff; }
.notif-count {
  margin-left: auto; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px;
}
.notif-bell-m { position: relative; margin-left: auto; background: none; font-family: inherit; }
.notif-bell-m .notif-count { position: absolute; top: 1px; right: 1px; margin: 0; padding: 1px 6px; }
.notif-panel {
  position: fixed; top: 18px; right: 18px; z-index: 150;
  width: min(430px, calc(100vw - 24px)); max-height: min(78vh, 640px); overflow-y: auto;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--border); border-radius: 22px;
  box-shadow: 0 30px 70px rgba(35, 45, 75, 0.28);
  padding: 20px 22px;
}
.notif-panel[hidden] { display: none; }
.notif-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }

/* ---------- Responsif ---------- */
@media (max-width: 980px) {
  .stats-grid, .prog-grid { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .layout { padding: 18px; gap: 18px; }
}
@media (max-width: 760px) {
  .notif-panel { top: 64px; right: 12px; }
  .sidebar { display: none; }
  .layout { padding: 0; }
  .main { padding: 18px 14px 50px; }
  .card { padding: 20px; border-radius: 20px; }
  h1 { font-size: 25px; }
  .mobile-nav {
    display: flex !important; gap: 4px; overflow-x: auto; padding: 10px 12px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px) saturate(1.5);
    -webkit-backdrop-filter: blur(16px) saturate(1.5);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 60;
  }
}
.mobile-nav { display: none; }
.mobile-nav .nav-item { white-space: nowrap; padding: 8px 12px; }
.mobile-nav .nav-item svg { display: none; }
