:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --line: #e8ecf2;
  --brand: #0f5132;
  --brand-ink: #0a3b24;
  --brand-soft: #e9f6ef;
  --accent: #f5b400;
  --accent-ink: #1a1503;
  --danger: #b42318;
  --danger-soft: #fee4e2;
  --ok: #157f3d;
  --ok-soft: #dcfce7;
  --warn-soft: #fef0c7;
  --warn-ink: #93540a;
  --info-soft: #e0eaff;
  --info-ink: #2148c0;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 4px 16px -4px rgba(16, 24, 40, .1), 0 2px 6px -2px rgba(16, 24, 40, .06);
  --shadow-lg: 0 16px 40px -12px rgba(16, 24, 40, .18);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; padding: 10px 13px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; width: 100%; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 81, 50, .12); }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 12px 0 5px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 18px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; transition: background .15s, border-color .15s, transform .1s, box-shadow .15s; }
.btn:hover { background: #f2f4f8; text-decoration: none; border-color: #d5dbe5; }
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 8px -2px rgba(15, 81, 50, .45); }
.btn-primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }


.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card h2, .card h3 { margin-top: 0; letter-spacing: -.01em; }
h1, h2 { letter-spacing: -.02em; }


.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: #eef2f7; color: #475569; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn-ink); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info-ink); }

.alert { padding: 11px 14px; border-radius: 8px; margin: 10px 0; font-size: 14px; }
.alert.error { background: var(--danger-soft); color: var(--danger); border: 1px solid #fecaca; }
.alert.warn { background: var(--warn-soft); color: var(--warn-ink); border: 1px solid #fde68a; }
.alert.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #bbf7d0; }
.alert.info { background: var(--info-soft); color: var(--info-ink); border: 1px solid #bfdbfe; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 9px 10px; border-bottom: 2px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:hover td { background: #fafbfc; }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 700px) { .two-col { grid-template-columns: 1fr; } }
.muted { color: var(--muted); font-size: 13.5px; }
.mt { margin-top: 14px; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .big { font-size: 40px; margin-bottom: 8px; }

.auth-box { max-width: 430px; margin: 40px auto; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 24px; border-left: 2px solid var(--line); margin-left: 8px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; }
.timeline li:last-child { border-left-color: transparent; }
.timeline .t-status { font-weight: 700; }
.timeline .t-meta { font-size: 12.5px; color: var(--muted); }


.toast-wrap { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #1a2233; color: #fff; padding: 11px 16px; border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.25); font-size: 14px; max-width: 360px; animation: pop .18s ease; }
.toast.error { background: var(--danger); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* ============================================================
   2026 mobile-first refresh
   ============================================================ */
:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #eef2f3;
  --ink: #111827;
  --muted: #667085;
  --line: #dfe5e8;
  --brand: #0b6b45;
  --brand-ink: #07452d;
  --brand-soft: #e4f6ee;
  --accent: #d99a17;
  --accent-ink: #2a1a02;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 10px 28px -20px rgba(15, 23, 42, .32);
  --shadow-lg: 0 24px 70px -36px rgba(15, 23, 42, .42);
}

html { scroll-behavior: smooth; }
body {
  background:
    linear-gradient(180deg, #ffffff 0, #f5f7f8 360px),
    var(--bg);
  font-family: "Archivo", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

a:hover { text-decoration: none; }
button, .btn, .tile, .product-card, .cat-card { -webkit-tap-highlight-color: transparent; }
input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 14px;
  min-height: 46px;
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(11, 107, 69, .7);
  box-shadow: 0 0 0 4px rgba(11, 107, 69, .11);
}
label {
  color: #475467;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .055em;
}

.btn {
  border-radius: 14px;
  min-height: 42px;
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 12px 24px -18px rgba(11, 107, 69, .8);
}
.btn-primary:hover { background: var(--brand-ink); }
.btn-sm {
  min-height: 34px;
  border-radius: 12px;
}
.card {
  border-radius: 20px;
  border: 1px solid rgba(17, 24, 39, .08);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}
.badge {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  letter-spacing: .02em;
}
.alert {
  border-radius: 14px;
  border-width: 1px;
}
table { font-size: 13.5px; }
th {
  border-bottom: 1px solid var(--line);
  letter-spacing: .06em;
}
td { border-bottom: 1px solid rgba(17, 24, 39, .07); }
tr:hover td { background: #f8faf9; }

.empty .big { display: none; }
.toast-wrap {
  left: 14px;
  right: 14px;
  bottom: 84px;
}
.toast {
  max-width: none;
  border-radius: 14px;
  background: #111827;
}

@media (min-width: 768px) {
  .toast-wrap {
    left: auto;
    right: 18px;
    bottom: 18px;
    width: min(380px, calc(100vw - 36px));
  }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .tile, .product-card, .cat-card, .nav-item, .basket-link, .drawer {
    transition-duration: .18s;
    transition-timing-function: cubic-bezier(.2, .8, .2, 1);
  }
}

/* ============================================================
   Elegant trade UI refinement
   ============================================================ */
:root {
  --bg: #f7f8f6;
  --surface: #ffffff;
  --surface-2: #f0f3f1;
  --ink: #111714;
  --muted: #65716a;
  --line: #dde4df;
  --brand: #0a5f45;
  --brand-ink: #063d2c;
  --brand-soft: #e6f3ee;
  --accent: #c88b24;
  --accent-ink: #231602;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(17, 23, 20, .04);
  --shadow-md: 0 18px 44px -34px rgba(17, 23, 20, .38);
  --shadow-lg: 0 34px 90px -54px rgba(17, 23, 20, .46);
}

* {
  letter-spacing: 0 !important;
}

body {
  color: var(--ink);
  background:
    linear-gradient(180deg, #ffffff 0, var(--bg) 34rem),
    var(--bg);
  line-height: 1.5;
  text-rendering: geometricPrecision;
}

input,
select,
textarea {
  border-radius: 12px;
  border-color: #dce4df;
  color: var(--ink);
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

input::placeholder,
textarea::placeholder {
  color: #8a958f;
}

label {
  color: #52615a;
  font-size: 11px;
  font-weight: 800;
}

.btn,
button {
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease;
}

.btn:active,
button:active {
  transform: translateY(1px);
}

.btn {
  border-radius: 12px;
  font-weight: 800;
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 14px 28px -22px rgba(10, 95, 69, .9);
}

.btn-primary:hover {
  background: var(--brand-ink);
  border-color: var(--brand-ink);
  box-shadow: 0 18px 34px -22px rgba(10, 95, 69, .8);
}

.card {
  border-color: rgba(17, 23, 20, .08);
  border-radius: 18px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
}

.badge {
  font-weight: 800;
}

.toast {
  background: #111714;
  box-shadow: 0 18px 42px -24px rgba(17, 23, 20, .7);
}

.file-viewer-back {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 10px;
  background: rgba(17, 23, 20, .68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.file-viewer {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1120px, 100%);
  min-height: min(760px, calc(100vh - 20px));
  max-height: calc(100vh - 20px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 34px 90px -42px rgba(17, 23, 20, .9);
}

.file-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid rgba(17, 23, 20, .08);
}

.file-viewer-head b,
.file-viewer-head span {
  display: block;
}

.file-viewer-head b {
  color: var(--ink);
  font-size: 14px;
}

.file-viewer-head span {
  color: var(--muted);
  font-size: 12px;
}

.file-viewer-body {
  min-height: 0;
  overflow: auto;
  background: #f0f3f1;
}

.file-viewer-image {
  display: block;
  width: auto;
  height: auto;
  margin: 0 auto;
  max-width: 100%;
  max-height: calc(100vh - 96px);
  object-fit: contain;
}

.file-viewer-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 96px);
  border: 0;
  background: #fff;
}

.file-viewer-empty {
  display: grid;
  min-height: 340px;
  place-content: center;
  padding: 22px;
  text-align: center;
}

@media (max-width: 640px) {
  .file-viewer-back {
    padding: 0;
  }

  .file-viewer {
    min-height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .file-viewer-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .file-viewer-head .row {
    width: 100%;
  }

  .file-viewer-head .btn {
    flex: 1 1 0;
  }

  .file-viewer-image {
    width: 100%;
    max-height: none;
    min-height: 0;
  }

  .file-viewer-frame {
    max-height: none;
    min-height: calc(100vh - 118px);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .card,
  .modal,
  .toast {
    animation: refineIn .22s ease both;
  }
}

@keyframes refineIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}


/* ============================================================
   WhatsApp-style support thread (shared: shop + admin)
   ============================================================ */
.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 14px 0;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: min(82%, 560px);
}

.chat-msg.own {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-msg.theirs {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-sender {
  margin: 0 10px 3px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}

.chat-bubble {
  padding: 9px 13px 7px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
  box-shadow: 0 1px 2px rgba(17, 23, 20, .08);
}

.chat-msg.own .chat-bubble {
  border-bottom-right-radius: 4px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  border: 1px solid rgba(10, 95, 69, .16);
}

.chat-msg.theirs .chat-bubble {
  border-bottom-left-radius: 4px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.chat-bubble .chat-body {
  white-space: pre-wrap;
}

.chat-time {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  text-align: right;
}

.chat-msg.own .chat-time {
  color: rgba(6, 61, 44, .62);
}

.chat-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.chat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .72);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}

.chat-chip::before {
  content: "";
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  background:
    linear-gradient(var(--muted), var(--muted)) center / 2px 10px no-repeat;
  border: 1.5px solid var(--muted);
  border-radius: 3px;
  opacity: .8;
}

.chat-msg.own .chat-chip {
  border-color: rgba(10, 95, 69, .22);
  background: rgba(255, 255, 255, .82);
  color: var(--brand-ink);
}

.chat-composer {
  position: sticky;
  bottom: 12px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.chat-composer textarea {
  min-height: 46px;
  resize: vertical;
}

.chat-composer-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-attach-btn {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  margin: 0;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.chat-attach-btn input[type="file"] {
  display: none;
}

.chat-composer-bar .btn-primary {
  flex: 1 1 auto;
  min-height: 44px;
  justify-content: center;
}
