/* ============================================================
   Design System Light (Neutro + Preto)
   ============================================================ */

:root {
  --bg-base:       #F4F5F7;
  --bg-card:       #FFFFFF;
  --bg-sidebar:    #111827;
  --bg-input:      #F8F9FA;
  --bg-hover:      #F1F3F5;
  --border:        #E5E7EB;
  --border-light:  #D1D5DB;

  --gold:          #111827;
  --gold-light:    #374151;
  --gold-dark:     #000000;
  --gold-glow:     rgba(17, 24, 39, 0.07);

  --text-primary:  #111827;
  --text-secondary:#4B5563;
  --text-muted:    #9CA3AF;

  --success:       #059669;
  --success-bg:    rgba(5, 150, 105, 0.08);
  --warning:       #D97706;
  --warning-bg:    rgba(217, 119, 6, 0.08);
  --danger:        #DC2626;
  --danger-bg:     rgba(220, 38, 38, 0.08);
  --info:          #2563EB;
  --info-bg:       rgba(37, 99, 235, 0.08);

  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     16px;
  --radius-xl:     24px;

  --shadow-card:   0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-gold:   0 4px 16px rgba(17, 24, 39, 0.12);

  --sidebar-w:     260px;
  --topbar-h:      64px;
  --transition:    0.2s ease;
}

/* Reset & Base ------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }

img { max-width: 100%; height: auto; }

/* Scrollbar customizada --------------------------------------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   LAYOUT
   ============================================================ */

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

/* Sidebar ---------------------------------------------------- */
.sidebar {
  width: var(--sidebar-w);
  background: #111827;
  border-right: none;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--topbar-h);
}

.sidebar-logo img {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.sidebar-logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logo-sub {
  font-size: 0.7rem;
  color: #6B7280;
  margin-top: 1px;
}

.sidebar-nav {
  padding: 14px 12px;
  flex: 1;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4B5563;
  /* Menu do dono tem muitos itens e a lista passava da altura da tela, o que
     obrigava a rolar a sidebar para achar o último. Respiro menor entre grupos
     e entre itens faz o menu inteiro caber. */
  padding: 9px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: var(--radius);
  color: #9CA3AF;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 1px;
  white-space: nowrap;
}

.nav-item i {
  width: 18px;
  text-align: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: #FFFFFF;
}

.nav-item.active {
  background: rgba(255,255,255,0.1);
  color: #FFFFFF;
  border: 1px solid rgba(255,255,255,0.12);
}

.nav-item.active i { color: #FFFFFF; }

.nav-item .badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
}

.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  transition: background var(--transition);
  cursor: pointer;
  text-decoration: none;
}

.sidebar-user:hover { background: rgba(255,255,255,0.06); }

.sidebar-user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}

.sidebar-user-avatar-placeholder {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  color: #FFFFFF;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-info { overflow: hidden; }
.sidebar-user-name { font-size: 0.82rem; font-weight: 600; color: #F9FAFB; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 0.7rem; color: #6B7280; }

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

/* Topbar ----------------------------------------------------- */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius);
  background: var(--bg-input);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.topbar-icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.topbar-icon-btn .notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

/* Page content ----------------------------------------------- */
.page-content {
  padding: 28px 28px 40px;
  flex: 1;
}

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

.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.card-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.card-body { padding: 22px; }
.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
}

/* Metric Card ----------------------------------------------- */
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition), transform var(--transition);
}

.metric-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.metric-card.gold-glow {
  border-color: rgba(17,24,39,0.2);
  box-shadow: var(--shadow-card), var(--shadow-gold);
}

.metric-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.metric-icon.gold   { background: var(--gold-glow); color: var(--gold); }
.metric-icon.green  { background: var(--success-bg); color: var(--success); }
.metric-icon.red    { background: var(--danger-bg); color: var(--danger); }
.metric-icon.blue   { background: var(--info-bg); color: var(--info); }
.metric-icon.purple { background: rgba(139,92,246,0.12); color: #8B5CF6; }

.metric-value {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 8px;
}

.metric-trend.up   { color: var(--success); }
.metric-trend.down { color: var(--danger); }

/* Grid ------------------------------------------------------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: #111827;
  color: #FFFFFF;
}
.btn-primary:hover { background: #1F2937; color: #FFFFFF; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}
.btn-outline:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--text-muted); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger  { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(16,185,129,0.2); }
.btn-success:hover { background: var(--success); color: #fff; }

.btn-info    { background: var(--info-bg); color: var(--info); border: 1px solid rgba(59,130,246,0.2); }
.btn-info:hover { background: var(--info); color: #fff; }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 12px 24px; font-size: 0.95rem; }

.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
}

.btn:disabled, .btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
   FORMS
   ============================================================ */

.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.form-label .required { color: var(--danger); margin-left: 3px; }

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  font-family: inherit;
}

.form-control::placeholder { color: var(--text-muted); }

.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.form-control:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394A3B8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

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

.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: 5px; }

.form-row { display: grid; gap: 16px; }
.form-row-2 { grid-template-columns: repeat(2, 1fr); }
.form-row-3 { grid-template-columns: repeat(3, 1fr); }

.input-group {
  position: relative;
  display: flex;
  align-items: stretch;
}

.input-group .input-icon {
  position: absolute;
  left: 12px;
  top: 50%; transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.input-group .form-control { padding-left: 36px; }

/* ============================================================
   BADGES / TAGS
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-gold    { background: var(--gold-glow); color: var(--gold); border: 1px solid rgba(245,158,11,0.25); }
.badge-green   { background: var(--success-bg); color: var(--success); }
.badge-red     { background: var(--danger-bg); color: var(--danger); }
.badge-blue    { background: var(--info-bg); color: var(--info); }
.badge-purple  { background: rgba(139,92,246,0.12); color: #8B5CF6; }
.badge-gray    { background: rgba(148,163,184,0.1); color: var(--text-secondary); }
.badge-orange  { background: rgba(251,146,60,0.1); color: #FB923C; }

/* Priority badges */
.priority-urgent { background: rgba(239,68,68,0.15); color: #EF4444; border: 1px solid rgba(239,68,68,0.3); animation: pulse-border 1.5s infinite; }
.priority-high   { background: rgba(251,146,60,0.12); color: #FB923C; border: 1px solid rgba(251,146,60,0.25); }
.priority-normal { background: rgba(59,130,246,0.1); color: var(--info); }
.priority-low    { background: rgba(148,163,184,0.08); color: var(--text-muted); }

@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
  50%       { box-shadow: 0 0 0 3px rgba(239,68,68,0.2); }
}

/* ============================================================
   TABLES
   ============================================================ */

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

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

.data-table thead th {
  background: var(--bg-sidebar);
  padding: 12px 16px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  /* O fundo do cabeçalho é escuro (cor da sidebar). Com --text-muted o
     título ficava cinza sobre cinza-escuro e mal dava para ler. */
  color: rgba(255, 255, 255, 0.72);
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.data-table tbody td {
  padding: 14px 16px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover td { background: var(--bg-hover); color: var(--text-primary); }

/* ============================================================
   KANBAN
   ============================================================ */

.kanban-board {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 10px;
  align-items: flex-start;
}

.kanban-col {
  flex-shrink: 0;
  width: 290px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 180px);
}

.kanban-col-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.kanban-col-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.kanban-col-count {
  width: 22px; height: 22px;
  background: var(--bg-input);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
}

.kanban-col-indicator {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kanban-cards {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kanban-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.kanban-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.kanban-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.kanban-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.kanban-card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kanban-card-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   MODAIS
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

/* Três nomes para o mesmo estado porque as telas foram escritas em épocas
   diferentes. Faltava `aberto`, e quem usava essa classe abria um modal com
   `opacity: 0`: o conteúdo carregava, mas na tela nada acontecia. */
.modal-overlay.open,
.modal-overlay.is-open,
.modal-overlay.aberto {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  transform: translateY(20px) scale(0.98);
  transition: transform var(--transition);
}

.modal-overlay.open .modal,
.modal-overlay.is-open .modal,
.modal-overlay.aberto .modal { transform: none; }

.modal-lg { max-width: 780px; }
.modal-xl { max-width: 1000px; }

.modal-header {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
  font-size: 0.85rem;
}

.modal-close:hover { background: var(--danger-bg); color: var(--danger); border-color: rgba(239,68,68,0.3); }

.modal-body { padding: 22px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ============================================================
   ALERTS / FLASH
   ============================================================ */

.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.875rem;
  margin-bottom: 20px;
}

.alert i { font-size: 1rem; margin-top: 1px; flex-shrink: 0; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(16,185,129,0.2); }
.alert-error   { background: var(--danger-bg);  color: var(--danger);  border: 1px solid rgba(239,68,68,0.2); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245,158,11,0.2); }
.alert-info    { background: var(--info-bg);    color: var(--info);    border: 1px solid rgba(59,130,246,0.2); }

/* ============================================================
   AVATAR
   ============================================================ */

.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 40px; height: 40px; }
.avatar-lg { width: 56px; height: 56px; }
.avatar-xl { width: 80px; height: 80px; }

.avatar-placeholder {
  border-radius: 50%;
  background: var(--gold-glow);
  color: var(--gold);
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ============================================================
   NOTIFICAÇÕES DROPDOWN
   ============================================================ */

.notif-dropdown {
  position: absolute;
  top: calc(var(--topbar-h) - 8px);
  right: 24px;
  width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  z-index: 150;
  display: none;
}

.notif-dropdown.open { display: block; }

.notif-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: rgba(245,158,11,0.04); }

.notif-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  background: var(--gold-glow);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.notif-text { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.4; }
.notif-time { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }

/* ============================================================
   CALENDÁRIO
   ============================================================ */

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day-header {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 4px;
}

.calendar-day {
  min-height: 80px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.calendar-day:hover { border-color: var(--gold); background: var(--gold-glow); }
.calendar-day.today { border-color: var(--gold); }
.calendar-day.has-gravacao { border-color: var(--info); background: var(--info-bg); }
.calendar-day.available { border-color: var(--success); background: var(--success-bg); }
.calendar-day.other-month { opacity: 0.3; pointer-events: none; }
.calendar-day.past { opacity: 0.4; pointer-events: none; }

.calendar-day-num {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.calendar-day.today .calendar-day-num {
  color: var(--gold);
  font-weight: 800;
}

.calendar-turnos {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
}

.turno-tag {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
}

.turno-manha  { background: rgba(251,191,36,0.15); color: #FCD34D; }
.turno-tarde  { background: rgba(251,146,60,0.15); color: #FB923C; }
.turno-noite  { background: rgba(139,92,246,0.15); color: #A78BFA; }

/* ============================================================
   TIMELINE DE VÍDEO (Frame.io style)
   ============================================================ */

.video-review-wrapper {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  height: calc(100vh - 200px);
}

.video-player-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.video-container {
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/9;
}

.video-container iframe,
.video-container video {
  width: 100%;
  height: 100%;
  border: none;
}

.video-timeline {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  position: relative;
  height: 56px;
  cursor: pointer;
}

.timeline-bar {
  background: var(--bg-input);
  height: 4px;
  border-radius: 99px;
  position: relative;
  margin-top: 10px;
}

.timeline-progress {
  background: var(--gold);
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s linear;
}

.timeline-marker {
  position: absolute;
  top: -6px;
  transform: translateX(-50%);
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  border: 2px solid var(--bg-card);
  transition: transform var(--transition);
}

.timeline-marker:hover { transform: translateX(-50%) scale(1.4); }
.timeline-marker.red   { background: var(--danger); }

.timeline-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: monospace;
  margin-top: 8px;
}

.comments-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-item {
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.comment-item:hover { border-color: var(--gold); }
.comment-item.active { border-color: var(--gold); background: var(--gold-glow); }
.comment-item.resolved { opacity: 0.5; }

.comment-timecode {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--gold-glow);
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 700;
  font-family: monospace;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 7px;
}

.comment-text { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; }

.comment-input-area {
  padding: 14px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   TIMER DE EDIÇÃO
   ============================================================ */

.timer-display {
  font-size: 2rem;
  font-weight: 800;
  font-family: monospace;
  color: var(--gold);
  letter-spacing: 0.05em;
}

.timer-controls {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

/* ============================================================
   UTILIDADES
   ============================================================ */

.flex   { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.text-gold    { color: var(--gold); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-muted   { color: var(--text-muted); }
.text-sm      { font-size: 0.82rem; }
.text-xs      { font-size: 0.72rem; }

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

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

.w-full { width: 100%; }
.h-full { height: 100%; }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.divider { height: 1px; background: var(--border); margin: 20px 0; }

.loading-spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border-light);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  gap: 12px;
}

.empty-state i {
  font-size: 2.5rem;
  color: var(--text-muted);
  opacity: 0.4;
}

.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--text-secondary); }
.empty-state p  { font-size: 0.82rem; color: var(--text-muted); }

/* ============================================================
   RESPONSIVO
   ============================================================ */

@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .video-review-wrapper { grid-template-columns: 1fr; }
  .comments-panel { height: 400px; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    transform: translateX(-260px);
    width: 260px;
  }

  .sidebar.mobile-open { transform: translateX(0); }

  .main-content { margin-left: 0; }

  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }

  .page-content { padding: 16px 16px 32px; }
}

@media (max-width: 600px) {
  .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .form-row-2, .form-row-3   { grid-template-columns: 1fr; }
  .kanban-board { flex-direction: column; }
  .kanban-col   { width: 100%; }
  .page-header  { flex-direction: column; align-items: flex-start; }
}

/* Mobile overlay sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}

@media (max-width: 900px) {
  .sidebar-overlay.active { display: block; }
}

/* iOS aplica zoom quando o campo focado tem fonte menor que 16px; isto garante o mínimo. */
@media (hover: none) and (pointer: coarse) {
  input, select, textarea { font-size: 16px !important; }
}

/* Modo discreto (admin): embaça nomes, sedes, e-mails e faturamento para gravar a tela. */
.discreto-btn[aria-pressed="true"] { background: var(--neutral-900, #0F172A) !important; color: #fff !important; border-color: transparent !important; }
body.modo-discreto .dado-discreto {
  display: inline-block;
  -webkit-filter: blur(6px);
  filter: blur(6px);
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}
