/* ===== ADMIN PANEL CSS - MOBILE FIRST ===== */
:root {
  --orange: #FF6B00; --orange-dark: #cc5500;
  --black: #1a1a1a; --dark: #111; --sidebar-bg: #161616;
  --sidebar-width: 240px; --topbar-h: 60px;
  --gray: #2d2d2d; --white: #fff; --bg: #f0f0f0;
  --danger: #ef4444; --success: #22c55e; --warning: #f59e0b;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', sans-serif; background: var(--bg); color: var(--black); }
img { max-width: 100%; height: auto; }

/* ── SIDEBAR ── */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  z-index: 200;
  border-right: 1px solid rgba(255,107,0,0.2);
  transform: translateX(-100%);
  transition: transform 0.3s;
}
.sidebar.open { transform: translateX(0); }

.sidebar-logo { padding: 1.2rem 1rem; border-bottom: 1px solid rgba(255,107,0,0.2); display: flex; align-items: center; gap: 10px; }
.sidebar-logo .logo-box { width: 38px; height: 38px; border-radius: 8px; object-fit: contain; flex-shrink: 0; }
.sidebar-logo .logo-text .name { color: var(--orange); font-size: 1rem; font-weight: 800; }
.sidebar-logo .logo-text .sub { color: #555; font-size: 0.6rem; }

.sidebar-menu { flex: 1; padding: 0.8rem 0; overflow-y: auto; }
.menu-label { color: #444; font-size: 0.62rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; padding: 0.7rem 1rem 0.3rem; }
.sidebar-menu a { display: flex; align-items: center; gap: 10px; padding: 0.65rem 1rem; color: #888; text-decoration: none; font-size: 0.85rem; font-weight: 500; transition: all 0.2s; border-left: 3px solid transparent; }
.sidebar-menu a:hover { color: white; background: rgba(255,107,0,0.08); }
.sidebar-menu a.active { color: var(--orange); background: rgba(255,107,0,0.12); border-left-color: var(--orange); font-weight: 600; }
.sidebar-menu a .icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-footer { padding: 1rem; border-top: 1px solid rgba(255,107,0,0.15); }
.sidebar-footer a { display: flex; align-items: center; gap: 8px; color: var(--danger); text-decoration: none; font-size: 0.85rem; font-weight: 600; padding: 0.5rem 0; }

/* Overlay */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 199; }
.sidebar-overlay.open { display: block; }

/* ── TOPBAR ── */
.topbar {
  background: white; border-bottom: 1px solid #e5e5e5;
  padding: 0 1rem; height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.topbar-left { display: flex; align-items: center; gap: 0.8rem; }
.topbar h1 { font-size: 0.95rem; font-weight: 700; color: var(--black); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.menu-btn { background: none; border: none; cursor: pointer; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.menu-btn span { display: block; width: 20px; height: 2px; background: #555; border-radius: 2px; }
.admin-info { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.admin-avatar { width: 32px; height: 32px; background: var(--orange); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 0.85rem; flex-shrink: 0; }
.admin-name { font-size: 0.82rem; font-weight: 600; color: #333; display: none; }

/* ── MAIN ── */
.main { min-height: 100vh; display: flex; flex-direction: column; }
.content { flex: 1; padding: 1rem; }

/* ── STAT CARDS ── */
.stats-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 0.8rem; margin-bottom: 1.2rem; }
.stat-card { background: white; border-radius: 12px; padding: 1rem; border: 1px solid #eee; display: flex; align-items: center; gap: 0.8rem; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.s-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.s-icon.orange { background: rgba(255,107,0,0.12); }
.s-icon.green  { background: rgba(34,197,94,0.12); }
.s-icon.red    { background: rgba(239,68,68,0.12); }
.s-icon.blue   { background: rgba(59,130,246,0.12); }
.s-num   { font-size: 1.5rem; font-weight: 900; color: var(--black); line-height: 1; }
.s-label { font-size: 0.72rem; color: #888; margin-top: 2px; }

/* ── CARD ── */
.card { background: white; border-radius: 12px; border: 1px solid #eee; box-shadow: 0 2px 8px rgba(0,0,0,0.04); overflow: hidden; margin-bottom: 1rem; }
.card-head { padding: 1rem; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; }
.card-head h2 { font-size: 0.95rem; font-weight: 700; }
.card-body { padding: 1rem; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.82rem; min-width: 600px; }
thead tr { background: #f8f8f8; }
th { padding: 0.65rem 0.8rem; text-align: left; font-weight: 600; color: #555; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid #eee; white-space: nowrap; }
td { padding: 0.75rem 0.8rem; border-bottom: 1px solid #f5f5f5; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }

/* ── BADGE ── */
.badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
.badge-aktif    { background: rgba(34,197,94,0.12); color: #16a34a; }
.badge-nonaktif { background: rgba(239,68,68,0.12); color: #dc2626; }
.badge-publish  { background: rgba(34,197,94,0.12); color: #16a34a; }
.badge-draft    { background: rgba(156,163,175,0.2); color: #6b7280; }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 0.5rem 0.9rem; border-radius: 7px; font-size: 0.82rem; font-weight: 600; cursor: pointer; text-decoration: none; border: none; transition: all 0.2s; white-space: nowrap; }
.btn-sm { padding: 0.28rem 0.6rem; font-size: 0.75rem; }
.btn-orange        { background: var(--orange); color: white; }
.btn-orange:hover  { background: var(--orange-dark); }
.btn-outline-orange { background: transparent; color: var(--orange); border: 1.5px solid var(--orange); }
.btn-outline-orange:hover { background: var(--orange); color: white; }
.btn-danger        { background: var(--danger); color: white; }
.btn-danger:hover  { background: #dc2626; }
.btn-success       { background: var(--success); color: white; }
.btn-gray          { background: #e5e5e5; color: #555; }
.btn-gray:hover    { background: #d0d0d0; }

/* ── FORM ── */
.form-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group.span2 { } /* span2 hanya aktif di desktop */
label { font-size: 0.8rem; font-weight: 600; color: #444; }
input[type=text], input[type=date], input[type=tel],
input[type=password], input[type=email], select, textarea {
  width: 100%; padding: 0.6rem 0.85rem;
  border: 1.5px solid #e0e0e0; border-radius: 8px;
  font-size: 0.88rem; font-family: inherit;
  transition: border-color 0.2s; background: white; color: var(--black);
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,107,0,0.1); }
textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: 0.72rem; color: #999; }
.required { color: var(--danger); }

/* ── FILTER BAR ── */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.filter-bar input, .filter-bar select { flex: 1; min-width: 140px; padding: 0.5rem 0.75rem; border: 1.5px solid #e0e0e0; border-radius: 8px; font-size: 0.83rem; -webkit-appearance: none; }
.filter-bar input:focus, .filter-bar select:focus { outline: none; border-color: var(--orange); }

/* ── FOTO ── */
.foto-preview { width: 90px; height: 90px; border-radius: 10px; object-fit: cover; border: 2px solid #eee; margin-top: 6px; }
.foto-circle  { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid #eee; }

/* ── ALERT ── */
.alert { padding: 0.75rem 1rem; border-radius: 8px; font-size: 0.85rem; margin-bottom: 1rem; }
.alert-success { background: rgba(34,197,94,0.1); color: #166534; border: 1px solid rgba(34,197,94,0.3); }
.alert-error   { background: rgba(239,68,68,0.1); color: #991b1b; border: 1px solid rgba(239,68,68,0.3); }

/* ── PAGINATION ── */
.pagination { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 1.2rem; }
.page-btn { width: 32px; height: 32px; border-radius: 6px; border: 1.5px solid #e0e0e0; background: white; cursor: pointer; font-size: 0.82rem; display: flex; align-items: center; justify-content: center; text-decoration: none; color: #555; font-weight: 600; transition: all 0.2s; }
.page-btn.active, .page-btn:hover { background: var(--orange); border-color: var(--orange); color: white; }

/* ── MAP ── */
#map { height: 240px; border-radius: 10px; border: 1.5px solid #e0e0e0; margin-top: 6px; }

/* ── QR ── */
.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.qr-wrap img { border: 3px solid var(--orange); border-radius: 10px; padding: 5px; background: white; }

/* ── LOGIN PAGE ── */
.login-page { min-height: 100svh; background: linear-gradient(135deg, #111 0%, #2d1a00 50%, #111 100%); display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.login-box { background: white; border-radius: 18px; padding: 2rem 1.5rem; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-logo { text-align: center; margin-bottom: 1.8rem; }
.login-logo h2 { font-size: 1.3rem; font-weight: 800; }
.login-logo p { color: #888; font-size: 0.82rem; }

/* ── TABLET 600px+ ── */
@media (min-width: 600px) {
  .stats-grid { grid-template-columns: repeat(4,1fr); }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-group.span2 { grid-column: span 2; }
  .admin-name { display: block; }
}

/* ── DESKTOP 900px+ ── */
@media (min-width: 900px) {
  .sidebar { transform: translateX(0); }
  .sidebar-overlay { display: none !important; }
  .menu-btn { display: none; }
  .main { margin-left: var(--sidebar-width); }
  .topbar { padding: 0 1.5rem; }
  .topbar h1 { font-size: 1.05rem; max-width: none; }
  .content { padding: 1.5rem; }
  #map { height: 300px; }
}
