/* D&A Mobile Mechanics — shop app styles */
:root {
  --bg: #0f172a;
  --surface: #111827;
  --surface-2: #1f2937;
  --border: #2b3648;
  --text: #f3f4f6;
  --muted: #9ca3af;
  --accent: #f59e0b;
  --accent-dark: #b45309;
  --green: #22c55e;
  --red: #ef4444;
  --blue: #38bdf8;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 960px; margin: 0 auto; padding: 16px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar .inner {
  max-width: 960px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #111827; font-size: 18px;
}
.brand-name { font-weight: 800; letter-spacing: .3px; }
.brand-sub { font-size: 12px; color: var(--muted); }
.user-chip { font-size: 13px; color: var(--muted); }

/* Tabs */
.tabs {
  display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px;
  -webkit-overflow-scrolling: touch;
}
.tab {
  appearance: none; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); padding: 10px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.tab.active { background: var(--accent); border-color: var(--accent); color: #111827; }

/* Cards & lists */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; margin: 12px 0;
}
.card h3 { margin: 0 0 8px; font-size: 17px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.meta { color: var(--muted); font-size: 13px; line-height: 1.5; }
.list-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; margin: 10px 0; cursor: pointer;
}
.list-item:hover { border-color: var(--accent); }
.list-item .title { font-weight: 700; margin-bottom: 4px; }

/* Status badges */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; text-transform: capitalize;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
}
.badge.requested { background: #0c4a6e; border-color: #38bdf8; color: #e0f2fe; }
.badge.approved { background: #134e4a; border-color: #2dd4bf; color: #ccfbf1; }
.badge.assigned { background: #4c1d95; border-color: #a78bfa; color: #ede9fe; }
.badge.in_progress { background: #78350f; border-color: var(--accent); color: #fef3c7; }
.badge.completed, .badge.paid { background: #14532d; border-color: var(--green); color: #dcfce7; }
.badge.cancelled, .badge.denied { background: #450a0a; border-color: var(--red); color: #fee2e2; }
.badge.unpaid, .badge.pending { background: #78350f; border-color: var(--accent); color: #fef3c7; }
.badge.ordered { background: #1e3a8a; border-color: #60a5fa; color: #dbeafe; }

/* Forms */
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 12px 0 4px; }
input, select, textarea {
  width: 100%; padding: 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); font-size: 15px; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 90px; resize: vertical; }
input[type="datetime-local"] { color-scheme: dark; }
input[type="file"] { padding: 8px; }

.btn {
  appearance: none; border: none; cursor: pointer;
  background: var(--accent); color: #111827; font-weight: 800;
  padding: 12px 18px; border-radius: 10px; font-size: 15px; width: 100%; margin-top: 14px;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: #7f1d1d; color: #fee2e2; }
.btn.small { width: auto; padding: 8px 14px; font-size: 13px; margin-top: 0; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.btn-row .btn { margin-top: 0; }

.linklike { background: none; border: none; color: var(--accent); font-size: 14px; cursor: pointer; padding: 0; }
.back { margin-bottom: 8px; }

/* Auth page */
.auth-box { max-width: 420px; margin: 40px auto; }
.auth-toggle { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.auth-toggle button {
  flex: 1; border: none; background: none; color: var(--muted);
  padding: 10px; border-radius: 8px; font-size: 15px; font-weight: 700; cursor: pointer;
}
.auth-toggle button.active { background: var(--accent); color: #111827; }
.notice {
  background: #78350f; border: 1px solid var(--accent); color: #fef3c7;
  border-radius: 10px; padding: 12px; font-size: 14px; margin: 12px 0;
}
.error { color: var(--red); font-size: 14px; margin-top: 10px; min-height: 20px; }

/* Timeline */
.timeline { border-left: 2px solid var(--border); margin: 12px 0 0 6px; padding-left: 16px; }
.timeline-item { margin-bottom: 14px; position: relative; }
.timeline-item::before {
  content: ""; position: absolute; left: -22px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
}
.timeline-item .who { font-size: 12px; color: var(--muted); }
.timeline-item .msg { margin: 4px 0; white-space: pre-wrap; }
.photo-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.photo-grid img {
  width: 110px; height: 110px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border); cursor: pointer;
}

/* Progress tracker */
.steps { display: flex; margin: 14px 0 4px; }
.step { flex: 1; text-align: center; position: relative; font-size: 11px; color: var(--muted); }
.step .dot {
  width: 22px; height: 22px; border-radius: 50%; margin: 0 auto 4px;
  background: var(--surface-2); border: 2px solid var(--border);
}
.step.done .dot { background: var(--accent); border-color: var(--accent); }
.step.done { color: var(--text); }
.step::before {
  content: ""; position: absolute; top: 11px; left: -50%; width: 100%;
  border-top: 2px solid var(--border); z-index: -1;
}
.step:first-child::before { display: none; }
.step.done::before { border-color: var(--accent); }

/* Totals strip */
.totals { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.total-box {
  flex: 1; min-width: 130px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px; text-align: center;
}
.total-box .n { font-size: 20px; font-weight: 800; color: var(--accent); }
.total-box .l { font-size: 12px; color: var(--muted); }

/* Toast */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(80px);
  background: var(--surface-2); border: 1px solid var(--accent); color: var(--text);
  padding: 12px 20px; border-radius: 12px; font-size: 14px; font-weight: 600;
  transition: transform .25s ease; z-index: 100; max-width: 90vw; text-align: center;
}
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.err { border-color: var(--red); }

.empty { color: var(--muted); text-align: center; padding: 28px 12px; font-size: 14px; }
.section-title { margin: 22px 0 4px; font-size: 18px; font-weight: 800; }
.hidden { display: none !important; }
.loading { text-align: center; color: var(--muted); padding: 40px 0; }
hr.sep { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
