/* ==========================================================================
   OtoServis — Stylesheet
   Desain mobile-first, app-like. Tanpa dependensi eksternal (font/CDN).
   ========================================================================== */

:root {
  --color-bg: #f2f4f8;
  --color-surface: #ffffff;
  --color-primary: #0f2a4a;
  --color-primary-light: #1e4976;
  --color-accent: #ff7a1a;
  --color-accent-dark: #e6690f;
  --color-success: #1a9e5c;
  --color-success-bg: #e5f7ee;
  --color-danger: #dc3545;
  --color-danger-bg: #fdeaec;
  --color-text: #1a2233;
  --color-text-muted: #6b7684;
  --color-border: #e6e9ef;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 3px rgba(15, 42, 74, 0.08);
  --shadow-md: 0 10px 28px rgba(15, 42, 74, 0.14);
  --nav-height: 66px;
  --header-height: 56px;
  --app-max-width: 480px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: #dfe4ec;
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }

/* ------------------------------- App shell ------------------------------- */

#app {
  max-width: var(--app-max-width);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-md);
}

@media (min-width: 540px) {
  body { padding: 28px 0; }
  #app { min-height: calc(100vh - 56px); border-radius: 28px; overflow: hidden; }
}

.app-header {
  flex: 0 0 auto;
  height: var(--header-height);
  background: var(--color-primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 30;
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 12px;
}
.header-title {
  flex: 1;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}
.header-logo { display: flex; align-items: center; color: var(--color-accent); }
.icon-btn {
  background: none;
  border: none;
  color: #fff;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.icon-btn:active { background: rgba(255, 255, 255, 0.12); }

.app-view {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 16px calc(var(--nav-height) + 20px);
}
#app.no-chrome .app-header,
#app.no-chrome .bottom-nav { display: none; }
#app.no-chrome .app-view { padding-bottom: 16px; }

.bottom-nav {
  position: sticky;
  bottom: 0;
  display: flex;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  height: var(--nav-height);
  z-index: 30;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 600;
}
.nav-item .icon { width: 21px; height: 21px; }
.nav-item.active { color: var(--color-accent); }

/* --------------------------------- Icons --------------------------------- */

.icon { width: 20px; height: 20px; flex-shrink: 0; }
.icon-xs { width: 14px; height: 14px; flex-shrink: 0; }
.icon-sm { width: 18px; height: 18px; flex-shrink: 0; }
.icon-lg { width: 40px; height: 40px; flex-shrink: 0; }

/* --------------------------------- Toast --------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translate(-50%, 20px);
  background: var(--color-primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 100;
  max-width: 90%;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------- Buttons -------------------------------- */

.btn {
  border: none;
  border-radius: var(--radius-md);
  padding: 13px 20px;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:active { background: var(--color-accent-dark); }
.btn-outline { background: transparent; border: 1.5px solid var(--color-border); color: var(--color-text); }
.btn-block { width: 100%; margin-top: 4px; }
.link-btn {
  background: none; border: none; color: var(--color-accent); font-weight: 700; font-size: 13px;
  display: flex; align-items: center; gap: 2px; padding: 4px;
}

/* --------------------------------- Forms --------------------------------- */

.form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12.5px; font-weight: 700; color: var(--color-text-muted); }
.form-group input,
.form-group select,
.form-group textarea {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  background: var(--color-surface);
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--color-accent); }
.form-group textarea { resize: vertical; font-family: inherit; }

/* -------------------------------- Auth screen ------------------------------ */

.auth-screen { display: flex; flex-direction: column; min-height: calc(100vh - 32px); justify-content: center; gap: 20px; }
.auth-brand { text-align: center; color: var(--color-primary); }
.auth-logo {
  width: 64px; height: 64px; border-radius: 20px; background: var(--color-primary);
  color: var(--color-accent); display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.auth-brand h1 { font-size: 24px; margin-bottom: 6px; }
.auth-brand p { color: var(--color-text-muted); font-size: 13.5px; }
.auth-card { display: flex; flex-direction: column; gap: 16px; }
.auth-tabs { margin-bottom: 4px; }
.auth-note { font-size: 11.5px; color: var(--color-text-muted); text-align: center; }

/* --------------------------------- Tabs ---------------------------------- */

.tabs { display: flex; background: #eceff4; border-radius: var(--radius-md); padding: 4px; margin-bottom: 14px; }
.tab {
  flex: 1; background: none; border: none; padding: 10px; border-radius: 10px;
  font-weight: 700; font-size: 13.5px; color: var(--color-text-muted);
}
.tab.active { background: var(--color-surface); color: var(--color-primary); box-shadow: var(--shadow-sm); }

/* --------------------------------- Layout --------------------------------- */

.section { margin-bottom: 16px; }
.greeting p { color: var(--color-text-muted); font-size: 14px; margin-bottom: 4px; }
.greeting h2 { font-size: 20px; }

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 20px 0 10px;
}
.section-header h3 { font-size: 15px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.stack { display: flex; flex-direction: column; gap: 10px; }

/* -------------------------------- Search box ------------------------------- */

.search-box, .search-input-wrap {
  display: flex; align-items: center; gap: 10px;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--color-text-muted);
  width: 100%;
  margin-bottom: 14px;
}
.search-box { border: none; box-shadow: var(--shadow-sm); text-align: left; }
.search-input-wrap input {
  border: none; outline: none; flex: 1; background: none; color: var(--color-text); padding: 0;
}

/* -------------------------------- Quick grid ------------------------------- */

.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.quick-item {
  background: var(--color-surface); border: none; border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); padding: 14px 6px; display: flex; flex-direction: column;
  align-items: center; gap: 8px; font-size: 11px; font-weight: 700; text-align: center; color: var(--color-text);
}
.quick-icon {
  width: 40px; height: 40px; border-radius: 12px; background: var(--color-success-bg);
  color: var(--color-success); display: flex; align-items: center; justify-content: center;
}
.quick-item:nth-child(1) .quick-icon { background: #fff1e6; color: var(--color-accent); }
.quick-item:nth-child(3) .quick-icon { background: #e9edfb; color: #3b4fd6; }
.quick-item:nth-child(4) .quick-icon { background: #f3e8fd; color: #7c3aed; }

/* -------------------------------- Promo banner ------------------------------ */

.promo-banner {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #fff; border-radius: var(--radius-lg); padding: 18px; display: flex;
  align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px;
}
.promo-banner h3 { font-size: 15px; margin-bottom: 4px; }
.promo-banner p { font-size: 12px; color: #cdd8ea; }
.promo-icon { color: var(--color-accent); opacity: 0.9; }

/* ---------------------------------- Cards --------------------------------- */

.card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 14px;
}

.bengkel-card {
  display: flex; gap: 12px; text-align: left; width: 100%; border: none;
  align-items: flex-start;
}
.bengkel-card-body { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bengkel-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.bengkel-card-top h4 { font-size: 14.5px; }
.kategori-line { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.02em; }

.avatar {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px;
}
.avatar-sm { width: 34px; height: 34px; border-radius: 11px; font-size: 12px; }

.muted-line { font-size: 12.5px; color: var(--color-text-muted); display: flex; align-items: center; gap: 4px; }

/* --------------------------------- Badges --------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700;
  padding: 4px 9px; border-radius: 999px; white-space: nowrap;
}
.badge-open { background: var(--color-success-bg); color: var(--color-success); }
.badge-closed { background: var(--color-danger-bg); color: var(--color-danger); }

/* --------------------------------- Rating --------------------------------- */

.rating { display: inline-flex; align-items: center; gap: 2px; }
.star-filled { color: #f5a623; fill: #f5a623; }
.star-empty { color: #d8dde5; }
.rating-num { font-size: 12px; font-weight: 700; color: var(--color-text-muted); margin-left: 3px; }

/* --------------------------------- Chips ---------------------------------- */

.chip-row { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.chip {
  border: 1.5px solid var(--color-border); background: var(--color-surface);
  border-radius: 999px; padding: 7px 14px; font-size: 12.5px; font-weight: 700; color: var(--color-text-muted);
}
.chip.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* ------------------------------- Empty state ------------------------------- */

.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 12px; padding: 48px 20px; color: var(--color-text-muted);
}
.empty-state .icon-lg { color: var(--color-border); }
.empty-state p { font-size: 13.5px; }

/* ----------------------------- Bengkel detail ------------------------------ */

.bengkel-banner {
  height: 120px; border-radius: var(--radius-lg); display: flex; align-items: center;
  justify-content: center; color: rgba(255, 255, 255, 0.85); margin-bottom: 14px;
}
.bengkel-detail-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.bengkel-detail-head h2 { font-size: 19px; }
.desc-text { font-size: 13px; color: var(--color-text-muted); line-height: 1.5; margin-top: 2px; }

.antrian-mini {
  display: flex; align-items: center; margin-bottom: 16px;
}
.antrian-mini-col { flex: 1; text-align: center; }
.antrian-mini-divider { width: 1px; height: 40px; flex: 0 0 1px; background: var(--color-border); }
.label-sm { font-size: 11px; color: var(--color-text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.big-num { font-size: 26px; font-weight: 800; color: var(--color-primary); margin-top: 4px; }
.big-num.small { font-size: 20px; }
.big-num.accent { color: var(--color-accent); }

.service-row { display: flex; align-items: center; justify-content: space-between; }
.service-row h4 { font-size: 14px; margin-bottom: 2px; }
.price { font-weight: 800; color: var(--color-primary); font-size: 14px; white-space: nowrap; }

.jam-table { display: flex; flex-direction: column; gap: 2px; }
.jam-row { display: flex; justify-content: space-between; padding: 7px 2px; font-size: 13px; color: var(--color-text-muted); }
.jam-row.today { color: var(--color-text); font-weight: 700; background: #fff6ee; border-radius: 8px; padding: 7px 8px; }

.testi-card .testi-body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.testi-card { display: flex; }
.testi-card .avatar-sm { margin-right: 10px; }
.testi-card p { font-size: 13px; }

/* --------------------------------- Antrian --------------------------------- */

.queue-card { margin-bottom: 20px; }
.queue-numbers { display: flex; gap: 12px; margin: 14px 0; }
.queue-num-box { flex: 1; background: #f7f8fb; border-radius: var(--radius-sm); padding: 12px; text-align: center; }
.queue-eta { font-size: 13px; text-align: center; color: var(--color-text-muted); }
.queue-eta strong { color: var(--color-text); }
.queue-eta.done { color: var(--color-success); font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; }

.stepper { display: flex; align-items: flex-start; margin-bottom: 22px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 10.5px; color: var(--color-text-muted); font-weight: 700; width: 60px; text-align: center; }
.step-dot {
  width: 26px; height: 26px; border-radius: 50%; background: #e6e9ef; color: #9aa2b1;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800;
}
.step.active .step-dot { background: var(--color-accent); color: #fff; }
.step.active { color: var(--color-accent); }
.step.done .step-dot { background: var(--color-success); color: #fff; }
.step.done { color: var(--color-success); }
.step-line { flex: 1; height: 2px; background: var(--color-border); margin-top: 13px; }

.detail-list { display: flex; flex-direction: column; gap: 10px; }
.detail-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.detail-row span:last-child { font-weight: 700; text-align: right; }

.confirm-state { padding-top: 24px; }
.confirm-icon { color: var(--color-success); }
.confirm-state h3 { font-size: 18px; margin-top: 4px; }
.confirm-num { font-size: 44px; margin: 6px 0; }

/* --------------------------------- Katalog --------------------------------- */

.item-card summary { list-style: none; cursor: pointer; }
.item-card summary::-webkit-details-marker { display: none; }
.item-summary-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.item-summary-row h4 { font-size: 14px; margin-bottom: 4px; }
.tag {
  font-size: 10.5px; font-weight: 700; background: #eef1f7; color: var(--color-text-muted);
  padding: 3px 8px; border-radius: 999px;
}
.item-body { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--color-border); font-size: 13px; color: var(--color-text-muted); display: flex; flex-direction: column; gap: 6px; }
.stok-ada { color: var(--color-success); font-weight: 700; }
.stok-habis { color: var(--color-danger); font-weight: 700; }

/* --------------------------------- Riwayat --------------------------------- */

.history-card h4 { font-size: 14px; }
.history-foot { margin-top: 8px; }

/* --------------------------------- Profil --------------------------------- */

.profil-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.profil-head h3 { font-size: 16px; }

.vehicle-card { display: flex; align-items: center; gap: 12px; }
.vehicle-card h4 { font-size: 14px; }

.add-vehicle summary { list-style: none; cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--color-accent); display: flex; align-items: center; gap: 8px; }
.add-vehicle summary::-webkit-details-marker { display: none; }
.add-vehicle form { margin-top: 14px; }

.menu-list { display: flex; flex-direction: column; padding: 4px 14px; }
.menu-item {
  display: flex; align-items: center; gap: 12px; background: none; border: none;
  padding: 13px 0; border-bottom: 1px solid var(--color-border); width: 100%; text-align: left; font-size: 13.5px; font-weight: 600;
}
.menu-item:last-child { border-bottom: none; }
.menu-item span:first-of-type { flex: 1; }
.menu-item.danger { color: var(--color-danger); }
