:root {
  --page-bg: #F9F8F5;
  --bg: #F2F2F2;
  --card: #FFFFFF;
  --text: #1E293B;
  --text-soft: #94A3B8;
  --accent: #CB0018;
  --accent-dark: #A20013;
  --border: #E2E8F0;
  --sidebar-bg: #34363A;
  --sidebar-text: rgba(255, 255, 255, 0.75);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--page-bg);
  color: var(--text);
  line-height: 1.55;
}

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

.sidebar {
  width: 294px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  padding: 1.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

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

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-weight: 500;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  font-size: 0.86rem;
  white-space: nowrap;
  border: 1px solid transparent;
}
.sidebar nav a .btn-icon { width: 17px; height: 17px; flex-shrink: 0; }
.sidebar nav a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.sidebar nav a.active {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border-color: rgba(255, 255, 255, 0.55);
}
.sidebar nav a.sub-nav-link {
  margin-left: 1.3rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.82rem;
}
.sidebar nav a.sub-nav-link .btn-icon { width: 15px; height: 15px; }

.sidebar-logout {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-weight: 500;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  font-size: 0.86rem;
  white-space: nowrap;
}
.sidebar-logout .btn-icon { width: 17px; height: 17px; flex-shrink: 0; }
.sidebar-logout:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.brand {
  display: block;
  text-decoration: none;
  padding: 0 0.35rem;
}
.brand-logo {
  width: 133px;
  max-width: 100%;
  height: auto;
  display: block;
}

.label {
  text-transform: uppercase;
  letter-spacing: 1.6px;
  font-size: 10.5px;
  color: var(--text-soft);
  font-weight: 700;
}

.container {
  flex: 1;
  min-width: 0;
  max-width: 1200px;
  padding: 2rem;
}

h1, h2, h3 { color: var(--text); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

th { color: var(--text-soft); font-weight: normal; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }

tr.subtotal td { font-weight: bold; background: var(--bg); }
tr.overall td { font-weight: bold; font-size: 1.1rem; color: var(--accent); }

.eval-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--accent);
  cursor: pointer;
}
.eval-toggle:hover { background: var(--border); }
.eval-toggle .btn-icon { transition: transform 0.2s ease; }
.artist-eval-card.open .eval-toggle .btn-icon { transform: rotate(180deg); }
.eval-details { margin-top: 0.25rem; }
.eval-metrics > div { text-align: center; font-weight: 700; }

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}
.highlight-tile {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem;
  border-radius: 14px;
  background: var(--page-bg);
  border: 1px solid var(--border);
}
.highlight-badge {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
}
.highlight-badge .btn-icon { width: 21px; height: 21px; }
.highlight-body { min-width: 0; }
.highlight-name { font-weight: 700; color: var(--text); margin-top: 0.1rem; line-height: 1.25; }
.highlight-value { font-weight: 800; color: var(--accent); font-size: 1.05rem; margin-top: 0.1rem; }
.highlight-tile.tone-gold .highlight-badge { background: #E0A82E; }
.highlight-tile.tone-gold .highlight-value { color: #B8860B; }
.highlight-tile.tone-danger { background: #FEF2F2; border-color: #FECACA; }
.highlight-tile.tone-danger .highlight-badge { background: #B91C1C; }
.highlight-tile.tone-danger .highlight-value { color: #B91C1C; }

.highlight-desvios {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-top: 1.25rem;
}
.highlight-desvios .label { display: inline-flex; align-items: center; gap: 0.35rem; }

.btn, .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 30px;
  padding: 0.6rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  border: none;
}
.btn-icon { flex-shrink: 0; }
.btn {
  background: var(--accent);
  color: white;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-secondary { background: var(--sidebar-bg); color: #fff; }
.btn-secondary:hover { background: #45484D; }

.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.78rem; }

.score-input {
  width: 4.5rem;
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
}

.field-input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}

.password-field { position: relative; }
.password-field input { padding-right: 2.4rem; }
.password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.2rem;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: var(--text-soft);
}
.password-toggle:hover { color: var(--text); }
.password-toggle .icon-eye-off { display: none; }
.password-toggle.is-showing .icon-eye { display: none; }
.password-toggle.is-showing .icon-eye-off { display: inline-flex; }

.artists-table th, .artists-table td {
  padding: 0.42rem 0.75rem;
  line-height: 1.3;
}
.btn-icon-only {
  padding: 0.5rem !important;
  border-radius: 50%;
  gap: 0 !important;
}

input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
  display: inline-flex;
  background: var(--bg);
  color: var(--text);
  border: none;
  border-radius: 30px;
  padding: 0.4rem 0.9rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  margin-right: 0.6rem;
}
input[type="file"]::file-selector-button:hover,
input[type="file"]::-webkit-file-upload-button:hover {
  background: var(--border);
}
.btn.btn-icon-only,
.btn-secondary.btn-icon-only { margin-right: 0.4rem; }

.photo-column {
  flex-shrink: 0;
  width: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.artist-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: block;
}
.photo-upload-form {
  margin-top: 0.75rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.photo-file-input {
  width: 100%;
  font-size: 0.7rem;
}
.photo-file-input::file-selector-button,
.photo-file-input::-webkit-file-upload-button {
  width: 100%;
  margin-right: 0;
  margin-bottom: 0.3rem;
  justify-content: center;
}

#feedback-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  resize: vertical;
}

.feedback-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.category-block { margin-bottom: 1.5rem; }
.category-block summary {
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  padding: 0.5rem 0;
}
.category-avg-pill {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  font-size: 0.9rem;
  margin-left: 0.5rem;
  color: var(--text-soft);
}

.subitem-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.subitem-toggle-label { display: flex; align-items: center; gap: 0.65rem; cursor: pointer; }
.subitem-score:disabled { opacity: 0.4; }

.toggle-switch { position: relative; display: inline-flex; flex-shrink: 0; width: 40px; height: 22px; }
.toggle-switch input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--text-soft);
  border-radius: 999px;
  transition: background-color 0.15s ease;
}
.toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
}
.toggle-switch input:checked ~ .toggle-track { background: var(--accent); }
.toggle-switch input:checked ~ .toggle-track .toggle-knob { transform: translateX(18px); }
.toggle-switch input:focus-visible ~ .toggle-track { outline: 2px solid var(--accent); outline-offset: 2px; }

.pill-list { list-style: none; padding: 0; margin: 0; }
.pill-list li {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
}
.pill-list li:last-child { border-bottom: none; }

.feedback-text {
  font-style: italic;
  font-size: 1.05rem;
  white-space: pre-wrap;
}

.status-tag {
  font-size: 0.85rem;
  color: var(--text-soft);
}

.empty-state {
  color: var(--text-soft);
  text-align: center;
  padding: 2rem 0;
}

a { color: var(--accent); text-decoration: none; font-weight: 600; }
