/*
 * app-ux.css — lightweight, additive UX layer (no build step, no vendor deps).
 * Loaded on every page via layouts/sections/styles.blade.php.
 * Added as part of the UI/UX + "record slow sometimes" improvements.
 */

/* ------------------------------------------------------------------ *
 * 1. Top loading bar — feedback during full-page reloads & AJAX.
 *    The admin reloads the whole page on most filter/status changes,
 *    so users currently get no signal that something is happening.
 * ------------------------------------------------------------------ */
#app-loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 2147483647;               /* above modals/offcanvas */
  background: linear-gradient(90deg, #696cff, #00cfe8);
  box-shadow: 0 0 8px rgba(105, 108, 255, 0.6);
  border-radius: 0 2px 2px 0;
  opacity: 0;
  transition: width 0.2s ease, opacity 0.3s ease;
  pointer-events: none;
}
#app-loading-bar.is-active {
  opacity: 1;
}

/* ------------------------------------------------------------------ *
 * 2. Toast — non-blocking feedback for failed / timed-out requests
 *    (replaces the silent hang / raw error page users see today).
 * ------------------------------------------------------------------ */
#app-toast-wrap {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2147483647;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(360px, calc(100vw - 2rem));
  pointer-events: none;
}
.app-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.5rem;
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.35;
  box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.18);
  background: #2f3349;
  border-left: 4px solid #8592a3;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.app-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.app-toast--error   { border-left-color: #ff3e1d; }
.app-toast--warning { border-left-color: #ffab00; }
.app-toast--success { border-left-color: #71dd37; }
.app-toast__close {
  margin-left: auto;
  cursor: pointer;
  opacity: 0.7;
  background: none;
  border: 0;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
}
.app-toast__close:hover { opacity: 1; }

/* ------------------------------------------------------------------ *
 * 3. Dense-table readability — these admin tables have 8-11 columns.
 *    Safe, additive: sticky header on scroll, keep action buttons on
 *    one line, subtle row hover. Applies to any .table inside
 *    .table-responsive (the theme default wrapper).
 * ------------------------------------------------------------------ */
.table-responsive { -webkit-overflow-scrolling: touch; }

.table-responsive > .table > thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bs-table-bg, #fff);
}

/* Keep action-button clusters from wrapping into a tall, cramped stack. */
.table td .btn-group,
.table td .action-buttons {
  white-space: nowrap;
}

.table-hover > tbody > tr:hover > * {
  --bs-table-accent-bg: rgba(105, 108, 255, 0.06);
}

/* Small helper for empty states in reports/tables. */
.app-empty-state {
  padding: 2.5rem 1rem;
  text-align: center;
  color: #a5a3ae;
}
.app-empty-state i { font-size: 2rem; display: block; margin-bottom: 0.5rem; opacity: 0.6; }
