/* ==========================================================================
   QR-Hotel · Design System "Hotel Boutique Claro"
   Fundo Areia #F7F5F0 · Cards #FFFFFF · Azul Marinho #162A45 · Dourado #B08A48
   Personalizavel via --brand e --accent (white-label por hotel)
   ========================================================================== */

:root {
  --bg: #F7F5F0;
  --surface: #FFFFFF;
  --surface-alt: #EFECE4;
  --surface-hover: #F3EFE7;
  --border: #E2DCD0;
  --border-strong: #CEC5B4;

  --brand: #162A45;
  --brand-hover: #0F1F35;
  --brand-soft: rgba(22, 42, 69, 0.08);
  --brand-ring: rgba(22, 42, 69, 0.24);
  --brand-contrast: #FFFFFF;

  --accent: #B08A48;
  --accent-hover: #967338;
  --accent-soft: rgba(176, 138, 72, 0.14);
  --accent-contrast: #FFFFFF;

  --text: #18202C;
  --text-muted: #536073;
  --text-subtle: #6E7B8C;

  --ok: #1F7A52;
  --ok-bg: #E8F5EE;
  --ok-border: #B7DEC9;

  --warn: #B5721A;
  --warn-bg: #FDF3E3;
  --warn-border: #EED09D;

  --danger: #B93838;
  --danger-bg: #FCEAEA;
  --danger-border: #ECC0C0;

  --info: #1E5B88;
  --info-bg: #EAF3FA;
  --info-border: #BDD8EC;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(24, 32, 44, 0.06);
  --shadow: 0 4px 14px rgba(24, 32, 44, 0.07);
  --shadow-lg: 0 14px 36px rgba(24, 32, 44, 0.14);

  --font-sans: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  color: var(--text);
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  overflow-x: clip;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

h1, h2, h3, h4 {
  margin: 0;
  color: var(--text);
  font-weight: 700;
  line-height: 1.25;
}

p {
  margin: 0;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

input, select, textarea {
  font-size: 16px; /* Previne zoom automatico no iOS */
}

button {
  cursor: pointer;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Marca / Logo -------------------------------------------------------- */
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brand);
  color: var(--brand-contrast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  border: 1px solid rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.brand-mark.has-logo {
  background: #FFFFFF;
  border: 1px solid var(--border);
  padding: 3px;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Botoes -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.2;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--surface-alt);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-contrast);
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.btn-accent:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-ok {
  background: var(--ok);
  border-color: var(--ok);
  color: #FFFFFF;
}

.btn-ok:hover:not(:disabled) {
  background: #176140;
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #FFFFFF;
}

.btn-danger:hover:not(:disabled) {
  background: #962A2A;
}

.btn-danger-outline {
  background: var(--surface);
  border-color: var(--danger-border);
  color: var(--danger);
}

.btn-danger-outline:hover:not(:disabled) {
  background: var(--danger-bg);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-alt);
  color: var(--text);
}

.btn-sm {
  min-height: 44px;
  padding: 0 12px;
  font-size: 0.875rem;
}

.btn-block {
  width: 100%;
}

/* --- Inputs & Forms ------------------------------------------------------ */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.textarea {
  min-height: 84px;
  resize: vertical;
}

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

.field-hint {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

/* --- Cards & Badges ------------------------------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-neutral {
  background: var(--surface-alt);
  color: var(--text-muted);
  border-color: var(--border);
}

.badge-brand {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: rgba(22, 42, 69, 0.18);
}

.badge-accent {
  background: var(--accent-soft);
  color: #7D5E29;
  border-color: rgba(176, 138, 72, 0.35);
}

.badge-ok {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: var(--ok-border);
}

.badge-warn {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: var(--warn-border);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-border);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info);
  border-color: var(--info-border);
}

/* --- Banners & Empty states ---------------------------------------------- */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 0.875rem;
  color: var(--text);
}

.alert-ok { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok); }
.alert-warn { background: var(--warn-bg); border-color: var(--warn-border); color: #8A540E; }
.alert-danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.alert-info { background: var(--info-bg); border-color: var(--info-border); color: var(--info); }

.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.empty-state h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.875rem;
}

/* --- Toasts -------------------------------------------------------------- */
.qh-toast-stack {
  position: fixed;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom, 16px));
  z-index: 9500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.qh-toast {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: var(--brand-contrast);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 600;
  border-left: 4px solid var(--accent);
  animation: qhSlideIn 0.2s ease;
}

.qh-toast.ok { background: var(--ok); color: #FFFFFF; border-left-color: #B7DEC9; }
.qh-toast.warn { background: #8A540E; color: #FFFFFF; border-left-color: #F4CE86; }
.qh-toast.danger { background: var(--danger); color: #FFFFFF; border-left-color: #F3C4C4; }

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

/* --- Modal Padrao Acessivel ---------------------------------------------- */
.qh-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(16, 24, 36, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.qh-modal {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  max-height: min(90dvh, 760px);
  overflow: hidden;
}

.qh-modal.lg { max-width: 680px; }
.qh-modal.xl { max-width: 920px; }

.qh-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.qh-modal-header h2, .qh-modal-header h3 {
  font-size: 1.0625rem;
}

.qh-modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.qh-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* --- Tela de Login da Equipe --------------------------------------------- */
.login-shell {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: radial-gradient(circle at top right, var(--accent-soft), transparent 45%), var(--bg);
}

.login-card {
  width: 100%;
  max-width: 410px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.login-head .brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  font-size: 1.35rem;
}

.login-head h1 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
}

.login-head p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.hidden {
  display: none !important;
}

/* --- Print helpers ------------------------------------------------------- */
@media print {
  body { background: #FFFFFF !important; }
  .no-print { display: none !important; }
}
