/* Trupe HQ — base stylesheet. Brand tokens lifted from www.trupe.pt (see design prototype). */

:root {
  --bg: #000000;
  --surface: #121212;
  --surface-2: #1c1c1c;
  --border: #2b2b2b;
  --text: #ffffff;
  --text-muted: #cccccc;
  --text-faint: #8a8a8a;
  --accent: #6bb895;
  --accent-ink: #ffffff;
  --mint: #74d7ad;
  --rose: #d63638;
  --font-display: 'Barlow Semi Condensed', system-ui, sans-serif;
  --font-body: 'Roboto', system-ui, sans-serif;
  --sidebar-w: 236px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--mint); }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; margin: 0; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 6px; }

/* ---------- Layout ---------- */

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

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; align-items: center; gap: 9px; padding: 6px 8px 24px 8px; }
.brand img { width: 25px; height: 25px; object-fit: contain; flex-shrink: 0; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: 0.2px; line-height: 1; }
.brand-tag { font-family: var(--font-body); font-weight: 500; font-size: 8px; letter-spacing: 1.4px; color: var(--text-faint); line-height: 1; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.navitem {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px;
  color: var(--text-muted); font-size: 14px; font-weight: 500; cursor: pointer; border: none; background: none;
  width: 100%; text-align: left;
}
.navitem svg { flex-shrink: 0; }
.navitem:hover { color: var(--text); }
.navitem.active { background: var(--surface-2); color: var(--text); }
.nav-badge { margin-left: auto; background: var(--rose); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 100px; padding: 1px 6px; line-height: 1.5; }

/* ---------- Sidebar artist switcher ---------- */

.artist-switcher { padding-bottom: 16px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.artist-switcher-label { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-faint); padding: 0 8px; margin-bottom: 6px; font-weight: 600; }
.artist-list { display: flex; flex-direction: column; gap: 2px; max-height: 190px; overflow-y: auto; margin-bottom: 6px; }
.artist-row { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 8px; color: var(--text-muted); font-size: 12.5px; font-weight: 500; text-decoration: none; }
.artist-row:hover { background: var(--surface-2); color: var(--text); }
.artist-row.active { background: var(--surface-2); color: var(--text); }
.artist-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artist-avatar {
  width: 22px; height: 22px; border-radius: 100px; background: var(--surface-2); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display);
  font-size: 9px; font-weight: 700; overflow: hidden;
}
.artist-avatar img { width: 100%; height: 100%; object-fit: cover; }
.artist-add-toggle { background: none; border: none; color: var(--accent); font-size: 12px; font-weight: 600; cursor: pointer; padding: 6px 8px; text-align: left; width: 100%; }
.artist-add-toggle:hover { color: var(--mint); }
.sidebar-add-form { display: none; flex-direction: column; gap: 6px; padding: 0 8px; margin-top: 4px; }
.sidebar-add-form.open { display: flex; }
.sidebar-add-form input { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; color: var(--text); font-size: 12.5px; }

.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px 8px; margin-top: 10px; border-top: 1px solid var(--border); }
.avatar { width: 30px; height: 30px; border-radius: 100px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 12px; font-weight: 600; flex-shrink: 0; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 68px; flex-shrink: 0; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 28px; gap: 16px;
}
.topbar-title { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.topbar-sub { font-size: 13px; color: var(--text-faint); }

.content { flex: 1; padding: 26px 28px 90px 28px; display: flex; flex-direction: column; gap: 22px; }

/* ---------- Components ---------- */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-title { font-family: var(--font-display); font-weight: 600; font-size: 15px; }

.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.stat-label { font-size: 12px; color: var(--text-faint); font-weight: 500; }
.stat-value { font-family: var(--font-display); font-size: 24px; font-weight: 700; }

.row-card { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.row-card:hover { border-color: var(--accent); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 100px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.chip-confirmado { background: rgba(116,215,173,0.15); color: var(--mint); }
.chip-advance { background: rgba(107,184,149,0.16); color: var(--accent); }
.chip-pendente { background: rgba(214,54,56,0.16); color: var(--rose); }
.chip-neutral { background: var(--surface-2); color: var(--text-muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink); border: none; border-radius: 10px;
  padding: 0 20px; height: 38px; font-family: var(--font-body); font-weight: 600; font-size: 13.5px;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--mint); color: var(--accent-ink); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); background: var(--surface); }
.btn-danger { background: var(--rose); color: #fff; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 12.5px; border-radius: 8px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11.5px; color: var(--text-faint); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }
.field input, .field select, .field textarea {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; color: var(--text); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }

.badge-dot { width: 7px; height: 7px; border-radius: 100px; flex-shrink: 0; }
.dot-mint { background: var(--mint); }
.dot-accent { background: var(--accent); }
.dot-rose { background: var(--rose); }
.dot-faint { background: var(--text-faint); }

.progress { height: 5px; border-radius: 100px; background: var(--surface-2); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); }

.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-faint); }
.breadcrumb a { color: var(--text-faint); }
.breadcrumb a:hover { color: var(--text); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab { padding: 10px 16px; font-size: 13.5px; font-weight: 500; color: var(--text-faint); border-bottom: 2px solid transparent; text-decoration: none; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

.toggle { position: relative; width: 38px; height: 22px; border-radius: 100px; background: var(--surface-2); border: 1px solid var(--border); flex-shrink: 0; cursor: pointer; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 100px; background: var(--text-faint); transition: 0.15s; }
.toggle.on { background: rgba(107,184,149,0.25); border-color: var(--accent); }
.toggle.on::after { background: var(--accent); left: 18px; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-faint); }

.flash { background: rgba(214,54,56,0.14); border: 1px solid rgba(214,54,56,0.4); color: var(--rose); padding: 10px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px; }

.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Mobile ---------- */

.bottom-tabbar { display: none; }

@media (max-width: 860px) {
  .sidebar { display: none; }
  .app-shell { flex-direction: column; }
  .content { padding: 18px 16px 90px 16px; }
  .topbar { padding: 0 16px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }

  .bottom-tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 62px;
    background: var(--surface); border-top: 1px solid var(--border); z-index: 20;
  }
  .bottom-tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--text-faint); font-size: 10.5px; font-weight: 500;
  }
  .bottom-tabbar a.active { color: var(--accent); }
}

/* ---------- Auth ---------- */

.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px 28px; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 26px; }
.auth-logo img { width: 40px; height: 40px; }
