/* ============================================================
   3TRANX LOGISTIQUE — Styles globaux
   Mobile-first | Brand: Orange #f97316, Navy #0f172a
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600&display=swap');

/* ============================================================ RESET & BASE */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand: #f97316;
  --brand-dark: #ea580c;
  --brand-light: rgba(249,115,22,.10);
  --navy: #0f172a;
  --navy2: #1e293b;
  --navy3: #334155;
  --text: #0f172a;
  --text2: #475569;
  --text3: #94a3b8;
  --bg: #f8fafc;
  --bg2: #f1f5f9;
  --bg3: #ffffff;
  --border: rgba(15,23,42,.08);
  --border2: rgba(15,23,42,.14);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.06);
  --shadow-md: 0 4px 12px rgba(15,23,42,.10);
  --font: 'Plus Jakarta Sans', sans-serif;
  --font2: 'Space Grotesk', sans-serif;
  --wa: #25D366;
  --alipay: #1677FF;
  --wechat: #07C160;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================ TOPBAR */
.topbar {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.topbar-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--brand);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font2);
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}
.logo-text {
  font-family: var(--font2);
  font-weight: 600;
  font-size: 15px;
  color: #fff;
  line-height: 1.2;
}
.logo-text span { display: block; font-size: 10px; font-weight: 400; color: rgba(255,255,255,.5); }
.btn-track {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.btn-track:hover { background: var(--brand-dark); text-decoration: none; }

/* ============================================================ HERO BANNER */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy2) 100%);
  padding: 20px 16px 24px;
  text-align: center;
}
.hero h1 {
  font-family: var(--font2);
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
}
.hero p {
  font-size: 13px;
  color: rgba(255,255,255,.55);
  line-height: 1.5;
}

/* ============================================================ PAGE WRAPPER */
.page-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 12px 48px;
}

/* ============================================================ SECTION LABEL */
.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text3);
  margin: 20px 0 10px;
  padding-left: 2px;
}

/* ============================================================ CARDS */
.card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.card-title .icon { font-size: 16px; }

/* ============================================================ SERVICE SELECTOR */
.service-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}
.service-btn {
  background: var(--bg3);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  position: relative;
}
.service-btn:hover { border-color: var(--brand); }
.service-btn.active {
  border-color: var(--brand);
  background: var(--brand-light);
}
.service-btn .s-icon { font-size: 24px; margin-bottom: 6px; }
.service-btn .s-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  line-height: 1.3;
}
.service-btn .s-desc { font-size: 10px; color: var(--text2); line-height: 1.4; }
.service-btn .s-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 16px;
  height: 16px;
  background: var(--brand);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 9px;
}
.service-btn.active .s-check { display: flex; }

/* ============================================================ FORMS */
.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 5px;
}
.field label .req { color: var(--brand); margin-left: 2px; }
.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 14px;
  padding: 10px 12px;
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  transition: border-color .2s;
  -webkit-appearance: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
}
.field textarea { height: 80px; resize: vertical; }
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

.wa-input-wrap {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
  transition: border-color .2s;
}
.wa-input-wrap:focus-within { border-color: var(--brand); background: #fff; }
.wa-prefix {
  background: var(--wa);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.wa-input-wrap input {
  border: none;
  border-radius: 0;
  background: transparent;
  flex: 1;
  font-size: 14px;
  padding: 10px 12px;
}
.wa-input-wrap input:focus { outline: none; border: none; }

/* Tracking numbers dynamique */
.tracking-list { display: flex; flex-direction: column; gap: 8px; }
.tracking-row { display: flex; gap: 8px; align-items: center; }
.tracking-row input { flex: 1; }
.btn-remove-tracking {
  width: 32px;
  height: 32px;
  background: #fee2e2;
  border: none;
  border-radius: 6px;
  color: #dc2626;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.btn-add-tracking {
  font-size: 12px;
  font-weight: 500;
  color: var(--brand);
  background: var(--brand-light);
  border: 1.5px dashed var(--brand);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  cursor: pointer;
  width: 100%;
  margin-top: 6px;
}

/* ============================================================ PAIEMENT GRID */
.payment-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.pay-opt {
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
}
.pay-opt .p-icon { font-size: 16px; margin-bottom: 3px; }
.pay-opt .p-name { font-size: 10px; font-weight: 500; color: var(--text2); line-height: 1.2; }
.pay-opt:hover { border-color: var(--brand); }
.pay-opt.selected { border-color: var(--brand); background: var(--brand-light); }
.pay-opt.selected .p-name { color: var(--brand-dark); }
.pay-opt[data-pay="Alipay"] { }
.pay-opt[data-pay="Alipay"].selected { border-color: var(--alipay); background: rgba(22,119,255,.07); }
.pay-opt[data-pay="Alipay"].selected .p-name { color: var(--alipay); }
.pay-opt[data-pay="WeChat Pay"].selected { border-color: var(--wechat); background: rgba(7,193,96,.07); }
.pay-opt[data-pay="WeChat Pay"].selected .p-name { color: var(--wechat); }

/* ============================================================ UPLOAD */
.upload-zone {
  border: 1.5px dashed var(--border2);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color .2s;
  background: var(--bg);
}
.upload-zone:hover { border-color: var(--brand); }
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-zone .u-icon { font-size: 28px; margin-bottom: 6px; }
.upload-zone .u-text { font-size: 12px; color: var(--text2); line-height: 1.4; }
.upload-zone .u-text strong { color: var(--brand); }
.upload-previews {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.preview-item img { width: 100%; height: 100%; object-fit: cover; }
.preview-item .rm-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  background: rgba(0,0,0,.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================ WAREHOUSES */
.warehouse-list { display: flex; flex-direction: column; gap: 1px; }
.warehouse-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.warehouse-item:last-child { border-bottom: none; padding-bottom: 0; }
.wh-badge {
  width: 32px;
  height: 32px;
  background: var(--brand-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font2);
  font-weight: 700;
  font-size: 13px;
  color: var(--brand-dark);
  flex-shrink: 0;
  margin-top: 2px;
}
.wh-info { flex: 1; min-width: 0; }
.wh-city { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.wh-addr { font-size: 11px; color: var(--text2); line-height: 1.5; word-break: break-all; }
.btn-copy {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
  padding: 6px 12px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  color: var(--text2);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn-copy:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-copy.copied { background: #16a34a; color: #fff; border-color: #16a34a; }

/* ============================================================ STATUS BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.status-wait      { background: #fef3c7; color: #92400e; }
.status-received  { background: #d1fae5; color: #065f46; }
.status-consol    { background: #dbeafe; color: #1e40af; }
.status-delivery  { background: #ede9fe; color: #5b21b6; }
.status-transit   { background: #e0f2fe; color: #0369a1; }
.status-done      { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* ============================================================ STATUS TIMELINE */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--bg2);
}
.timeline-step {
  position: relative;
  padding: 0 0 16px 16px;
}
.timeline-step:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -28px;
  top: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg2);
  border: 2px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  z-index: 1;
}
.timeline-step.done .timeline-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.timeline-step.current .timeline-dot { background: var(--navy); border-color: var(--navy); color: #fff; }
.timeline-label { font-size: 13px; font-weight: 500; color: var(--text); }
.timeline-step.done .timeline-label { color: var(--brand-dark); }
.timeline-step:not(.done):not(.current) .timeline-label { color: var(--text3); }
.timeline-date { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* ============================================================ SUBMIT BUTTON */
.btn-submit {
  width: 100%;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  padding: 14px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .2s, transform .1s;
  margin-top: 4px;
}
.btn-submit:hover { background: var(--brand-dark); }
.btn-submit:active { transform: scale(0.98); }
.btn-submit:disabled { background: var(--text3); cursor: not-allowed; }

/* ============================================================ HISTORY ITEMS */
.history-list { display: flex; flex-direction: column; gap: 1px; }
.history-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.history-item:last-child { border-bottom: none; }
.history-item:hover { background: var(--bg2); margin: 0 -16px; padding: 11px 16px; border-radius: 8px; }
.h-ref { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 2px; font-family: var(--font2); }
.h-meta { font-size: 11px; color: var(--text3); }
.history-item .arrow { font-size: 14px; color: var(--text3); flex-shrink: 0; margin-top: 2px; }

/* ============================================================ NOTIFICATIONS */
.notif-list { display: flex; flex-direction: column; }
.notif-item {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.notif-item:last-child { border-bottom: none; }
.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
  margin-top: 5px;
}
.notif-dot.read { background: var(--border2); }
.notif-text { font-size: 13px; color: var(--text); line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text3); margin-top: 3px; }

/* ============================================================ TABS */
.tabs-nav {
  display: flex;
  gap: 4px;
  background: var(--bg2);
  padding: 4px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.tab-btn {
  flex: 1;
  padding: 8px 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.tab-btn.active {
  background: var(--bg3);
  color: var(--text);
  box-shadow: var(--shadow);
}

/* ============================================================ TOOLS GRID */
.tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tool-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: border-color .2s, box-shadow .2s;
  display: block;
}
.tool-card:hover { border-color: var(--brand); box-shadow: var(--shadow-md); text-decoration: none; }
.tool-card .t-icon { font-size: 24px; margin-bottom: 8px; }
.tool-card .t-title { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.tool-card .t-desc { font-size: 11px; color: var(--text2); line-height: 1.4; }

/* ============================================================ CALCULATOR MODAL */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.6);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.modal-overlay.open { display: flex; }
.modal-sheet {
  background: var(--bg3);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 0 16px 32px;
  animation: slideUp .25s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--border2);
  border-radius: 2px;
  margin: 12px auto 16px;
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}
.calc-result {
  background: var(--brand-light);
  border: 1.5px solid var(--brand);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 14px;
}
.calc-result .r-label { font-size: 12px; color: var(--text2); margin-bottom: 4px; }
.calc-result .r-value { font-size: 24px; font-weight: 700; color: var(--brand-dark); font-family: var(--font2); }
.calc-result .r-sub { font-size: 12px; color: var(--text3); margin-top: 4px; }
.calc-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  gap: 0;
}
.calc-tab {
  flex: 1;
  padding: 10px 0;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .15s;
}
.calc-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.calc-section { display: none; }
.calc-section.active { display: block; }

/* ============================================================ SUCCESS SCREEN */
.success-screen {
  text-align: center;
  padding: 32px 16px;
}
.success-icon {
  width: 72px;
  height: 72px;
  background: #dcfce7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 16px;
}
.success-screen h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.ref-display {
  background: var(--navy);
  color: #fff;
  font-family: var(--font2);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: var(--radius);
  margin: 16px 0;
  letter-spacing: .5px;
  word-break: break-all;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ref-display button {
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
}

/* ============================================================ ALERT / INFO */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 12px;
}
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ============================================================ MESSAGE BOX */
.message-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.msg-bubble {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
}
.msg-bubble.admin {
  background: var(--bg2);
  color: var(--text);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.msg-bubble.client {
  background: var(--brand);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.msg-time { font-size: 10px; color: var(--text3); margin-top: 3px; }
.msg-send-area {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.msg-send-area textarea {
  flex: 1;
  border: 1.5px solid var(--border2);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: var(--font);
  font-size: 13px;
  resize: none;
  height: 44px;
  color: var(--text);
  background: var(--bg);
  max-height: 100px;
}
.msg-send-area textarea:focus { outline: none; border-color: var(--brand); }
.btn-send {
  width: 40px;
  height: 40px;
  background: var(--brand);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================ ADMIN STYLES */
.admin-sidebar {
  background: var(--navy);
  min-height: 100vh;
  width: 220px;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 50;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
}
.admin-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 8px;
}
.admin-logo .icon { font-size: 22px; }
.admin-logo span { font-family: var(--font2); font-weight: 700; font-size: 16px; color: #fff; }
.admin-logo small { display: block; font-size: 10px; color: rgba(255,255,255,.4); font-weight: 400; }
.admin-nav { flex: 1; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: rgba(255,255,255,.55);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all .15s;
  border-left: 3px solid transparent;
}
.nav-link .n-icon { font-size: 16px; width: 20px; text-align: center; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.06); text-decoration: none; }
.nav-link.active { color: #fff; border-left-color: var(--brand); background: rgba(249,115,22,.12); }
.nav-badge {
  margin-left: auto;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
}
.admin-user-bar {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-avatar {
  width: 32px;
  height: 32px;
  background: var(--brand);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
}
.admin-user-name { font-size: 12px; font-weight: 600; color: #fff; }
.admin-user-role { font-size: 10px; color: rgba(255,255,255,.4); }
.admin-main {
  margin-left: 220px;
  min-height: 100vh;
  background: var(--bg);
}
.admin-topbar {
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}
.admin-topbar h1 { font-size: 16px; font-weight: 700; color: var(--text); }
.admin-content { padding: 24px; max-width: 1100px; }
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.stat-card .s-num {
  font-family: var(--font2);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-card .s-label { font-size: 12px; color: var(--text2); }
.stat-card.orange .s-num { color: var(--brand); }
.stat-card.blue .s-num { color: #3b82f6; }
.stat-card.green .s-num { color: #16a34a; }
.stat-card.gray .s-num { color: var(--text3); }

/* Admin table */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  background: var(--bg2);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.data-table tr:hover td { background: var(--bg2); }
.data-table tr:last-child td { border-bottom: none; }
.table-wrap {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* Admin action buttons */
.btn-wa {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--wa);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 10px;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .15s;
}
.btn-wa:hover { opacity: .85; text-decoration: none; color: #fff; }
.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg2);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 10px;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
}
.btn-sm:hover { background: var(--bg3); text-decoration: none; color: var(--text); }
.btn-primary {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary:hover { background: var(--brand-dark); }

/* Admin demande detail */
.demande-header {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.ref-big {
  font-family: var(--font2);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.admin-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 700px) {
  .admin-sidebar { display: none; }
  .admin-main { margin-left: 0; }
  .admin-detail-grid { grid-template-columns: 1fr; }
}
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.detail-row:last-child { border-bottom: none; }
.detail-row .dl { color: var(--text2); font-weight: 500; flex-shrink: 0; }
.detail-row .dv { color: var(--text); text-align: right; word-break: break-all; }

/* Status update panel */
.status-panel {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.status-panel select {
  width: 100%;
  font-family: var(--font);
  font-size: 14px;
  padding: 10px 12px;
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  margin-bottom: 10px;
}
.status-panel textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 13px;
  padding: 10px 12px;
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  height: 80px;
  resize: vertical;
  margin-bottom: 10px;
}
.status-panel select:focus,
.status-panel textarea:focus { outline: none; border-color: var(--brand); }

/* Client history in admin */
.client-hist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.client-hist-row:last-child { border-bottom: none; }

/* Filters */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-bar input,
.filter-bar select {
  font-family: var(--font);
  font-size: 13px;
  padding: 7px 12px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--bg3);
  color: var(--text);
}
.filter-bar input { flex: 1; min-width: 160px; }
.filter-bar input:focus,
.filter-bar select:focus { outline: none; border-color: var(--brand); }

/* ============================================================ RESPONSIVE */
@media (min-width: 540px) {
  .payment-options { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 680px) {
  .hero { padding: 28px 24px 32px; }
  .hero h1 { font-size: 22px; }
  .page-wrap { padding: 0 16px 64px; }
}

/* ============================================================ UTILITIES */
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.text-center { text-align: center; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text2); }
.font-mono { font-family: var(--font2); }
.hidden { display: none !important; }

/* Loading spinner */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transition: all .3s;
  z-index: 999;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow-md);
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
