
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg-body: #0f172a;
  --bg-elevated: #020617;
  --bg-card: #020617;
  --bg-card-soft: #020617;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --accent-strong: #0ea5e9;
  --danger: #ef4444;
  --success: #22c55e;
  --border-subtle: rgba(148, 163, 184, 0.25);
  --text-main: #e5e7eb;
  --text-muted: #94a3b8;
  --radius-xl: 18px;
  --radius-pill: 999px;
  --shadow-soft: 0 24px 60px rgba(15, 23, 42, 0.9);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}


.page-section {
  display: none;
}

.page-section.active {
  display: block;
}


html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background: radial-gradient(circle at 0% 0%, #0f172a 0, #020617 40%, #000 100%);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
}


.sidebar {
  background: radial-gradient(circle at top left, #0f172a, #020617 55%, #000 100%);
  border-right: 1px solid rgba(148, 163, 184, 0.18);
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: radial-gradient(circle at 30% 20%, #38bdf8, #0f172a 60%, #020617 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #f9fafb;
  box-shadow: 0 18px 40px rgba(56, 189, 248, 0.45);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.86rem;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.nav-link {
  background: transparent;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
}

.nav-link:hover {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(148, 163, 184, 0.5);
  color: #e5e7eb;
}

.nav-link.active {
  background: var(--accent-soft);
  border-color: rgba(56, 189, 248, 0.9);
  color: #e0f2fe;
}

.sidebar-footer {
  margin-top: auto;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  padding-top: 0.75rem;
}



.app-main {
  padding: 1.7rem 1.8rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}



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

.topbar h1 {
  margin: 0;
  font-size: 1.5rem;
}

.topbar p {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.topbar-summary {
  display: flex;
  gap: 0.5rem;
}



.chip {
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.45);
  font-size: 0.8rem;
  color: var(--text-main);
}

.chip-success {
  border-color: rgba(34, 197, 94, 0.8);
  background: rgba(22, 163, 74, 0.08);
}


main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card {
  background: radial-gradient(circle at 0 0, #1f2937 0, #020617 35%, #020617 100%);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.3rem 1.3rem;
  border: 1px solid rgba(148, 163, 184, 0.19);
  box-shadow: var(--shadow-soft);
}

.card-highlight {
  border: 1px solid rgba(56, 189, 248, 0.6);
  box-shadow: 0 30px 80px rgba(8, 47, 73, 0.8);
}

.card-header {
  margin-bottom: 1rem;
}

.card-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.card-header p {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Layout grid sections */

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr);
  gap: 1rem;
}

/* KPIs */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
}

.kpi {
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), #020617);
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.kpi-value {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.kpi-value-positive {
  color: #4ade80;
}

/* ===========================
   Forms
   =========================== */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.75rem 0.9rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field-full {
  grid-column: 1 / -1;
}

label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

input,
select {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  padding: 0.45rem 0.7rem;
  color: var(--text-main);
  font-size: 0.86rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease,
    background-color 0.18s ease;
}

input::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

input:focus,
select:focus {
  border-color: rgba(56, 189, 248, 0.95);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.5);
  background: rgba(15, 23, 42, 1);
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

/* ===========================
   Buttons
   =========================== */

button {
  font-family: inherit;
}

.btn-primary,
.btn-ghost {
  padding: 0.48rem 1.1rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #0b1120;
  box-shadow: 0 14px 35px rgba(56, 189, 248, 0.5);
}

.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 10px 25px rgba(56, 189, 248, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: rgba(148, 163, 184, 0.4);
}

.btn-ghost:hover {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
}

/* Small icon buttons in table */

.table-action-btn {
  padding: 0.28rem 0.7rem;
  font-size: 0.78rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.18s ease;
}

.table-action-btn:hover {
  border-color: rgba(56, 189, 248, 0.8);
  color: #e0f2fe;
}

/* ===========================
   Tables
   =========================== */

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-top: 0.4rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  min-width: 640px;
}

th,
td {
  padding: 0.5rem 0.55rem;
  border-bottom: 1px solid rgba(30, 41, 59, 0.85);
  text-align: left;
  white-space: nowrap;
}

th {
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: linear-gradient(
    to right,
    rgba(15, 23, 42, 0.95),
    rgba(15, 23, 42, 0.6)
  );
  position: sticky;
  top: 0;
  z-index: 1;
}

tr:hover td {
  background: rgba(15, 23, 42, 0.85);
}

.col-acoes {
  text-align: right;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.25rem;
}

/* Badges */

.badge {
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge.aberta {
  background: rgba(251, 191, 36, 0.1);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.6);
}

.badge.fechada {
  background: rgba(22, 163, 74, 0.12);
  color: #bbf7d0;
  border: 1px solid rgba(34, 197, 94, 0.85);
}

/* ===========================
   Modal
   =========================== */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: radial-gradient(circle at 0 0, #1f2937 0, #020617 35%, #020617 100%);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 1rem 1.1rem 1rem;
  width: min(520px, 100% - 2rem);
  box-shadow: var(--shadow-soft);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.modal-header h3 {
  margin: 0;
  font-size: 1rem;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  color: #e5e7eb;
}

.modal-content pre {
  background: rgba(15, 23, 42, 0.98);
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  font-size: 0.78rem;
  max-height: 260px;
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

/* ===========================
   Footer
   =========================== */

.app-footer {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  padding-top: 0.6rem;
}

/* ===========================
   Responsividade
   =========================== */

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 1.2rem;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sidebar-footer {
    display: none;
  }
}

@media (max-width: 720px) {
  .layout-grid {
    grid-template-columns: 1fr;
  }

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

  table {
    min-width: 540px;
  }
}

@media (max-width: 480px) {
  .app-main {
    padding-inline: 1rem;
  }
}
