/* ---------------------------------------------------------------------------
   QR Menu - shared UI polish layer
   Loaded after Tailwind 2.2.19 in includes/header.php.
   Purely additive: no existing class is removed, so nothing can break.
   --------------------------------------------------------------------------- */

:root {
  --qm-primary: #f97316;
  --qm-primary-dark: #ea580c;
  --qm-primary-soft: #fff7ed;
  --qm-ring: rgba(249, 115, 22, 0.25);
  --qm-border: #e5e7eb;
  --qm-text: #111827;
  --qm-muted: #6b7280;
  --qm-radius: 12px;
}

body {
  color: var(--qm-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Cards ---------------------------------------------------------------- */
.bg-white.rounded-xl,
.bg-white.rounded-lg {
  border: 1px solid var(--qm-border);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.bg-white.rounded-xl:hover {
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.07);
}

/* --- Form controls ------------------------------------------------------- */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="search"],
select,
textarea {
  border-radius: 10px;
  border-color: var(--qm-border);
  background-color: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--qm-primary);
  box-shadow: 0 0 0 3px var(--qm-ring);
}

input:disabled,
select:disabled,
textarea:disabled {
  background-color: #f9fafb;
  color: var(--qm-muted);
  cursor: not-allowed;
}

label {
  font-size: 0.875rem;
}

/* --- Buttons ------------------------------------------------------------- */
button,
.btn,
a.bg-primary,
button.bg-primary {
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
}

button:active,
a.bg-primary:active {
  transform: translateY(1px);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--qm-primary);
  outline-offset: 2px;
}

.bg-primary {
  box-shadow: 0 1px 2px rgba(249, 115, 22, 0.3);
}

button[disabled],
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

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

thead th {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--qm-muted);
  background: #f9fafb;
}

tbody tr {
  transition: background-color 0.12s ease;
}

tbody tr:hover {
  background-color: var(--qm-primary-soft);
}

/* --- Status pills --------------------------------------------------------- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}

/* --- Scrollbars ----------------------------------------------------------- */
* {
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 8px;
}

*::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* --- Flash toast ---------------------------------------------------------- */
#flash-message {
  animation: qmSlideIn 0.25s ease-out;
  border-radius: var(--qm-radius);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.15);
}

@keyframes qmSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Image placeholders --------------------------------------------------- */
img {
  max-width: 100%;
}

.qm-logo {
  object-fit: cover;
  background: #f3f4f6;
}

/* --- Print ---------------------------------------------------------------- */
@media print {
  aside,
  nav,
  header,
  .no-print,
  button {
    display: none !important;
  }
}

/* --- Mobile tap targets --------------------------------------------------- */
@media (max-width: 640px) {
  button,
  a.bg-primary,
  select,
  input[type="submit"] {
    min-height: 42px;
  }
}

/* --- Reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
