/* ============================================================
   mdise — Panel Admin (mewarisi style.css)
   ============================================================ */

/* ---------- Layout ---------- */
.admin-body { background: var(--cream-50); }
.admin-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--maroon-900), var(--maroon-800));
  color: #e7c8c8;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.side-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 18px; border-bottom: 1px solid rgba(231,200,200,.15);
}
.side-brand .brand-logo { height: 34px; width: auto; box-shadow: none; }
.side-brand { align-items: center; }
.side-brand strong { font-family: var(--font-head); font-size: 1.2rem; color: #fff; display: block; line-height: 1.1; }
.side-brand small { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #d8a5a5; }

.side-nav { display: flex; flex-direction: column; gap: 3px; padding: 16px 12px; flex: 1; }
.side-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 14px; border-radius: 10px;
  font-size: .92rem; font-weight: 500;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.side-nav a:hover { background: rgba(255,255,255,.08); color: #fff; transform: translateX(3px); }
.side-nav a.on { background: var(--maroon-600); color: #fff; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.side-nav a.quit { margin-top: auto; color: #f0b8b8; }
.pill-count {
  margin-left: auto; background: var(--maroon-500); color: #fff;
  border-radius: 999px; min-width: 21px; height: 21px; padding: 0 6px;
  display: inline-grid; place-items: center; font-size: .72rem; font-weight: 700;
}
.side-user { padding: 16px 20px; font-size: .78rem; border-top: 1px solid rgba(231,200,200,.15); }
.side-user strong { color: #fff; }

.admin-main { flex: 1; padding: 34px 40px 60px; max-width: 1200px; }
.admin-head h1 { font-size: 1.55rem; letter-spacing: -.01em; }
.mono { font-family: ui-monospace, monospace; }

/* ---------- Kartu statistik ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-top: 24px; }
.stat-card {
  display: flex; align-items: center; gap: 15px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-ic {
  display: grid; place-items: center; width: 48px; height: 48px;
  border-radius: 13px; background: var(--cream-100); color: var(--maroon-700); flex-shrink: 0;
}
.stat-num { display: block; font-family: var(--font-head); font-size: 1.35rem; font-weight: 700; color: var(--ink-900); line-height: 1.2; }
.stat-label { font-size: .82rem; color: var(--ink-600); }

/* ---------- Panel & tabel ---------- */
.panel {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  margin-top: 24px; overflow: hidden;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { font-size: 1.08rem; }
.table-wrap { overflow-x: auto; padding: 14px 10px 10px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th {
  text-align: left; font-size: .74rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-600);
  padding: 10px 12px; border-bottom: 2px solid var(--line); white-space: nowrap;
}
td { padding: 11px 12px; border-bottom: 1px solid #f3e9e7; vertical-align: middle; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: var(--cream-50); }
tfoot td { border-bottom: none; border-top: 2px solid var(--line); }
.cell-product { display: flex; align-items: center; gap: 12px; min-width: 210px; }
.cell-product img { width: 42px; height: 42px; border-radius: 9px; object-fit: cover; }
.cell-actions { white-space: nowrap; }
.cell-actions form { display: inline-flex; margin-left: 6px; }
.warn-text { color: var(--warn); font-weight: 700; }

/* ---------- Flash message ---------- */
.flash {
  display: flex; align-items: center; gap: 9px;
  margin-top: 18px; padding: 12px 18px; border-radius: 12px; font-size: .9rem; font-weight: 500;
}
.ok-flash { background: #f0fdf4; color: var(--ok); border: 1px solid #bbf7d0; }
.bad-flash { background: #fef2f2; color: var(--maroon-600); border: 1px solid #fecaca; }

/* ---------- Form produk ---------- */
.product-form { padding: 20px 22px 22px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .grow { flex: 1; min-width: 180px; }
.form-row.align-center { align-items: center; }
.product-form input[type="text"], .product-form input[type="number"],
.product-form select, .product-form textarea,
.status-form select {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 11px;
  font: inherit; outline: none; background: var(--cream-50);
  transition: border-color .2s, box-shadow .2s;
}
.product-form input:focus, .product-form select:focus, .product-form textarea:focus,
.status-form select:focus { border-color: var(--maroon-600); box-shadow: 0 0 0 4px rgba(153,27,27,.12); background: #fff; }
.switch-label { display: flex; align-items: center; gap: 9px; font-size: .9rem; font-weight: 500; cursor: pointer; }
.switch-label input { width: 19px; height: 19px; accent-color: var(--maroon-700); }
.thumb-preview { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; margin-top: 10px; border: 1px solid var(--line); }
.form-actions { display: flex; align-items: center; gap: 16px; margin-top: 8px; }

/* ---------- Detail pesanan ---------- */
.detail-grid { display: grid; grid-template-columns: 340px 1fr; gap: 22px; align-items: start; margin-top: 4px; }
.kv { margin: 0; padding: 6px 22px 18px; }
.kv div { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dashed #f3e9e7; font-size: .92rem; }
.kv dt { color: var(--ink-600); }
.kv dd { text-align: right; margin: 0; }
.status-form { display: flex; align-items: end; gap: 12px; padding: 18px 22px 22px; flex-wrap: wrap; }
.status-form label { font-weight: 600; font-size: .9rem; }
.status-form select { width: 230px; }

/* ---------- Laporan bar chart ---------- */
.bar-list { display: flex; flex-direction: column; gap: 13px; padding: 18px 22px 24px; }
.bar-row { display: grid; grid-template-columns: 190px 1fr auto; gap: 14px; align-items: center; font-size: .87rem; }
.bar-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 12px; background: var(--cream-100); border-radius: 999px; overflow: hidden; }
.bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--maroon-700), var(--maroon-500));
  animation: barGrow .9s cubic-bezier(.25,.8,.35,1) both;
}
@keyframes barGrow { from { width: 0 !important; } }
.bar-val { color: var(--ink-600); font-size: .82rem; white-space: nowrap; }

/* ---------- Halaman login / password ---------- */
.login-body {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--maroon-900), var(--maroon-800) 55%, var(--maroon-700));
  position: relative; overflow: hidden; padding: 20px;
}
.login-card {
  position: relative; z-index: 1;
  background: var(--white); border-radius: 20px; box-shadow: var(--shadow-lg);
  width: min(400px, 94vw); padding: 38px 36px 30px;
}
.login-mark { height: 54px; width: auto; margin-bottom: 16px; }
.login-card h1 { font-size: 1.45rem; }
.login-card h1 small { display: block; font-size: .78rem; font-weight: 500; color: var(--ink-600); letter-spacing: .06em; text-transform: uppercase; }
.login-sub { color: var(--ink-600); font-size: .9rem; margin: 8px 0 20px; }
.login-card input:not([type="checkbox"]) {
  width: 100%; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 12px;
  font: inherit; outline: none; background: var(--cream-50); transition: border-color .2s, box-shadow .2s;
}
.login-card input:focus { border-color: var(--maroon-600); box-shadow: 0 0 0 4px rgba(153,27,27,.12); background: #fff; }
.center { text-align: center; }
.center a { color: var(--maroon-700); font-weight: 600; }

/* ---------- Responsif admin ---------- */
@media (max-width: 900px) {
  .admin-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-user { display: none; }
  .detail-grid { grid-template-columns: 1fr; }
  .admin-main { padding: 24px 18px 50px; }
  .bar-row { grid-template-columns: 130px 1fr; }
  .bar-val { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Ukuran & warna produk */
.size-checks { display: flex; flex-wrap: wrap; gap: 10px; }
.size-check { display: inline-flex; cursor: pointer; }
.size-check input { position: absolute; opacity: 0; pointer-events: none; }
.size-check span {
  display: inline-grid; place-items: center; min-width: 42px; height: 38px; padding: 0 10px;
  border: 1.5px solid var(--line); border-radius: 10px; font-weight: 600; font-size: .88rem;
  color: var(--ink-600); background: var(--cream-50); transition: all .18s ease;
}
.size-check input:checked + span {
  background: var(--maroon-700); border-color: var(--maroon-700); color: #fff;
  box-shadow: 0 4px 12px rgba(138,22,22,.25);
}
.size-check span:hover { border-color: var(--maroon-600); color: var(--maroon-700); }
