/* ============================================================
   Seasons Konveksi — Gaya Tampilan
   Identitas: bengkel kain / konveksi. Indigo celup + benang marigold.
   ============================================================ */

:root {
  --ink:     #1B2A4A;   /* indigo tua — judul, tombol utama */
  --ink-2:   #2E4274;   /* indigo terang — hover/link        */
  --thread:  #D98A2B;   /* benang marigold — aksen tunggal    */
  --thread-2:#B9701B;
  --bg:      #ECEDE8;   /* greige lembut                      */
  --surface: #FFFFFF;
  --line:    #DCDEE3;
  --text:    #1F2433;
  --muted:   #717784;
  --ok:      #2E7D5B;
  --ok-bg:   #E6F2EC;
  --danger:  #C0492F;
  --danger-bg:#FBEAE5;
  --radius:  14px;
  --radius-sm:10px;
  --shadow:  0 1px 2px rgba(27,42,74,.06), 0 8px 24px rgba(27,42,74,.08);
  --shadow-sm:0 1px 2px rgba(27,42,74,.08);
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  font-size: 15px;
}

/* ---------- Header / top bar ---------- */
.topbar {
  background: var(--ink);
  color: #fff;
  position: sticky; top: 0; z-index: 30;
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto;
  padding: 14px 20px;
  display: flex; align-items: center; gap: 14px;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -.02em;
  color: #fff;
  display: inline-flex; align-items: baseline; gap: 8px;
  text-decoration: none;
}
.wordmark .seasons { position: relative; }
.wordmark .seasons::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px;
  height: 3px; border-radius: 3px;
  background: repeating-linear-gradient(90deg, var(--thread) 0 7px, transparent 7px 12px);
}
.wordmark .tag {
  font-family: var(--font-body);
  font-weight: 600; font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: #9fb0d6;
  align-self: center;
}
.topbar .back {
  margin-left: auto;
  color: #c8d2ea; text-decoration: none; font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
}
.topbar .back:hover { color: #fff; }

/* ---------- Layout ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }
.page-head { margin-bottom: 22px; }
.page-head h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(24px, 3.5vw, 32px); letter-spacing: -.02em;
  margin: 0 0 4px;
}
.page-head p { margin: 0; color: var(--muted); }

/* ---------- Dashboard menu tiles ---------- */
.tiles {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.tile {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 150px; position: relative; overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.tile.active:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #c5cbd6; }
.tile .ico {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  background: #EEF1F8; color: var(--ink);
}
.tile.active .ico { background: var(--ink); color: #fff; }
.tile h3 { font-family: var(--font-display); font-weight: 700; font-size: 18px; margin: 0; }
.tile p { margin: 0; color: var(--muted); font-size: 13.5px; }
.tile .soon {
  position: absolute; top: 14px; right: 14px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--thread-2); background: #FBF1E2; padding: 3px 8px; border-radius: 20px;
}
.tile.soon-tile { opacity: .82; }
.tile .go { margin-top: auto; font-weight: 600; color: var(--ink-2); font-size: 14px; }

/* ---------- Buttons ---------- */
.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 11px 18px; display: inline-flex; align-items: center; gap: 8px;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-2); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Toolbar above list ---------- */
.list-tools {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.search-box {
  flex: 1; min-width: 200px; position: relative;
}
.search-box input {
  width: 100%; padding: 11px 14px 11px 40px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; background: var(--surface);
}
.search-box input:focus { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 3px rgba(46,66,116,.12); }
.search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* ---------- Material list (signature swatch cards) ---------- */
.bahan-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.bahan-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; cursor: pointer; text-align: left; width: 100%;
  padding: 0; font: inherit; color: inherit;
  transition: box-shadow .15s, border-color .15s, transform .15s;
}
.bahan-card:hover { box-shadow: var(--shadow); border-color: #c5cbd6; transform: translateY(-2px); }
.bahan-card:focus-visible { outline: 3px solid rgba(46,66,116,.35); outline-offset: 2px; }

/* swatch chip kiri */
.swatch {
  width: 104px; min-width: 104px; align-self: stretch;
  background: #EEF1F8 center/cover no-repeat;
  position: relative; border-right: 1px solid var(--line);
}
.swatch.empty { display: grid; place-items: center; color: #9aa2b4; }
/* lubang jahit kecil sebagai motif tanda kain */
.swatch::before {
  content: ""; position: absolute; top: 12px; left: 12px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 0 0 2px rgba(27,42,74,.18);
}
.bahan-body { padding: 14px 16px; flex: 1; min-width: 0; }
.bahan-body .jenis {
  font-family: var(--font-display); font-weight: 700; font-size: 16.5px;
  margin: 0 0 2px; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bahan-body .toko { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.qty-tag {
  display: inline-flex; align-items: baseline; gap: 5px;
  background: var(--ok-bg); color: var(--ok);
  padding: 5px 11px; border-radius: 20px; font-weight: 600; font-size: 14px;
}
.qty-tag .unit { font-weight: 500; font-size: 12px; }
.bahan-body .harga { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- Empty state ---------- */
.empty-state {
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 48px 24px; text-align: center; color: var(--muted);
  background: rgba(255,255,255,.5);
}
.empty-state h3 { font-family: var(--font-display); color: var(--text); margin: 12px 0 4px; }

/* ---------- Drawer / form ---------- */
.scrim {
  position: fixed; inset: 0; background: rgba(20,28,48,.45);
  opacity: 0; visibility: hidden; transition: opacity .2s; z-index: 40;
}
.scrim.show { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(440px, 100%);
  background: var(--surface); z-index: 50; box-shadow: -8px 0 30px rgba(20,28,48,.18);
  transform: translateX(100%); transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.drawer.show { transform: translateX(0); }
.drawer-head {
  padding: 18px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.drawer-head h2 { font-family: var(--font-display); font-size: 19px; margin: 0; }
.drawer-close { background: none; border: none; cursor: pointer; color: var(--muted); padding: 6px; border-radius: 8px; }
.drawer-close:hover { background: #f0f1f4; color: var(--text); }
.drawer-body { padding: 20px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 16px 20px; border-top: 1px solid var(--line); }

/* ---------- Form fields ---------- */
.field { margin-bottom: 18px; }
.field > label {
  display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 7px; color: var(--ink);
}
.field .hint { color: var(--muted); font-weight: 400; }
.input, .select-native {
  width: 100%; padding: 11px 13px; font: inherit;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
}
.input:focus, .select-native:focus {
  outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 3px rgba(46,66,116,.12);
}
.input-group { display: flex; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .addon {
  border: 1px solid var(--line); border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0 13px; display: grid; place-items: center;
  background: #f5f6f8; color: var(--muted); font-weight: 600; font-size: 13px;
}
.prefix-group { display: flex; }
.prefix-group .addon-left {
  border: 1px solid var(--line); border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  padding: 0 12px; display: grid; place-items: center;
  background: #f5f6f8; color: var(--muted); font-weight: 600;
}
.prefix-group .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* segmented control (satuan) */
.segment { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.segment label { flex: 1; }
.segment input { position: absolute; opacity: 0; pointer-events: none; }
.segment span {
  display: block; padding: 10px 22px; cursor: pointer; font-weight: 600; color: var(--muted);
  text-align: center; user-select: none;
}
.segment input:checked + span { background: var(--ink); color: #fff; }
.segment input:focus-visible + span { box-shadow: inset 0 0 0 2px rgba(46,66,116,.5); }

/* ---------- Combobox (cari & tambah) ---------- */
.combo { position: relative; }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); max-height: 230px; overflow-y: auto;
  display: none;
}
.combo.open .combo-list { display: block; }
.combo-opt {
  padding: 10px 13px; cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.combo-opt:hover, .combo-opt.active { background: #EEF1F8; }
.combo-opt.add { color: var(--ink-2); font-weight: 600; border-top: 1px solid var(--line); }
.combo-opt.add .plus { color: var(--thread-2); }
.combo-empty { padding: 12px 13px; color: var(--muted); font-size: 13px; }

/* ---------- Foto preview ---------- */
.photo-drop {
  border: 1px dashed var(--line); border-radius: var(--radius-sm);
  padding: 18px; text-align: center; cursor: pointer; color: var(--muted);
  background: #fafbfc; transition: border-color .15s, background .15s;
}
.photo-drop:hover { border-color: var(--ink-2); background: #f4f6fa; }
.photo-drop.has-img { padding: 0; border-style: solid; overflow: hidden; }
.photo-drop img { width: 100%; max-height: 200px; object-fit: cover; display: block; }
.photo-clear {
  margin-top: 8px; background: none; border: none; color: var(--danger);
  font: inherit; font-size: 13px; cursor: pointer; font-weight: 600;
}

/* ---------- Detail modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 60; display: none;
  align-items: center; justify-content: center; padding: 20px;
}
.modal.show { display: flex; }
.modal-card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  width: min(560px, 100%); max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow);
}
.modal-photo { width: 100%; aspect-ratio: 16/10; background: #EEF1F8 center/cover no-repeat; }
.modal-photo.empty { display: grid; place-items: center; color: #9aa2b4; }
.modal-content { padding: 22px 24px 26px; }
.modal-content h2 { font-family: var(--font-display); font-size: 22px; margin: 0 0 16px; }
.detail-row {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.detail-row:last-child { border-bottom: none; }
.detail-row .k { color: var(--muted); }
.detail-row .v { font-weight: 600; text-align: right; }
.modal-close-row { margin-top: 20px; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px;
  box-shadow: var(--shadow); font-weight: 500; animation: toastin .2s ease;
}
.toast.err { background: var(--danger); }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Misc ---------- */
.skeleton { background: linear-gradient(90deg,#eceef1 25%,#f4f5f7 37%,#eceef1 63%); background-size: 400% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); height: 132px; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

@media (max-width: 520px) {
  .wrap { padding: 20px 14px 50px; }
  .swatch { width: 84px; min-width: 84px; }
  .drawer { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
