/* ═══════════════════════════════════════════════════════
   Mandiri Laundry — App CSS
   Mobile-first, no framework
═══════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Brand */
  --blue:       #1a6fc4;
  --blue-dark:  #0e4a8a;
  --blue-lt:    #e8f1fb;
  --blue-mid:   #bfdbfe;
  --green:      #1a8a4a;
  --green-lt:   #e6f5ed;
  --amber:      #b45309;
  --amber-lt:   #fef3c7;
  --red:        #c0392b;
  --red-lt:     #fdecea;
  --gray:       #6b7280;
  --gray-lt:    #f3f4f6;

  /* Text */
  --text:       #111827;
  --text2:      #6b7280;
  --text3:      #9ca3af;

  /* Surface */
  --border:     #e5e7eb;
  --surface:    #ffffff;
  --bg:         #f0f4f8;

  --radius:     10px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
}

/* ── TOPBAR ── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 8px rgba(14,74,138,.3);
}
.topbar-brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 15px; color: white;
  white-space: nowrap; overflow: hidden;
}
.topbar-brand span:first-child { font-size: 20px; flex-shrink: 0; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.topbar-user { text-align: right; }
.topbar-user .name { font-size: 12px; font-weight: 600; color: white; white-space: nowrap; }
.topbar-user .role { font-size: 10px; color: rgba(255,255,255,.7); }
.topbar .btn-outline {
  border-color: rgba(255,255,255,.5); color: white; background: rgba(255,255,255,.15);
  font-size: 12px; padding: 4px 10px; white-space: nowrap;
}
.topbar .btn-outline:hover { background: rgba(255,255,255,.25); }

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: white;
  border-top: 1px solid var(--border);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -2px 10px rgba(0,0,0,.08);
}
.bottom-nav a {
  flex: 1; text-decoration: none; color: var(--text3);
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 9px 4px 11px; font-size: 10px; font-weight: 500;
  transition: color .15s;
}
.bottom-nav a .nav-icon { font-size: 19px; line-height: 1; }
.bottom-nav a.active { color: var(--blue); }

/* ── MAIN ── */
.main { padding: 14px; padding-bottom: 80px; max-width: 480px; margin: 0 auto; }

/* ── CARD ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.card-sm { padding: 12px 14px; }

/* ── STATS ── */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.stat-card {
  background: white; border-radius: 14px; padding: 14px 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06); border: 1px solid var(--border);
}
.stat-label { font-size: 11px; color: var(--text2); margin-bottom: 4px; font-weight: 500; }
.stat-value { font-size: 24px; font-weight: 700; }
.stat-value.blue  { color: var(--blue); }
.stat-value.amber { color: var(--amber); }
.stat-value.green { color: var(--green); }
.stat-value.sm    { font-size: 16px; }

/* ── BADGE ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.badge-amber { background: var(--amber-lt); color: var(--amber); }
.badge-blue  { background: var(--blue-lt);  color: var(--blue); }
.badge-green { background: var(--green-lt); color: var(--green); }
.badge-gray  { background: var(--gray-lt);  color: var(--gray); }

/* ── ORDER CARD ── */
.order-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px; margin-bottom: 8px;
  display: block; text-decoration: none; color: inherit;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  transition: box-shadow .15s, border-color .15s;
}
.order-card:hover { border-color: var(--blue-mid); box-shadow: 0 2px 8px rgba(26,111,196,.1); }
.order-card-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.order-kode  { font-weight: 700; font-size: 14px; }
.order-nama  { font-size: 13px; color: var(--text2); margin-top: 1px; }
.order-foot  { display: flex; justify-content: space-between; font-size: 13px; color: var(--text2); border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }
.order-total { color: var(--blue); font-weight: 700; }

/* ── ACCORDION KATEGORI ── */
.akordeon { margin-bottom: 8px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: white; }
.akordeon-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; cursor: pointer;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: white; user-select: none;
}
.akordeon-header h3 { font-size: 13px; font-weight: 700; letter-spacing: .3px; }
.akordeon-arrow { font-size: 12px; transition: transform .2s; }
.akordeon-header.open .akordeon-arrow { transform: rotate(180deg); }
.akordeon-body { display: none; padding: 10px; }
.akordeon-body.open { display: block; }

/* ── PAKET ITEM (dalam accordion) ── */
.paket-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px; border: 1.5px solid var(--border);
  border-radius: 10px; margin-bottom: 6px; cursor: pointer;
  transition: border-color .15s, background .15s;
  background: #fafbfc;
}
.paket-item:last-child { margin-bottom: 0; }
.paket-item.selected { border-color: var(--blue); background: var(--blue-lt); }
.paket-check {
  width: 22px; height: 22px; border-radius: 6px;
  border: 2px solid var(--border); background: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0; margin-top: 1px;
  transition: all .15s;
}
.paket-item.selected .paket-check { border-color: var(--blue); background: var(--blue); color: white; }
.paket-info { flex: 1; min-width: 0; }
.paket-nama { font-weight: 600; font-size: 13px; line-height: 1.3; }
.paket-ket  { font-size: 11px; color: var(--text2); margin-top: 2px; }
.paket-right { text-align: right; flex-shrink: 0; }
.paket-harga { font-weight: 700; color: var(--blue); font-size: 13px; }
.paket-est   { font-size: 11px; color: var(--text2); margin-top: 1px; }

/* ── QTY ROW ── */
.qty-row {
  display: none; align-items: center; gap: 6px;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed var(--blue-mid);
  flex-wrap: nowrap;
}
.paket-item.selected .qty-row { display: flex; }
.qty-btn {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--blue); background: white; color: var(--blue);
  font-size: 16px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; line-height: 1; padding: 0;
}
.qty-input {
  width: 52px; text-align: center;
  border: 1.5px solid var(--blue); border-radius: 8px;
  padding: 4px 4px; font-size: 13px; font-weight: 600;
  flex-shrink: 0;
}
.qty-sat  { font-size: 11px; color: var(--text2); flex-shrink: 0; }
.qty-sub  { font-size: 12px; font-weight: 700; color: var(--blue); margin-left: auto; flex-shrink: 0; }

/* ── TOTAL BAR ── */
.total-bar {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  border-radius: 12px; padding: 12px 14px; margin: 12px 0;
  display: none;
}
.total-bar.show { display: flex; justify-content: space-between; align-items: center; }
.total-bar-label { font-size: 13px; color: rgba(255,255,255,.8); }
.total-bar-val   { font-size: 18px; font-weight: 700; color: white; }

/* ── STICKY FOOTER ── */
.sticky-order {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  background: white; border-top: 1px solid var(--border);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0));
  display: none; align-items: center; justify-content: space-between; gap: 12px;
  box-shadow: 0 -4px 16px rgba(0,0,0,.1);
}
.sticky-order.show { display: flex; }

/* ── FORMS ── */
.form-group { margin-bottom: 14px; }
.form-label { font-size: 13px; color: var(--text2); display: block; margin-bottom: 5px; font-weight: 500; }
.form-control {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 15px; color: var(--text); background: white;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,111,196,.12); }
.form-error { color: var(--red); font-size: 12px; margin-top: 4px; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 70px; }

/* ── BUTTONS ── */
.btn {
  display: block; width: 100%; padding: 12px;
  border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer;
  border: 1.5px solid transparent; text-align: center; text-decoration: none;
  transition: opacity .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn-primary {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: white; border-color: var(--blue-dark);
  box-shadow: 0 2px 8px rgba(26,111,196,.3);
}
.btn-primary:disabled { opacity: .45; box-shadow: none; }
.btn-success  { background: var(--green); color: white; }
.btn-outline  { background: transparent; border-color: var(--border); color: var(--text); }
.btn-wa       { background: #25D366; color: white; border-color: #1da851; }
.btn-sm       { padding: 7px 14px; font-size: 13px; width: auto; border-radius: 8px; display: inline-block; }
.btn-row      { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; }

/* ── PROGRESS ── */
.progress-list { list-style: none; }
.progress-item { display: flex; gap: 12px; align-items: flex-start; }
.progress-item:not(:last-child) .progress-line-wrap { min-height: 46px; }
.progress-line-wrap { display: flex; flex-direction: column; align-items: center; width: 28px; flex-shrink: 0; }
.progress-line-wrap::after {
  content: ''; display: block; width: 2px; flex: 1;
  background: var(--border); margin: 3px auto 0; border-radius: 2px;
}
.progress-item:last-child .progress-line-wrap::after { display: none; }
.progress-dot {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
  border: 2px solid var(--border); background: var(--bg); color: var(--text3);
}
.progress-dot.done   { background: var(--green-lt); border-color: var(--green); color: var(--green); font-weight: 700; }
.progress-dot.active { background: linear-gradient(135deg,var(--blue),var(--blue-dark)); border-color: var(--blue-dark); color: white; }
.progress-label { font-size: 13px; padding-top: 5px; color: var(--text2); }
.progress-label.done   { color: var(--text); }
.progress-label.active { color: var(--blue); font-weight: 600; }
.progress-time { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* ── DETAIL TABLE ── */
.detail-table { width: 100%; border-collapse: collapse; }
.detail-table td { padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: top; }
.detail-table td:first-child { color: var(--text2); width: 44%; }
.detail-table td:last-child  { font-weight: 500; text-align: right; }
.detail-table .highlight     { color: var(--blue); }

/* ── NOTA ── */
.nota-wrap { background: white; border: 1px solid var(--border); border-radius: 14px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.nota-header { text-align: center; margin-bottom: 14px; }
.nota-header .icon { font-size: 32px; }
.nota-header h2 { font-size: 17px; font-weight: 700; margin-top: 4px; }
.nota-header .sub { font-size: 12px; color: var(--text2); }
.nota-kode { display: inline-block; background: var(--blue-lt); color: var(--blue); font-weight: 700; font-size: 14px; padding: 5px 16px; border-radius: 20px; margin: 8px 0; }
.nota-divider { border: none; border-top: 1px dashed var(--border); margin: 12px 0; }
.nota-footer { font-size: 12px; color: var(--text3); text-align: center; margin-top: 12px; }

/* ── ALERT ── */
.alert { padding: 11px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 12px; }
.alert-success { background: var(--green-lt); color: var(--green); border: 1px solid #bbf7d0; }
.alert-error   { background: var(--red-lt);   color: var(--red);   border: 1px solid #fecaca; }

/* ── MISC ── */
.section-title { font-size: 17px; font-weight: 700; margin-bottom: 14px; color: var(--text); }
.empty { text-align: center; padding: 40px 20px; color: var(--text2); }
.empty .icon { font-size: 40px; margin-bottom: 10px; }
.empty p { font-size: 14px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--blue); font-size: 14px; text-decoration: none; margin-bottom: 12px; font-weight: 500; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.text-blue  { color: var(--blue); }
.text-green { color: var(--green); }
.text-muted { color: var(--text2); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-12 { margin-top: 12px; }
.mb-0  { margin-bottom: 0; }

/* ── LOGIN ── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(160deg, var(--blue-dark) 0%, var(--blue) 50%, #2980b9 100%); }
.login-box { width: 100%; max-width: 360px; }
.login-header { text-align: center; margin-bottom: 24px; }
.login-header .logo { font-size: 52px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.2)); }
.login-header h1 { font-size: 22px; font-weight: 700; color: white; margin-top: 10px; }
.login-header p  { color: rgba(255,255,255,.75); font-size: 14px; margin-top: 4px; }
.login-card { background: white; border-radius: 20px; padding: 24px; box-shadow: 0 8px 32px rgba(0,0,0,.2); }
.login-hint { background: var(--gray-lt); border-radius: 8px; padding: 10px 12px; margin-top: 14px; font-size: 12px; color: var(--text2); }
.login-hint div { margin-bottom: 3px; }

/* ── PUBLIC NAV ── */
.nav-pub { display: flex; gap: 8px; justify-content: center; padding: 10px 14px; background: white; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.nav-pub a { font-size: 13px; font-weight: 600; color: var(--blue); text-decoration: none; padding: 5px 14px; border-radius: 20px; border: 1.5px solid var(--blue); transition: all .15s; }
.nav-pub a.active { background: linear-gradient(135deg,var(--blue),var(--blue-dark)); color: white; border-color: var(--blue-dark); }

/* ── PRINT ── */
@media print {
  .topbar, .bottom-nav, .sticky-order, .no-print { display: none !important; }
  .main { padding: 0; }
  body { background: white; }
}
