/* Controle de Aluguéis — estilos */

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8ef;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #0f766e;
  --primary-hover: #115e59;
  --primary-soft: #ccfbf1;
  --side: #0b1f2a;
  --side-text: #b6c6d1;
  --side-active: #134e4a;
  --ok: #15803d;      --ok-soft: #dcfce7;
  --warn: #b45309;    --warn-soft: #fef3c7;
  --danger: #b91c1c;  --danger-soft: #fee2e2;
  --info: #1d4ed8;    --info-soft: #dbeafe;
  --neutral-soft: #eef2f6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14.5px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2;
        stroke-linecap: round; stroke-linejoin: round; }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex: none; background: var(--side); color: var(--side-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 18px; color: #fff; font-weight: 700; font-size: 16px; }
.brand-logo { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #14b8a6, #0f766e);
              display: grid; place-items: center; }
.brand-logo .icon { color: #fff; }
.nav { padding: 6px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #5f7887; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; color: var(--side-text); font-weight: 500; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav a.active { background: var(--side-active); color: #fff; }
.side-foot { padding: 14px 16px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 13px; }
.side-foot .user { color: #fff; font-weight: 600; }
.side-foot a { color: var(--side-text); }
.side-foot form { display: inline; }
.side-foot button { background: none; border: 0; color: var(--side-text); padding: 0; cursor: pointer; font: inherit; }
.side-foot button:hover, .side-foot a:hover { color: #fff; text-decoration: underline; }

.main { flex: 1; min-width: 0; }
.topbar { display: none; }
.content { padding: 28px 32px 48px; max-width: 1280px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.breadcrumb a { color: var(--muted); }

/* ---------- cartões ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-body { padding: 18px 20px; }
.card + .card, .grid + .card, .card + .grid, .grid + .grid { margin-top: 20px; }
.grid { display: grid; gap: 20px; align-items: start; }
.grid > .card { margin-top: 0 !important; }
.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)); }
.span-2 { grid-column: span 2; }

.stat { padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; }
.stat-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.stat-icon.teal { background: var(--primary-soft); color: var(--primary); }
.stat-icon.green { background: var(--ok-soft); color: var(--ok); }
.stat-icon.amber { background: var(--warn-soft); color: var(--warn); }
.stat-icon.red { background: var(--danger-soft); color: var(--danger); }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat-value { font-size: 22px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* ---------- tabelas ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
            font-weight: 600; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafcfd; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--border); }
.row-link { color: var(--text); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty .icon { width: 32px; height: 32px; color: #cbd5e1; margin-bottom: 8px; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px;
         font-weight: 600; white-space: nowrap; background: var(--neutral-soft); color: #475569; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.ok, .badge.pago, .badge.alugado, .badge.ativo, .badge.concluida { background: var(--ok-soft); color: var(--ok); }
.badge.warn, .badge.pendente, .badge.andamento, .badge.media { background: var(--warn-soft); color: var(--warn); }
.badge.danger, .badge.atrasado, .badge.urgente, .badge.alta, .badge.rescindido { background: var(--danger-soft); color: var(--danger); }
.badge.info, .badge.disponivel, .badge.aberta { background: var(--info-soft); color: var(--info); }

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 600;
       font-size: 13.5px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
       line-height: 1.3; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #991b1b; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }

/* ---------- formulários ---------- */
.input, select.input, textarea.input {
  width: 100%; padding: 9px 11px; border: 1px solid #d3dbe4; border-radius: 8px; font: inherit; color: var(--text);
  background: #fff; transition: border-color .12s, box-shadow .12s;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 118, 110, .15); }
textarea.input { resize: vertical; }
.check { width: 17px; height: 17px; accent-color: var(--primary); }
.form-section { padding: 20px; border-bottom: 1px solid var(--border); }
.form-section:last-of-type { border-bottom: 0; }
.form-section h3 { margin-bottom: 14px; color: var(--primary); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.fields { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 16px; }
.field { grid-column: span 4; }
.field.w2 { grid-column: span 2; } .field.w3 { grid-column: span 3; } .field.w6 { grid-column: span 6; }
.field.w8 { grid-column: span 8; } .field.w12 { grid-column: span 12; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: #334155; }
.field.checkbox { display: flex; align-items: center; gap: 8px; padding-top: 22px; }
.field.checkbox label { margin: 0; font-weight: 500; }
.field .help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field .error { font-size: 12.5px; color: var(--danger); margin-top: 4px; }
.field.has-error .input { border-color: var(--danger); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 20px; background: var(--surface-2);
                border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.filters .input { width: auto; min-width: 150px; padding: 7px 10px; }
.filters .search { flex: 1; min-width: 200px; }
.tabs { display: flex; gap: 4px; padding: 10px 12px 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a { padding: 8px 12px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--primary); border-color: var(--primary); }

/* ---------- detalhes ---------- */
dl.data { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px 20px; margin: 0; }
dl.data dt { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
dl.data dd { margin: 3px 0 0; font-weight: 500; word-break: break-word; }
.pre { white-space: pre-line; }

.alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.alert { padding: 11px 14px; border-radius: 9px; border: 1px solid; font-weight: 500; }
.alert.success { background: var(--ok-soft); border-color: #bbf7d0; color: #14532d; }
.alert.error { background: var(--danger-soft); border-color: #fecaca; color: #7f1d1d; }
.alert.warning { background: var(--warn-soft); border-color: #fde68a; color: #78350f; }
.alert.info { background: var(--info-soft); border-color: #bfdbfe; color: #1e3a8a; }

.list-simple { list-style: none; margin: 0; padding: 0; }
.list-simple li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--border); }
.list-simple li:last-child { border-bottom: 0; }
.list-simple .title { font-weight: 600; }

/* gráfico de barras */
.chart { display: flex; align-items: flex-end; gap: 18px; height: 180px; padding: 10px 4px 0; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.chart-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.chart-bar { width: 38%; max-width: 26px; border-radius: 5px 5px 0 0; min-height: 2px; }
.chart-bar.prev { background: #cbd5e1; }
.chart-bar.rec { background: var(--primary); }
.chart-label { font-size: 12px; color: var(--muted); }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .l-prev::before { background: #cbd5e1; }
.legend .l-rec::before { background: var(--primary); }

.imovel-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.imovel-card { overflow: hidden; display: flex; flex-direction: column; color: var(--text); transition: transform .12s, box-shadow .12s; }
.imovel-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15, 23, 42, .08); }
.imovel-foto { height: 150px; background: linear-gradient(135deg, #e2e8f0, #f1f5f9); display: grid; place-items: center;
               background-size: cover; background-position: center; color: #94a3b8; }
.imovel-foto .icon { width: 40px; height: 40px; }
.imovel-info { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.imovel-meta { display: flex; gap: 12px; color: var(--muted); font-size: 12.5px; flex-wrap: wrap; }
.imovel-foot { display: flex; justify-content: space-between; align-items: center; padding: 11px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.foto-detalhe { width: 100%; max-height: 320px; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; display: block; }

.pagination { display: flex; gap: 6px; justify-content: center; align-items: center; padding: 14px; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
              background: radial-gradient(circle at 20% 10%, #134e4a 0, #0b1f2a 55%); }
.login-card { width: 100%; max-width: 380px; padding: 32px; }
.login-card .brand { color: var(--text); padding: 0 0 20px; }

/* ---------- responsivo ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  body.menu-aberto .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .4); }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--side); color: #fff; position: sticky; top: 0; z-index: 40; }
  .topbar button { background: none; border: 0; color: #fff; padding: 4px; cursor: pointer; }
  .content { padding: 20px 16px 40px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .field, .field.w2, .field.w3, .field.w6, .field.w8, .field.w12 { grid-column: auto; }
  .field.checkbox { padding-top: 0; }
  .table th, .table td { padding: 10px 12px; }
  .hide-mobile { display: none; }
}

@media print {
  .sidebar, .topbar, .page-head .actions, .no-print { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; }
  .card { box-shadow: none; }
}

.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; padding: 10px 12px;
              border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.check-grid label { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 0; }
.check-grid input { width: 16px; height: 16px; accent-color: var(--primary); }
