:root {
  color-scheme: light;
  --bg: #f5f6fa;
  --surface: #ffffff;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #f97316;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ===============================
   BASE
================================*/
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

html,
body {
  height: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===============================
   TOPBAR
================================*/
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.05rem;
}

.topbar__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar__link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-weight: 500;
  color: var(--muted);
  transition: all 0.2s ease;
}

.topbar__link:hover {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
}

/* ===============================
   FOOTER
================================*/
.footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
  background: var(--surface);
}

/* ===============================
   CONTENT
================================*/
main {
  flex: 1;
}

.content {
  padding: 2rem clamp(1.5rem, 4vw, 3rem);
  min-height: calc(100vh - 120px);
}

/* ===============================
   SECTIONS / CARDS / TABLES
================================*/
.section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.section__header h1 {
  margin: 0;
  font-size: 1.8rem;
}

.section__header p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.section__actions {
  display: flex;
  gap: 0.75rem;
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.btn--primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn--secondary {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.2);
  color: var(--primary);
}

/* Grids */
.grid {
  display: grid;
  gap: 1rem;
}

.grid--stats {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.grid--two {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid rgba(15, 23, 42, 0.05);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.05);
}

.card--stat {
  position: relative;
  overflow: hidden;
}

.card--stat::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), transparent 60%);
  pointer-events: none;
}

.card__label {
  font-size: 0.9rem;
  color: var(--muted);
}

.card__value {
  font-size: 2rem;
  margin-top: 0.35rem;
}

.card__trend {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.card__trend--up {
  color: #16a34a;
}

.card__trend--down {
  color: #dc2626;
}

.card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card__header h2 {
  margin: 0;
  font-size: 1.3rem;
}

.card__action {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

/* Tabelas */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.9rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table th {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.table__muted {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.table__actions {
  display: flex;
  gap: 0.5rem;
}

.table__badge--ok {
  color: #16a34a;
  font-weight: 600;
}

.table__badge--alert {
  color: #dc2626;
  font-weight: 600;
}

/* Status */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status--confirmed {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.status--pending {
  background: rgba(249, 115, 22, 0.12);
  color: #c2410c;
}

.status--viewed {
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
}

/* ===============================
   AUTH (login etc.)
================================*/
.auth {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  align-items: center;
}

.auth__card {
  background: var(--surface);
  padding: 2.5rem;
  border-radius: 1.25rem;
  box-shadow: 0 30px 50px rgba(15, 23, 42, 0.1);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.auth__title {
  margin: 0;
  font-size: 1.75rem;
}

.auth__subtitle {
  margin: 0.75rem 0 1.5rem;
  color: var(--muted);
  line-height: 1.5;
}

.auth__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth__label {
  font-weight: 600;
}

.auth__input {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: #f9fafb;
  font-size: 1rem;
}

.auth__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

.auth__forgot {
  font-size: 0.9rem;
  color: var(--primary);
  text-decoration: none;
}

.auth__highlight {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: var(--muted);
}

.auth__highlight h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text);
}

.auth__highlight ul {
  list-style: disc;
  padding-left: 1.2rem;
  margin: 0;
  line-height: 1.6;
}

/* ===============================
   RESPONSIVIDADE
================================*/
@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    gap: 1rem;
  }

  .topbar__brand {
    width: 100%;
    justify-content: space-between;
  }

  .topbar__nav {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
    order: 3;
  }

  .topbar__link {
    flex: 1 1 auto;
    text-align: center;
    padding: 0.6rem;
  }

  .section__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth__actions {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }
}

/* ===============================
   AJUSTES DE MARGENS
================================*/
h1.h3 {
  margin-left: 0 !important;
}

p.text-muted {
  margin-left: 0 !important;
}