/* AA Carnival — Shared Styles */

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

:root {
  --blue-dark:   #0b4ea2;
  --blue-mid:    #1463c2;
  --red:         #d7232a;
  --bg:          #f3f5f8;
  --white:       #ffffff;
  --text:        #0f1623;
  --text-sub:    #5a6378;
  --border:      #e2e6ed;
  --card-shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius:      12px;
  --max-w:       480px;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Layout shell ── */
.page-wrap {
  width: 100%;
  max-width: var(--max-w);
  padding: 8px 16px 48px;
  flex: 1;
}

/* ── Branding header ── */
.brand-header {
  text-align: center;
  padding: 0 0 24px;
}

.brand-logo {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  margin-bottom: 8px;
}

.brand-logo svg {
  width: 64px;
  height: 44px;
}

.brand-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.brand-logo-img {
  height: 56px;
  width: auto;
  display: block;
}

.brand-subtitle {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--text-sub);
  text-transform: uppercase;
  margin-top: 4px;
}

/* ── Card ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 24px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

/* ── Form elements ── */
.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s;
  -webkit-appearance: none;
}

.field input:focus {
  outline: none;
  border-color: var(--blue-mid);
}

.field input[type="password"] {
  letter-spacing: 0.12em;
}

/* ── Buttons ── */
.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

.btn:focus-visible {
  outline: 3px solid var(--blue-mid);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--blue-dark);
  color: var(--white);
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  background: var(--white);
  color: var(--blue-dark);
  border: 2px solid var(--blue-dark);
}

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

.btn-danger {
  background: var(--red);
  color: var(--white);
}

.btn-danger:hover {
  opacity: 0.9;
}

.btn-ghost {
  background: transparent;
  color: var(--blue-mid);
  font-weight: 600;
  padding: 10px;
}

.btn + .btn {
  margin-top: 10px;
}

/* ── Error / alert ── */
.alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 14px;
  display: none;
}

.alert.visible {
  display: block;
}

.alert-error {
  background: #fdf0f0;
  color: var(--red);
  border: 1px solid #f5c6c6;
}

.alert-success {
  background: #f0f8f0;
  color: #1a7c3a;
  border: 1px solid #b6dfc0;
}

/* ── Small text / links ── */
.help-text {
  text-align: center;
  font-size: 0.825rem;
  color: var(--text-sub);
  margin-top: 14px;
}

.help-text a {
  color: var(--blue-mid);
  text-decoration: none;
}

.help-text a:hover {
  text-decoration: underline;
}

/* ── Divider ── */
.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--text-sub);
  font-size: 0.8rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Tabs ── */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 12px;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn.active {
  color: var(--blue-dark);
  border-bottom-color: var(--blue-dark);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ── Ticket summary row ── */
.ticket-row {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.ticket-chip {
  flex: 1;
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  padding: 12px 8px;
  text-align: center;
}

.ticket-chip .num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--blue-dark);
  line-height: 1;
}

.ticket-chip .lbl {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* ── Booth / prize cards ── */
.booth-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 16px 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.booth-card .booth-name {
  font-size: 0.95rem;
  font-weight: 700;
}

.booth-card .booth-stats {
  font-size: 0.75rem;
  color: var(--text-sub);
  margin-top: 3px;
}

.booth-card .booth-icon {
  font-size: 1.6rem;
}

/* ── Prize entry card ── */
.prize-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 16px 18px;
  margin-bottom: 12px;
}

.prize-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.prize-name {
  font-size: 0.95rem;
  font-weight: 700;
  flex: 1;
}

.prize-badge {
  background: var(--bg);
  color: var(--blue-dark);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}

.stepper-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--blue-dark);
  background: var(--white);
  color: var(--blue-dark);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.1s, color 0.1s;
  flex-shrink: 0;
}

.stepper-btn:hover {
  background: var(--blue-dark);
  color: var(--white);
}

.stepper-val {
  font-size: 1.4rem;
  font-weight: 800;
  min-width: 24px;
  text-align: center;
  color: var(--text);
}

.stepper-label {
  font-size: 0.8rem;
  color: var(--text-sub);
  flex: 1;
}

/* ── Status badge ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.status-badge.open {
  background: #eaf6ee;
  color: #1a7c3a;
}

.status-badge.open::before {
  background: #1a7c3a;
}

.status-badge.closed {
  background: #fdf0f0;
  color: var(--red);
}

.status-badge.closed::before {
  background: var(--red);
}

/* ── Admin action cards ── */
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.action-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 20px 16px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: box-shadow 0.15s, transform 0.1s;
}

.action-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-1px);
}

.action-card .icon {
  font-size: 2rem;
}

.action-card .label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--blue-dark);
}

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

.data-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-sub);
  border-bottom: 2px solid var(--border);
}

.data-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* ── Confirm bar ── */
.confirm-bar {
  position: sticky;
  bottom: 0;
  background: var(--white);
  padding: 14px 16px;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  width: 100%;
  max-width: var(--max-w);
}

/* ── Section heading ── */
.section-heading {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-sub);
  margin: 20px 0 10px;
}

/* ── Page heading ── */
.page-heading {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.page-subheading {
  font-size: 0.875rem;
  color: var(--text-sub);
  margin-bottom: 20px;
}

/* ── Balance bar ── */
.balance-bar {
  background: var(--blue-dark);
  color: var(--white);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.balance-bar .bal-label {
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.8;
}

.balance-bar .bal-val {
  font-size: 1.3rem;
  font-weight: 900;
}

/* ── Back link ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue-mid);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 16px;
}

.back-link:hover {
  text-decoration: underline;
}

/* ── Top nav bar ── */
#app-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  height: 44px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.app-nav-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.app-nav-logo {
  height: 28px;
  width: auto;
  display: block;
}

.app-nav-bug-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
}

.app-nav-bug-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

body.has-nav {
  padding-top: 44px;
}

/* ── Bug report modal ── */
#bug-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#bug-modal.open {
  display: flex;
}

.bug-modal-box {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,0.22);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bug-modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
}

.bug-modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bug-modal-field label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bug-modal-field input,
.bug-modal-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  resize: vertical;
}

.bug-modal-field input:focus,
.bug-modal-field textarea:focus {
  outline: none;
  border-color: var(--blue-mid);
}

.bug-modal-field input[readonly] {
  background: var(--bg);
  color: var(--text-sub);
}

.bug-modal-feedback {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
}

.bug-modal-feedback.success {
  background: #f0f8f0;
  color: #1a7c3a;
  border: 1px solid #b6dfc0;
}

.bug-modal-feedback.error {
  background: #fdf0f0;
  color: var(--red);
  border: 1px solid #f5c6c6;
}

.bug-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.bug-modal-actions button {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: none;
}

.bug-cancel-btn {
  background: var(--bg);
  color: var(--text-sub);
}

.bug-cancel-btn:hover {
  background: var(--border);
}

.bug-submit-btn {
  background: var(--blue-dark);
  color: var(--white);
}

.bug-submit-btn:hover {
  opacity: 0.9;
}

.bug-submit-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Nav actions group ── */
.app-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Info button ── */
.app-nav-info-btn {
  background: none;
  border: 1.5px solid var(--blue-dark);
  color: var(--blue-dark);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1;
}
.app-nav-info-btn:hover {
  background: var(--blue-dark);
  color: #fff;
}

/* ── Info modal ── */
#info-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1100;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 20px 16px 40px;
}
#info-modal.open {
  display: flex;
}
.info-modal-box {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 680px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.22);
  overflow: hidden;
}
.info-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.info-modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}
.info-modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-sub);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
  font-family: inherit;
}
.info-modal-close:hover {
  background: var(--bg);
  color: var(--text-main);
}
.info-modal-body {
  padding: 0 24px 32px;
}
.info-section {
  border-bottom: 1px solid var(--border);
  padding: 24px 0;
}
.info-section-last {
  border-bottom: none;
}
.info-role-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}
.info-badge-all  { background: #e3f2fd; color: #1565c0; }
.info-badge-guest { background: #e8f5e9; color: #2e7d32; }
.info-badge-booth { background: #fff3e0; color: #e65100; }
.info-badge-admin { background: #fce4ec; color: #880e4f; }
.info-section-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 10px;
}
.info-subheading {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 16px 0 6px;
}
.info-section p {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.6;
  margin: 0 0 8px;
}
.info-steps, .info-list {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.7;
  margin: 6px 0 0 0;
  padding-left: 22px;
}
.info-steps li, .info-list li {
  margin-bottom: 4px;
}
.info-note {
  font-size: 0.82rem !important;
  color: var(--text-sub) !important;
  background: var(--bg);
  border-left: 3px solid var(--border);
  padding: 8px 12px !important;
  border-radius: 0 6px 6px 0;
  margin-top: 12px !important;
}

/* ── Status banners ── */
.banner {
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-weight: 600;
  text-align: center;
}

.banner-error {
  background: var(--red);
  color: var(--white);
}

.banner-warning {
  background: #e65100;
  color: var(--white);
}

.banner-success {
  background: #2e7d32;
  color: var(--white);
}

.banner-info {
  background: var(--blue-dark);
  color: var(--white);
}

/* ── Scrollable table container ── */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Bug tracker ── */
.bug-filter-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.bug-filter-tab {
  padding: 6px 16px;
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-sub);
  font-family: inherit;
}
.bug-filter-tab.active {
  border-color: var(--blue-dark);
  background: var(--blue-dark);
  color: #fff;
}
.bug-count-line {
  font-size: 0.8rem;
  color: var(--text-sub);
  margin-bottom: 10px;
}
.bug-ticket {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.bug-ticket.bt-resolved {
  opacity: 0.65;
}
.bt-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.bt-id {
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--text-sub);
  min-width: 28px;
}
.bt-page {
  background: #e8f0fe;
  color: #1a56db;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}
.bt-user {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}
.bt-time {
  font-size: 0.78rem;
  color: var(--text-sub);
  margin-left: auto;
}
.bug-chip {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 10px;
}
.chip-open     { background: #fff3cd; color: #856404; }
.chip-resolved { background: #d1fae5; color: #065f46; }
.bt-desc {
  font-size: 0.92rem;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 14px;
  line-height: 1.55;
}
.bt-notes-wrap {
  margin-bottom: 12px;
}
.bt-notes-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.bt-notes-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.bt-notes-input {
  flex: 1;
  min-height: 54px;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: inherit;
  resize: vertical;
  color: var(--text);
  background: var(--bg);
}
.bt-notes-input:focus {
  outline: none;
  border-color: var(--blue-dark);
  background: #fff;
}
.bt-notes-status {
  font-size: 0.75rem;
  padding-top: 4px;
  min-width: 48px;
}
.ns-saving { color: var(--text-sub); }
.ns-saved  { color: #059669; }
.ns-error  { color: var(--red); }
.bug-analysis {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.87rem;
  margin-bottom: 12px;
  line-height: 1.5;
}
.ba-pending   { background: var(--bg); color: var(--text-sub); }
.ba-analyzing { background: #eff6ff; color: #1d4ed8; display: flex; align-items: center; gap: 8px; }
.ba-verified  { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.ba-unverified{ background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
.ba-error     { background: #fff1f2; border: 1px solid #fca5a5; color: #991b1b; }
.ba-status-label { font-weight: 700; margin-bottom: 8px; }
.ba-layman {
  font-size: 0.93rem;
  line-height: 1.55;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.04);
  border-radius: 6px;
}
.ba-playwright {
  margin: 8px 0;
  padding: 10px 12px;
  background: rgba(0,0,0,0.05);
  border-radius: 6px;
  border-left: 3px solid currentColor;
  opacity: 0.85;
}
.ba-verifying {
  display: flex;
  align-items: center;
  font-size: 0.87rem;
  opacity: 0.8;
}
.ba-playwright-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
  opacity: 0.7;
}
.ba-playwright-text {
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.ba-technical {
  margin-top: 4px;
}
.ba-technical-toggle {
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  color: inherit;
  opacity: 0.65;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
}
.ba-technical-toggle::-webkit-details-marker { display: none; }
.ba-technical-toggle::before { content: '▶'; font-size: 0.65rem; transition: transform 0.15s; }
details[open] .ba-technical-toggle::before { transform: rotate(90deg); }
.ba-technical-toggle:hover { opacity: 1; }
.ba-text { margin-bottom: 4px; font-size: 0.85rem; }
.ba-fix  { margin-top: 6px; font-size: 0.84rem; }
.ba-raw-toggle { margin-top: 8px; font-size: 0.78rem; color: inherit; opacity: 0.7; cursor: pointer; user-select: none; }
.ba-raw-toggle:hover { opacity: 1; }
.ba-raw-output { background: rgba(0,0,0,0.08); border-radius: 4px; padding: 10px; font-size: 0.75rem; white-space: pre-wrap; word-break: break-word; margin-top: 6px; max-height: 300px; overflow-y: auto; }
.bt-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.btn-sm {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-main);
  font-family: inherit;
}
.btn-sm:hover:not(:disabled) { background: var(--bg); }
.btn-sm:disabled { opacity: 0.4; cursor: not-allowed; }
.bt-fix-btn {
  border-color: var(--blue-dark);
  color: var(--blue-dark);
}
.bt-fix-btn:not(:disabled):hover {
  background: var(--blue-dark);
  color: #fff;
}
.bt-fix-result {
  margin-top: 12px;
  border: 1.5px solid #334155;
  border-radius: 8px;
  overflow: hidden;
}
.bt-fix-result-label {
  background: #1e293b;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 6px 14px;
}
.bt-fix-result .bt-fix-output {
  border-radius: 0;
  margin-top: 0;
  max-height: 360px;
}
.bt-fix-output {
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.78rem;
  line-height: 1.55;
  padding: 14px 16px;
  border-radius: 8px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
  margin-top: 8px;
}
.ba-stream-output {
  background: rgba(0,0,0,0.07);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 0.76rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow-y: auto;
  margin-top: 4px;
  color: inherit;
}
.bug-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #93c5fd;
  border-top-color: #1d4ed8;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Admin nav bugs link ── */
.app-nav-bugs-link {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-sub);
  text-decoration: none;
  padding: 5px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.app-nav-bugs-link:hover {
  background: var(--bg);
  color: var(--text-main);
}

/* ── Utility ── */
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-sub); }
.fw-700 { font-weight: 700; }

/* ── Desktop layout (≥ 700px) ── */
@media (min-width: 700px) {
  :root {
    --max-w: 960px;
    --radius: 14px;
  }

  /* Page shell */
  .page-wrap {
    padding: 12px 48px 80px;
  }

  /* Top nav */
  #app-nav {
    height: 54px;
    padding: 0 32px;
  }
  body.has-nav {
    padding-top: 54px;
  }
  .app-nav-logo {
    height: 32px;
  }
  .app-nav-bug-btn,
  .app-nav-info-btn,
  .app-nav-bugs-link {
    font-size: 0.85rem;
    padding: 6px 14px;
  }
  .app-nav-actions {
    gap: 10px;
  }

  /* Brand header */
  .brand-header {
    padding: 0 0 24px;
  }
  .brand-logo-img {
    height: 72px;
  }
  .brand-subtitle {
    font-size: 0.78rem;
    margin-top: 6px;
  }

  /* Cards */
  .card {
    padding: 32px 36px;
    margin-bottom: 20px;
  }
  .card-title {
    font-size: 1.1rem;
    margin-bottom: 20px;
  }

  /* Headings */
  .page-heading {
    font-size: 1.7rem;
  }
  .page-subheading {
    font-size: 0.95rem;
    margin-bottom: 24px;
  }
  .section-heading {
    margin: 28px 0 12px;
  }

  /* Buttons */
  .btn {
    padding: 15px;
    font-size: 1.05rem;
    border-radius: 11px;
  }
  .btn + .btn {
    margin-top: 12px;
  }

  /* Form fields */
  .field {
    margin-bottom: 18px;
  }
  .field input {
    padding: 13px 16px;
    font-size: 1.05rem;
  }

  /* Action grid — more columns on desktop */
  .action-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 20px;
  }
  .action-card {
    padding: 24px 18px;
  }
  .action-card .icon {
    font-size: 2.2rem;
  }
  .action-card .label {
    font-size: 0.9rem;
  }

  /* Ticket chips */
  .ticket-row {
    gap: 14px;
    margin-bottom: 24px;
  }
  .ticket-chip {
    padding: 16px 12px;
  }
  .ticket-chip .num {
    font-size: 1.7rem;
  }
  .ticket-chip .lbl {
    font-size: 0.7rem;
  }

  /* Balance bar */
  .balance-bar {
    padding: 18px 24px;
    margin-bottom: 20px;
  }
  .balance-bar .bal-val {
    font-size: 1.55rem;
  }

  /* Tables */
  .data-table th {
    padding: 10px 14px;
  }
  .data-table td {
    padding: 12px 14px;
  }

  /* Bug tracker */
  .bug-ticket {
    padding: 20px 26px;
    margin-bottom: 18px;
    border-radius: 12px;
  }
  .bt-header {
    gap: 8px;
    margin-bottom: 12px;
  }
  .bt-desc {
    font-size: 0.95rem;
    margin-bottom: 16px;
  }
  .bug-analysis {
    font-size: 0.9rem;
    padding: 12px 16px;
  }
  .bt-fix-output {
    font-size: 0.82rem;
    padding: 16px 20px;
    max-height: 520px;
  }
  .bug-filter-tabs {
    gap: 8px;
    margin-bottom: 18px;
  }
  .bug-filter-tab {
    padding: 7px 20px;
    font-size: 0.85rem;
  }

  /* Info modal */
  .info-modal-box {
    max-width: 800px;
    margin-top: 24px;
  }

  /* Confirm bar */
  .confirm-bar {
    padding: 18px 24px;
  }
}
