/* Painel do hotel — layout, navegação e componentes específicos */
:root {
  --hotel-sidebar-w: 252px;
  --hotel-ink: #0d2028;
}

/* Login */
.auth-hint {
  margin-top: 1.25rem; color: var(--muted); font-size: .82rem; text-align: center;
}

/* Pagamentos PIX */
.pix-modal { display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.pix-modal__qr { padding: .8rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.pix-modal__qr img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.pix-modal__amount { font-size: 1.7rem; color: var(--brand-dark); letter-spacing: -.02em; }
.pix-modal__info { min-width: 0; }
.pix-details__head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.pix-code {
  display: block; max-height: 150px; overflow: auto; margin-top: .4rem; padding: .7rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft);
  font-size: .74rem; line-height: 1.5; overflow-wrap: anywhere; user-select: all;
}
.table-actions { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }

/* Alvos de toque acessíveis */
.hotel-app .btn, .auth-shell .btn, .hotel-app .btn--sm { min-height: 44px; }
.hotel-app .icon-btn, .modal-overlay .icon-btn { width: 44px; height: 44px; }
.sidebar__link, .topbar__user, .checkbox-card, .tab, .cal-day { min-height: 44px; }

/* Estrutura */
.hotel-app { min-height: 100vh; }
.hotel-main {
  margin-left: var(--hotel-sidebar-w); min-height: 100vh;
  display: flex; flex-direction: column; min-width: 0;
}

/* Sidebar */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 60;
  width: var(--hotel-sidebar-w); display: flex; flex-direction: column;
  background: var(--hotel-ink); color: #dce8ec;
  box-shadow: 4px 0 24px rgba(5, 18, 24, .18);
}
.sidebar__brand {
  display: flex; align-items: center; gap: .7rem; min-height: var(--header-h);
  padding: .8rem 1rem; border-bottom: 1px solid rgba(255, 255, 255, .09);
}
.sidebar__mark {
  flex: none; width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center; background: var(--brand); color: #fff;
  font-weight: 800; font-size: .9rem; letter-spacing: -.04em;
}
.sidebar__brand-text { display: flex; flex-direction: column; min-width: 0; }
.sidebar__brand-text strong { font-size: .92rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__brand-text small { color: #8fa9b2; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__close { display: none; margin-left: auto; background: transparent; border-color: rgba(255, 255, 255, .2); color: #fff; }
.sidebar__nav { flex: 1; overflow-y: auto; padding: 1rem .6rem; }
.sidebar__caption {
  display: block; padding: .9rem .7rem .4rem; color: #72909b;
  font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em;
}
.sidebar__link {
  display: flex; align-items: center; gap: .8rem; width: 100%; min-height: 46px;
  padding: .6rem .75rem; margin-bottom: .2rem; border: 0; border-radius: 10px;
  background: transparent; color: #c9dbe1; text-align: left; font-size: .9rem; font-weight: 600;
}
.sidebar__link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar__link.is-active { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(15, 118, 110, .28); }
.sidebar__icon { width: 22px; text-align: center; font-size: 1.05rem; flex: none; }
.sidebar__foot {
  padding: 1rem; border-top: 1px solid rgba(255, 255, 255, .09);
  display: flex; flex-direction: column; gap: .35rem; font-size: .76rem; color: #7f9aa4;
}
.sidebar__external { color: #bcd4db; font-weight: 600; overflow-wrap: anywhere; }
.sidebar__external:hover { color: #fff; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(7, 20, 26, .55); }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 30; min-height: var(--header-h);
  display: flex; align-items: center; gap: .8rem; padding: .6rem 1.5rem;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar__title { display: flex; flex-direction: column; min-width: 0; }
.topbar__title strong { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__title small { font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__spacer { flex: 1; }
.topbar__tenant { font-size: .72rem; font-weight: 700; color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, #fff); padding: .25rem .55rem; border-radius: 999px; }
.topbar__user {
  display: flex; align-items: center; gap: .6rem; font-size: .84rem; font-weight: 600;
  padding: .3rem .4rem; border-radius: 999px;
}
.topbar__avatar {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-soft); color: var(--brand-dark); font-weight: 800;
}
.topbar__user-text { display: flex; flex-direction: column; line-height: 1.2; }
.topbar__user-text small { font-weight: 500; font-size: .7rem; }
.topbar__menu { display: none; }

/* Conteúdo */
.content { flex: 1; width: 100%; max-width: 1500px; margin: 0 auto; padding: 1.5rem; }
.view-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; margin-bottom: 1.2rem;
}
.view-head h1 { margin-bottom: .2rem; }
.view-head p { margin-bottom: 0; }
.view-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.toolbar {
  display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
  padding: .8rem 1rem; margin-bottom: 1rem;
}
.toolbar input[type='search'], .toolbar select, .toolbar input[type='date'] { width: auto; flex: 1 1 170px; min-width: 150px; }
.toolbar__count { margin-left: auto; color: var(--muted); font-size: .78rem; white-space: nowrap; }
.section-title {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  margin: 1.6rem 0 .8rem;
}
.section-title h2 { font-size: 1.1rem; margin: 0; }
.stack { display: flex; flex-direction: column; gap: 1rem; }

/* KPIs e gráfico */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; }
.kpi--accent { border-left: 3px solid var(--accent); }
.kpi--brand { border-left: 3px solid var(--brand); }
.kpi__icon { float: right; font-size: 1.1rem; opacity: .5; }
.kpi__value--money { font-size: 1.35rem; }
.chart-card .card__body { padding-bottom: 1rem; }
.chart {
  display: flex; align-items: flex-end; gap: 1rem; height: 220px;
  padding: 1rem .25rem 0; border-bottom: 1px solid var(--line);
}
.chart__col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.chart__bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.chart__bar {
  width: min(64px, 78%); min-height: 4px; border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--brand), var(--brand-dark));
  transition: filter .15s ease;
}
.chart__col:hover .chart__bar { filter: brightness(1.12); }
.chart__bar--h1 { height: 6%; } .chart__bar--h2 { height: 14%; }
.chart__bar--h3 { height: 24%; } .chart__bar--h4 { height: 34%; }
.chart__bar--h5 { height: 45%; } .chart__bar--h6 { height: 57%; }
.chart__bar--h7 { height: 69%; } .chart__bar--h8 { height: 80%; }
.chart__bar--h9 { height: 91%; } .chart__bar--h10 { height: 100%; }
.chart__label { padding-top: .55rem; font-size: .7rem; color: var(--muted); text-align: center; white-space: nowrap; }
.chart__value { font-size: .68rem; font-weight: 700; color: var(--text); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: .9rem; font-size: .76rem; color: var(--muted); }
.chart-legend__dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--brand); margin-right: .35rem; }

/* Tabelas responsivas (cards no mobile) */
.data-table { font-size: .85rem; }
.data-table th { white-space: nowrap; }
.data-table td { vertical-align: middle; }
.data-table .cell-main { display: flex; flex-direction: column; gap: .1rem; }
.data-table .cell-main strong { font-size: .88rem; color: var(--text); }
.data-table .cell-main small { font-size: .74rem; }
.data-table .cell-actions { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.data-table .actions { display: table-cell; }
.entity-mark {
  display: inline-grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--surface-soft); color: var(--brand-dark); font-size: .78rem; font-weight: 800;
}
.entity-line { display: flex; align-items: center; gap: .6rem; }
.entity-line > span:last-child { min-width: 0; }
.permission-chip, .chip {
  padding: .12rem .45rem; border-radius: 999px; background: var(--surface-soft);
  color: var(--muted); font-size: .68rem; font-weight: 700;
}

/* Abas */
.tabs {
  display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.tabs--scroll { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: .2rem; }
.tab {
  display: inline-flex; align-items: center; min-height: 44px; padding: .5rem .9rem;
  border: 0; border-bottom: 2px solid transparent; background: transparent;
  color: var(--muted); font-weight: 650; font-size: .86rem; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }

/* Grade de acomodações */
.room-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.room-card { display: flex; flex-direction: column; height: 100%; }
.room-card__media {
  height: 150px; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, var(--surface-soft), color-mix(in srgb, var(--brand) 12%, var(--surface)));
  color: var(--brand-dark); font-size: 2.6rem; font-weight: 800;
}
.room-card__media img { width: 100%; height: 100%; object-fit: cover; }
.room-card__body { flex: 1; display: flex; flex-direction: column; gap: .5rem; }
.room-card__title { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.room-card__title h3 { margin: 0; font-size: 1rem; }
.room-card__price { font-weight: 800; color: var(--brand-dark); white-space: nowrap; }
.room-card__desc { color: var(--muted); font-size: .82rem; margin: 0; min-height: 2.4em; }
.room-card__meta { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .75rem; color: var(--muted); }
.room-card__amenities { display: flex; flex-wrap: wrap; gap: .3rem; }
.room-card__foot { display: flex; gap: .4rem; flex-wrap: wrap; padding: .8rem 1.1rem; border-top: 1px solid var(--line); }

/* Galeria de fotos */
.gallery-editor { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.gallery-item { position: relative; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-soft); }
.gallery-item img { width: 100%; height: 96px; object-fit: cover; }
.gallery-item__bar { display: flex; align-items: center; justify-content: space-between; gap: .2rem; padding: .3rem; }
.gallery-item__bar .btn { min-height: 34px; padding: .25rem .45rem; }
.upload-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
  min-height: 96px; padding: .8rem; border: 1.5px dashed var(--line); border-radius: var(--radius-sm);
  background: var(--surface-soft); text-align: center; color: var(--muted); font-size: .78rem;
}
.upload-box input[type='file'] { max-width: 100%; font-size: .74rem; }
.upload-preview { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-top: .5rem; }
.upload-preview img { width: 92px; height: 66px; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.upload-preview__placeholder { display: grid; place-items: center; width: 92px; height: 66px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 1.3rem; }

/* Calendário */
.calendar-month { min-width: 130px; text-align: center; text-transform: capitalize; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calendar__weekday {
  padding: .4rem .2rem; text-align: center; font-size: .68rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-soft); border-radius: 6px;
}
.cal-day {
  display: flex; flex-direction: column; align-items: flex-start; gap: .15rem;
  min-height: 78px; padding: .35rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); text-align: left; overflow: hidden;
}
.cal-day:hover { border-color: var(--brand); }
.cal-day--blank { background: transparent; border-color: transparent; pointer-events: none; }
.cal-day--today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day--busy { background: color-mix(in srgb, var(--brand) 10%, #fff); }
.cal-day--full { background: color-mix(in srgb, var(--danger) 12%, #fff); }
.cal-day--blocked { background: var(--surface-soft); }
.cal-day__num { font-size: .82rem; font-weight: 750; }
.cal-day__hint { font-size: .65rem; color: var(--muted); line-height: 1.2; }
.cal-day__hint--busy { color: var(--brand-dark); font-weight: 700; }
.cal-day__hint--blocked { color: var(--danger); font-weight: 700; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; font-size: .78rem; color: var(--muted); }
.cal-legend__item { display: inline-flex; align-items: center; gap: .35rem; }
.cal-legend__dot { width: 12px; height: 12px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); }
.cal-legend__dot--busy { background: color-mix(in srgb, var(--brand) 18%, #fff); }
.cal-legend__dot--full { background: color-mix(in srgb, var(--danger) 18%, #fff); }
.cal-legend__dot--blocked { background: var(--surface-soft); }
.cal-legend__dot--today { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }

/* Formulários em modal */
.form-section { margin-bottom: 1.4rem; }
.form-section:last-child { margin-bottom: 0; }
.form-section__title {
  display: flex; align-items: center; gap: .5rem; margin-bottom: .8rem;
  font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-dark);
}
.form-section__title::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.form-note { color: var(--muted); font-size: .78rem; margin: -.2rem 0 .8rem; }
.checkbox-card {
  display: flex; align-items: center; gap: .6rem; min-height: 44px;
  padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  cursor: pointer; font-size: .84rem;
}
.checkbox-card:hover { background: var(--surface-soft); }
.checkbox-card input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.checkbox-card small { display: block; font-size: .7rem; color: var(--muted); }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.2rem; flex-wrap: wrap; }
.color-field { display: flex; align-items: center; gap: .5rem; }
.color-field input[type='color'] { width: 46px; height: 44px; min-height: 44px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; }
.color-field input[type='text'] { flex: 1; min-width: 0; }
.chip-input { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }

/* Atividade e detalhes */
.event-list { display: flex; flex-direction: column; }
.event { display: flex; gap: .9rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.event:last-child { border-bottom: 0; }
.event__icon {
  flex: none; width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; background: var(--surface-soft); color: var(--brand-dark); font-size: 1rem;
}
.event__body { min-width: 0; }
.event__title { font-weight: 650; font-size: .87rem; }
.event__meta { color: var(--muted); font-size: .75rem; margin-top: .15rem; }
.event__desc { color: var(--muted); font-size: .82rem; margin-top: .25rem; overflow-wrap: anywhere; }
.action-badge {
  display: inline-block; padding: .1rem .4rem; border-radius: 5px;
  background: var(--surface-soft); color: var(--muted); font-size: .66rem; font-weight: 700; letter-spacing: .03em;
}
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem 1rem; margin: 0 0 1rem; }
.detail-list__item { min-width: 0; }
.detail-list__item dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.detail-list__item dd { margin: .1rem 0 0; font-size: .9rem; overflow-wrap: anywhere; }
.rich-text { overflow-wrap: anywhere; }
.rich-text p { margin-bottom: .6rem; }

/* Utilitários */
.loading-box { padding: .5rem 1.2rem 1.2rem; }
.error-box {
  padding: 1rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid #fecaca;
  background: #fef2f2; color: #991b1b; font-size: .86rem;
}
.text-danger { color: var(--danger); }
.nowrap { white-space: nowrap; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; }
.pagination__info { color: var(--muted); font-size: .78rem; }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .room-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar__close { display: inline-flex; }
  .hotel-main { margin-left: 0; }
  .topbar__menu { display: inline-flex; }
}
@media (max-width: 760px) {
  .content { padding: 1rem; }
  .topbar { padding: .6rem 1rem; }
  .topbar__user-text, .topbar__tenant { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Tabelas viram cartões */
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
    margin-bottom: .8rem; padding: .5rem .9rem; box-shadow: var(--shadow-sm);
  }
  .data-table td {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    border-bottom: 1px solid var(--line); padding: .55rem 0; white-space: normal; text-align: right;
  }
  .data-table td:last-child { border-bottom: 0; }
  .data-table td::before {
    content: attr(data-label); flex: none; color: var(--muted);
    font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; text-align: left;
  }
  .data-table td.actions, .data-table td.cell-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; }
  .data-table .cell-actions { justify-content: flex-end; }
  .room-grid { grid-template-columns: 1fr; }
  .permission-grid, .detail-list, .gallery-editor { grid-template-columns: 1fr 1fr; }
  .pix-modal { grid-template-columns: 1fr; }
  .pix-modal__qr { max-width: 260px; margin: 0 auto; }
  .chart { height: 180px; gap: .4rem; }
  .chart__label { font-size: .62rem; writing-mode: vertical-rl; transform: rotate(180deg); }
  .calendar { gap: 2px; }
  .cal-day { min-height: 64px; padding: .25rem; }
  .cal-day__hint { font-size: .58rem; }
  .toolbar input[type='search'], .toolbar select, .toolbar input[type='date'] { flex-basis: 100%; }
}
@media (max-width: 460px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .gallery-editor { grid-template-columns: 1fr; }
  .form-actions .btn { flex: 1; }
  .view-actions { width: 100%; }
  .view-actions .btn { flex: 1; }
}
