@charset "utf-8";

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

:root {
  --bg: #f1f0f6;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #81648b;
  --muted-2: #b494b8;
  --line: #eae5eb;
  --primary: #7d009f;
  --primary-600: rgb(64, 0, 83);
  --radius: 14px;
  --shadow: 0 10px 30px rgba(21, 2, 23, 0.06), 0 2px 6px rgba(19, 2, 23, 0.04);
  --sidebar-w: 240px;
  --topbar-h: 64px;
  --z-sidebar: 80;
  --z-backdrop: 70;
  --bp-lg: 1024px;
  --bp-sm: 640px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
    "Helvetica Neue", Arial;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "sidebar header"
    "sidebar main";
}

/* =======================
   Sidebar
======================= */
.sidebar {
  grid-area: sidebar;
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  z-index: var(--z-sidebar);
}

.brand {
  display: flex;
  align-items: center;
  font-weight: 800;
  font-size: 20px;
  color: #1f2937;
  padding: 6px 10px 14px;
  display: flex;
  flex-direction: row;
  gap: 10px;
}

.brand #logo {
  width: 45px;
  height: 50px;
}

.brand #data {
  display: flex;
  flex-direction: column;
  font-size: 14px;
}

.brand p {
  font-weight: 400;
  color: #555;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.nav-group {
  margin-top: 18px;
}

.nav-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 12px 10px 8px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #111827;
  padding: 10px 12px;
  border-radius: 10px;
}

.nav a:hover {
  background: #f1f5f9;
}

.nav a.active {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  font-weight: 600;
}

.sidebar .info {
  margin-top: auto;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.info .btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  text-align: center;
}

.info .btn:hover {
  background: var(--primary-600);
}

/* =======================
   Topbar
======================= */
.topbar {
  grid-area: header;
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  justify-items: end;
}

.menu-btn {
  /* botão hamburger (esconde no desktop) */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}

.menu-btn:focus {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.search {
  max-width: 560px;
  width: 100%;
  position: relative;
}

.search input {
  width: 100%;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f8fafc;
  padding: 0 14px 0 42px;
  outline: none;
}

.search .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--muted);
}

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid #fff;
}

/* =======================
   Main / Conteúdo
======================= */
.main {
  grid-area: main;
  padding: 28px;
  overflow-y: scroll;
}

.container {
  margin: 0 auto;
  max-width: 1200px;
}

.breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.page-title {
  font-size: 32px;
  font-weight: 800;
  margin: 8px 0 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: hidden;
}

.panel-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.panel-body {
  padding: 18px;
}

/* =======================
   Grid utilitária (12 colunas)
======================= */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.col-12 {
  grid-column: span 12;
}

.col-8 {
  grid-column: span 8;
}

.col-6 {
  grid-column: span 6;
}

.col-4 {
  grid-column: span 4;
}

.col-3 {
  grid-column: span 3;
}

/* =======================
   Tabela
======================= */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table thead th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
}

.table tbody td {
  border-bottom: 1px solid #eef2f7;
  padding: 12px 10px;
}

.table tr:hover td {
  background: #fafbff;
}

.pagination {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  color: var(--muted);
}

.pagination a {
  text-decoration: none;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 8px;
}

.pagination a:hover {
  background: #f1f5f9;
  color: var(--ink);
}

/* =======================
   Utilitários
======================= */
.text-muted {
  color: var(--muted);
}

.mt-12 {
  margin-top: 12px !important;
}

.profile #data {
  display: flex;
  flex-direction: column;
  font-size: 10px;
  align-items: flex-end;
  justify-content: center;
}

.profile #data .title {
  font-size: 12px;
}

.profile {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

/* =======================
   Responsivo / Menu Off-canvas
======================= */
/* checkbox invisível que controla o menu */
.nav-toggle {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.badge {
  padding: 5px 10px;
  color: white;
  text-align: center;
  border-radius: 20px;
}

.open {
  background-color: #00ad00;
}

.wait {
  background-color: #ff7b00;
}

.close {
  background-color: #df0000;
}

@media screen and (max-width: 1024px) {
  /* Layout colapsa: só header + main */
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-h) 1fr;
    grid-template-areas:
      "header"
      "main";
  }

  /* Sidebar vira off-canvas à esquerda */
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: none;
  }

  /* Botão hamburger visível */
  .menu-btn {
    display: inline-flex;
  }

  /* Quando o checkbox está marcado, abre o menu */
  .nav-toggle:checked ~ .sidebar {
    transform: translateX(0);
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.35);
  }

  /* Backdrop clicável (label) */
  .backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.35);
    z-index: var(--z-backdrop);
  }

  .nav-toggle:checked ~ .backdrop {
    display: block;
  }

  /* Grid reduz colunas */
  .grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .col-8 {
    grid-column: span 6;
  }

  .col-6 {
    grid-column: span 6;
  }

  .col-4 {
    grid-column: span 6;
  }

  .col-3 {
    grid-column: span 3;
  }
}

@media screen and (max-width: 640px) {
  .main {
    padding: 18px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .panel {
    overflow-x: scroll;
  }

  .col-12,
  .col-8,
  .col-6,
  .col-4,
  .col-3 {
    grid-column: span 12;
    overflow-x: scroll;
  }

  .profile #data {
    display: none;
  }
}

/* botões */
.btn {
  border: 0;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}
.btn-primary {
  background: #5b6cff;
  color: #fff;
}
.btn-danger {
  background: #ff5964;
  color: #fff;
}
.btn-light {
  background: #f3f5ff;
  color: #475;
}
.btn-warning {
  background: #de9000;
  color: rgb(255, 255, 255);
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.link {
  background: transparent;
  color: #5b6cff;
  border: 0;
  cursor: pointer;
  padding: 0 6px;
}