/* ── Variables ──────────────────────────────────────────────────────────── */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --accent: #6366f1;
  --accent-dark: #4f46e5;
  --accent-light: #eef2ff;
  --green: #10b981;
  --red: #ef4444;
  --yellow: #f59e0b;
  --radius: 14px;
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
  --admin-accent: #0f172a;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

input,
select,
textarea,
button {
  font-family: inherit;
  font-size: 1rem;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* ── Typography ─────────────────────────────────────────────────────────── */
h1,
h2,
h3,
h4 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

/* ── Utilities ──────────────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.text-green {
  color: var(--green);
}

.text-red {
  color: var(--red);
}

.text-muted {
  color: var(--muted);
}

.fw-bold {
  font-weight: 700;
}

.w-full {
  width: 100%;
}

.d-flex {
  display: flex;
}

.gap-1 {
  gap: 0.5rem;
}

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-success {
  background: #dcfce7;
  color: #16a34a;
}

.badge-warning {
  background: #fef9c3;
  color: #a16207;
}

.badge-danger {
  background: #fee2e2;
  color: #dc2626;
}

.badge-secondary {
  background: #f1f5f9;
  color: #64748b;
}

.badge-blue {
  background: #dbeafe;
  color: #2563eb;
}

.badge-gold {
  background: #fef3c7;
  color: #92400e;
}

.badge-pending {
  background: #fef9c3;
  color: #a16207;
}

.badge-approved {
  background: #dcfce7;
  color: #16a34a;
}

.badge-suspended {
  background: #fee2e2;
  color: #dc2626;
}

.badge-inactive {
  background: #f1f5f9;
  color: #64748b;
}

/* ── Flash ──────────────────────────────────────────────────────────────── */
.flash,
.portal-flash,
.alert {
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.75rem 1.5rem;
}

.flash-success,
.alert-success {
  background: #dcfce7;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.flash-error,
.alert-error {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.flash-info,
.alert-info {
  background: #dbeafe;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  font-weight: 600;
  transition: 0.2s;
}

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-weight: 600;
  transition: 0.2s;
}

.btn-secondary:hover {
  background: var(--bg);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  background: var(--red);
  color: #fff;
  border-radius: 10px;
  font-weight: 600;
  transition: 0.2s;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 10px;
  font-weight: 600;
  transition: 0.2s;
}

.btn-lg {
  padding: 0.9rem 2rem;
  font-size: 1.05rem;
}

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: 0.2s;
}

.btn-view {
  background: #dbeafe;
  color: #2563eb;
}

.btn-edit {
  background: #dcfce7;
  color: #16a34a;
}

.btn-del {
  background: #fee2e2;
  color: #dc2626;
}

.btn-icon:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group small {
  font-size: 0.78rem;
  color: var(--muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.input-wrap {
  position: relative;
}

.input-wrap>i {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.9rem;
  pointer-events: none;
}

.input-wrap.wa-input>i {
  color: #25D366;
}

.input-wrap input,
.input-wrap select,
.input-wrap textarea {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  transition: 0.2s;
}

.input-wrap textarea {
  padding-top: 0.75rem;
  resize: vertical;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.75rem 2.5rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  transition: 0.2s;
}

.input-wrap input:focus,
.input-wrap select:focus,
.input-wrap textarea:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.toggle-pw {
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  background: none;
  padding: 0;
  font-size: 0.85rem;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.form-section-title {
  font-family: 'Syne', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin: 1.25rem 0 1rem;
}

/* ── Tables ─────────────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table thead tr {
  border-bottom: 2px solid var(--border);
}

.data-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: var(--bg);
}

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.modal-overlay.show {
  display: flex;
}

.modal-box {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-lg {
  max-width: 720px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.1rem;
}

.modal-header button {
  font-size: 1.4rem;
  color: var(--muted);
  line-height: 1;
  padding: 0.25rem;
}

.modal-form {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ── Cards ──────────────────────────────────────────────────────────────── */
.dash-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.card-link {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

/* ── Pricing ────────────────────────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.pricing-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  position: relative;
  transition: 0.3s;
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.pricing-featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.pricing-inactive {
  opacity: 0.6;
}

.plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.9rem;
  border-radius: 50px;
  white-space: nowrap;
}

.plan-name {
  font-family: 'Syne', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.plan-price {
  font-size: 2.8rem;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 1.5rem;
}

.plan-price span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
}

.plan-features {
  list-style: none;
  margin-bottom: 1.75rem;
}

.plan-features li {
  padding: 0.4rem 0;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.plan-features li i.fa-check {
  color: var(--green);
}

.plan-features li i.fa-times {
  color: var(--muted);
}

.plan-features li.muted {
  color: var(--muted);
}

.plan-btn {
  display: block;
  width: 100%;
  padding: 0.8rem;
  text-align: center;
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-weight: 700;
  transition: 0.2s;
}

.plan-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.plan-btn-featured {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Empty State ────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

.empty-state i {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.4;
  display: block;
}

.empty-state p {
  margin-bottom: 1rem;
}

/* ── Notices ────────────────────────────────────────────────────────────── */
.notice-banner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.notice-banner i {
  margin-top: 2px;
  flex-shrink: 0;
}

.notice-warning {
  background: #fef9c3;
  color: #a16207;
  border: 1px solid #fef08a;
}

.notice-danger {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.notice-info {
  background: #dbeafe;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.notice-banner a {
  font-weight: 700;
  text-decoration: underline;
}

/* ── Search form ────────────────────────────────────────────────────────── */
.search-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.search-form input,
.search-form select {
  padding: 0.55rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
}

.search-form input:focus,
.search-form select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── File upload ────────────────────────────────────────────────────────── */
.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: 0.2s;
}

.file-upload-area:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.file-upload-area input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-upload-area i {
  font-size: 1.5rem;
  color: var(--muted);
  display: block;
  margin-bottom: 0.5rem;
}

.file-upload-area span {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ── Store info list ────────────────────────────────────────────────────── */
.store-info-list {
  padding: 1rem 1.5rem;
}

.si-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.si-row:last-child {
  border-bottom: none;
}

.si-row span:first-child {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.si-val {
  font-weight: 500;
  text-align: right;
}

.link-val {
  color: var(--accent);
  font-size: 0.85rem;
}

/* ── Profile ────────────────────────────────────────────────────────────── */
.profile-card {
  padding: 2rem;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.profile-logo {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  object-fit: cover;
}

.profile-avatar-lg {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 2rem;
  font-family: 'Syne', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* ── QR Page ────────────────────────────────────────────────────────────── */
.qr-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.qr-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
}

.qr-brand {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.qr-image {
  max-width: 260px;
  margin: 0 auto 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.qr-url {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.qr-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.qr-tips {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.qr-tips h3 {
  margin-bottom: 1rem;
  font-size: 1rem;
}

.qr-tips ul {
  list-style: none;
}

.qr-tips li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.qr-tips li:last-child {
  border-bottom: none;
}

.qr-tips li i {
  width: 20px;
  color: var(--accent);
}

/* ── Pending center ─────────────────────────────────────────────────────── */
.empty-page-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.pending-card {
  text-align: center;
  max-width: 420px;
  padding: 2.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
}

.pending-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.pending-card h2 {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.pending-card p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.pending-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}

/* ── Misc portal ────────────────────────────────────────────────────────── */
.product-mini-list {
  padding: 1rem 1.5rem;
}

.pm-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.pm-item:last-child {
  border-bottom: none;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .qr-page {
    grid-template-columns: 1fr;
  }
}