/* ===============================================
   Portal Pazin - Estilos Globais
   =============================================== */

:root {
  /* Paleta principal — Índigo */
  --primary: #4F46E5;
  --primary-dark: #4338CA;
  --primary-light: #6366F1;
  --primary-bg: #EEF2FF;

  /* Semânticas */
  --success: #10B981;
  --success-bg: #D1FAE5;
  --warning: #F59E0B;
  --warning-bg: #FEF3C7;
  --danger: #EF4444;
  --danger-bg: #FEE2E2;
  --info: #0891b2;
  --info-bg: #ecfeff;

  /* Superfícies */
  --bg: #F8FAFC;
  --card-bg: #FFFFFF;
  --surface: #FFFFFF;             /* alias para JS que usa var(--card-bg) */

  /* Texto */
  --text: #0F172A;
  --text-light: #475569;
  --text-muted: #94A3B8;

  /* Bordas e sombras */
  --border: #E2E8F0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.04);

  /* Raios */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Layout */
  --nav-height: 60px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Aliases de compatibilidade (CSS usa nome novo, JS usa nome antigo) */
  --text-primary: var(--text);
  --text-secondary: var(--text-light);
  --primary-hover: var(--primary-dark);
  --success-light: var(--success-bg);
  --warning-light: var(--warning-bg);
  --danger-light: var(--danger-bg);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== TYPOGRAPHY ===== */
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.375rem; font-weight: 600; }
h3 { font-size: 1.125rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
p  { color: var(--text-light); }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== LAYOUT ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.page-content { padding: 2rem 1.5rem; max-width: 1200px; margin: 0 auto; }

/* ===== TOP NAVIGATION BAR ===== */
.topbar {
  height: var(--nav-height);
  background: #1E293B;
  color: white;
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 2px 8px rgba(0,0,0,0.18);
  gap: 0.5rem;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  color: white;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.topbar-brand .brand-icon {
  width: 30px; height: 30px;
  background: var(--primary);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.15);
  flex-shrink: 0;
}
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: 0.75rem;
  flex: 1;
  overflow: visible;
  flex-wrap: nowrap;
}
.topbar-nav a {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.topbar-nav a:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.9); }
.topbar-nav a.active {
  background: rgba(255,255,255,0.1);
  color: white;
  font-weight: 600;
}
.topbar-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0.5rem;
  right: 0.5rem;
  height: 2px;
  background: var(--primary-light);
  border-radius: 1px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}
.topbar-user {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font);
  line-height: 1.4;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary    { background: var(--primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }

.btn-success    { background: var(--success); color: white; }
.btn-success:hover:not(:disabled) { background: #15803d; }

.btn-danger     { background: var(--danger); color: white; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }

.btn-warning    { background: var(--warning); color: white; }
.btn-warning:hover:not(:disabled) { background: #b45309; }

.btn-outline    { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover:not(:disabled) { background: var(--primary-bg); }

.btn-ghost      { background: transparent; color: var(--text-light); }
.btn-ghost:hover:not(:disabled) { background: #f3f4f6; color: var(--text); }

.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; border-radius: 6px; }
.btn-lg { padding: 0.65rem 1.375rem; font-size: 0.95rem; }

.btn-icon { padding: 0.375rem; border-radius: 6px; background: transparent; border: none; cursor: pointer; color: var(--text-muted); transition: all 0.15s; font-size: 1rem; line-height: 1; }
.btn-icon:hover { background: #f3f4f6; color: var(--text); }

.btn-logout {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
}
.btn-logout:hover { background: rgba(255,255,255,0.2); }

/* ===== CARDS ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.card-body   { padding: 1.5rem; }
.card-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); background: #f9fafb; }

/* Summary cards (menu) */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.summary-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: default;
}
.summary-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.summary-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.summary-card-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}
.icon-blue   { background: var(--primary-bg); }
.icon-green  { background: var(--success-bg); }
.icon-yellow { background: var(--warning-bg); }
.icon-purple { background: #f3e8ff; }

.summary-card-value { font-size: 2rem; font-weight: 700; line-height: 1; }
.summary-card-label { font-size: 0.875rem; color: var(--text-muted); margin-top: 0.25rem; }
.summary-card-sub   { font-size: 0.8rem; color: var(--text-muted); }

/* ===== GRID UTILITIES ===== */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ===== FLEX UTILITIES ===== */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-1  { gap: 0.5rem; }
.gap-2  { gap: 1rem; }
.flex-1 { flex: 1; }

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-header h2 { margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--text); }
.page-header p  { margin: 0; font-size: 0.875rem; color: var(--text-muted); }

/* ===== FILTERS BAR ===== */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  padding: 0.875rem 1.25rem;
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.filters-bar label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }

/* ===== FORM CONTROLS ===== */
.form-group { display: flex; flex-direction: column; gap: 0.375rem; }
.form-label { font-size: 0.875rem; font-weight: 500; color: #374151; }
.form-control {
  padding: 0.5625rem 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: var(--font);
  color: var(--text);
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  line-height: 1.5;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.14);
}
.form-control::placeholder { color: #9ca3af; }
.form-control-sm { padding: 0.35rem 0.65rem; font-size: 0.8rem; border-radius: 6px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-hint { font-size: 0.75rem; color: var(--text-muted); }

/* Checkbox & Radio */
.checkbox-group { display: flex; align-items: center; gap: 0.5rem; }
.checkbox-group input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }
.checkbox-group label { font-size: 0.875rem; cursor: pointer; }

/* ===== TABLES ===== */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: white; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead { background: var(--bg); }
thead th { padding: 0.75rem 1rem; text-align: left; font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody td { padding: 0.875rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #FAFBFF; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-success  { background: var(--success-bg); color: var(--success); }
.badge-danger   { background: var(--danger-bg); color: var(--danger); }
.badge-warning  { background: var(--warning-bg); color: var(--warning); }
.badge-info     { background: var(--info-bg); color: var(--info); }
.badge-gray     { background: #f1f5f9; color: var(--text-light); }
.badge-primary  { background: var(--primary-bg); color: var(--primary); }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.15s ease;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.14), 0 4px 16px rgba(0,0,0,0.08);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.2s ease;
}
.modal-lg { max-width: 720px; }
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { margin: 0; font-size: 1rem; }
.modal-body { padding: 1.5rem; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.625rem; background: var(--bg); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1E293B 0%, #0F172A 60%, #1e1b4b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.login-card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
}
.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo .logo-icon {
  width: 72px; height: 72px;
  background: var(--primary-bg);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1rem;
}
.login-logo h1 { font-size: 1.5rem; color: var(--text); }
.login-logo p  { color: var(--text-muted); font-size: 0.875rem; }
.login-form { display: flex; flex-direction: column; gap: 1rem; }

/* ===== ALERT ===== */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.alert-danger  { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #bbf7d0; }
.alert-info    { background: var(--primary-bg); color: var(--primary); border: 1px solid #bfdbfe; }
.alert.hidden  { display: none; }

/* ===== TODO LIST (Lembretes) ===== */
.todo-list { display: flex; flex-direction: column; gap: 0.5rem; }
.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.15s;
}
.todo-item:hover { box-shadow: var(--shadow-sm); }
.todo-item.done { opacity: 0.55; }
.todo-item.done .todo-text { text-decoration: line-through; color: var(--text-muted); }
.todo-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  margin-top: 2px;
}
.todo-check.checked { background: var(--success); border-color: var(--success); }
.todo-check.checked::after { content: '✓'; color: white; font-size: 0.75rem; font-weight: 700; }
.todo-priority { width: 4px; min-height: 36px; align-self: stretch; border-radius: 999px; flex-shrink: 0; }
.priority-alta  { background: var(--danger); }
.priority-media { background: var(--warning); }
.priority-baixa { background: var(--success); }
.todo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.todo-row  { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.todo-text { flex: 1; font-size: 0.9rem; min-width: 0; }
.todo-actions { display: flex; gap: 0.25rem; opacity: 0; transition: opacity 0.15s; }
.todo-item:hover .todo-actions { opacity: 1; }
.sub-progress { margin-left: 0.25rem; }

/* Subtarefas */
.subtarefas-list { display: flex; flex-direction: column; gap: 0.3rem; padding-left: 0.25rem; }
.subtarefa-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
}
.subtarefa-item:hover { background: var(--hover-bg, rgba(0,0,0,0.03)); }
.subtarefa-item.done .sub-texto { text-decoration: line-through; color: var(--text-muted); }
.sub-check {
  width: 15px; height: 15px;
  border-radius: 3px;
  border: 2px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.sub-check.checked { background: var(--success); border-color: var(--success); }
.sub-check.checked::after { content: '✓'; color: white; font-size: 0.6rem; font-weight: 700; }
.sub-texto { flex: 1; font-size: 0.82rem; color: var(--text-secondary); }
.sub-del { font-size: 1rem; line-height: 1; opacity: 0; transition: opacity 0.15s; padding: 0 0.2rem; }
.subtarefa-item:hover .sub-del { opacity: 1; }
.add-subtarefa {
  display: flex; align-items: center; gap: 0.35rem;
  margin-top: 0.1rem;
}
.sub-input {
  flex: 1;
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.sub-input:focus { border-color: var(--primary); border-style: solid; }
.sub-input::placeholder { color: var(--text-muted); }
.sub-add {
  font-size: 1.1rem;
  color: var(--primary);
  opacity: 0.5;
  transition: opacity 0.15s;
  padding: 0 0.2rem;
}
.sub-add:hover { opacity: 1; }

/* Nota de privacidade */
.privacy-note {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--primary-bg);
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 1.25rem;
}

/* ===== CALENDAR ===== */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.calendar-nav-btn {
  background: none; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem; cursor: pointer;
  font-size: 0.875rem; color: var(--text-light);
  transition: all 0.15s;
}
.calendar-nav-btn:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }
.calendar-month-title { font-size: 1.1rem; font-weight: 600; color: var(--text); }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-day-name {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cal-day {
  min-height: 80px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem;
  position: relative;
}
.cal-day.other-month { background: var(--bg); }
.cal-day.today { border-color: var(--primary); }
.cal-day.today .cal-day-num { background: var(--primary); color: white; }
.cal-day-num {
  font-size: 0.8rem;
  font-weight: 600;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.25rem;
  color: var(--text);
}
.cal-events { display: flex; flex-direction: column; gap: 2px; }
.cal-event {
  font-size: 0.65rem;
  font-weight: 500;
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: white;
}

/* ===== INSTALLMENT TRACK ===== */
.installment-track {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}
.installment-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
}
.installment-dot.paid { background: var(--success); border-color: var(--success); }
.installment-dot.unpaid { background: white; }
.installment-dot:hover { transform: scale(1.2); }

/* ===== PROGRESS BAR ===== */
.progress-bar-wrap { background: var(--bg); border-radius: 999px; height: 8px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 999px; background: var(--primary); transition: width 0.3s; }
.progress-bar.green  { background: var(--success); }
.progress-bar.yellow { background: var(--warning); }

/* ===== STAT CARDS ===== */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.375rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; margin-bottom: 0.5rem; line-height: 1.4; }
.stat-card-value { font-size: 1.625rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat-card-value.green  { color: var(--success); }
.stat-card-value.red    { color: var(--danger); }
.stat-card-value.yellow { color: var(--warning); }
.stat-card-value.blue   { color: var(--primary); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.empty-state p { font-size: 0.9rem; }

/* ===== LOADING ===== */
.loading-spin {
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== CATEGORY TAG ===== */
.cat-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
}
.cat-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ===== ACTION ROW ===== */
.action-row { display: flex; gap: 0.375rem; align-items: center; }

/* ===== UTILITIES ===== */
.text-muted   { color: var(--text-muted); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.font-bold    { font-weight: 700; }
.font-medium  { font-weight: 500; }
.font-sm      { font-size: 0.875rem; }
.font-xs      { font-size: 0.8rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.strikethrough { text-decoration: line-through; }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* ===== SECTION DIVIDER ===== */
.section-title { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 0.75rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; }
  .topbar-nav { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .summary-cards { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 1rem; max-width: 100%; box-sizing: border-box; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .topbar-user { display: none; }
  .topbar-right { flex-shrink: 1; min-width: 0; }
  .card { min-width: 0; }
  .table-wrapper { max-width: 100%; }
}

@media (max-width: 480px) {
  .summary-cards { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr; }
  .calendar-grid { font-size: 0.7rem; }
  .cal-day { min-height: 60px; }
  .modal { max-width: 100%; border-radius: var(--radius); }
}

/* ===== FOOTER ===== */
.app-footer {
  text-align: center;
  padding: 1.5rem 1rem 1rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.dev-link {
  cursor: pointer;
  color: var(--primary);
  text-decoration: underline dotted;
  font-weight: 500;
}
.dev-link:hover { color: var(--primary-dark); }

/* ===== VIEW TOGGLE ===== */
.view-toggle {
  display: flex;
  gap: 0.25rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}
.view-toggle .btn {
  border-radius: 5px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}
.view-toggle .btn.active {
  background: white;
  box-shadow: var(--shadow-sm);
  color: var(--primary);
  font-weight: 600;
}
.view-toggle .btn:not(.active) {
  background: transparent;
  color: var(--text-muted);
}

/* ===== KANBAN ===== */
.kanban-board {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  align-items: flex-start;
}
.kanban-col {
  flex: 0 0 265px;
  background: #f9fafb;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
}
.kanban-col-header {
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border-radius: var(--radius) var(--radius) 0 0;
  position: sticky;
  top: 0;
}
.kanban-col-header .col-count {
  background: #e5e7eb;
  color: #6b7280;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.72rem;
  font-weight: 600;
}
.kanban-col-body {
  padding: 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  flex: 1;
}
.kanban-card {
  background: white;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding: 0.875rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: box-shadow 0.15s, transform 0.15s;
  cursor: default;
}
.kanban-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kanban-card.escalado { border-left: 3px solid var(--danger); }
.kanban-card-title { font-weight: 600; font-size: 0.875rem; margin-bottom: 0.375rem; color: #111827; }
.kanban-card-meta  { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 0.375rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.kanban-card-actions { display: flex; gap: 0.25rem; flex-wrap: wrap; margin-top: 0.5rem; }

/* ===== AGENDA LIST ===== */
.agenda-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: box-shadow 0.15s, transform 0.1s;
}
.agenda-item:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.agenda-item.escalado { border-left: 3px solid var(--danger); }
.agenda-item-body { flex: 1; min-width: 0; }
.agenda-item-title { font-weight: 600; font-size: 0.9rem; color: #111827; }
.agenda-item-desc  { font-size: 0.8rem; color: var(--text-light); margin-top: 0.25rem; white-space: pre-wrap; line-height: 1.5; }
.agenda-item-meta  { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.375rem; display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.agenda-item-actions { display: flex; gap: 0.25rem; flex-wrap: wrap; align-items: center; flex-shrink: 0; }

/* Status colors */
.status-em_andamento    { background: var(--primary-bg); color: var(--primary); }
.status-aguardando_orbium { background: #fff7ed; color: #c2410c; }
.status-aguardando_ti   { background: #faf5ff; color: #7c3aed; }
.status-acompanhamento_sac { background: #ecfeff; color: #0891b2; }
.status-resolvido       { background: var(--success-bg); color: var(--success); }

.kanban-col-em_andamento    .kanban-col-header { border-top: 3px solid var(--primary); }
.kanban-col-aguardando_orbium .kanban-col-header { border-top: 3px solid #c2410c; }
.kanban-col-aguardando_ti   .kanban-col-header { border-top: 3px solid #7c3aed; }
.kanban-col-acompanhamento_sac .kanban-col-header { border-top: 3px solid #0891b2; }
.kanban-col-resolvido       .kanban-col-header { border-top: 3px solid var(--success); }

/* ===== PRIORIDADE MÉDIA ===== */
.badge-media { background: #fef9c3; color: #a16207; }

/* ===== NOTIFICAÇÃO: BOLINHA VERMELHA NO BOTÃO ===== */
/* Orbium status switch */
.orbium-switch {
  display: inline-flex;
  border-radius: 999px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}
.orbium-switch-opt {
  padding: 3px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  transition: background 0.18s, color 0.18s;
  white-space: nowrap;
}
.orbium-switch-opt.active-aguardando {
  background: #fef2f2;
  color: #991b1b;
}
.orbium-switch-opt.active-resolvido {
  background: #d1fae5;
  color: #065f46;
}
.orbium-switch-opt:hover:not(.active-aguardando):not(.active-resolvido) {
  background: var(--border);
}

/* Card prazo piscando */
@keyframes border-pulse {
  0%, 100% { border-color: #dc2626; box-shadow: 0 0 0 0 rgba(220,38,38,0.25); }
  50%       { border-color: #ef4444; box-shadow: 0 0 0 5px rgba(220,38,38,0); }
}
.agenda-item.prazo-critico {
  animation: border-pulse 1.4s ease-in-out infinite;
}

/* Orbium pulse */
@keyframes orbium-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(1.4); }
}
.orbium-pulse-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  animation: orbium-pulse 1.2s ease-in-out infinite;
  flex-shrink: 0;
}

.notif-dot-wrapper { position: relative; display: inline-flex; }
.notif-dot-wrapper.has-dot::after {
  content: '';
  position: absolute;
  top: -3px; right: -3px;
  width: 9px; height: 9px;
  background: var(--danger);
  border-radius: 50%;
  border: 1.5px solid white;
  pointer-events: none;
}

/* ===== CENTRAL DE NOTIFICAÇÕES (SINO) ===== */
.notif-wrapper { position: relative; }
.notif-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  position: relative;
  line-height: 1;
  display: flex;
  align-items: center;
}
.notif-btn:hover { background: rgba(0,0,0,0.06); }
.notif-badge {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--danger);
  color: white;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 15px;
  height: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  border: 1.5px solid white;
}
.notif-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 370px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  z-index: 300;
  display: flex;
  flex-direction: column;
  max-height: 500px;
  overflow: hidden;
}
.notif-dropdown-header {
  padding: 0.875rem 1rem;
  font-weight: 700;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  background: var(--bg);
}
.notif-marcar-todas {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--primary);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.notif-marcar-todas:hover { text-decoration: underline; }
.notif-list { overflow-y: auto; flex: 1; }
.notif-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg); }
.notif-item.unread {
  background: #eff6ff;
  border-left: 4px solid var(--primary);
}
.notif-item:not(.unread) { border-left: 4px solid transparent; opacity: 0.7; }
.notif-item-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 4px;
}
.notif-item:not(.unread) .notif-item-dot { background: transparent; }
.notif-item-content { flex: 1; min-width: 0; }
.notif-item-titulo { font-weight: 700; font-size: 0.82rem; color: var(--text); line-height: 1.3; }
.notif-item:not(.unread) .notif-item-titulo { font-weight: 500; }
.notif-item-msg {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-item-data { font-size: 0.68rem; color: var(--text-muted); margin-top: 0.3rem; }
.notif-empty { padding: 2.5rem; text-align: center; color: var(--text-muted); font-size: 0.85rem; }

/* ── Notificações urgentes (prazo próximo / atraso) ─────────────────────────── */
.notif-item.unread.urgente {
  background: #fff5f5;
  border-left: 4px solid var(--danger);
}
.notif-item.unread.urgente .notif-item-titulo { color: var(--danger); }
.notif-item.unread.urgente .notif-item-dot {
  background: var(--danger);
  animation: orbium-pulse 1.2s ease-in-out infinite;
}
@keyframes notif-urgente-pulse {
  0%, 100% { background: #fff5f5; }
  50%       { background: #fee2e2; }
}
.notif-item.unread.urgente { animation: notif-urgente-pulse 2s ease-in-out infinite; }

/* ── Brand dinâmica (estado + master) ───────────────────────────────────────── */
.topbar-brand .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.topbar-brand .brand-text span:first-child {
  font-weight: 700;
  font-size: 1rem;
}
.brand-sub {
  font-size: 0.62rem;
  font-weight: 400;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.02em;
}

/* ── Tabs (admin-acessos) ───────────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
}
.tab-btn {
  padding: 0.6rem 1.25rem;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.tab-panel { animation: fadeIn 0.15s ease; }

/* ===== AVISOS ===== */
.aviso-item {
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
  transition: background 0.15s;
}
.aviso-item:last-child { border-bottom: none; }
.aviso-item:hover { background: var(--hover-bg, rgba(0,0,0,0.02)); }
.aviso-item-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 0.75rem; margin-bottom: 0.4rem;
}
.aviso-titulo { font-weight: 600; font-size: 0.95rem; margin-right: 0.5rem; }
.aviso-destino-badge {
  display: inline-block;
  background: rgba(59,130,246,0.1);
  color: var(--primary);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
}
.aviso-data { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.aviso-corpo {
  font-size: 0.875rem;
  color: var(--text-secondary, var(--text-muted));
  white-space: pre-wrap;
  line-height: 1.5;
}

/* ===== NOTIF DROPDOWN FOOTER (Central de Avisos) ===== */
.notif-dropdown-footer {
  border-top: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
}
.btn-central-avisos {
  width: 100%;
  background: rgba(59,130,246,0.08);
  border: 1.5px solid rgba(59,130,246,0.2);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: background 0.15s;
  text-align: center;
}
.btn-central-avisos:hover { background: rgba(59,130,246,0.15); }

/* ===== CENTRAL DE AVISOS MODAL ===== */
.aviso-central-item {
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
  transition: background 0.15s;
}
.aviso-central-item:last-child { border-bottom: none; }
.aviso-central-item:hover { background: var(--hover-bg, rgba(0,0,0,0.02)); }
.aviso-central-header {
  display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.4rem;
}
.aviso-central-titulo { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.2rem; }
.aviso-central-meta {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  font-size: 0.75rem; color: var(--text-muted);
}
.aviso-central-meta span::before { content: '·'; margin-right: 0.4rem; }
.aviso-central-meta span:first-child::before { content: ''; margin-right: 0; }
.aviso-central-corpo {
  font-size: 0.875rem;
  color: var(--text-secondary, var(--text-muted));
  white-space: pre-wrap;
  line-height: 1.5;
  padding-left: 0.1rem;
}

/* ── User dropdown menu (topbar) ────────────────────────────────────────────── */
.topbar-user-wrap {
  position: relative;
}
.topbar-user-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  color: rgba(255,255,255,0.85);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.topbar-user-btn:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.2);
  color: white;
}
.user-dropdown-arrow {
  font-size: 0.65rem;
  opacity: 0.7;
  flex-shrink: 0;
}
.user-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  min-width: 200px;
  z-index: 200;
  overflow: hidden;
}
.user-dropdown-menu.hidden { display: none; }
.user-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  font-size: 0.875rem;
  color: var(--text);
  text-decoration: none;
  transition: background 0.12s;
}
.user-dropdown-menu a:hover {
  background: var(--primary-bg);
  color: var(--primary);
}

/* ── Dropdowns de grupo no menu superior (.topbar-nav) ───────────────────────── */
.nav-group { position: relative; display: inline-flex; }
.nav-group-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.65);
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.nav-group-btn:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.9); }
.nav-group-btn.active { background: rgba(255,255,255,0.1); color: white; font-weight: 600; }
.nav-group-btn .user-dropdown-arrow { transition: transform 0.15s ease; }
.nav-group:hover .nav-group-btn .user-dropdown-arrow,
.nav-group-btn[aria-expanded="true"] .user-dropdown-arrow { transform: rotate(180deg); }

/* Dropdown abre ao passar o mouse (CSS puro, sem custo de JS). O clique
   mantém aberto via classe .is-open — NÃO usa a classe utilitária global
   .hidden (que tem display:none !important e anularia o hover). */
.nav-group-menu {
  position: absolute;
  left: 0;
  top: 100%; /* sem vão entre o botão e o dropdown — qualquer gap aqui quebraria o :hover */
  background: white;
  border: 1px solid var(--border);
  border-top: 2px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(0,0,0,0.16), 0 2px 8px rgba(0,0,0,0.06);
  min-width: 210px;
  z-index: 200;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s;
}
.nav-group:hover .nav-group-menu,
.nav-group-menu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.nav-group-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  color: var(--text) !important;
  background: white !important;
  text-decoration: none;
  transition: background 0.12s;
}
.nav-group-menu a:hover,
.nav-group-menu a.active {
  background: var(--primary-bg) !important;
  color: var(--primary) !important;
}
.nav-group-menu a.active { font-weight: 600; }

/* ── Campo de senha com botão olho ──────────────────────────────────────────── */
.password-field {
  position: relative;
  display: flex;
  align-items: center;
}
.password-field .form-control {
  padding-right: 2.5rem;
  width: 100%;
}
.btn-eye {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-muted);
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.15s;
}
.btn-eye:hover { color: var(--text); }

/* ===== ESCALA DE TRABALHO ===== */

.escala-grid-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
}

.escala-grid {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
}

.escala-grid th,
.escala-grid td {
  border: 1px solid var(--border);
  padding: 0;
}

.escala-col-nome {
  position: sticky;
  left: 0;
  background: var(--card-bg);
  z-index: 2;
  min-width: 144px;
  max-width: 164px;
  padding: 0.5rem 0.75rem !important;
  box-shadow: 2px 0 4px rgba(0,0,0,0.04);
}

.escala-grid thead .escala-col-nome {
  background: var(--bg);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.escala-col-dia {
  min-width: 34px;
  max-width: 34px;
  width: 34px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.1rem !important;
  background: var(--bg);
  color: var(--text-muted);
  line-height: 1.3;
}

.escala-dia-sem {
  font-size: 0.58rem;
  font-weight: 400;
  display: block;
}

.escala-fim-semana {
  background: #fef9f0 !important;
}

.escala-col-stats {
  min-width: 44px;
  width: 44px;
  text-align: center;
  padding: 0.25rem 0.3rem !important;
  background: var(--bg);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.4;
}

.escala-cell {
  min-width: 34px;
  max-width: 34px;
  width: 34px;
  height: 38px;
  text-align: center;
  cursor: pointer;
  transition: background 0.1s;
  vertical-align: middle;
  padding: 2px !important;
}

.escala-cell:hover { background: #eff6ff; }

.escala-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 26px;
  border-radius: 5px;
  font-size: 0.62rem;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  user-select: none;
}

.escala-badge-folga {
  background: #16a34a;
}

.escala-colab-nome {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 136px;
  margin-bottom: 2px;
}

.escala-legenda {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.escala-legenda-item {
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Popover de célula */
.escala-popover {
  position: absolute;
  z-index: 9999;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 172px;
  max-width: 220px;
  padding: 0.3rem;
}

.escala-pop-header {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
  padding: 0.15rem 0.4rem 0.3rem;
}

.escala-pop-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  border-radius: 5px;
  padding: 0.35rem 0.5rem;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
  color: var(--text);
  gap: 0.5rem;
}

.escala-pop-btn:hover { background: var(--bg); }
.escala-pop-btn.pop-active { background: #eff6ff; color: var(--primary); font-weight: 600; }
.escala-pop-btn.pop-folga:hover { background: #f0fdf4; }
.escala-pop-btn.pop-limpar { color: var(--danger); font-size: 0.78rem; }
.escala-pop-btn.pop-limpar:hover { background: var(--danger-bg); }

/* Swatch de cor para turnos */
.turno-cor-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid transparent;
  transition: all 0.15s;
  cursor: pointer;
}

.turno-cor-swatch:hover { transform: scale(1.1); }

/* Barras de progresso de meta */
.meta-progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 99px;
  overflow: hidden;
}

.meta-progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease, background 0.4s ease;
  min-width: 2px;
}

/* Mini-dashboard de metas abaixo da escala */
.escala-meta-dash {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem 1.25rem;
  margin-top: 1rem;
}

.escala-meta-dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  flex-wrap: wrap;
}

.escala-meta-loja-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.escala-meta-loja-info {
  min-width: 140px;
}

.escala-meta-vendedores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.escala-meta-colab-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  min-width: 130px;
  max-width: 170px;
  flex: 1;
}

/* ── Radio groups (NF / SP / similar) ─────────────────────────────────────── */
.radio-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}
.radio-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text);
  user-select: none;
}
.radio-item input[type="radio"] {
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* ── Marketing tipo options (card-style radio) ────────────────────────────── */
.mkt-tipo-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--card-bg);
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.mkt-tipo-option:has(input:checked) {
  border-color: var(--primary);
  background: #eff6ff;
  color: var(--primary);
  font-weight: 600;
}
.mkt-tipo-option input[type="radio"] {
  display: none;
}

/* ── Marketing dashboard ──────────────────────────────────────────────────── */
.mkt-estado-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.mkt-estado-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: #fff;
}
.mkt-estado-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.mkt-estado-sigla {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 6px;
  padding: 0.25rem 0.65rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.mkt-estado-nome {
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0.92;
}
.mkt-estado-meta {
  font-size: 0.8rem;
  opacity: 0.75;
  margin-top: 0.1rem;
}
.mkt-estado-body {
  padding: 1rem 1.25rem 1.25rem;
}
.mkt-verba-geral-block {
  margin-bottom: 1rem;
}
.mkt-verba-geral-block .mkt-vg-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}
.mkt-verba-geral-block .mkt-vg-values {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.mkt-verba-geral-block .mkt-vg-gasto {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}
.mkt-verba-geral-block .mkt-vg-total {
  font-size: 0.875rem;
  color: var(--text-muted);
}
.mkt-verba-geral-block .mkt-vg-pct {
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: auto;
}
.mkt-progress-lg {
  height: 12px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.mkt-progress-lg-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s ease;
}
.mkt-sub-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.65rem;
  margin-top: 0.9rem;
}
.mkt-sub-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
}
.mkt-sub-card-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}
.mkt-sub-card-gasto {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.mkt-sub-card-limit {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.mkt-sub-card-pct {
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 0.3rem;
}
.mkt-progress-sm {
  height: 5px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 0.4rem;
}
.mkt-progress-sm-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s ease;
}

/* ===== MOBILE SIDEBAR ===== */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: rgba(255,255,255,0.85);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  line-height: 1;
  flex-shrink: 0;
  margin-right: 0.25rem;
}
.mobile-menu-btn:hover { background: rgba(255,255,255,0.1); }

#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 199;
}
#sidebar-overlay.open { display: block; }

#mobile-sidebar {
  position: fixed;
  top: 0;
  left: -290px;
  width: 270px;
  height: 100%;
  background: #1E293B;
  z-index: 200;
  transition: left 0.25s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0,0,0,0.25);
}
#mobile-sidebar.open { left: 0; }

.mobile-sidebar-header {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
}
#sidebar-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.3rem 0.4rem;
  border-radius: 5px;
  line-height: 1;
}
#sidebar-close:hover { background: rgba(255,255,255,0.1); color: white; }

.mobile-sidebar-nav {
  padding: 0.5rem 0;
  flex: 1;
}
.mobile-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.25rem;
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  border-left: 3px solid transparent;
}
.mobile-sidebar-nav a:hover {
  background: rgba(255,255,255,0.07);
  color: white;
  border-left-color: var(--primary-light);
  text-decoration: none;
}
.mobile-sidebar-nav a.hidden { display: none; }

.mobile-sidebar-footer {
  padding: 0.9rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
#sidebar-user-email {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; }
  .topbar-nav { display: none !important; }
  .topbar-user { display: none !important; }
}
