/* merchant.css — Design system Ridee Merchant Panel */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --yellow:       #F9D515;
  --yellow-dark:  #E8C400;
  --yellow-light: #FFF9CC;
  --black:        #1A1A1A;
  --dark:         #2D2D2D;
  --gray-700:     #4A4A4A;
  --gray-500:     #6B6B6B;
  --gray-400:     #9E9E9E;
  --gray-200:     #E8E8E8;
  --gray-100:     #F5F5F5;
  --white:        #FFFFFF;
  --green:        #00B894;
  --green-light:  #E8FBF5;
  --red:          #E53935;
  --red-light:    #FFEBEE;
  --orange:       #FF6B00;
  --orange-light: #FFF3E0;
  --blue:         #2196F3;
  --blue-light:   #E3F2FD;

  --radius-xl:  20px;
  --radius-lg:  16px;
  --radius-md:  12px;
  --radius-sm:  8px;
  --radius-xs:  6px;

  --shadow-sm:  0 1px 4px rgba(0,0,0,.06);
  --shadow-md:  0 2px 12px rgba(0,0,0,.08);
  --shadow-lg:  0 4px 24px rgba(0,0,0,.12);
  --shadow-xl:  0 8px 32px rgba(0,0,0,.16);

  --header-h:   60px;
  --bottomnav-h:68px;
  --max-w:      500px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--gray-100);
  color: var(--black);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout shell ── */
.app-shell {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  min-height: 100vh;
  background: var(--gray-100);
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--yellow);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(249,213,21,.3);
}
.app-header .logo {
  font-weight: 800;
  font-size: 20px;
  color: var(--black);
  letter-spacing: -.5px;
}
.app-header .logo span { color: #FF6B00; }
.app-header .header-title {
  flex: 1;
  font-weight: 600;
  font-size: 16px;
  color: var(--black);
  text-align: center;
}
.app-header .btn-icon {
  width: 40px; height: 40px;
  border: none;
  background: rgba(0,0,0,.08);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--black);
  font-size: 18px;
  transition: background .15s;
  text-decoration: none;
}
.app-header .btn-icon:hover { background: rgba(0,0,0,.15); }

/* ── Main content ── */
.app-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(var(--bottomnav-h) + 16px);
}
.app-content.no-bottom { padding-bottom: 16px; }

/* ── Bottom nav ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  height: var(--bottomnav-h);
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  display: flex;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,.06);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  color: var(--gray-400);
  font-size: 11px;
  font-weight: 500;
  transition: color .15s;
  padding: 8px 0;
  position: relative;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--black); }
.nav-item.active::after {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 32px; height: 3px;
  background: var(--yellow);
  border-radius: 0 0 3px 3px;
}
.nav-item.active svg { stroke-width: 2.5; }

/* ── Cards ── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 12px; }
.card-tight { padding: 12px 16px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.card-title {
  font-weight: 600; font-size: 15px; color: var(--black);
}

/* ── Sections ── */
.section { padding: 16px 16px 0; }
.section-title {
  font-weight: 700; font-size: 13px; color: var(--gray-500);
  text-transform: uppercase; letter-spacing: .6px;
  margin-bottom: 12px;
}

/* ── Balance card ── */
.balance-card {
  background: var(--black);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin: 16px;
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.balance-card::before {
  content: '';
  position: absolute;
  right: -20px; top: -20px;
  width: 120px; height: 120px;
  background: rgba(249,213,21,.15);
  border-radius: 50%;
}
.balance-card::after {
  content: '';
  position: absolute;
  right: 20px; top: 30px;
  width: 60px; height: 60px;
  background: rgba(249,213,21,.1);
  border-radius: 50%;
}
.balance-label {
  font-size: 12px; color: rgba(255,255,255,.6);
  margin-bottom: 4px;
}
.balance-amount {
  font-size: 28px; font-weight: 800;
  color: var(--yellow);
  letter-spacing: -.5px;
}
.balance-meta {
  margin-top: 12px;
  display: flex; gap: 16px;
}
.balance-meta-item {
  display: flex; flex-direction: column; gap: 2px;
}
.balance-meta-label { font-size: 11px; color: rgba(255,255,255,.5); }
.balance-meta-value { font-size: 14px; font-weight: 600; color: var(--white); }

/* ── Stats row ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 16px 16px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-value {
  font-size: 20px; font-weight: 800; color: var(--black);
  line-height: 1;
}
.stat-label {
  font-size: 11px; color: var(--gray-400);
  margin-top: 4px;
}

/* ── Order item ── */
.order-item {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
}
.order-item + .order-item { margin-top: 8px; }
.order-item:active { background: var(--gray-100); }
.order-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: var(--yellow-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.order-info { flex: 1; min-width: 0; }
.order-recipient {
  font-weight: 600; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.order-address {
  font-size: 12px; color: var(--gray-500);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.order-meta {
  display: flex; gap: 8px; align-items: center;
  margin-top: 6px;
}
.order-time { font-size: 11px; color: var(--gray-400); }
.order-price {
  font-weight: 700; font-size: 14px; color: var(--black);
  text-align: right;
  flex-shrink: 0;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}

/* ── Status badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border-radius: 100px;
  font-size: 11px; font-weight: 600;
}
.s-pending   { background: var(--orange-light); color: var(--orange); }
.s-accepted  { background: var(--blue-light);   color: var(--blue); }
.s-collecting{ background: var(--blue-light);   color: var(--blue); }
.s-transit   { background: #EDE7F6; color: #7B1FA2; }
.s-delivered { background: var(--green-light);  color: var(--green); }
.s-cancelled { background: var(--red-light);    color: var(--red); }
.s-unknown   { background: var(--gray-100);     color: var(--gray-500); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  border: none;
  font-family: inherit;
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--yellow);
  color: var(--black);
}
.btn-primary:hover { background: var(--yellow-dark); }
.btn-primary:active { transform: scale(.97); }

.btn-dark {
  background: var(--black);
  color: var(--white);
}
.btn-dark:hover { background: var(--dark); }

.btn-outline {
  background: transparent;
  color: var(--black);
  border: 1.5px solid var(--gray-200);
}
.btn-outline:hover { background: var(--gray-100); }

.btn-danger { background: var(--red-light); color: var(--red); }
.btn-success { background: var(--green-light); color: var(--green); }

.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-full { width: 100%; }
.btn-icon-only {
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--gray-100);
  border: none;
  cursor: pointer;
  color: var(--black);
  transition: background .15s;
}
.btn-icon-only:hover { background: var(--gray-200); }

/* ── FAB ── */
.fab {
  position: fixed;
  bottom: calc(var(--bottomnav-h) + 16px);
  right: 50%;
  transform: translateX(50%);
  max-width: var(--max-w);
  width: calc(100% - 32px);
  max-width: 468px;
  background: var(--yellow);
  color: var(--black);
  border: none;
  border-radius: var(--radius-lg);
  height: 52px;
  font-size: 15px; font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(249,213,21,.5);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  text-decoration: none;
  transition: all .15s;
  z-index: 90;
}
.fab:hover { background: var(--yellow-dark); box-shadow: 0 6px 20px rgba(249,213,21,.6); }
.fab:active { transform: translateX(50%) scale(.97); }

/* ── Login page ── */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--white);
  max-width: var(--max-w);
  margin: 0 auto;
}
.login-logo {
  font-size: 36px; font-weight: 800; color: var(--black);
  margin-bottom: 8px;
  letter-spacing: -1px;
}
.login-logo span { color: var(--orange); }
.login-subtitle {
  font-size: 15px; color: var(--gray-500);
  margin-bottom: 40px;
  text-align: center;
}
.login-form { width: 100%; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px; font-weight: 600; color: var(--gray-700);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  color: var(--black);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-input:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(249,213,21,.2);
}
.form-input::placeholder { color: var(--gray-400); }
.form-input.error { border-color: var(--red); }

.form-select {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  color: var(--black);
  background: var(--white);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B6B6B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.form-select:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(249,213,21,.2);
}

.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  color: var(--black);
  background: var(--white);
  resize: vertical;
  min-height: 80px;
  outline: none;
  transition: border-color .15s;
}
.form-textarea:focus { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(249,213,21,.2); }

.form-hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--red); margin-top: 4px; }

/* ── Alert ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-error   { background: var(--red-light);    color: var(--red); }
.alert-success { background: var(--green-light);  color: var(--green); }
.alert-warning { background: var(--orange-light); color: var(--orange); }
.alert-info    { background: var(--blue-light);   color: var(--blue); }

/* ── Divider ── */
.divider {
  height: 1px; background: var(--gray-200);
  margin: 16px 0;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-400);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.empty-state p  { font-size: 14px; }

/* ── Timeline ── */
.timeline { padding: 0 16px; }
.timeline-item {
  display: flex; gap: 12px;
  padding-bottom: 20px;
  position: relative;
}
.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 15px; top: 30px;
  width: 2px;
  height: calc(100% - 10px);
  background: var(--gray-200);
}
.timeline-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--yellow-light);
  border: 2px solid var(--yellow);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.timeline-dot.done { background: var(--green-light); border-color: var(--green); }
.timeline-content { flex: 1; }
.timeline-label { font-weight: 600; font-size: 14px; color: var(--black); }
.timeline-time  { font-size: 12px; color: var(--gray-400); margin-top: 2px; }

/* ── Detail rows ── */
.detail-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
}
.detail-row:last-child { border-bottom: none; }
.detail-key { font-size: 13px; color: var(--gray-500); }
.detail-val { font-size: 14px; font-weight: 600; color: var(--black); text-align: right; }

/* ── Tab bar ── */
.tab-bar {
  display: flex;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-item {
  flex: 1;
  min-width: fit-content;
  padding: 12px 16px;
  text-align: center;
  font-size: 13px; font-weight: 500;
  color: var(--gray-400);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  text-decoration: none;
}
.tab-item.active {
  color: var(--black);
  border-bottom-color: var(--yellow);
  font-weight: 700;
}

/* ── Topup modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  display: flex; align-items: flex-end;
  justify-content: center;
}
.modal-overlay.hidden { display: none; }
.modal-sheet {
  background: var(--white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 8px 20px 32px;
  width: 100%;
  max-width: var(--max-w);
  animation: slideUp .25s ease-out;
}
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.modal-handle {
  width: 40px; height: 4px;
  background: var(--gray-200);
  border-radius: 100px;
  margin: 8px auto 20px;
}
.modal-title { font-weight: 700; font-size: 18px; margin-bottom: 20px; }

/* ── Chips / filter tags ── */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 0 16px 12px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 13px; font-weight: 500;
  border: 1.5px solid var(--gray-200);
  color: var(--gray-500);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: all .15s;
  background: var(--white);
}
.chip.active {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--black);
  font-weight: 700;
}

/* ── Loading ── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-row {
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
  gap: 12px;
  color: var(--gray-400);
  font-size: 14px;
}

/* ── Tracking page ── */
.tracking-header {
  background: var(--yellow);
  padding: 20px 16px;
  text-align: center;
}
.tracking-logo {
  font-size: 22px; font-weight: 800; letter-spacing: -.5px;
}
.tracking-logo span { color: var(--orange); }
.tracking-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  margin: 16px;
  padding: 20px;
  box-shadow: var(--shadow-md);
}

/* ── Responsive ── */
@media (min-width: 520px) {
  .app-shell {
    border-left: 1px solid var(--gray-200);
    border-right: 1px solid var(--gray-200);
  }
  .bottom-nav { border-radius: 0; }
}
