* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #1a1a2e;
  color: #eee;
  line-height: 1.6;
  padding: 0;
  min-height: 100vh;
}
.container { max-width: 900px; margin: 0 auto; padding: 16px; }
header {
  background: #16213e;
  padding: 14px 16px;
  border-bottom: 2px solid #0f3460;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
header h1 { font-size: 20px; color: #e94560; }
header nav a {
  color: #eee;
  text-decoration: none;
  margin-left: 12px;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 4px;
  background: #0f3460;
}
header nav a:hover { background: #e94560; }
h2 { margin: 18px 0 10px; color: #e94560; }
h3 { margin: 14px 0 8px; color: #fff; }
.card {
  background: #16213e;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
  border: 1px solid #0f3460;
}
.form-group { margin-bottom: 12px; }
.form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 14px;
  color: #ccc;
}
input[type=text], input[type=email], input[type=password],
input[type=number], input[type=tel], input[type=date],
select, textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #0f3460;
  border-radius: 4px;
  background: #1a1a2e;
  color: #eee;
  font-size: 16px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #e94560;
}
textarea { min-height: 140px; font-family: inherit; resize: vertical; }
.btn {
  display: inline-block;
  padding: 10px 18px;
  background: #e94560;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity .2s;
}
.btn:hover { opacity: .85; }
.btn-secondary { background: #0f3460; }
.btn-success { background: #1db954; }
.btn-danger { background: #c62828; }
.btn-sm { padding: 6px 10px; font-size: 13px; }
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background: #16213e;
  border-radius: 6px;
  overflow: hidden;
}
th, td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #0f3460;
  font-size: 14px;
}
th { background: #0f3460; color: #e94560; }
tr:hover td { background: #1f2a4a; }
.alert {
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 12px;
  font-size: 14px;
}
.alert-success { background: #1db95433; border: 1px solid #1db954; color: #4ade80; }
.alert-error { background: #c6282833; border: 1px solid #c62828; color: #f87171; }
.alert-info { background: #0f346033; border: 1px solid #0f3460; color: #93c5fd; }
.badge { padding: 3px 8px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-pago { background: #1db954; color: #fff; }
.badge-pendente { background: #f59e0b; color: #000; }
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.muted { color: #888; font-size: 13px; }
.total-box {
  background: #0f3460;
  padding: 14px;
  border-radius: 6px;
  text-align: center;
  margin-top: 10px;
}
.total-box .valor { font-size: 28px; color: #e94560; font-weight: bold; }
@media (max-width: 640px) {
  header { flex-direction: column; align-items: flex-start; }
  header nav { display: flex; flex-wrap: wrap; gap: 6px; margin-left: -6px; }
  header nav a { margin-left: 6px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  table { font-size: 13px; }
  th, td { padding: 8px 6px; }
}
/* =========================================================
   Painel de salas (novo) — adicionar ao final do style.css
   ========================================================= */

/* ----- Navegação de mês ----- */
.month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #16213e;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid #0f3460;
  gap: 8px;
}
.month-nav .arrow {
  background: #0f3460;
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  transition: background .15s;
}
.month-nav .arrow:hover { background: #e94560; color: #fff; }
.month-nav-center { text-align: center; flex: 1; min-width: 0; }
.month-nav-center .quick {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 2px;
}
.month-nav-center h2 {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: .3px;
}

/* ----- Picker alternativo (details/summary) ----- */
.month-picker {
  margin-bottom: 18px;
  font-size: 13px;
}
.month-picker summary {
  cursor: pointer;
  color: #94a3b8;
  padding: 4px 0;
  user-select: none;
  list-style: none;
}
.month-picker summary::-webkit-details-marker { display: none; }
.month-picker summary::before { content: '▸ '; display: inline-block; transition: transform .15s; }
.month-picker[open] summary::before { transform: rotate(90deg); }
.month-picker summary:hover { color: #e94560; }
.month-picker-form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}
.month-picker-form select {
  flex: 1;
  padding: 6px 8px;
  font-size: 14px;
}
.month-picker-form .btn { flex: 0 0 auto; }

/* ----- Sumário (3 cards de totais) ----- */
.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.stat {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 10px;
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
}
.stat.total::before    { background: #e94560; }
.stat.pago::before     { background: #1db954; }
.stat.pendente::before { background: #f39c12; }
.stat .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #94a3b8;
  margin-bottom: 4px;
  font-weight: 600;
}
.stat .valor {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}
.stat .sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

/* ----- Título de seção ----- */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 2px;
}
.section-title h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #cbd5e1;
  font-weight: 600;
  margin: 0;
}
.section-title .count {
  font-size: 12px;
  color: #94a3b8;
}

/* ----- Grid de salas ----- */
.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.room {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 12px;
  padding: 14px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform .1s, border-color .15s, box-shadow .15s;
  position: relative;
  overflow: hidden;
}
.room:hover {
  transform: translateY(-2px);
  border-color: #e94560;
  box-shadow: 0 4px 16px rgba(233, 69, 96, 0.15);
}
.room.pago      { border-left: 4px solid #1db954; }
.room.pendente  { border-left: 4px solid #f39c12; }
.room.sem-lanc  { border-left: 4px solid #64748b; }

.room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 6px;
}
.room-num {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #94a3b8;
  font-weight: 700;
}
.room-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.room-status.pago      { background: #1db95422; color: #1db954; }
.room-status.pendente  { background: #f39c1222; color: #f39c12; }
.room-status.sem-lanc  { background: #64748b22; color: #94a3b8; }

.room-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.3;
  word-wrap: break-word;
}
.room-value {
  font-size: 19px;
  font-weight: 800;
  color: #e94560;
  margin-bottom: 10px;
  line-height: 1.1;
}
.room-value-sub {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  margin-left: 4px;
}
.room-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 10px;
  border-top: 1px solid #0f3460;
  padding-top: 8px;
  gap: 6px;
  flex-wrap: wrap;
}
.room-actions {
  display: flex;
  gap: 6px;
}
.btn-room {
  flex: 1;
  padding: 7px 4px;
  background: #0f3460;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  transition: filter .15s;
}
.btn-room.primary { background: #e94560; }
.btn-room:hover   { filter: brightness(1.15); }

/* Área de ações no rodapé do painel */
.bottom-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

/* ========== MOBILE (≤ 640px) ========== */
@media (max-width: 640px) {
  .month-nav { padding: 8px 10px; }
  .month-nav-center h2 { font-size: 17px; }
  .month-nav .arrow { width: 34px; height: 34px; font-size: 18px; }

  .summary { grid-template-columns: 1fr; gap: 8px; }
  .stat { padding: 10px 12px; }
  .stat .valor { font-size: 19px; }

  .rooms-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .room { padding: 12px; }
  .room-name  { font-size: 14px; }
  .room-value { font-size: 17px; }
}
@media (max-width: 380px) {
  .rooms-grid { grid-template-columns: 1fr; }
}
/* =========================================================
   Header (topbar) — classes usadas em _header.php
   ========================================================= */

.topbar {
  background: #16213e;
  border-bottom: 2px solid #0f3460;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
}

.topbar .logo {
  color: #e94560;
  font-size: 17px;
  font-weight: 800;
  text-decoration: none;
  flex: 0 0 auto;
  white-space: nowrap;
}
.topbar .logo:hover { color: #fff; }

.topbar .nav {
  display: flex;
  gap: 4px;
  align-items: center;
  flex: 1 1 auto;
  justify-content: center;
}
.topbar .nav a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 6px;
  background: transparent;
  transition: all .15s;
  white-space: nowrap;
}
.topbar .nav a:hover  { background: #0f3460; color: #fff; }
.topbar .nav a.active { background: #e94560; color: #fff; }

.topbar .user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: #0f3460;
  border-radius: 20px;
  font-size: 13px;
  flex: 0 0 auto;
  white-space: nowrap;
}
.topbar .user-menu .user-name {
  color: #fff;
  font-weight: 600;
}
.topbar .user-menu .logout {
  color: #94a3b8;
  text-decoration: none;
  font-size: 12px;
  padding-left: 6px;
  border-left: 1px solid #1e3a5f;
}
.topbar .user-menu .logout:hover { color: #e94560; }

/* Container base para .main */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px;
}
main.container, .main {
  padding-top: 20px;
  padding-bottom: 20px;
}

/* Flash messages */
.flash {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 14px;
  font-size: 14px;
}
.flash-success { background: #1db95422; color: #1db954; border: 1px solid #1db954; }
.flash-error   { background: #c0392b22; color: #e74c3c; border: 1px solid #c0392b; }
.flash-info    { background: #0f346044; color: #6ea8ff; border: 1px solid #0f3460; }

/* Título da página */
.page-title {
  color: #e94560;
  font-size: 22px;
  margin: 0 0 16px;
}

/* ========== Header mobile ========== */
@media (max-width: 720px) {
  .topbar-inner {
    flex-wrap: wrap;
    padding: 8px 12px;
    gap: 8px;
  }
  .topbar .logo { font-size: 15px; }
  .topbar .user-menu {
    padding: 4px 10px;
    font-size: 12px;
    order: 2;
  }
  .topbar .nav {
    order: 3;
    width: 100%;
    flex: 1 1 100%;
    justify-content: space-around;
    gap: 2px;
    border-top: 1px solid #0f3460;
    padding-top: 6px;
  }
  .topbar .nav a {
    font-size: 13px;
    padding: 6px 8px;
    flex: 1;
    text-align: center;
  }
  .container { padding: 14px 10px; }
  .page-title { font-size: 18px; }
}
/* =========================================================
   Inquilinos / Histórico — complementos visuais
   ========================================================= */

/* Header da página com botão à direita */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.page-header .page-title { margin: 0; }

/* Variação de sumário com 2 colunas (inquilinos) */
.summary-2 {
  grid-template-columns: repeat(2, 1fr);
}

/* ----- Barra de filtros (histórico) ----- */
.filters-bar {
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.filter-group label {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  font-weight: 600;
}
.filter-group select {
  padding: 8px 10px;
  font-size: 14px;
}

/* Tabs de status */
.filter-tabs {
  display: flex;
  background: #0f3460;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.filter-tabs a {
  flex: 1;
  padding: 7px 6px;
  text-align: center;
  text-decoration: none;
  color: #94a3b8;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  transition: all .15s;
}
.filter-tabs a:hover  { color: #fff; }
.filter-tabs a.active { background: #e94560; color: #fff; }

/* Mobile */
@media (max-width: 640px) {
  .summary-2 { grid-template-columns: 1fr; }
  .filters-bar { grid-template-columns: 1fr; gap: 10px; padding: 10px; }
  .page-header { flex-direction: column; align-items: stretch; }
  .page-header .btn { width: auto; }
}
.white { color: #fff !important; }
.room-value { color: #fff !important; }
.room-status { font-size: 13px !important; padding: 6px 14px !important; letter-spacing: 0.8px !important; }
.room-num { font-size: 16px !important; letter-spacing: 0.5px !important; font-weight: 700 !important; color: #fff !important; }
.room-meta { font-size: 14px !important; }
.section-title h3 { font-size: 16px !important; } .section-title .count { font-size: 14px !important; }

/* Rodapé: fonte menor no mobile pra não quebrar linha */
.footer .container { font-size: 13px; text-align: center; }
@media (max-width: 720px) {
  .footer .container { font-size: 11px; padding: 8px 12px; }
}
@media (max-width: 380px) {
  .footer .container { font-size: 10px; }
}
