/* ============================================================
   ExpoBase — shared stylesheet
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  margin: 0;
  color: #1a1a1a;
  background: #fff;
  font-size: 15px;
  line-height: 1.5;
}

/* ── Nav ────────────────────────────────────────────────────── */
.navbar {
  background: #1a1a1a;
  color: #fff;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: -.01em;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.breadcrumb {
  font-size: .82rem;
  color: #9ca3af;
}

.breadcrumb a {
  color: #d1d5db;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: #fff;
}

.breadcrumb .sep {
  margin: 0 4px;
  color: #6b7280;
}

/* ── Content wrapper ───────────────────────────────────────── */
.content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 24px;
  /* Long unbroken strings (booth names, emails, supplier URLs) break
     instead of forcing the whole page to scroll sideways on phones. */
  overflow-wrap: break-word;
}

/* ── Flash messages ────────────────────────────────────────── */
.flash {
  padding: 10px 16px;
  border-radius: 5px;
  margin-bottom: 16px;
  font-size: .9rem;
  border: 1px solid transparent;
}

.flash-success,
.flash-export_success {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.flash-error {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.flash-info {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e40af;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 9px 20px;
  border-radius: 5px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  line-height: 1.4;
  white-space: nowrap;
}

.btn-primary {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

.btn-primary:hover { background: #333; border-color: #333; }

.btn-secondary {
  background: #fff;
  color: #1a1a1a;
  border-color: #d1d5db;
}

.btn-secondary:hover { background: #f9fafb; }

.btn-danger {
  background: #fff;
  color: #b91c1c;
  border-color: #fca5a5;
}

.btn-danger:hover { background: #fef2f2; }

.btn-sm {
  padding: 5px 12px;
  font-size: .82rem;
}

/* Nav button (used in navbar) */
.btn-nav {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 4px;
  background: #fff;
  color: #1a1a1a;
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
}

.btn-nav:hover { background: #e5e7eb; }

button.btn-nav { border: none; cursor: pointer; font-family: inherit; }

.nav-user { font-size: .82rem; color: #d1d5db; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
}

/* ── Progress bar ──────────────────────────────────────────── */
.progress-wrap {
  background: #e5e7eb;
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 99px;
  background: #16a34a;
  transition: width .3s;
}

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

th {
  text-align: left;
  padding: 9px 10px;
  background: #f9fafb;
  border-bottom: 2px solid #e5e7eb;
  font-weight: 600;
  white-space: nowrap;
}

td {
  padding: 9px 10px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

tr:nth-child(even) td { background: #fafafa; }
tr:hover td { background: #f3f4f6; }

th.num, td.num { text-align: right; }

/* ── Responsive ────────────────────────────────────────────── */

/* Tablet — tighten spacing and let the nav buttons start wrapping
   rather than spilling past the right edge. */
@media (max-width: 1024px) {
  .content { padding: 28px 20px; }

  .navbar { padding: 0 20px; }
  .nav-right {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px 12px;
  }
  .btn-nav { padding: 6px 12px; }
}

/* Small tablet / large phone — the navbar is the main fix here: its
   fixed 52px height + non-wrapping button row used to push the
   rightmost links (Account, Logout) off-screen and out of reach. We
   let it grow vertically and wrap so every button stays tappable. */
@media (max-width: 768px) {
  .content { padding: 20px 16px; }

  .navbar {
    height: auto;
    min-height: 52px;
    padding: 8px 16px;
    flex-wrap: wrap;
    gap: 8px 12px;
  }
  .nav-right {
    flex-wrap: wrap;
    gap: 8px 10px;
  }
  .nav-right .breadcrumb { display: none; }

  /* Wide tables scroll inside their own box instead of stretching the page. */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Phone — brand on its own line, nav buttons wrap into a full-width
   block of comfortably tappable targets, and body type scales down
   so labels wrap cleanly. */
@media (max-width: 480px) {
  body { font-size: 14px; }
  .content { padding: 16px 12px; }

  .navbar { padding: 8px 12px; }
  .nav-brand {
    font-size: 1rem;
    flex: 1 0 100%;
  }
  .nav-right {
    width: 100%;
    justify-content: flex-start;
  }
  .btn-nav { padding: 7px 12px; }
  .nav-user {
    flex-basis: 100%;
    order: 99;
  }

  .card { padding: 16px; }
}
