:root {
  --bg: #f7f6f2;
  --ink: #0b0b0b;
  --dark: #1c1c1b;
  --dark-2: #2c2c2a;
  --muted: #52514e;
  --muted-2: #898781;
  --border: rgba(11,11,11,0.10);
  --accent: #2a78d6;
  --accent-dark: #184f95;
  --card: #ffffff;
  --chip-bg: #eceae4;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

.wrap {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero {
  background: var(--dark);
  color: #fff;
  border-radius: 14px;
  padding: 28px 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.hero-text { display: flex; flex-direction: column; gap: 6px; min-width: 280px; }
.hero-bar { height: 4px; width: 40px; background: var(--accent); border-radius: 2px; margin-bottom: 8px; }
.hero h1 { margin: 0; font-size: clamp(20px, 3vw, 30px); font-weight: 800; letter-spacing: .2px; line-height: 1.15; }
.hero .sep { color: #898781; font-weight: 500; }
.hero p { margin: 0; font-size: 15px; color: #c3c2b7; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.btn-lg { padding: 12px 20px; font-size: 14.5px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: var(--chip-bg); color: var(--ink); }
.btn-ghost:hover { background: #ddd9cf; }
.btn-danger { background: #c23b3b; color: #fff; }
.btn-danger:hover { background: #a22f2f; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 12px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat-card .icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--chip-bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--dark);
}
.stat-card .value { font-size: 27px; font-weight: 800; line-height: 1; }
.stat-card .label { font-size: 12.5px; color: var(--muted); }

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.panel-header {
  background: var(--dark);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel-header h2 { margin: 0; font-size: 16px; font-weight: 700; flex-grow: 1; }
.badge {
  font-size: 12px;
  background: rgba(255,255,255,.14);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid #e1e0d9;
}
.search-box {
  flex: 1 1 240px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--muted);
}
.search-box input {
  border: none; background: transparent; outline: none;
  font-size: 14px; width: 100%; color: var(--ink);
}
select, input, textarea {
  font-family: inherit;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--bg);
  color: var(--ink);
}

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
th {
  text-align: left;
  padding: 10px 20px;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid #e1e0d9;
  white-space: nowrap;
}
td {
  padding: 10px 20px;
  border-bottom: 1px solid #e1e0d9;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fbfaf7; }
.muted { color: var(--muted-2); }
.col-actions { text-align: right; }
td.col-actions { text-align: right; }

.row-actions { display: inline-flex; gap: 6px; }
.icon-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
}
.icon-btn:hover { background: var(--chip-bg); color: var(--ink); }
.icon-btn.danger:hover { background: #fdeaea; color: #c23b3b; border-color: #f3c9c9; }

.status-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
}
.status-operacional { background: #e3f5e3; color: #0b6b0b; }
.status-em-contratacao { background: #fdf0cf; color: #8a5a00; }
.status-reserva { background: var(--chip-bg); color: #3f3e3b; }
.status-manutencao { background: #fde3e3; color: #9c1f1f; }

.empty-state { padding: 40px 20px; text-align: center; color: var(--muted-2); }

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(11,11,11,0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--card);
  border-radius: 14px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
}
.modal-sm { max-width: 420px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.modal-header h3 { margin: 0; font-size: 18px; font-weight: 800; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.form-grid label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.form-grid label.full { grid-column: 1 / -1; }
.form-grid textarea { resize: vertical; font-weight: 400; }

.form-error {
  margin-top: 14px;
  background: #fdeaea; color: #9c1f1f;
  border: 1px solid #f3c9c9;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
}

.modal-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 20px;
}
.confirm-text { font-size: 14px; color: var(--muted); margin: 0 0 8px; }

.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: var(--dark); color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  z-index: 100;
}

@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .hero { padding: 22px; }
}
