/* Nanvery Portal — Biru Muda, Hijau Pupus, Putih + Mode Gelap/Terang */
:root {
  --bg: #ffffff;
  --bg-soft: #f3f9fd;
  --surface: #ffffff;
  --surface-alt: #f8fcfa;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #52637a;
  --border: #dce8f2;

  /* Biru Muda + Hijau Pupus */
  --sky: #38bdf8;
  --sky-deep: #0284c7;
  --sky-text: #0369a1;
  --sky-soft: rgba(56, 189, 248, 0.14);

  --lime: #84cc16;
  --lime-bright: #a3e635;
  --lime-text: #3f6212;
  --lime-soft: rgba(132, 204, 22, 0.15);

  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.10);

  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 12px 32px rgba(2, 132, 199, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #0b1220;
  --bg-soft: #0f192d;
  --surface: #121e33;
  --surface-alt: #16243d;
  --ink: #f1f5f9;
  --ink-2: #cbd5e1;
  --muted: #94a3b8;
  --border: #223452;

  --sky: #38bdf8;
  --sky-deep: #38bdf8;
  --sky-text: #7dd3fc;
  --sky-soft: rgba(56, 189, 248, 0.16);

  --lime: #a3e635;
  --lime-bright: #bef264;
  --lime-text: #bef264;
  --lime-soft: rgba(163, 230, 53, 0.14);

  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);

  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 14px 36px rgba(0, 0, 0, 0.38);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 8% -5%, var(--sky-soft), transparent 62%),
    radial-gradient(760px 380px at 94% 4%, var(--lime-soft), transparent 58%),
    var(--bg);
  color: var(--ink);
  transition: background-color 280ms var(--ease), color 280ms var(--ease), opacity 200ms var(--ease), transform 200ms var(--ease);
}

/* Smooth page enter & exit */
body.page-enter {
  animation: pageFadeIn 380ms var(--ease) both;
}

body.page-leaving {
  opacity: 0;
  transform: translateY(-6px);
}

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  animation: revealUp 460ms var(--ease) forwards;
}
.delay-1 { animation-delay: 70ms; }
.delay-2 { animation-delay: 140ms; }
.delay-3 { animation-delay: 210ms; }

@keyframes revealUp {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  body.page-enter, .reveal { animation: none; opacity: 1; transform: none; }
  body { transition: none; }
}

/* Layout */
.container {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--sky) 0%, var(--lime) 100%);
  display: grid;
  place-items: center;
  color: #0b1220;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.28);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 180ms var(--ease), background-color 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--sky-deep), #0ea5e9);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.24);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(2, 132, 199, 0.34);
}

.btn-lime {
  background: var(--lime-soft);
  color: var(--lime-text);
  border-color: color-mix(in srgb, var(--lime) 45%, transparent);
}
.btn-lime:hover {
  background: color-mix(in srgb, var(--lime) 24%, transparent);
}

.btn-ghost {
  background: var(--surface);
  color: var(--ink-2);
  border-color: var(--border);
}
.btn-ghost:hover {
  border-color: var(--sky);
  color: var(--sky-text);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}
.btn-danger:hover {
  background: color-mix(in srgb, var(--danger) 18%, transparent);
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
}

/* Profile Hero */
.hero {
  padding: 68px 0 44px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--lime-soft);
  color: var(--lime-text);
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--lime);
  display: inline-block;
}

.hero h1 {
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  max-width: 18ch;
}

.hero-accent {
  background: linear-gradient(90deg, var(--sky-deep), var(--lime));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  font-size: 1.1rem;
  color: var(--ink-2);
  max-width: 60ch;
  margin: 0 0 28px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Sections & Cards */
.section {
  padding: 36px 0;
}

.section-title {
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}

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

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 220ms var(--ease), border-color 220ms var(--ease), box-shadow 220ms var(--ease);
}

.card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--sky) 55%, var(--border));
  box-shadow: var(--shadow-md);
}

.card-accent {
  width: 36px;
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--sky), var(--lime));
  margin-bottom: 14px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.card p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.94rem;
}

.bio-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--sky);
  border-radius: var(--radius);
  padding: 24px;
  color: var(--ink-2);
}

.footer {
  margin-top: 56px;
  padding: 26px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

/* Login Page */
.auth-wrap {
  min-height: calc(100vh - 66px);
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.auth-card {
  width: 100%;
  max-width: 410px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--sky);
  border-radius: var(--radius);
  padding: 30px 26px;
  box-shadow: var(--shadow-md);
}

.auth-card h1 {
  font-size: 1.45rem;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.auth-sub {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.92rem;
}

.field {
  margin-bottom: 15px;
}

.field label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.input, .textarea {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--ink);
  font: inherit;
  font-size: 0.94rem;
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.textarea { min-height: 92px; resize: vertical; }

.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--sky-deep);
  box-shadow: 0 0 0 3px var(--sky-soft);
}

.alert {
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 14px;
  display: none;
}

.alert.show { display: block; animation: pageFadeIn 220ms var(--ease); }
.alert-error { background: var(--danger-soft); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }
.alert-ok { background: var(--lime-soft); color: var(--lime-text); border: 1px solid color-mix(in srgb, var(--lime) 40%, transparent); }

/* Admin Dashboard */
.admin-head {
  padding: 32px 0 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.admin-head h1 {
  margin: 0 0 4px;
  font-size: 1.65rem;
  letter-spacing: -0.02em;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.tab-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 180ms var(--ease);
}

.tab-btn.active {
  background: var(--sky-soft);
  color: var(--sky-text);
  border-color: var(--sky);
}

.panel { display: none; }
.panel.active { display: block; animation: pageFadeIn 260ms var(--ease); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.search-input {
  max-width: 300px;
}

.svc-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.svc-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.svc-cat {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--sky-text);
  background: var(--sky-soft);
  padding: 3px 10px;
  border-radius: 999px;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}
.badge-online { background: var(--lime-soft); color: var(--lime-text); }
.badge-offline { background: var(--danger-soft); color: var(--danger); }
.badge-external { background: var(--sky-soft); color: var(--sky-text); }

.svc-sub {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.83rem;
  color: var(--muted);
  word-break: break-all;
}

.svc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th, td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--bg-soft);
}

tr:last-child td { border-bottom: none; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem; }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(4px);
  display: none;
  place-items: center;
  padding: 16px;
  z-index: 60;
}
.modal-backdrop.open { display: grid; animation: pageFadeIn 200ms var(--ease); }

.modal {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-head h2 { margin: 0; font-size: 1.15rem; }

.btn-full { width: 100%; }
.mt-12 { margin-top: 12px; }
.text-muted { color: var(--muted); font-size: 0.88rem; }

@media (max-width: 820px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .hero { padding: 44px 0 28px; }
}
