:root {
  --background: #f5f7fc;
  --foreground: #1d2b48;
  --sidebar-background: #ffffff;
  --border: #e4e9f2;
  --muted: #64718a;
  --primary: #2454df;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  flex: 0 0 220px;
  padding: 24px 12px;
  background: var(--sidebar-background);
  border-right: 1px solid var(--border);
}

.sidebar-nav ul {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar-link {
  display: block;
  padding: 11px 14px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.sidebar-link:hover,
.sidebar-link:focus-visible {
  background: #eef3ff;
  color: var(--primary);
  outline: none;
}

.sidebar-link.active {
  background: #eef3ff;
  color: var(--primary);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgb(36 84 223 / 14%);
}

.conteudo {
  flex: 1;
  min-width: 0;
  padding: 32px 40px;
}

.conteudo h1 {
  margin: 0 0 10px;
  color: #17233c;
  font-size: 28px;
}

.conteudo p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.table-container {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table th {
  background: #f8faff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.data-table td {
  color: var(--foreground);
  font-size: 14px;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 22px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #2f6ef6 0%, #1d57d7 100%);
  color: #ffffff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 10px 20px rgb(47 110 246 / 22%);
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.button-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #255fe9 0%, #1a4dc2 100%);
  box-shadow: 0 14px 24px rgb(47 110 246 / 28%);
  transform: translateY(-1px);
}

.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.button-secondary:hover {
  background: #f8faff;
  color: var(--foreground);
}

.button-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border: 1px solid #fecdd3;
  border-radius: 6px;
  background: #fff1f2;
  color: #e11d48;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 150ms ease;
}

.button-danger:hover {
  background: #ffe4e6;
  border-color: #fda4af;
  color: #be123c;
}

.alert-success {
  padding: 12px 16px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  color: #065f46;
  margin-bottom: 20px;
  font-size: 14px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.form-page {
  max-width: 1200px;
}

.app-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.form-field label {
  color: #1f2b3d;
  font-size: 15px;
  font-weight: 700;
}

.form-field .form-field-error {
  margin: 0;
  color: #b42318;
  font-size: 13px;
  line-height: 1.4;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  background: #f7f9fc;
  color: var(--foreground);
  font: inherit;
  box-shadow: inset 0 1px 2px rgb(15 23 42 / 4%);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.form-field textarea {
  min-height: 100px;
  resize: vertical;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #7d8aa3;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: #2f6ef6;
  outline: none;
  box-shadow: 0 0 0 4px rgb(47 110 246 / 12%);
}

.form-field input[aria-invalid="true"] {
  border-color: #b42318;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

@media (max-width: 1024px) {
  .sidebar {
    flex-basis: 180px;
  }

  .conteudo {
    padding: 24px 20px;
  }

  .data-table th,
  .data-table td {
    padding: 12px 10px;
    white-space: normal;
    word-break: break-word;
  }

  .page-header {
    gap: 12px;
  }
}

@media (max-width: 640px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    flex-basis: auto;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

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

  .sidebar-link {
    padding: 9px 12px;
  }

  .conteudo {
    padding: 24px 18px;
  }

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