/* AdZoom admin — same design system as the storefront. */
:root {
  --bg: #F9FAFB;
  --card: #ffffff;
  --ink: #111827;
  --muted: #6B7280;
  --faint: #9CA3AF;
  --brand: #7C3AED;
  --brand-d: #6D28D9;
  --brand-soft: #F3E8FF;
  --line: #E5E7EB;
  --ok: #15803D;
  --bad: #B91C1C;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 16px -4px rgba(16,24,40,.08);
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font);
  background: var(--bg); color: var(--ink);
  font-size: 14px; line-height: 1.55;
}
a { color: var(--brand); }

/* Top navigation */
.anav {
  background: rgba(255,255,255,.94);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
  margin-bottom: 24px;
}
.anav .awrap {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 16px; flex-wrap: wrap;
}
.abrand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 16.5px; color: var(--ink) !important;
  text-decoration: none; margin-right: 14px; padding: 4px 0;
}
.abrand em { font-style: normal; color: var(--faint); font-weight: 600; font-size: 13px; }
.alogo {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), #4F46E5);
  color: #fff; font-weight: 800; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px -2px rgba(124,58,237,.4);
}
.anavs { display: flex; gap: 4px; flex-wrap: wrap; }
.anl {
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px;
  padding: 8px 14px; border-radius: 999px; white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.anl:hover { background: #F3F4F6; color: var(--ink); }
.anl.on { background: var(--brand-soft); color: var(--brand); }
.sp { flex: 1; }

.awrap { max-width: 1100px; margin: 0 auto; padding: 0 16px 48px; }
.anav .awrap { padding-bottom: 10px; }

h1 { font-size: 24px; margin: 4px 0 18px; letter-spacing: -.015em; }
h2 {
  font-size: 16px; margin: 24px 0 10px;
  border-bottom: 1px solid var(--line); padding-bottom: 8px;
}

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 16px;
}

/* Tables */
table.t { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
table.t th, table.t td {
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--line); vertical-align: top;
}
table.t th {
  background: #F8FAFC; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); white-space: nowrap;
}
@media (max-width: 720px) {
  table.t { display: block; overflow-x: auto; }
  table.t th, table.t td { white-space: nowrap; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--brand); color: #fff; border: 0; border-radius: 999px;
  padding: 9px 18px; font-size: 14px; font-weight: 700; font-family: inherit;
  cursor: pointer; text-decoration: none;
  transition: background .15s ease, transform .08s ease;
}
.btn:hover { background: var(--brand-d); color: #fff; }
.btn:active { transform: scale(.98); }
.btn.sec { background: #EEF0F6; color: var(--ink); }
.btn.sec:hover { background: #E2E5EE; color: var(--ink); }
.btn.danger { background: var(--bad); }
.btn.danger:hover { background: #991B1B; color: #fff; }
.btn.sm { padding: 6px 13px; font-size: 13px; }

/* Forms */
label.f { display: block; margin: 14px 0 6px; font-weight: 600; font-size: 13.5px; }
input[type=text], input[type=email], input[type=password], input[type=number],
textarea, select {
  width: 100%; max-width: 560px; padding: 10px 12px;
  border: 1px solid #D1D5DB; border-radius: 10px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(124,58,237,.15);
}
textarea { min-height: 80px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; resize: vertical; }
textarea.tall { min-height: 160px; }
.hint { font-size: 12.5px; color: var(--muted); max-width: 560px; margin-top: 6px; }
.checkrow { display: flex; gap: 10px; align-items: center; margin: 14px 0; font-weight: 600; }
.checkrow input { width: 18px; height: 18px; accent-color: var(--brand); }

/* Flash messages */
.flash { padding: 12px 16px; border-radius: 10px; margin: 0 0 16px; font-size: 14px; font-weight: 600; }
.flash.ok { background: #F0FDF4; border: 1px solid #BBF7D0; color: var(--ok); }
.flash.err { background: #FEF2F2; border: 1px solid #FECACA; color: var(--bad); }

/* Dashboard stats */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
}
.stat b { font-size: 26px; display: block; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 13px; }

/* Login */
.login-wrap { max-width: 400px; margin: 70px auto; padding: 0 16px; }
.login-box {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); padding: 30px 28px;
}
.login-box h1 { margin-top: 0; }

/* Badges + misc */
.badge {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.badge.pending { background: #FEF9C3; color: #854D0E; }
.badge.paid { background: #DCFCE7; color: #166534; }
.badge.failed, .badge.cancelled { background: #FEE2E2; color: #991B1B; }
.badge.open { background: #FEF9C3; color: #854D0E; }
.badge.answered { background: #DBEAFE; color: #1E40AF; }
.badge.closed { background: #F3F4F6; color: #6B7280; }

/* Ticket conversation */
.tmsg {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin: 0 0 12px; overflow-wrap: anywhere;
}
.tmsg.staff { background: #EFF6FF; border-color: #BFDBFE; }
.tmsg-head { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.tmsg-head b { color: var(--ink); font-size: 14px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; }
.inline { display: inline; }
.filters { margin-bottom: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
