/* Design system — Reservas Hotel Platform */
:root {
  --brand: #0f766e;
  --brand-dark: #134e4a;
  --accent: #f59e0b;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #f0f4f5;
  --text: #16252b;
  --muted: #64748b;
  --line: #dfe6e9;
  --success: #15803d;
  --warning: #b45309;
  --danger: #dc2626;
  --info: #0369a1;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(15, 23, 42, .07);
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, .06);
  --header-h: 68px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.modal-open { overflow: hidden; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.2; letter-spacing: -.02em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }
small { color: var(--muted); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
ul { margin: 0 0 1rem; padding-left: 1.2rem; }

.container { width: min(1180px, 100% - 2rem); margin-inline: auto; }
.container--narrow { width: min(760px, 100% - 2rem); }
.section { padding: 3.5rem 0; }
.section--soft { background: var(--surface-soft); }
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.text-sm { font-size: .86rem; }
.text-lg { font-size: 1.1rem; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: .4rem; }
.mt-2 { margin-top: .8rem; }
.mt-3 { margin-top: 1.2rem; }
.mb-2 { margin-bottom: .8rem; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .4rem; }
.gap-2 { gap: .8rem; }
.gap-3 { gap: 1.2rem; }
.grid { display: grid; gap: 1rem; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 42px; padding: .6rem 1.05rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: var(--surface-soft); color: var(--text);
  font-weight: 600; font-size: .92rem; line-height: 1.1; text-decoration: none;
  transition: transform .12s ease, filter .12s ease, background .12s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--brand); color: #fff; }
.btn--dark { background: var(--brand-dark); color: #fff; }
.btn--accent { background: var(--accent); color: #261a00; }
.btn--whatsapp { background: #25d366; color: #052e16; }
.btn--ghost { background: transparent; border-color: var(--line); }
.btn--soft { background: var(--surface-soft); }
.btn--danger { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.btn--danger-solid { background: var(--danger); color: #fff; }
.btn--sm { min-height: 34px; padding: .4rem .7rem; font-size: .82rem; }
.btn--lg { min-height: 50px; padding: .8rem 1.4rem; font-size: 1rem; }
.btn--block { width: 100%; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); font-size: 1.25rem; line-height: 1;
}
.icon-btn:hover { background: var(--surface-soft); }

/* Cartões */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.card--pad { padding: 1.25rem; }
.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--line);
}
.card__body { padding: 1.25rem; }
.card__foot { padding: 1rem 1.25rem; border-top: 1px solid var(--line); }

/* Formulários */
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .9rem; min-width: 0; }
.field > label, .field-label { font-size: .82rem; font-weight: 650; color: #334155; }
.field-hint { font-size: .76rem; color: var(--muted); }
input[type='text'], input[type='email'], input[type='password'], input[type='tel'],
input[type='number'], input[type='date'], input[type='time'], select, textarea {
  width: 100%; min-height: 42px; padding: .6rem .75rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; outline: none; transition: border-color .12s, box-shadow .12s;
}
textarea { min-height: 100px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent);
}
input[aria-invalid='true'], select[aria-invalid='true'] { border-color: var(--danger); }
.checkbox { display: inline-flex; align-items: center; gap: .5rem; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--brand); }
.input-group { display: flex; gap: .5rem; align-items: stretch; }
.input-group input, .input-group select { flex: 1; min-width: 0; }
.field-row { display: grid; gap: .8rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Tabelas */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: .7rem .8rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-soft); }
tbody tr:hover { background: color-mix(in srgb, var(--brand) 4%, transparent); }
td.actions { display: flex; gap: .35rem; }

/* Badges e estados */
.badge {
  display: inline-block; padding: .2rem .55rem; border-radius: 999px;
  font-size: .72rem; font-weight: 700; background: var(--surface-soft); color: var(--muted);
}
.badge--success { background: #dcfce7; color: var(--success); }
.badge--warning { background: #fef3c7; color: var(--warning); }
.badge--danger { background: #fee2e2; color: var(--danger); }
.badge--info { background: #e0f2fe; color: var(--info); }
.empty-state { padding: 2.5rem 1rem; text-align: center; color: var(--muted); }
.empty-state__icon { font-size: 2rem; opacity: .4; }
.skeleton {
  height: 64px; border-radius: var(--radius-sm); margin-bottom: .7rem;
  background: linear-gradient(90deg, #eef2f3 25%, #e2e8f0 50%, #eef2f3 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* Modal e toasts */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 1rem; background: rgba(12, 24, 30, .55); backdrop-filter: blur(3px);
}
.modal {
  width: min(620px, 100%); max-height: min(88vh, 900px); overflow: auto;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
}
.modal--sm { width: min(420px, 100%); }
.modal--lg { width: min(900px, 100%); }
.modal__head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal__head h3 { margin: 0; }
.modal__body { padding: 1.25rem; }
.modal__actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.2rem; }
.modal-text { color: var(--muted); }
.toast-stack { position: fixed; right: 1rem; bottom: 1rem; z-index: 1200; display: flex; flex-direction: column; gap: .5rem; width: min(360px, calc(100vw - 2rem)); }
.toast {
  padding: .8rem 1rem; border-radius: var(--radius-sm); background: #14262d; color: #fff;
  box-shadow: var(--shadow); font-size: .88rem; animation: toast-in .2s ease;
}
.toast--success { background: #166534; }
.toast--error { background: #b91c1c; }
.toast--warning { background: #92400e; }
.toast--out { opacity: 0; transform: translateX(1rem); transition: .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(.5rem); } }

/* KPIs */
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem; box-shadow: var(--shadow-sm);
}
.kpi__label { font-size: .77rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.kpi__value { font-size: 1.6rem; font-weight: 750; margin-top: .2rem; letter-spacing: -.03em; }
.kpi__hint { font-size: .76rem; color: var(--muted); }

/* Login */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: linear-gradient(145deg, var(--brand-dark), #0b1620 70%); }
.auth-card { width: min(440px, 100%); background: var(--surface); border-radius: 20px; padding: 2rem; box-shadow: 0 30px 70px rgba(0,0,0,.28); }
.auth-brand { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.5rem; }
.auth-brand__mark { width: 44px; height: 44px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; }
.auth-error { margin-top: .8rem; color: var(--danger); font-size: .86rem; min-height: 1.2em; }

/* Acessibilidade e responsividade */
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); 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; }
@media (max-width: 820px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  h1 { font-size: 1.5rem; }
  .grid--2, .grid--3, .grid--4, .field-row { grid-template-columns: 1fr; }
  .section { padding: 2.5rem 0; }
  .btn { min-height: 44px; }
  .toast-stack { left: 1rem; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
