﻿:root {
  --teal-dark: #0d4f4f;
  --teal: #1eab8b;
  --teal-light: #e8f7f3;
  --bg: #f3f5f7;
  --card-shadow: 0 4px 14px rgba(0,0,0,.12);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Segoe UI, Tahoma, sans-serif;
  background: var(--bg);
  color: #1f2937;
}
.layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, #0a3f42, #0d4f4f);
  color: #fff;
  padding: 1rem;
}
.sidebar .brand { font-size: 1.4rem; font-weight: 700; margin-bottom: 1.5rem; }
.nav-btn {
  display: block; width: 100%; margin-bottom: .75rem; padding: .9rem;
  border: 2px solid transparent; border-radius: 6px; text-align: center;
  text-decoration: none; color: #fff; background: #3d6d70; font-weight: 600;
}
.nav-btn.active { background: var(--teal); border-color: #fff; }
.filter-block { margin-top: 1.25rem; }
.filter-block label { display: block; font-size: .85rem; margin-bottom: .35rem; opacity: .9; }
.filter-block select, .filter-block input {
  width: 100%; padding: .45rem; border-radius: 4px; border: none; margin-bottom: .75rem;
}
.main { padding: 0; }
.header {
  background: var(--teal); color: #fff; padding: .6rem 1.25rem;
  display: flex; justify-content: space-between; align-items: center;
}
.header .logo-text { font-weight: 700; font-size: 1.1rem; }
.header-actions {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.ultima-atualizacao { font-size: .9rem; }
.btn-refresh {
  background: #fff; color: var(--teal-dark); border: none; border-radius: 4px;
  padding: .4rem .85rem; font-weight: 600; cursor: pointer; font-size: .85rem;
}
.btn-refresh:hover:not(:disabled) { background: var(--teal-light); }
.btn-refresh:disabled { opacity: .7; cursor: wait; }
.btn-refresh.is-refreshing,
.btn-refresh.htmx-request {
  opacity: .85;
  cursor: wait;
}
.btn-refresh .refresh-loading { display: none; }
.btn-refresh.is-refreshing .refresh-label,
.btn-refresh.htmx-request .refresh-label { display: none; }
.btn-refresh.is-refreshing .refresh-loading,
.btn-refresh.htmx-request .refresh-loading { display: inline; }
.alert {
  padding: .75rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: .9rem;
}
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.content { padding: 1rem 1.25rem 4rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1rem; }
.kpi-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) {
  .kpi-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
.kpi-card {
  background: var(--teal); color: #fff; border-radius: 8px; padding: 1rem 1.25rem;
  box-shadow: var(--card-shadow); text-align: center;
}
.kpi-card .label { font-size: .95rem; opacity: .95; }
.kpi-card .value { font-size: 2.4rem; font-weight: 700; line-height: 1.1; }
.table-wrap {
  background: #fff; border-radius: 8px; overflow: auto; box-shadow: var(--card-shadow);
}
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead th {
  background: var(--teal); color: #fff; padding: .65rem .75rem; text-align: left;
  position: sticky; top: 0;
}
tbody td { padding: .55rem .75rem; border-bottom: 1px solid #e5e7eb; }
tbody tr:nth-child(even) { background: #f9fafb; }
.status-icon {
  display: inline-flex; width: 22px; height: 22px; border-radius: 50%;
  align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: .8rem;
}
.status-ok { background: #16a34a; }
.status-warning { background: #f59e0b; }
.status-error { background: #dc2626; }
.footer {
  position: fixed; left: 260px; right: 0; bottom: 0;
  background: var(--teal); color: #fff; text-align: center; padding: .55rem;
  font-size: .9rem;
}
.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator { opacity: 1; }

/* Auth layout */
.auth-body { background: linear-gradient(135deg, #0a3f42, #1eab8b); min-height: 100vh; }
.auth-layout {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.auth-card {
  background: #fff; border-radius: 10px; box-shadow: var(--card-shadow);
  padding: 2rem; width: 100%; max-width: 440px;
}
.auth-card-wide {
  max-width: 550px;
  padding: 2.5rem;
}
.auth-brand { font-size: 1.5rem; font-weight: 700; color: var(--teal-dark); margin-bottom: 1rem; text-align: center; }
.auth-title { font-size: 1.25rem; margin: 0 0 1rem; color: #111827; }
.auth-subtitle { font-size: .9rem; color: #6b7280; margin: 0 0 1rem; }
.auth-section-title { font-size: 1rem; margin: 1.5rem 0 .75rem; color: var(--teal-dark); }
.auth-form label { display: block; font-size: .85rem; margin-bottom: .35rem; color: #374151; }
.auth-form input, .auth-form select {
  width: 100%; padding: .55rem .65rem; margin-bottom: .85rem;
  border: 1px solid #d1d5db; border-radius: 6px; font-size: .95rem;
}
.btn-primary {
  width: 100%; padding: .65rem; background: var(--teal); color: #fff; border: none;
  border-radius: 6px; font-weight: 600; cursor: pointer; font-size: .95rem;
}
.btn-primary:hover { background: #179a7d; }
.btn-secondary {
  padding: .45rem .75rem; background: #e5e7eb; color: #1f2937; border: none;
  border-radius: 6px; cursor: pointer; font-size: .85rem;
}
.btn-sm { padding: .3rem .5rem; font-size: .8rem; }
.auth-footer-link { text-align: center; margin-top: 1rem; font-size: .9rem; }
.auth-footer-link a { color: var(--teal-dark); }
.password-rules { font-size: .8rem; color: #6b7280; margin: 0 0 1rem 1.1rem; padding: 0; }
.user-info { font-size: .85rem; }
.btn-link-header { color: #fff; text-decoration: underline; font-size: .85rem; }
.admin-table-wrap {
  overflow: auto;
  max-width: 100%;
  margin-top: .5rem;
  min-height: 8.8rem;
  padding-bottom: 0.85rem;
  scrollbar-gutter: stable;
}
.admin-table { width: 100%; font-size: .85rem; border-collapse: collapse; }
.admin-table th, .admin-table td { border: 1px solid #e5e7eb; padding: .45rem .5rem; text-align: left; }
.admin-table thead th {
  background: #111827;
  color: #fff;
  font-weight: 600;
}
.admin-actions { min-width: 220px; }
.inline-reset-form { display: flex; gap: .35rem; margin-top: .35rem; flex-wrap: wrap; }
.inline-reset-form input { flex: 1; min-width: 120px; margin: 0; padding: .3rem .45rem; font-size: .8rem; }
.text-muted { color: #9ca3af; font-size: .85rem; }
