/* DEWA BETON — panel admin */

:root {
  --concrete-050: #f7f7f5;
  --concrete-100: #efefec;
  --concrete-200: #dededa;
  --concrete-400: #a3a39d;
  --concrete-600: #60605c;
  --concrete-800: #33332f;
  --concrete-900: #1c1c1a;
  --orange-500: #f47b1f;
  --orange-600: #dc6510;
  --orange-100: #fdeee2;
  --green-600: #1f8a4c;
  --red-600: #c0392b;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

* { box-sizing: border-box; }

/* Atribut hidden harus menang atas display:grid/flex di bawah (login-wrap,
   modal-backdrop). Tanpa ini overlay modal menutupi form login. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--concrete-050);
  color: var(--concrete-800);
  font-size: 15px;
}

h1, h2 { margin: 0 0 4px; }
h2 { font-size: 20px; }
.muted { color: var(--concrete-600); font-size: 13px; margin: 0 0 16px; }
.error { color: var(--red-600); font-size: 13px; margin: 10px 0 0; }
.status { font-size: 13px; margin: 12px 0 0; color: var(--green-600); }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--concrete-100), var(--concrete-050));
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: #fff;
  padding: 32px;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .08);
  text-align: center;
}
.login-logo {
  width: 54px; height: 54px;
  margin: 0 auto 14px;
  border-radius: 12px;
  background: var(--orange-500);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 20px;
}
.login-card h1 { font-size: 20px; letter-spacing: .04em; }
.login-card label { text-align: left; display: block; margin-top: 14px; }
.back-link { display: inline-block; margin-top: 18px; font-size: 13px; color: var(--concrete-600); text-decoration: none; }
.back-link:hover { color: var(--orange-500); }

/* ---------- form ---------- */
label {
  display: block;
  font-size: 13px;
  color: var(--concrete-600);
  margin-bottom: 12px;
}
input[type=text], input[type=password], input[type=email], input[type=file], select, textarea {
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--concrete-800);
  background: #fff;
  border: 1px solid var(--concrete-200);
  border-radius: var(--radius);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--orange-500);
  box-shadow: 0 0 0 3px rgba(244, 123, 31, .15);
}
textarea { resize: vertical; }

.btn-primary {
  width: 100%;
  padding: 11px 18px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  background: var(--orange-500);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}
.btn-primary:hover { background: var(--orange-600); }
.btn-primary:disabled { opacity: .6; cursor: wait; }

.ghost {
  padding: 9px 14px;
  font: inherit;
  font-size: 13px;
  color: var(--concrete-800);
  background: transparent;
  border: 1px solid var(--concrete-200);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.ghost:hover { border-color: var(--orange-500); color: var(--orange-500); }

/* ---------- shell ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: #fff;
  border-bottom: 1px solid var(--concrete-200);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { font-weight: 700; letter-spacing: .05em; font-size: 15px; }
.brand span { color: var(--orange-500); font-weight: 500; }
.topbar-actions { display: flex; gap: 8px; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 12px 24px 0;
  background: #fff;
  border-bottom: 1px solid var(--concrete-200);
  overflow-x: auto;
}
.tab {
  padding: 9px 16px;
  font: inherit;
  font-size: 14px;
  color: var(--concrete-600);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.tab.active { color: var(--orange-600); border-bottom-color: var(--orange-500); font-weight: 600; }

.content { padding: 24px; max-width: 1180px; margin: 0 auto; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; gap: 12px; flex-wrap: wrap; }
.panel-head .btn-primary { width: auto; }

.form-card {
  background: #fff;
  padding: 22px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-width: 720px;
}
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.field-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; margin: 0; }
.file-field span { display: block; margin-bottom: 4px; }
.file-field small { display: block; margin-top: 6px; }

/* ---------- cards ---------- */
.grid-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.pcard {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.pcard-media {
  height: 130px;
  background: var(--concrete-100);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.pcard-media img { width: 100%; height: 100%; object-fit: cover; }
.pcard-media svg { width: 54px; height: 54px; opacity: .45; }
.pcard-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.pcard-cat { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--orange-600); }
.pcard-body h3 { margin: 5px 0 6px; font-size: 15px; }
.pcard-desc { font-size: 13px; color: var(--concrete-600); margin: 0 0 10px; flex: 1; }
.pcard-price { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.pcard-price small { font-weight: 400; color: var(--concrete-600); margin-left: 5px; }
.pcard-specs { list-style: none; padding: 0; margin: 0 0 12px; font-size: 12px; color: var(--concrete-600); }
.pcard-specs li { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dashed var(--concrete-200); }
.pcard-actions { display: flex; gap: 7px; }
.pcard-actions .ghost { flex: 1; padding: 7px 10px; font-size: 13px; }
.pcard-actions .del { color: var(--red-600); }
.pcard-actions .del:hover { border-color: var(--red-600); color: var(--red-600); }
.badge-flag { display: inline-block; background: var(--orange-100); color: var(--orange-600); font-size: 11px; padding: 2px 8px; border-radius: 20px; margin-left: 6px; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(28, 28, 26, .55);
  display: grid; place-items: center;
  padding: 20px;
  z-index: 20;
  overflow-y: auto;
}
.modal-card {
  position: relative;
  background: #fff;
  border-radius: 14px;
  padding: 26px;
  width: 100%;
  max-width: 680px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.modal-card h2 { margin-bottom: 16px; }
.modal-x {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none;
  font-size: 26px; line-height: 1;
  color: var(--concrete-400); cursor: pointer;
}
.modal-x:hover { color: var(--concrete-800); }
.modal-actions { display: flex; gap: 10px; margin-top: 6px; }
.modal-actions .btn-primary { width: auto; }

@media (max-width: 720px) {
  .field-grid { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .tabs { padding: 10px 16px 0; }
}

/* ---------- Multi-foto ---------- */
.photo-thumbs {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px;
}
.photo-thumb {
  position: relative; width: 76px; height: 76px;
  border: 1px solid var(--concrete-300); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--concrete-050);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb button {
  position: absolute; top: 2px; right: 2px;
  width: 20px; height: 20px; line-height: 1;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(30,30,29,.72); color: #fff; font-size: 13px;
}
.photo-thumb button:hover { background: var(--red-600); }
