* {
  box-sizing: border-box;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --bg: #f5f7fb;
  --sidebar: #061b3a;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --white: #ffffff;
  --green: #16a34a;
  --orange: #f59e0b;
  --red: #dc2626;
  --purple: #7c3aed;
  --cyan: #0891b2;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.sidebar {
  width: 270px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: linear-gradient(180deg, #061b3a, #082657);
  color: white;
  padding: 22px;
  display: flex;
  flex-direction: column;
  z-index: 20;
  overflow-y: auto;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-icon {
  font-size: 34px;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 18px;
}

.brand span {
  font-size: 14px;
  color: #bfdbfe;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item {
  border: none;
  background: transparent;
  color: #e5efff;
  text-align: left;
  padding: 13px 15px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 15px;
  transition: 0.2s;
}

.menu-item:hover,
.menu-item.active {
  background: var(--primary);
  color: white;
}

.sidebar-footer {
  margin-top: 28px;
  background: rgba(255, 255, 255, 0.08);
  padding: 14px;
  border-radius: 18px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.sidebar-footer strong,
.sidebar-footer span {
  display: block;
}

.sidebar-footer span {
  font-size: 13px;
  color: #bfdbfe;
}

.user-avatar {
  background: #e2e8f0;
  color: #0f172a;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.main {
  margin-left: 270px;
  padding: 28px;
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 28px;
}

.topbar h1 {
  margin: 0;
  font-size: 30px;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification-button {
  position: relative;
  border: 1px solid var(--border);
  background: white;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 18px;
}

.notification-button span {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--red);
  color: white;
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  padding: 2px 6px;
  font-size: 12px;
  display: grid;
  place-items: center;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.card strong {
  display: block;
  font-size: 26px;
  margin-top: 4px;
}

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 22px;
}

.blue {
  background: #dbeafe;
}

.green {
  background: #dcfce7;
}

.orange {
  background: #fef3c7;
}

.purple {
  background: #ede9fe;
}

.cyan {
  background: #cffafe;
}

.red {
  background: #fee2e2;
}

.gray {
  background: #f1f5f9;
}

.grid-dashboard {
  display: grid;
  grid-template-columns: 1.35fr 0.8fr;
  gap: 20px;
}

.margin-top {
  margin-top: 20px;
}

.panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel-header h2 {
  margin: 0;
  font-size: 20px;
}

.panel-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 220px 180px;
  gap: 12px;
  margin-bottom: 18px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
  background: white;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
  vertical-align: middle;
}

th {
  color: #475569;
  font-size: 13px;
  background: #f8fafc;
}

tr:hover td {
  background: #f8fafc;
}

.person {
  display: flex;
  gap: 10px;
  align-items: center;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--primary-dark);
  display: grid;
  place-items: center;
  font-weight: 700;
  flex-shrink: 0;
}

.person strong,
.person span {
  display: block;
}

.person span {
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.green {
  color: #166534;
  background: #dcfce7;
}

.badge.orange {
  color: #92400e;
  background: #fef3c7;
}

.badge.red {
  color: #991b1b;
  background: #fee2e2;
}

.badge.blue {
  color: #1e40af;
  background: #dbeafe;
}

.badge.gray {
  color: #475569;
  background: #f1f5f9;
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 700;
  transition: 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

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

.btn-light {
  background: #eef2f7;
  color: #0f172a;
}

.btn-light:hover {
  background: #e2e8f0;
}

.btn-danger {
  background: #fee2e2;
  color: #991b1b;
}

.action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.action-buttons button {
  border: none;
  border-radius: 10px;
  padding: 8px 9px;
  cursor: pointer;
  background: #eef2f7;
}

.action-buttons button:hover {
  background: #dbeafe;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.quick-actions button {
  border: 1px solid var(--border);
  background: #f8fafc;
  padding: 18px;
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  font-weight: 700;
}

.quick-actions button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.lista-resumo {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.resumo-item {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.resumo-item strong,
.resumo-item span {
  display: block;
}

.resumo-item span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.30);
}

.modal-content.large {
  max-width: 980px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.modal-header h2 {
  margin: 0;
}

.modal-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.close {
  border: none;
  background: #eef2f7;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 22px;
  cursor: pointer;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

.notice {
  background: #eff6ff;
  border-left: 4px solid var(--primary);
  padding: 14px;
  border-radius: 14px;
  color: #1e3a8a;
  line-height: 1.5;
  margin-top: 18px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #0f172a;
  color: white;
  padding: 14px 18px;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
  z-index: 999;
  max-width: 360px;
}

.toast.hidden {
  display: none;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px;
  background: #f8fafc;
  border: 1px dashed var(--border);
  border-radius: 16px;
}

@media (max-width: 1300px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-dashboard {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
  }

  .main {
    margin-left: 0;
  }

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

  .topbar-actions {
    flex-wrap: wrap;
  }

  .toolbar,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-field-full {
    grid-column: auto;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }
}