/* ============================================================
   OLDBIKE INDONESIA — Panel Admin
   Tema gahar: hitam pekat + merah/oranye. Mobile-first, CSS murni.
   ============================================================ */
:root {
  --bg: #0b0a09;
  --bg2: #12100e;
  --card: #171412;
  --card2: #1d1815;
  --line: #2b2320;
  --red: #d92b1f;
  --red-dark: #9c1c12;
  --orange: #ff7a1a;
  --text: #f3ece2;
  --muted: #a89c8d;
  --green: #3fae5a;
  --radius: 12px;
  --font-head: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 20%, rgba(217, 43, 31, .14), transparent 55%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
  border-radius: var(--radius);
  padding: 28px 24px;
}
.login-card h1 {
  font-family: var(--font-head);
  font-size: 2rem;
  letter-spacing: .04em;
  margin: 0 0 4px;
  text-transform: uppercase;
}
.login-card h1 span { color: var(--red); }
.login-card p.sub { color: var(--muted); margin: 0 0 20px; font-size: .9rem; }
.login-error {
  background: rgba(217, 43, 31, .12);
  border: 1px solid var(--red);
  color: #ffb4ab;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: .9rem;
}

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(11, 10, 9, .96);
  border-bottom: 2px solid var(--red);
  backdrop-filter: blur(6px);
}
.brand {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand span { color: var(--red); }
.role-badge {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--orange);
  color: #1a0e00;
  white-space: nowrap;
}
.role-badge.superadmin { background: var(--red); color: #fff; }

/* ---------- Nav ---------- */
.app-nav {
  position: sticky;
  top: 57px;
  z-index: 40;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 12px;
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.app-nav::-webkit-scrollbar { display: none; }
.nav-btn {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.nav-btn.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* ---------- Layout ---------- */
main { padding: 16px 14px 60px; max-width: 980px; margin: 0 auto; }
.view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 14px;
}
.view-head h2 {
  font-family: var(--font-head);
  font-size: 1.7rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 0;
}
.view-head h2::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  background: var(--red);
  margin-top: 4px;
}

/* ---------- Cards & stats ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  border-radius: 10px;
  padding: 14px;
}
.stat .num { font-family: var(--font-head); font-size: 2.2rem; font-weight: 800; line-height: 1; }
.stat .lbl { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.greet { font-size: 1.05rem; margin: 0 0 4px; }
.greet b { color: var(--orange); }
.hint { color: var(--muted); font-size: .88rem; margin: 0 0 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--card2);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, var(--red), var(--red-dark));
  border-color: var(--red-dark);
  color: #fff;
}
.btn-danger {
  background: transparent;
  border-color: var(--red);
  color: #ff8d81;
}
.btn-small { padding: 7px 12px; font-size: .8rem; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: .85rem; margin-bottom: 6px; }
.field label .opt { color: var(--muted); font-weight: 400; }
.field input[type="text"],
.field input[type="url"],
.field input[type="date"],
.field input[type="number"],
.field input[type="email"],
.field input[type="password"],
.field select,
.field textarea {
  width: 100%;
  background: #0e0c0b;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: .95rem;
  font-family: var(--font-body);
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--red);
}
.field .help { color: var(--muted); font-size: .78rem; margin-top: 5px; }
.field .slug-row { display: flex; gap: 8px; align-items: center; }
.field .slug-row code {
  background: #0e0c0b;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: .8rem;
  color: var(--orange);
  word-break: break-all;
}
input[type="file"] { color: var(--muted); font-size: .85rem; }
.img-preview {
  margin-top: 8px;
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  max-height: 220px;
  object-fit: contain;
  background: #000;
}
.img-preview-wrap { position: relative; display: inline-block; max-width: 100%; }

/* ---------- Data rows ---------- */
.rows { display: flex; flex-direction: column; gap: 10px; }
.row {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.row .thumb {
  width: 56px; height: 56px; flex: 0 0 56px;
  border-radius: 8px; object-fit: cover; background: #000;
  border: 1px solid var(--line);
}
.row .thumb.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 1.4rem;
}
.row .info { flex: 1; min-width: 0; }
.row .info .t { font-weight: 700; word-break: break-word; }
.row .info .s { color: var(--muted); font-size: .8rem; word-break: break-word; }
.row .acts { display: flex; gap: 6px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }
.empty {
  text-align: center; color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px 16px;
}
.loading { color: var(--muted); padding: 20px; text-align: center; }

/* ---------- Gallery ---------- */
.gal-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.gal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.gal-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}
.gal-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: #000; }
.gal-item .cap { padding: 8px; }
.gal-item .cap input {
  width: 100%; background: #0e0c0b; border: 1px solid var(--line);
  color: var(--text); border-radius: 8px; padding: 7px 9px; font-size: .82rem;
}
.gal-item .bar { display: flex; gap: 6px; padding: 0 8px 8px; align-items: center; }
.gal-check {
  position: absolute; top: 8px; left: 8px;
  width: 26px; height: 26px; accent-color: var(--red); cursor: pointer;
}
.progress { color: var(--orange); font-size: .88rem; margin: 8px 0; }

/* ---------- Website images ---------- */
.slot-grid { display: grid; gap: 12px; }
.slot-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.slot-card h3 { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 10px; font-size: 1.25rem; }
.slot-card img { width: 100%; max-height: 240px; object-fit: contain; background: #000; border-radius: 8px; border: 1px solid var(--line); }
.slot-placeholder {
  border: 1px dashed var(--line); border-radius: 8px; padding: 30px;
  text-align: center; color: var(--muted);
}
.slot-card .row-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Konten teks ---------- */
.kv { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.kv code { color: var(--orange); font-size: .82rem; word-break: break-all; }
.kv textarea {
  width: 100%; background: #0e0c0b; border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 9px 10px; font-size: .9rem; min-height: 70px; resize: vertical;
  margin: 8px 0;
}

/* ---------- Publish info ---------- */
.steps { counter-reset: step; display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.steps li {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--red);
  border-radius: 10px; padding: 12px 14px; position: relative; padding-left: 48px;
}
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 12px; top: 12px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--red); color: #fff;
  font-weight: 800; font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
}
.warn-box {
  background: rgba(255, 122, 26, .08);
  border: 1px solid var(--orange);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-size: .9rem;
}
.warn-box b { color: var(--orange); }

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, .75);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal {
  background: var(--card); border: 1px solid var(--line);
  border-top: 4px solid var(--red);
  border-radius: var(--radius);
  max-width: 640px; width: 100%;
  max-height: 88vh; overflow-y: auto; padding: 20px;
}
.modal h3 { font-family: var(--font-head); text-transform: uppercase; margin: 0 0 10px; font-size: 1.5rem; }
.modal img { max-width: 100%; border-radius: 8px; margin-bottom: 10px; }
.modal .body-text { white-space: pre-wrap; word-break: break-word; }
.modal-close-row { display: flex; justify-content: flex-end; margin-top: 14px; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  z-index: 200; max-width: calc(100vw - 32px);
  background: var(--card2); border: 1px solid var(--red);
  color: var(--text); border-radius: 10px;
  padding: 12px 18px; font-size: .9rem; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
  text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { border-color: var(--red); background: #2a0f0c; }
#toast.success { border-color: var(--green); }

/* ---------- Desktop tweaks ---------- */
@media (min-width: 720px) {
  main { padding: 24px 20px 80px; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .gal-grid { grid-template-columns: repeat(4, 1fr); }
  .slot-grid { grid-template-columns: repeat(2, 1fr); }
  .app-nav { top: 61px; }
}
