/* ═══════════════════════════════════════════════════════════════
   MANTO PLATFORM — Design System
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }

/* ── 2. DESIGN TOKENS ─────────────────────────────────────────── */
:root {
  /* Sidebar */
  --sidebar-bg:     #1e1635;
  --sidebar-border: rgba(255,255,255,0.07);
  --sidebar-text:   rgba(255,255,255,0.60);
  --sidebar-text-h: rgba(255,255,255,0.92);
  --sidebar-accent: #f7d897;
  --sidebar-hover:  rgba(247,216,151,0.10);
  --sidebar-active: rgba(247,216,151,0.18);
  --sidebar-w:      220px;

  /* Content */
  --bg:      #f4f3f8;
  --panel:   #ffffff;
  --ink:     #1a1a1a;
  --muted:   #6b6b6b;
  --line:    #e5e3ef;
  --surface: #f4f3f8;
  --surface-2: #eeecf5;

  /* Accent / Brand */
  --accent:      #544596;
  --accent-dark: #3c316b;
  --accent-soft: rgba(84,69,150,0.10);
  --ring:        rgba(84,69,150,0.30);

  /* Semantic */
  --green:      #1a7f3c;
  --green-soft: #d4edda;
  --red:        #c0392b;
  --red-soft:   #fde8e8;
  --blue:       #2563eb;
  --blue-soft:  #dbeafe;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.07), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.10), 0 4px 10px rgba(0,0,0,0.05);

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
}

/* ── 3. APP LAYOUT ───────────────────────────────────────────── */
.app {
  display: flex;
  min-height: 100vh;
}

/* ── 4. SIDEBAR ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform 0.25s ease;
  border-right: 1px solid var(--sidebar-border);
}

.sidebar-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.sidebar-brand img { height: 32px; width: auto; }
.sidebar-brand-name {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}
.sidebar-brand-sub {
  font-size: 10px;
  color: var(--sidebar-accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.sidebar-section {
  margin-bottom: 4px;
}
.sidebar-section-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  padding: 14px 10px 6px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
}
.sidebar-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-h);
  text-decoration: none;
}
.sidebar-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-accent);
  font-weight: 600;
}
.sidebar-item .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.75;
}
.sidebar-item.active .icon { opacity: 1; }
.sidebar-item .icon svg { width: 18px; height: 18px; }

.sidebar-sep {
  border: 0;
  border-top: 1px solid var(--sidebar-border);
  margin: 10px 10px;
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  margin-bottom: 4px;
}
.sidebar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--sidebar-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-username {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sidebar-text-h);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-role {
  font-size: 10.5px;
  color: var(--sidebar-accent);
  margin-top: 1px;
}
.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  color: rgba(255,255,255,0.40);
  font-size: 13px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
}
.sidebar-logout:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.75);
  text-decoration: none;
}

/* ── 5. MAIN CONTENT ─────────────────────────────────────────── */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar-mobile {
  display: none;
  height: 52px;
  background: var(--sidebar-bg);
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--sidebar-border);
}
.topbar-mobile .brand-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: rgba(255,255,255,0.75);
  border-radius: 2px;
  transition: 0.2s;
}

.page-header {
  padding: 28px 32px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.page-header .sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}
.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.content {
  padding: 24px 32px 40px;
  flex: 1;
}

/* ── 6. OVERLAY (mobile sidebar) ─────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 190;
}

/* ── 7. PANELS & CARDS ───────────────────────────────────────── */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.panel h2 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 16px;
}
.panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card-body { padding: 14px 16px; }
.card-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }

/* ── 8. BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(84,69,150,0.30);
}
.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: 0 4px 14px rgba(84,69,150,0.40);
}

.btn-secondary {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { background: #f9f8f5; }

.btn-danger {
  background: var(--red-soft);
  color: var(--red);
  border-color: #fac5c5;
}
.btn-danger:hover { background: #fdd0d0; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}
.btn-ghost:hover { background: #f0ede8; color: var(--ink); }

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--r-sm);
}
.btn-lg {
  padding: 13px 24px;
  font-size: 15px;
  border-radius: var(--r-lg);
}

/* ── 9. FORMS ────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.label-hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
  margin-left: 6px;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="file"],
input[type="color"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 13.5px;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
}
input[type="color"] { padding: 4px 6px; height: 40px; cursor: pointer; }
input[type="file"] { padding: 7px 12px; }

/* ── Botão olhinho (mostrar/ocultar senha) ────────────────────── */
.pw-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pw-wrap input[type="password"],
.pw-wrap input[type="text"] {
  padding-right: 40px;
}
.pw-eye {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  color: var(--muted);
  transition: color 0.15s;
}
.pw-eye:hover { color: var(--ink); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b6b6b'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
}
textarea { resize: vertical; min-height: 80px; }
input::placeholder, textarea::placeholder { color: #b0a898; }

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

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

/* ── 10. TABLES ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
thead th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 2px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #faf9f6; }

/* ── 11. BADGES ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-gold   { background: rgba(84,69,150,0.12); color: var(--accent-dark); }
.badge-green  { background: var(--green-soft); color: var(--green); }
.badge-red    { background: var(--red-soft); color: var(--red); }
.badge-gray   { background: #f0ede8; color: var(--muted); }
.badge-blue   { background: var(--blue-soft); color: var(--blue); }

/* ── 12. KPI CARDS ───────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
}
.kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}
.kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
}
.kpi-value.green { color: var(--green); }
.kpi-value.red   { color: var(--red); }
.kpi-value.gold  { color: var(--accent-dark); }
.kpi-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ── 13. DONUT CHART ─────────────────────────────────────────── */
.donut {
  display: grid;
  place-items: center;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0deg, var(--green) var(--p, 0deg), var(--red-soft) var(--p, 0deg));
  margin: 0 auto;
}
.donut-inner {
  background: var(--panel);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  color: var(--ink);
}

/* ── 14. CALENDAR ────────────────────────────────────────────── */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
}
.cal-head {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 8px 0;
  text-align: center;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.cal-cell {
  height: 130px;
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  padding: 4px 4px 2px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  transition: background 0.12s;
}
.cal-cell:hover { background: var(--surface-2); }
.cal-cell.other-month {
  background: var(--surface);
  opacity: 0.55;
}
.cal-cell.today {
  background: rgba(84,69,150,0.06);
}
.cal-day {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 1px;
  line-height: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
}
.cal-cell.today .cal-day {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
.cal-event {
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--accent);
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  display: block;
  font-weight: 500;
  line-height: 1.5;
  flex-shrink: 0;
  transition: opacity 0.12s;
  min-width: 0;
}
.cal-event:hover {
  opacity: 0.85;
  text-decoration: none;
  color: #fff;
}
.cal-event.no-link {
  background: var(--line);
  color: var(--muted);
}
.cal-event .ev-time {
  font-size: 9.5px;
  font-weight: 600;
  opacity: 0.85;
  margin-right: 3px;
}
.cal-more {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 4px;
  cursor: default;
  flex-shrink: 0;
}

/* ── 15. ALERTS ──────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  margin-bottom: 16px;
}
.alert-error   { background: var(--red-soft); color: var(--red); border: 1px solid #fac5c5; }
.alert-success { background: var(--green-soft); color: var(--green); border: 1px solid #b7dfca; }
.alert-info    { background: var(--blue-soft); color: var(--blue); border: 1px solid #bfdbfe; }
.alert-gold    { background: var(--accent-soft); color: var(--accent-dark); border: 1px solid rgba(84,69,150,0.30); }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }

/* ── 16. UTILITIES ───────────────────────────────────────────── */
.muted   { color: var(--muted); }
.meta    { font-size: 12.5px; color: var(--muted); }
.strong  { font-weight: 700; }
.small   { font-size: 12px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center  { display: flex; align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.sep { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* ── 17. AUTH PAGES (login, change_password) ─────────────────── */
.auth-page {
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  background: var(--panel);
  border-radius: var(--r-xl);
  padding: 44px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo-name {
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.auth-logo-tag {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 3px;
}
.auth-card h1 {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 24px;
}

/* ── 18. ROLE ROWS (event_detail) ────────────────────────────── */
.role-row {
  display: grid;
  grid-template-columns: 1.6fr 1.4fr 110px 90px;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: 8px;
  background: var(--panel);
}
.role-row:hover { border-color: #d5d1ca; }

/* ── 19. MODAL ───────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.50);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.modal-backdrop.open { display: flex; }
.modal-box {
  background: var(--panel);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-rows: auto 1fr;
}
.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}

/* ── 20. TALENT CARDS ────────────────────────────────────────── */
.talent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.talent-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.talent-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.talent-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: #f0ede8;
}
.talent-card-body { padding: 12px 14px 14px; }
.talent-card-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.talent-card-meta { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ── 21. FILTERS ─────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 20px;
  padding: 16px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 120px;
}
.filter-group label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0;
}

/* ── 22. ACTIVITY LOG ────────────────────────────────────────── */
.log-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.log-item:last-child { border-bottom: 0; }
.log-ts { font-size: 11px; color: var(--muted); margin-bottom: 2px; font-family: monospace; }
.log-msg { color: var(--ink); }
.log-actor { font-weight: 600; }

/* ── 23. TRANSPORT CALC ──────────────────────────────────────── */
.mode-switch {
  display: flex;
  gap: 6px;
  background: #f0ede8;
  border-radius: var(--r-lg);
  padding: 5px;
  margin-bottom: 20px;
}
.mode-btn {
  flex: 1;
  padding: 10px;
  border-radius: var(--r-md);
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--muted);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.mode-btn.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.result-box {
  background: var(--sidebar-bg);
  color: #fff;
  border-radius: var(--r-lg);
  padding: 20px 24px;
  margin-top: 20px;
}
.result-total {
  font-size: 32px;
  font-weight: 800;
  color: var(--sidebar-accent);
  margin: 6px 0;
}
.result-line {
  font-size: 12.5px;
  color: rgba(255,255,255,0.55);
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
}

/* ── 24. RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open {
    display: block;
  }
  .main {
    margin-left: 0;
  }
  .topbar-mobile {
    display: flex;
  }
  .page-header {
    padding: 20px 16px 0;
  }
  .content {
    padding: 16px 16px 32px;
  }
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
  .form-grid-2,
  .form-grid-3,
  .form-grid-4,
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  .role-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  /* Page header: empilha título + botões */
  .page-header-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-actions { flex-wrap: wrap; width: 100%; }

  /* Foto do talento: limita em mobile via container */
  .talent-photo-wrap { max-height: 360px !important; }

  /* Task rows na home: empilha botão abaixo do texto */
  .task-row { flex-direction: column !important; align-items: flex-start !important; gap: 8px !important; }
  .task-row .btn { width: 100%; text-align: center; justify-content: center; }

  /* Portal invite actions: empilha verticalmente */
  .invite-actions { flex-direction: column !important; }
  .invite-actions .btn { width: 100%; justify-content: center; }

  /* Portal invite detail: empilha label+valor */
  .invite-detail-row { flex-direction: column !important; gap: 2px !important; }
  .invite-detail-label { min-width: 0 !important; }

  /* Portal header: empilha no mobile */
  .portal-header { flex-direction: column !important; align-items: flex-start !important; gap: 12px; }

  /* Formulário medidas: 2 colunas em tablet */
  .grid-medidas { grid-template-columns: 1fr 1fr !important; }
}

@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .talent-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .auth-card { padding: 28px 20px; }
  .calendar-grid { font-size: 10px; }
  .cal-cell { height: 80px; padding: 2px; }
  .cal-event { font-size: 10px; padding: 1px 3px; }

  /* Formulário medidas: 1 coluna em celular */
  .grid-medidas { grid-template-columns: 1fr 1fr !important; }

  /* Event row no portal: empilha badge */
  .portal-event-row { flex-direction: column !important; align-items: flex-start !important; gap: 6px !important; }

  /* Role-row inputs: aumenta espaço entre campos */
  .role-row > div { min-width: 0; }
}

@media (min-width: 1400px) {
  :root { --sidebar-w: 240px; }
}

/* ── Role Switcher (sidebar footer) ──────────────────────────── */
.role-switcher {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 10px 0 8px;
  margin-bottom: 6px;
}
.role-switcher-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 6px;
}
.role-switcher-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.role-pill {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  line-height: 1.4;
}
.role-pill:hover {
  background: rgba(84,69,150,0.12);
  border-color: rgba(84,69,150,0.35);
  color: var(--accent);
}
.role-pill.active {
  background: rgba(84,69,150,0.18);
  border-color: var(--accent);
  color: var(--accent);
}
.role-pill.reset {
  background: rgba(192,57,43,0.12);
  border-color: rgba(192,57,43,0.3);
  color: rgba(255,120,100,0.9);
}
.role-pill.reset:hover {
  background: rgba(192,57,43,0.22);
  border-color: rgba(192,57,43,0.6);
  color: #ff7060;
}

/* ── Impersonation Banner ─────────────────────────────────────── */
.impersonate-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(84,69,150,0.10);
  border-bottom: 2px solid var(--accent);
  color: var(--accent-dark);
  font-size: 13px;
  padding: 8px 32px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.impersonate-banner strong {
  font-weight: 700;
}
.impersonate-reset-btn {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  cursor: pointer;
  transition: background .15s;
}
.impersonate-reset-btn:hover {
  background: var(--accent-dark);
}

/* ── Sidebar user as link ─────────────────────────────────── */
a.sidebar-user {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  padding: 6px 8px;
  margin: 0 -8px;
  transition: background .15s;
}
a.sidebar-user:hover {
  background: rgba(255,255,255,0.06);
}
a.sidebar-user.sidebar-user-active {
  background: rgba(247,216,151,0.15);
}
