/* Premium custom styles */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
html[dir="rtl"] body {
  font-family: 'Tajawal', 'Inter', system-ui, sans-serif;
}

/* Top-nav secondary actions (index.html #navMore): one row on wide screens,
   a drop-down panel opened by the menu button below 1280px. */
.nav-more { display: flex; align-items: center; gap: 1rem; }
@media (max-width: 1279.98px) {
  .nav-more {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0.5rem;
    padding: 0.75rem 1rem 1rem; background: #fff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 16px 24px -16px rgba(15, 23, 42, 0.35);
  }
  .nav-more.open { display: flex; }
  .nav-more > * { width: 100%; justify-content: flex-start; }
}
/* Narrow phones, signed in: the logo alone, so credits + account still fit. */
@media (max-width: 479.98px) {
  body.signed-in .brand-text { display: none; }
}

/* Hero grid backdrop */
.hero-grid {
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 50px 50px;
}

/* Example chip */
.example-chip {
  font-size: 0.75rem;
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.18);
  transition: all 0.15s;
  cursor: pointer;
}
.example-chip:hover { background: rgba(255,255,255,0.22); }

/* Detail field */
.detail-field {
  background: white;
  padding: 0.9rem 1.1rem;
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
}
.detail-field:hover { background: #f8fafc; }
.detail-field .lbl {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 0.25rem;
}
.detail-field .val {
  font-size: 0.95rem;
  font-weight: 500;
  color: #0f172a;
  word-break: break-word;
}
.detail-field .val.empty {
  color: #cbd5e1;
  font-style: italic;
  font-weight: 400;
}
.detail-field .copy-icon {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  opacity: 0;
  transition: opacity 0.12s;
  color: #94a3b8;
}
html[dir="rtl"] .detail-field .copy-icon { right: auto; left: 0.7rem; }
.detail-field:hover .copy-icon { opacity: 1; }
.detail-field.copied {
  background: #ecfdf5 !important;
}
.detail-field.copied .copy-icon { opacity: 1; color: #10b981; }

/* Modal show states */
#pricingModal.show,
#bulkModal.show,
#settingsModal.show,
#grantModal.show,
#companyModal.show,
#superAdminModal.show,
#packModal.show,
#companyGrantModal.show,
#superUserModal.show,
#superBillingModal.show { display: flex; }

/* Toast */
#toast.show {
  opacity: 1;
  transform: translate(-50%, -8px);
}

/* Map fixes */
#map { width: 100%; height: 100%; }
.leaflet-container { background: #f1f5f9; cursor: crosshair; }

/* Admin tabs */
.admin-tab,
.super-tab {
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}
.admin-tab:hover,
.super-tab:hover { color: #0f172a; }
.admin-tab.active,
.super-tab.active {
  color: #0f172a;
  border-bottom-color: #0ea5e9;
  font-weight: 600;
}

/* Stat card (admin) */
.stat-card {
  padding: 1.25rem;
  border-radius: 1rem;
  background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
  color: white;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
}
.stat-card p:first-child {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.9;
  margin-bottom: 0.25rem;
}

/* Login tab states */
.tab-btn { color: rgba(255,255,255,0.6); }
.tab-btn.active { background: rgba(255,255,255,0.18); color: white; }

/* Dashboard table */
table { border-collapse: separate; border-spacing: 0; }

/* ── Product tour ─────────────────────────────────────────── */
.tour-overlay{position:fixed;inset:0;background:rgba(8,14,22,.66);z-index:9998;
  backdrop-filter:blur(1px)}
.tour-lit{position:relative;z-index:9999;box-shadow:0 0 0 4px rgba(56,189,248,.9),
  0 0 0 10px rgba(56,189,248,.28),0 12px 40px rgba(0,0,0,.45);border-radius:12px}
.tour-box{position:fixed;z-index:10000;width:320px;max-width:calc(100vw - 24px);
  background:#fff;color:#0f172a;border-radius:14px;padding:16px 18px 14px;
  box-shadow:0 20px 50px rgba(0,0,0,.35);font-size:14px;line-height:1.55}
.tour-box h3{margin:.15rem 0 .4rem;font-size:1.02rem;font-weight:700}
.tour-box p{margin:0 0 .9rem;color:#334155}
.tour-step{font-size:.7rem;letter-spacing:.08em;text-transform:uppercase;
  color:#0891b2;font-weight:700}
.tour-actions{display:flex;align-items:center;justify-content:space-between;gap:.5rem}
.tour-right{display:flex;gap:.4rem}
.tour-box button{border:0;border-radius:9px;padding:.45rem .9rem;font-weight:600;
  font-size:.85rem;cursor:pointer}
.tour-skip{background:transparent;color:#64748b}
.tour-skip:hover{color:#0f172a;text-decoration:underline}
.tour-back{background:#e2e8f0;color:#0f172a}
.tour-next{background:linear-gradient(90deg,#0891b2,#0e7490);color:#fff}
.tour-next:hover{filter:brightness(1.08)}
html[dir="rtl"] .tour-actions{flex-direction:row-reverse}
@media (prefers-color-scheme:dark){
  .tour-box{background:#111a24;color:#e2e8f0}
  .tour-box p{color:#94a3b8}
  .tour-back{background:#1e293b;color:#e2e8f0}
}
