/* Tema ala gethomepage (dark / slate) — dipakai apps.deyy.cloud & admin.deyy.cloud */
:root {
  --bg: #1e293b;
  --bg-deep: #0f172a;
  --card: rgba(255, 255, 255, .05);
  --card-hover: rgba(255, 255, 255, .10);
  --border: rgba(255, 255, 255, .08);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --faint: #64748b;
  --accent: #38bdf8;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 6px;
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, .25), 0 2px 4px -2px rgba(15, 23, 42, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 Manrope, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 16px; }
@media (min-width: 640px) { .wrap { padding: 24px 32px; } }

/* ---------- Header / info widgets ---------- */
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px;
  padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--border);
}
.greet { flex: 1 1 220px; min-width: 0; }
.greet h1 { margin: 0; font-size: 20px; font-weight: 500; }
.greet .clock { color: var(--muted); font-size: 13px; }
.widgets { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; color: var(--muted); font-size: 12px; }
.res { display: flex; align-items: center; gap: 6px; min-width: 96px; }
.res .bar { width: 64px; height: 4px; background: rgba(255,255,255,.1); border-radius: 2px; overflow: hidden; }
.res .bar i { display: block; height: 100%; background: var(--muted); }
.search { flex: 1 1 260px; max-width: 420px; position: relative; }
.search input {
  width: 100%; padding: 8px 12px 8px 34px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--border); outline: none;
}
.search input:focus { border-color: var(--accent); background: var(--card-hover); }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.userbox { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }

/* ---------- Service groups (seperti Homepage) ---------- */
.groups { display: grid; grid-template-columns: 1fr; gap: 24px 20px; align-items: start; }
@media (min-width: 640px)  { .groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .groups { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.group h2 { margin: 0 0 8px 4px; font-size: 18px; font-weight: 500; color: #cbd5e1; }
.services { display: flex; flex-direction: column; gap: 8px; }

.service {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: background .15s ease; min-height: 56px;
}
.service:hover, .service:focus-visible { background: var(--card-hover); outline: none; }
.service .meta { min-width: 0; }
.service .name { font-size: 14px; font-weight: 500; }
.service .desc { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.service .tag { margin-left: auto; flex-shrink: 0; }
.service .unread-badge {
  margin-left: auto; flex-shrink: 0; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
  background: var(--ok); color: #052e1c; font-size: 12px; font-weight: 700; display: grid; place-items: center;
}

.icon { width: 32px; height: 32px; flex-shrink: 0; object-fit: contain; border-radius: 4px; }
.icon-mono { filter: invert(.85); }
.icon-letter, .icon-text {
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 15px;
}
.icon-letter { background: hsl(var(--hue, 210) 45% 35%); color: #fff; }
.icon-text { font-size: 22px; }

.empty { color: var(--muted); padding: 32px 0; text-align: center; }

/* ---------- Umum: tombol, form, pesan ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--card); cursor: pointer; font-size: 13px; white-space: nowrap;
}
.btn:hover { background: var(--card-hover); }
.btn-primary { background: #0369a1; border-color: #0284c7; color: #fff; }
.btn-primary:hover { background: #0284c7; }
.btn-danger { color: var(--danger); border-color: rgba(248,113,113,.35); }
.btn-danger:hover { background: rgba(248,113,113,.12); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; border: 1px solid; }
.alert-ok { color: var(--ok); border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.08); }
.alert-err { color: var(--danger); border-color: rgba(248,113,113,.35); background: rgba(248,113,113,.08); }
.alert-warn { color: var(--warn); border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.08); }

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 12px; color: var(--muted); }
.field input[type=text], .field input[type=password], .field input[type=url], .field input[type=number], .field select, .field textarea {
  width: 100%; padding: 8px 10px; border-radius: var(--radius);
  background: rgba(15,23,42,.6); border: 1px solid var(--border); outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field .hint { font-size: 11px; color: var(--faint); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: #0284c7; }
.check.disabled { opacity: .55; cursor: default; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 28px 24px; box-shadow: var(--shadow); }
.login-card h1 { margin: 0 0 4px; font-size: 20px; font-weight: 600; }
.login-card p.sub { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.login-card .btn { width: 100%; padding: 10px; }
.login-foot { margin-top: 16px; text-align: center; font-size: 12px; color: var(--faint); }

/* ---------- Admin ---------- */
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { padding: 6px 12px; border-radius: var(--radius); color: var(--muted); font-size: 13px; }
.nav a.on, .nav a:hover { background: var(--card-hover); color: var(--text); }
.layout { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
@media (min-width: 1024px) { .layout { grid-template-columns: minmax(0, 1fr) 380px; } }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.panel h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 8px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.cell-app { display: flex; align-items: center; gap: 10px; }
.cell-app .icon { width: 24px; height: 24px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.08); color: #cbd5e1; white-space: nowrap; }
.chip-admin { background: rgba(56,189,248,.15); color: var(--accent); }
.chip-off { background: rgba(248,113,113,.12); color: var(--danger); }
.chip-pub { background: rgba(52,211,153,.12); color: var(--ok); }
.apps-check { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(15,23,42,.4); }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

.chip-warn { background: rgba(251,191,36,.12); color: var(--warn); }

/* ---------- Laporan keamanan ---------- */
.report { max-width: 980px; margin: 0 auto; padding: 20px 24px; }
.report-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; }
.report-head h2 { margin: 0 0 4px; font-size: 20px; font-weight: 600; }
.report-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.report-toc a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 12px; color: var(--muted); }
.report-toc a:hover { background: var(--card-hover); color: var(--text); }
.report-body { font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.report-body p, .report-body li { margin: 6px 0; }
.report-body ul, .report-body ol { padding-left: 22px; margin: 6px 0 10px; }
.report-body strong { color: #f8fafc; font-weight: 600; }
.report-body hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
.report-body h2 { scroll-margin-top: 16px; margin: 28px 0 12px; padding: 6px 12px; border-radius: var(--radius); font-size: 15px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; background: var(--card-hover); }
.report-body h2.sev-high { background: rgba(248,113,113,.14); color: var(--danger); }
.report-body h2.sev-med  { background: rgba(251,146,60,.14); color: #fb923c; }
.report-body h2.sev-low  { background: rgba(251,191,36,.12); color: var(--warn); }
.report-body h3 { scroll-margin-top: 16px; margin: 22px 0 6px; padding-left: 10px; border-left: 3px solid var(--faint); font-size: 15px; font-weight: 600; }
.report-body h3.f-high { border-left-color: var(--danger); }
.report-body h3.f-med  { border-left-color: #fb923c; }
.report-body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: rgba(15,23,42,.6); padding: 1px 5px; border-radius: 4px; color: #e0f2fe; }
.report-body pre { background: var(--bg-deep); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; overflow-x: auto; font-size: 12.5px; line-height: 1.5; }
.report-body pre code { background: none; padding: 0; overflow-wrap: normal; white-space: pre; }
.report-body .tbl { overflow-x: auto; margin: 8px 0; }
.report-body table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-body th, .report-body td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; text-align: left; }
.report-body th { color: var(--muted); font-weight: 500; font-size: 12px; }
.report-body td { min-width: 110px; }
.report-body td:first-child { min-width: 0; color: var(--muted); }
@media (max-width: 640px) { .report { padding: 16px; } .report-body { font-size: 13.5px; } }

/* Tabel → kartu di layar HP */
@media (max-width: 720px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .table tr:last-child { border-bottom: 0; }
  .table td { border: 0; padding: 4px 0; }
  .table td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--faint); }
  .table td:first-child::before { display: none; }
  .table td:first-child { padding-bottom: 6px; }
  .table td:last-child { padding-top: 8px; }
}
