/* ═══════════════════════════════════════════════════════
   Recruitment Platform - Complete Stylesheet
   Original styles from index.html + new auth/payment styles
   ═══════════════════════════════════════════════════════ */

:root {
  --bg: #ffffff;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text2: #64748b;
  --accent: #2563eb;
  --accent2: #7c3aed;
  --border: #e2e8f0;
  --tag-bg: #eff6ff;
  --tag-text: #2563eb;
  --row-hover: #f0f4ff;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* ═══════════ NAVBAR ═══════════ */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.navbar .logo {
  font-weight: 800;
  font-size: 1.05em;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

.navbar .nav-links {
  display: flex;
  gap: 12px;
  align-items: center;
}

.navbar .nav-links a {
  font-size: .85em;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 6px;
  transition: all .18s;
  font-weight: 500;
  color: var(--text2);
}

.navbar .nav-links a:hover {
  background: var(--row-hover);
  color: var(--accent);
}

.navbar .nav-links a.btn-nav {
  background: var(--accent);
  color: #fff;
}

.navbar .nav-links a.btn-nav:hover {
  background: #1d4ed8;
}

.navbar .nav-links .user-email {
  font-size: .8em;
  color: var(--text2);
  margin-right: 4px;
}

.navbar .sub-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: .68em;
  font-weight: 600;
}

.navbar .sub-badge.trial {
  background: #fef3c7;
  color: #d97706;
}

.navbar .sub-badge.active {
  background: #d1fae5;
  color: #059669;
}

.navbar .sub-badge.expired {
  background: #fee2e2;
  color: #dc2626;
}

/* ═══════════ HERO ═══════════ */
.hero {
  background: #ffffff;
  padding: 44px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: 2em;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.hero .subtitle {
  color: var(--text2);
  font-size: .95em;
}

.hero .update {
  display: inline-block;
  margin-top: 10px;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 5px 18px;
  border-radius: 20px;
  font-size: .82em;
  border: 1px solid #bfdbfe;
}

.stats-row {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-item .num {
  font-size: 1.7em;
  font-weight: 800;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-item .label {
  color: var(--text2);
  font-size: .78em;
}

/* ═══════════ BANNERS ═══════════ */
.banner {
  border-radius: 8px;
  padding: 12px 18px;
  margin: 12px 0;
  font-size: .82em;
  text-align: center;
}

.banner.trial {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b;
  color: #92400e;
}

.banner.expired {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.banner.active {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.banner.preview {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.banner a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
}

/* ═══════════ CONTAINER ═══════════ */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 20px;
}

/* ═══════════ SEARCH BAR ═══════════ */
.search-bar-wrap {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(10px);
  padding: 12px 20px 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.search-input-row {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 700px;
  align-items: center;
}

.search-input-row input {
  flex: 1;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 9px 18px;
  color: #0f172a;
  font-size: .88em;
  outline: none;
  transition: border .2s;
}

.search-input-row input:focus {
  border-color: var(--accent);
  background: #fff;
}

.search-input-row input::placeholder {
  color: #94a3b8;
}

.search-result-count {
  font-size: .78em;
  color: var(--text2);
  white-space: nowrap;
}

/* ── Autocomplete dropdown ── */
.search-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0 0 12px 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  z-index: 300;
  max-height: 280px;
  overflow-y: auto;
  display: none;
}
.search-autocomplete.show { display: block; }
.search-autocomplete .ac-item {
  padding: 10px 18px;
  cursor: pointer;
  font-size: .85em;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background .12s;
}
.search-autocomplete .ac-item:last-child { border-bottom: none; }
.search-autocomplete .ac-item:hover,
.search-autocomplete .ac-item.active {
  background: var(--row-hover);
  color: var(--accent);
}
.search-autocomplete .ac-item .ac-name { font-weight: 600; color: #0f172a; }
.search-autocomplete .ac-item .ac-loc { font-size: .8em; color: #d97706; }
.search-autocomplete .ac-item:hover .ac-name { color: var(--accent); }
.search-autocomplete .ac-empty {
  padding: 14px 18px;
  text-align: center;
  color: #94a3b8;
  font-size: .82em;
}

.search-chips {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
}

.search-chips-row {
  display: flex;
  gap: 5px;
  flex-wrap: nowrap;
  align-items: center;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.search-chips-row::-webkit-scrollbar { height: 4px; }
.search-chips-row::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

.search-chip-group {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.search-chip-cat {
  font-size: .68em;
  color: #94a3b8;
  font-weight: 700;
  white-space: nowrap;
  margin: 0 2px;
  user-select: none;
}

.search-chip {
  flex-shrink: 0;
  font-size: .72em;
  padding: 5px 13px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text2);
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
  user-select: none;
}

.search-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #f8faff;
}

.search-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}

.search-chip.hot-chip {
  border-color: #ef4444;
  color: #dc2626;
}

.search-chip.hot-chip:hover,
.search-chip.hot-chip.active {
  background: #ef4444;
  color: #fff;
}

.search-summary {
  font-size: .76em;
  color: var(--text2);
  text-align: center;
  padding: 4px 0;
}

.search-summary .clear-link {
  color: var(--accent);
  cursor: pointer;
  margin-left: 6px;
  text-decoration: underline;
}

/* ═══════════ DATA ROWS ═══════════ */
.rows {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.row {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 18px;
  display: flex;
  align-items: center;
  gap: 32px;
  transition: all .18s;
  min-height: 48px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
}

.row:hover {
  border-color: var(--accent);
  background: var(--row-hover);
  box-shadow: 0 2px 8px rgba(37, 99, 235, .08);
}

.row-num {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: #f1f5f9;
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72em;
  font-weight: 700;
  flex-shrink: 0;
}

.row-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 170px;
  max-width: 280px;
  flex-shrink: 0;
}

.row-company {
  font-weight: 700;
  color: #0f172a;
  font-size: .9em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-loc {
  font-size: .84em;
  color: #d97706;
  white-space: nowrap;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.tag {
  font-size: .66em;
  padding: 2px 7px;
  border-radius: 8px;
  background: var(--tag-bg);
  color: var(--tag-text);
  white-space: nowrap;
  border: 1px solid #bfdbfe;
}

.tag.hot {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.tag.green {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #bbf7d0;
}

.tag.orange {
  background: #fff7ed;
  color: #ea580c;
  border-color: #fed7aa;
}

.tag.purple {
  background: #f5f3ff;
  color: #7c3aed;
  border-color: #ddd6fe;
}

.row-info {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: .85em;
  color: var(--text2);
  align-items: center;
  min-width: 0;
  padding-left: 12px;
}

.row-info .info-item {
  white-space: nowrap;
}

.row-info .info-item strong {
  color: #334155;
  font-weight: 600;
}

.row-info.masked {
  filter: blur(0px);
}

.row-info .masked-text {
  color: #94a3b8;
  font-style: italic;
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
}

.row-actions a,
.row-actions button {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: .76em;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s;
  white-space: nowrap;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
  background: #fff;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #f8faff;
}

.btn-locked {
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px dashed var(--border);
  cursor: pointer;
}

.btn-locked:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--row-hover);
}

.row.header-row {
  background: transparent;
  border: none;
  padding: 5px 16px;
  font-size: .74em;
  color: var(--text2);
  font-weight: 600;
  min-height: auto;
  box-shadow: none;
}

.row.header-row:hover {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.row.header-row .row-left {
  visibility: hidden;
}

.row.hidden {
  display: none;
}

.no-result {
  text-align: center;
  padding: 40px;
  color: var(--text2);
  font-size: .9em;
}

/* Loading & States */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text2);
}

.loading-spinner {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ═══════════ ALERT / TIPS ═══════════ */
.alert {
  border-radius: 8px;
  padding: 12px 18px;
  margin: 12px 0;
  font-size: .82em;
}

.alert.tips {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.alert h3 {
  margin-bottom: 5px;
  font-size: .92em;
}

/* ═══════════ FOOTER ═══════════ */
.footer {
  text-align: center;
  padding: 26px 20px;
  color: var(--text2);
  font-size: .74em;
  border-top: 1px solid var(--border);
  margin-top: 24px;
}

.footer a {
  color: var(--accent);
}

/* ═══════════ AUTH FORMS ═══════════ */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  background: #f8fafc;
  padding: 20px;
}

.auth-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 32px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .06);
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 6px;
  font-size: 1.4em;
}

.auth-card .sub {
  text-align: center;
  color: var(--text2);
  font-size: .85em;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: .82em;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .9em;
  outline: none;
  transition: border .2s;
  background: #f8fafc;
}

.form-group input:focus {
  border-color: var(--accent);
  background: #fff;
}

.form-group .helper {
  font-size: .74em;
  color: var(--text2);
  margin-top: 4px;
}

.btn-full {
  width: 100%;
  padding: 11px;
  border-radius: 8px;
  font-size: .9em;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s;
}

.btn-full.primary {
  background: var(--accent);
  color: #fff;
}

.btn-full.primary:hover {
  background: #1d4ed8;
}

.btn-full:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.auth-card .alt-link {
  text-align: center;
  margin-top: 16px;
  font-size: .82em;
  color: var(--text2);
}

.auth-card .alt-link a {
  color: var(--accent);
  font-weight: 600;
}

.error-msg {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: .82em;
  margin-bottom: 16px;
}

.success-msg {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: .82em;
  margin-bottom: 16px;
}

/* ═══════════ PAYMENT PAGE ═══════════ */
.payment-section {
  max-width: 600px;
  margin: 30px auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

.payment-section h3 {
  margin-bottom: 16px;
}

.price-tag {
  text-align: center;
  margin: 20px 0;
}

.price-tag .amount {
  font-size: 3em;
  font-weight: 800;
  color: var(--accent);
}

.price-tag .period {
  color: var(--text2);
  font-size: .9em;
}

.price-tag .unit {
  font-size: 1.2em;
  font-weight: 600;
}

.qr-section {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin: 20px 0;
  flex-wrap: wrap;
}

.qr-card {
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  min-width: 160px;
}

.qr-card img {
  width: 150px;
  height: 150px;
  object-fit: contain;
  margin-bottom: 8px;
}

.qr-card .label {
  font-size: .82em;
  font-weight: 600;
}

.qr-card.alipay .label {
  color: #1677ff;
}

.upload-section {
  margin: 20px 0;
  padding: 20px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  text-align: center;
}

.upload-section:hover {
  border-color: var(--accent);
}

.upload-section input[type="file"] {
  display: none;
}

.upload-label {
  cursor: pointer;
  display: inline-block;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  font-size: .85em;
}

.payment-orders {
  margin-top: 24px;
}

.payment-orders table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82em;
}

.payment-orders th,
.payment-orders td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.payment-orders th {
  color: var(--text2);
  font-weight: 600;
  font-size: .78em;
}

.status-badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: .75em;
  font-weight: 600;
}

.status-badge.pending {
  background: #fef3c7;
  color: #d97706;
}

.status-badge.completed {
  background: #d1fae5;
  color: #059669;
}

.status-badge.cancelled {
  background: #fee2e2;
  color: #dc2626;
}

.status-badge.pending_verify {
  background: #dbeafe;
  color: #1d4ed8;
}

/* ═══════════ ADMIN PAGE ═══════════ */
.admin-section {
  max-width: 800px;
  margin: 30px auto;
}

.admin-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.admin-stat-card {
  flex: 1;
  min-width: 140px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.admin-stat-card .num {
  font-size: 1.8em;
  font-weight: 800;
  color: var(--accent);
}

.admin-stat-card .label {
  font-size: .76em;
  color: var(--text2);
}

.admin-payment-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-payment-card .info {
  font-size: .85em;
}

.admin-payment-card .actions {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: .78em;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s;
}

.btn-approve {
  background: #16a34a;
  color: #fff;
}

.btn-approve:hover {
  background: #15803d;
}

.btn-reject {
  background: #ef4444;
  color: #fff;
}

.btn-reject:hover {
  background: #dc2626;
}

/* ═══════════ PAGINATION ═══════════ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 20px 0;
}

.pagination button {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: .82em;
  transition: all .18s;
}

.pagination button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pagination button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.pagination button:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* ═══════════ BACK TO TOP ═══════════ */
#backToTopBtn {
  position: fixed;
  bottom: 32px;
  right: 24px;
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--accent);
  font-size: 1.2em;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}
#backToTopBtn.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#backToTopBtn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(37,99,235,.3);
}
@media (prefers-color-scheme: dark) {
  #backToTopBtn {
    box-shadow: 0 2px 12px rgba(0,0,0,.4);
  }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — Mobile-First Enhancements
   Breakpoints: 480px (small phone), 768px (large phone/tablet), 1024px (tablet landscape)
   ═══════════════════════════════════════════════ */

/* ──── HAMBURGER BUTTON ──── */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 1.4em;
  cursor: pointer;
  color: var(--text);
  transition: all .18s;
  flex-shrink: 0;
}
.hamburger-btn:hover { background: var(--row-hover); color: var(--accent); }

/* ──── BOTTOM NAV BAR (mobile) ──── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 6px 8px max(6px, env(safe-area-inset-bottom));
  justify-content: space-around;
  align-items: center;
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: var(--text2);
  font-size: .62em;
  font-weight: 500;
  padding: 4px 6px;
  border-radius: 8px;
  transition: all .18s;
  min-width: 48px;
  min-height: 48px;
  justify-content: center;
}
.bottom-nav a .bn-icon {
  font-size: 1.5em;
  line-height: 1;
}
.bottom-nav a.active,
.bottom-nav a:active {
  color: var(--accent);
  background: var(--tag-bg);
}

/* ──── MOBILE ONLY (≤768px) ──── */
@media (max-width: 768px) {
  /* Prevent horizontal overflow */
  body { overflow-x: hidden; }

  /* ── Navbar ── */
  .navbar { padding: 10px 14px; gap: 10px; }
  .navbar .logo { font-size: .9em; }
  .hamburger-btn { display: flex; }

  .nav-links {
    display: none;
  }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 2px solid var(--accent);
    box-shadow: 0 12px 28px rgba(0,0,0,.14);
    padding: 6px 0;
    z-index: 1000;
    animation: slideDown .2s ease;
  }
  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .nav-links.open a {
    padding: 14px 20px;
    font-size: .92em;
    border-radius: 0;
    border-bottom: 1px solid #f1f5f9;
    display: block;
    text-align: left;
  }
  .nav-links.open a.btn-nav { margin: 4px 16px; border-radius: 8px; text-align: center; }
  .nav-links.open .user-email { padding: 8px 20px 4px; font-size: .78em; display: block; }
  .nav-links.open .sub-badge { margin: 0 20px; }

  /* ── Hero ── */
  .hero { padding: 28px 14px; }
  .hero h1 { font-size: 1.25em; line-height: 1.3; }
  .hero .subtitle { font-size: .82em; margin-top: 4px; }
  .hero .update { font-size: .74em; padding: 4px 14px; }

  .stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
  }
  .stat-item .num { font-size: 1.35em; }
  .stat-item .label { font-size: .7em; }

  /* ── Data Rows → Card Layout ── */
  .rows { gap: 8px; }
  .row {
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    padding: 14px;
    border-radius: 10px;
    min-height: auto;
  }
  .row.header-row { display: none; }

  .row-num {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    font-size: .65em;
    border-radius: 4px;
    background: #f8fafc;
  }

  /* Row header area: company name + location inline */
  .row-left {
    min-width: 0;
    max-width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    padding-right: 28px; /* room for row-num badge */
  }
  .row-company { font-size: .95em; font-weight: 700; }
  .row-loc { font-size: .78em; }
  .row-tags { width: 100%; }

  /* Info section */
  .row-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding-left: 0;
    font-size: .8em;
    width: 100%;
  }
  .row-info .info-item { white-space: normal; }

  /* Actions */
  .row-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px solid #f1f5f9;
  }
  .row-actions a,
  .row-actions button {
    padding: 9px 16px;
    font-size: .78em;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
  }

  /* ── Container ── */
  .container { padding: 8px 12px 80px; }

  /* ── Banner ── */
  .banner { font-size: .76em; padding: 10px 14px; }

  /* ── Alert / Tips ── */
  .alert { font-size: .76em; padding: 10px 14px; }

  /* ── Search Bar ── */
  .search-bar-wrap {
    padding: 10px 12px 6px;
    top: 0;
  }
  .search-input-row { max-width: 100%; }
  .search-input-row input {
    padding: 11px 18px;
    font-size: .9em;
    border-radius: 24px;
    /* Prevent iOS zoom on focus */
    font-size: 16px;
  }
  .search-result-count { font-size: .72em; }

  .search-chips-row {
    gap: 6px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 6px;
  }
  .search-chip {
    scroll-snap-align: start;
    font-size: .74em;
    padding: 8px 14px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }
  .search-chip-cat { font-size: .64em; }

  /* ── Auth Forms ── */
  .auth-page { padding: 12px; min-height: auto; align-items: flex-start; }
  .auth-card {
    max-width: 100%;
    padding: 24px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
  }
  .auth-card h2 { font-size: 1.2em; }
  .form-group input {
    padding: 13px 14px;
    font-size: 16px; /* Prevent iOS zoom */
    border-radius: 10px;
    min-height: 48px;
  }
  .form-group label { font-size: .84em; }
  .btn-full { padding: 14px; font-size: .95em; border-radius: 10px; min-height: 48px; }
  .code-row { flex-direction: column; }
  .code-row button { width: 100%; }
  .forgot-link { text-align: center; margin-top: -4px; margin-bottom: 20px; }
  .forgot-link a { padding: 8px; display: inline-block; }

  /* ── Payment ── */
  .payment-section {
    max-width: 100%;
    margin: 12px 0;
    padding: 18px 14px;
    border-radius: 10px;
  }
  .plan-cards { flex-direction: column; gap: 10px; }
  .plan-card { max-width: 100%; min-width: 0; padding: 16px; }
  .plan-price { font-size: 1.6em; }
  .qr-section { flex-direction: column; align-items: center; gap: 16px; }

  .payment-orders { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .payment-orders table { min-width: 500px; font-size: .76em; }
  .payment-orders th, .payment-orders td { padding: 6px 8px; }

  .upload-section { padding: 16px; }
  .upload-label { padding: 12px 24px; font-size: .9em; }

  /* ── Admin ── */
  .admin-section { max-width: 100%; margin: 12px 0; }
  .admin-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .admin-stat-card { min-width: 0; padding: 14px 10px; }
  .admin-stat-card .num { font-size: 1.4em; }
  .admin-payment-card { flex-direction: column; align-items: stretch; }
  .admin-payment-card .actions { width: 100%; justify-content: flex-end; }
  .analytics-grid { grid-template-columns: 1fr; }
  .analytics-table { display: block; overflow-x: auto; }

  /* ── Dashboard Tabs ── */
  .tab-btn { padding: 12px 18px; font-size: .82em; min-height: 44px; }

  /* ── Footer ── */
  .footer { padding: 20px 12px 84px; font-size: .7em; }

  /* ── Back to Top ── */
  #backToTopBtn {
    bottom: 80px;
    right: 14px;
    width: 40px;
    height: 40px;
    font-size: 1.1em;
  }

  /* ── Bottom Nav (show only on mobile when logged-in pages exist) ── */
  .bottom-nav.show { display: flex; }
  body.has-bottom-nav { padding-bottom: 70px; }

  /* ── Modal ── */
  .modal-box { max-width: 90vw; padding: 20px; }
  .modal-box img { width: 160px; height: 160px; }
}

/* ──── SMALL PHONE (≤480px) ──── */
@media (max-width: 480px) {
  .hero h1 { font-size: 1.1em; }
  .hero .subtitle { font-size: .76em; }
  .hero .update { font-size: .7em; }

  .stats-row { gap: 6px; }
  .stat-item .num { font-size: 1.15em; }
  .stat-item .label { font-size: .66em; }

  .row { padding: 10px; gap: 4px; }
  .row-company { font-size: .88em; }
  .row-loc { font-size: .74em; }
  .row-info { font-size: .76em; }

  .row-actions a,
  .row-actions button {
    padding: 7px 12px;
    font-size: .74em;
    min-height: 36px;
  }

  .tag { font-size: .62em; padding: 2px 6px; }

  .search-input-row input { padding: 10px 14px; font-size: 15px; }

  .navbar { padding: 8px 10px; }
  .navbar .logo { font-size: .82em; }

  .auth-card { padding: 18px 12px; }
  .auth-card h2 { font-size: 1.1em; }

  .bottom-nav a { font-size: .58em; min-width: 40px; }
  .bottom-nav a .bn-icon { font-size: 1.3em; }
}

