/* ============================================================
   GESTOR — Design System v2.0
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* --- Variáveis --- */
:root {
  --bg:           #f0f2f8;
  --card-bg:      #ffffff;
  --border:       #e2e8f0;
  --border-light: #f1f5f9;

  --sidebar-bg:    #1e2035;
  --sidebar-hover: rgba(255,255,255,.07);
  --sidebar-text:  #8b92a9;

  --primary:       #4f6ef7;
  --primary-dark:  #3b5bdb;
  --primary-light: #eef2ff;

  --success:       #22c55e;
  --success-light: #dcfce7;
  --danger:        #ef4444;
  --danger-light:  #fee2e2;
  --warning:       #f59e0b;
  --warning-light: #fef3c7;
  --info:          #06b6d4;
  --info-light:    #cffafe;
  --purple:        #a855f7;
  --purple-light:  #f3e8ff;
  --orange:        #f97316;
  --orange-light:  #ffedd5;

  --text-primary:   #1a1d2e;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

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

  --shadow-sm: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow:    0 4px 12px rgba(15,23,42,.08), 0 2px 4px rgba(15,23,42,.04);
  --shadow-lg: 0 10px 30px rgba(15,23,42,.12);

  --sidebar-w:  240px;
  --topbar-h:   60px;
  --transition: all .18s ease;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

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

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

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  position: fixed; top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  z-index: 100; overflow-y: auto; overflow-x: hidden;
  transition: transform .25s ease;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); }

.sidebar-logo {
  padding: 20px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.sidebar-logo .logo-mark {
  width: 34px; height: 34px;
  background: var(--primary); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 10px;
}
.sidebar-logo .logo-name { font-size: 14px; font-weight: 800; color: #fff; letter-spacing: -.3px; }
.sidebar-logo .logo-sub  { font-size: 11px; color: var(--sidebar-text); margin-top: 2px; }

.sidebar-user {
  padding: 12px 18px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.s-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.s-user-name { font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-user-role { font-size: 11px; color: var(--sidebar-text); }

.sidebar-nav { flex: 1; padding: 10px 0; }
.nav-group { margin-bottom: 2px; }
.nav-group-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: .8px; text-transform: uppercase;
  color: rgba(255,255,255,.25);
  padding: 10px 18px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px 9px 18px; margin: 1px 8px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text); font-size: 13px; font-weight: 500;
  transition: var(--transition);
}
.nav-item:hover  { background: var(--sidebar-hover); color: rgba(255,255,255,.85); }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .75; }
.nav-item.active svg { opacity: 1; }
.nav-item .nav-badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px;
}
.sidebar-footer { padding: 8px; border-top: 1px solid rgba(255,255,255,.06); flex-shrink: 0; }

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

/* --- Topbar --- */
.topbar {
  height: var(--topbar-h);
  background: var(--card-bg); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 var(--space-lg); gap: var(--space-md);
  position: sticky; top: 0; z-index: 50; flex-shrink: 0;
}
.topbar-left { flex: 1; }
.topbar-breadcrumb { font-size: 11.5px; color: var(--text-muted); }
.topbar-title { font-size: 15px; font-weight: 700; color: var(--text-primary); letter-spacing: -.3px; }
.topbar-right { display: flex; align-items: center; gap: var(--space-sm); }
.topbar-date {
  font-size: 12px; color: var(--text-muted);
  padding: 4px 10px; background: var(--bg); border-radius: var(--radius-sm); white-space: nowrap;
}

/* --- Page content --- */
.page-content { flex: 1; padding: var(--space-lg); }

/* ============================================================
   CARD
   ============================================================ */
.card { background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.card-header {
  padding: 14px var(--space-lg); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-md);
}
.card-title { font-size: 13.5px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.card-body  { padding: var(--space-lg); }
.card-footer {
  padding: 12px var(--space-lg); border-top: 1px solid var(--border);
  background: var(--bg); border-radius: 0 0 var(--radius) var(--radius);
}

/* ============================================================
   KPI CARDS
   ============================================================ */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--space-md); }
.kpi-card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.kpi-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.kpi-card.c-primary::after { background: var(--primary); }
.kpi-card.c-success::after { background: var(--success); }
.kpi-card.c-danger::after  { background: var(--danger); }
.kpi-card.c-warning::after { background: var(--warning); }
.kpi-card.c-info::after    { background: var(--info); }
.kpi-card.c-purple::after  { background: var(--purple); }
.kpi-card.c-orange::after  { background: var(--orange); }
.kpi-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: var(--space-sm); }
.kpi-value { font-size: 28px; font-weight: 800; color: var(--text-primary); letter-spacing: -1.5px; line-height: 1; }
.kpi-sub   { font-size: 12px; color: var(--text-muted); margin-top: var(--space-xs); }
.kpi-icon  {
  position: absolute; top: var(--space-md); right: var(--space-md);
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.kpi-card.c-primary .kpi-icon { background: var(--primary-light); }
.kpi-card.c-success .kpi-icon { background: var(--success-light); }
.kpi-card.c-danger  .kpi-icon { background: var(--danger-light); }
.kpi-card.c-warning .kpi-icon { background: var(--warning-light); }
.kpi-card.c-info    .kpi-icon { background: var(--info-light); }
.kpi-card.c-purple  .kpi-icon { background: var(--purple-light); }
.kpi-card.c-orange  .kpi-icon { background: var(--orange-light); }

/* ============================================================
   GRIDS
   ============================================================ */
.grid   { display: grid; gap: var(--space-md); }
.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-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-primary  { background: var(--primary-light);  color: var(--primary); }
.badge-success  { background: var(--success-light);  color: #16a34a; }
.badge-danger   { background: var(--danger-light);   color: #dc2626; }
.badge-warning  { background: var(--warning-light);  color: #d97706; }
.badge-info     { background: var(--info-light);     color: #0891b2; }
.badge-purple   { background: var(--purple-light);   color: #9333ea; }
.badge-orange   { background: var(--orange-light);   color: #ea580c; }
.badge-neutral  { background: #f1f5f9;               color: #64748b; }
/* Status */
.badge-nao_iniciada { background: #f1f5f9;            color: #64748b; }
.badge-em_progresso { background: var(--info-light);  color: #0891b2; }
.badge-concluida    { background: var(--success-light); color: #16a34a; }
.badge-bloqueada    { background: var(--danger-light);  color: #dc2626; }
/* Prioridade */
.badge-critica { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.badge-alta    { background: var(--danger-light);  color: #dc2626; }
.badge-media   { background: var(--warning-light); color: #d97706; }
.badge-baixa   { background: var(--success-light); color: #16a34a; }

/* ============================================================
   BOTÕES
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer; border: none;
  transition: var(--transition); white-space: nowrap; line-height: 1;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #16a34a; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-danger:hover  { background: #dc2626; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--bg); }
.btn-ghost   { background: transparent; color: var(--text-secondary); padding: 6px 10px; }
.btn-ghost:hover   { background: var(--bg); }
.btn-sm  { padding: 5px 10px; font-size: 12px; }
.btn-lg  { padding: 11px 22px; font-size: 15px; }
.btn-icon{ padding: 7px; }
.btn-block { width: 100%; }

/* ============================================================
   FORMULÁRIOS
   ============================================================ */
.form-group { margin-bottom: var(--space-md); }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 9px 12px;
  background: var(--card-bg); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13.5px; color: var(--text-primary);
  font-family: inherit; transition: border-color .15s; outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,110,247,.1); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-md); }
.form-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }

/* ============================================================
   TABELAS
   ============================================================ */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card-bg); }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 10px 14px; text-align: left;
  font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: var(--text-muted); background: var(--bg); border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { padding: 11px 14px; font-size: 13.5px; color: var(--text-secondary); border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafbfe; }
td.td-main    { color: var(--text-primary); font-weight: 500; }
td.td-actions { text-align: right; white-space: nowrap; }

/* ============================================================
   MODAIS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  backdrop-filter: blur(4px); z-index: 200;
  display: none; align-items: center; justify-content: center; padding: var(--space-lg);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card-bg); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  animation: modal-in .2s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(-10px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-lg { max-width: 700px; }
.modal-xl { max-width: 920px; }

/* Modal editor de nota (Quill) */
.modal-nota-editor { max-width: 660px; overflow: visible; }
.modal-nota-header-info { display: flex; flex-direction: column; gap: 2px; }
.modal-nota-date {
  font-size: 11px; color: var(--text-muted); font-weight: 500; letter-spacing: .2px;
}
.modal-nota-body { padding: 0; }

/* Quill — ajustes visuais para combinar com o app */
.modal-nota-editor .ql-toolbar.ql-snow {
  border: none; border-bottom: 1px solid var(--border);
  padding: 8px var(--space-lg); background: var(--bg);
  border-radius: 0; font-family: 'Inter', sans-serif;
}
.modal-nota-editor .ql-container.ql-snow {
  border: none; font-family: 'Inter', sans-serif;
}
.modal-nota-editor .ql-editor {
  min-height: 220px; max-height: 380px; overflow-y: auto;
  padding: var(--space-lg); font-size: 14px; line-height: 1.7;
  color: var(--text-primary);
}
.modal-nota-editor .ql-editor.ql-blank::before {
  font-style: normal; color: var(--text-muted); font-size: 13.5px;
}
.modal-nota-editor .ql-snow .ql-stroke { stroke: var(--text-secondary); }
.modal-nota-editor .ql-snow .ql-fill  { fill: var(--text-secondary); }
.modal-nota-editor .ql-snow.ql-toolbar button:hover .ql-stroke,
.modal-nota-editor .ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--primary); }
.modal-nota-editor .ql-snow.ql-toolbar button:hover .ql-fill,
.modal-nota-editor .ql-snow.ql-toolbar button.ql-active .ql-fill   { fill: var(--primary); }
.modal-nota-editor .ql-snow .ql-picker-label { color: var(--text-secondary); }
.modal-nota-editor .ql-snow .ql-picker-label:hover { color: var(--primary); }
.modal-header {
  padding: var(--space-lg); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: var(--card-bg); z-index: 1;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.modal-close {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: var(--bg); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--text-muted); transition: var(--transition); line-height: 1;
}
.modal-close:hover { background: var(--border); color: var(--text-primary); }
.modal-body { padding: var(--space-lg); }
.modal-footer {
  padding: 12px var(--space-lg); border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end; gap: var(--space-sm);
  position: sticky; bottom: 0; background: var(--card-bg);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ============================================================
   ALERTAS
   ============================================================ */
.alert {
  padding: 12px var(--space-md); border-radius: var(--radius-sm);
  font-size: 13px; display: flex; align-items: flex-start; gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.alert-success { background: var(--success-light); color: #15803d; border-left: 3px solid var(--success); }
.alert-danger  { background: var(--danger-light);  color: #b91c1c; border-left: 3px solid var(--danger); }
.alert-warning { background: var(--warning-light); color: #b45309; border-left: 3px solid var(--warning); }
.alert-info    { background: var(--info-light);    color: #0e7490; border-left: 3px solid var(--info); }

/* ============================================================
   TABS
   ============================================================ */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: var(--space-lg); overflow-x: auto; }
.tab-item {
  padding: 9px 16px; font-size: 13px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; border: none; border-bottom: 2px solid transparent;
  background: none; margin-bottom: -2px;
  transition: var(--transition); white-space: nowrap;
}
.tab-item:hover  { color: var(--text-secondary); }
.tab-item.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================
   DIVIDER / EMPTY / PROGRESS / DOT
   ============================================================ */
.divider { height: 1px; background: var(--border); margin: var(--space-lg) 0; }
.empty-state { text-align: center; padding: 48px var(--space-lg); color: var(--text-muted); }
.empty-state .ei { font-size: 40px; margin-bottom: var(--space-md); }
.empty-state h3  { font-size: 15px; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p   { font-size: 13px; }
.progress { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 3px; transition: width .4s ease; }
.progress-bar.p-primary { background: var(--primary); }
.progress-bar.p-success { background: var(--success); }
.progress-bar.p-warning { background: var(--warning); }
.progress-bar.p-danger  { background: var(--danger); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.dot-success { background: var(--success); }
.dot-danger  { background: var(--danger); }
.dot-warning { background: var(--warning); }
.dot-neutral { background: #cbd5e1; }
.dot-info    { background: var(--info); }

/* ============================================================
   KANBAN
   ============================================================ */
.kanban-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-md); align-items: start; }
.kanban-col   { border-radius: var(--radius); overflow: hidden; background: var(--bg); }
.kanban-col-header {
  padding: 10px var(--space-md); display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
}
.kanban-col-header .col-count { background: rgba(0,0,0,.1); padding: 1px 7px; border-radius: 10px; font-size: 11px; }
.col-pending  .kanban-col-header { background: #f1f5f9; color: #475569; }
.col-progress .kanban-col-header { background: #e0f2fe; color: #0369a1; }
.col-blocked  .kanban-col-header { background: #fee2e2; color: #b91c1c; }
.col-done     .kanban-col-header { background: #dcfce7; color: #15803d; }
.kanban-cards { padding: var(--space-sm); display: flex; flex-direction: column; gap: var(--space-sm); min-height: 80px; }
.kanban-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px; box-shadow: var(--shadow-sm);
  cursor: pointer; transition: var(--transition);
}
.kanban-card:hover { box-shadow: var(--shadow); border-color: #c7d2fe; transform: translateY(-1px); }
.kc-title { font-size: 13px; font-weight: 500; color: var(--text-primary); margin-bottom: 8px; line-height: 1.4; }
.kc-meta  { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kc-person { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-muted); }
.task-avatar {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.kc-due { font-size: 11px; color: var(--text-muted); }
.kc-due.overdue { color: var(--danger); font-weight: 600; }

/* ============================================================
   STAND-UP (GESTOR REGISTRA POR EQUIPE)
   ============================================================ */
.standup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: var(--space-md);
}
.standup-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
}
.standup-card.has-blocker { border-color: var(--danger); }
.standup-card.pending     { border-style: dashed; opacity: .7; }

.sc-header {
  padding: 10px var(--space-md); background: var(--bg); border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
}
.standup-card.has-blocker .sc-header { background: #fff1f2; }
.sc-dept {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-muted); margin-bottom: 3px;
}
.sc-participants {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--text-secondary);
}
.sc-edit-btn { flex-shrink: 0; }

.sc-body   { padding: var(--space-md); flex: 1; }
.sc-section { margin-bottom: 12px; }
.sc-section:last-child { margin-bottom: 0; }
.sc-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-muted); margin-bottom: 4px;
}
.sc-text  { font-size: 13px; color: var(--text-secondary); line-height: 1.55; }
.sc-empty { font-size: 13px; color: var(--text-muted); font-style: italic; text-align: center; padding: 8px 0; }

/* ============================================================
   ROTINA
   ============================================================ */

/* Navegador de data */
.rn-nav {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px var(--space-lg);
  box-shadow: var(--shadow-sm);
}
.rn-arrow {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border);
  color: var(--text-secondary); background: var(--bg); text-decoration: none;
  transition: background .12s, border-color .12s, color .12s; flex-shrink: 0;
}
.rn-arrow:hover       { background: #f0f4ff; border-color: var(--primary); color: var(--primary); }
.rn-arrow.disabled    { opacity: .35; pointer-events: none; }
.rn-center {
  display: flex; align-items: center; gap: 10px; flex: 1; justify-content: center;
  position: relative;
}
.rn-date-label {
  font-size: 14px; font-weight: 700; color: var(--text-primary);
}
.rn-today-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  background: var(--primary); color: #fff;
  padding: 2px 8px; border-radius: 20px;
}
.rn-cal-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text-muted); cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.rn-cal-btn:hover { background: #f0f4ff; border-color: var(--primary); color: var(--primary); }

.rotina-progress-bar {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg); display: flex; align-items: center; gap: var(--space-md); margin-bottom: var(--space-md);
}
.rotina-progress-bar .rp-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.rotina-progress-bar .rp-bar  { flex: 1; }
.rotina-progress-bar .rp-pct  { font-size: 13px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.rotina-group {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); margin-bottom: var(--space-md);
}
.rg-header {
  padding: 12px var(--space-lg); background: var(--bg); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.rg-name     { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.rg-actions  { display: flex; gap: 6px; }
.rg-progress { font-size: 12px; color: var(--text-muted); }
/* Abas */
.tab-bar { display: flex; gap: 4px; border-bottom: 2px solid var(--border); }
.tab-btn {
  background: none; border: none; cursor: pointer;
  padding: 8px 16px; font-size: 13.5px; font-weight: 600; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -2px; display: flex; align-items: center; gap: 6px;
  transition: color .15s;
}
.tab-btn:hover  { color: var(--text-primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--border); color: var(--text-muted); border-radius: 20px;
  font-size: 11px; font-weight: 700; padding: 1px 7px; line-height: 1.4;
}
.tab-btn.active .tab-badge { background: #e0e7ff; color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* Itens de rotina (wrap + painel de nota) */
.rotina-item-wrap { border-bottom: 1px solid var(--border-light); }
.rotina-item-wrap:last-child { border-bottom: none; }
.rotina-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px var(--space-lg); transition: background .1s;
}
.rotina-item:hover       { background: #fafbfe; }
.rotina-item.done        { opacity: .55; }
.rotina-item input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.ri-time { font-size: 11px; font-weight: 700; color: var(--text-muted); min-width: 40px; font-variant-numeric: tabular-nums; }
.ri-desc { flex: 1; font-size: 13.5px; color: var(--text-primary); }
.rotina-item.done .ri-desc { text-decoration: line-through; color: var(--text-muted); }

/* Frequência badge */
.ri-freq {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  padding: 2px 7px; border-radius: 20px; white-space: nowrap; flex-shrink: 0;
}
.ri-freq-semanal   { background: #fef9c3; color: #a16207; }
.ri-freq-quinzenal { background: #ede9fe; color: #7c3aed; }
.ri-freq-mensal    { background: #fce7f3; color: #be185d; }

/* Controles de linha (nota + delete) */
.ri-controls { display: flex; align-items: center; gap: 6px; opacity: 0; transition: opacity .15s; }
.rotina-item:hover .ri-controls { opacity: 1; }
.ri-del { display: flex; }

/* Botão de nota */
.ri-nota-btn {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--card-bg); color: var(--text-muted); cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.ri-nota-btn:hover       { background: #f0f4ff; border-color: var(--primary); color: var(--primary); }
.ri-nota-btn.has-nota    { background: #e0e7ff; border-color: var(--primary); color: var(--primary); }

/* Preview de nota (renderiza HTML do Quill) */
.ri-nota-preview {
  margin: 0 var(--space-lg) 10px;
  background: #f8f9ff; border-left: 3px solid #c7d2fe;
  border-radius: 0 8px 8px 0; overflow: hidden;
}
.ri-nota-preview .ql-snow { border: none; background: transparent; }
.ri-nota-preview .ql-editor.ri-nota-preview-body {
  padding: 8px 12px; font-size: 13px; line-height: 1.6;
  max-height: 120px; overflow: hidden;
  color: var(--text-secondary);
}
.ri-nota-preview-edit {
  display: flex; align-items: center; gap: 5px;
  width: 100%; padding: 5px 12px;
  background: none; border: none; border-top: 1px solid #e0e7ff;
  font-size: 11.5px; font-weight: 600; color: var(--primary);
  cursor: pointer; text-align: left; transition: background .12s;
}
.ri-nota-preview-edit:hover { background: #eef2ff; }

/* Histórico / timeline */
.rh-timeline { display: flex; flex-direction: column; gap: var(--space-lg); }
.rh-day { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.rh-day-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px var(--space-lg); background: var(--bg); border-bottom: 1px solid var(--border);
}
.rh-day-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.rh-day-date  { font-size: 13px; font-weight: 700; color: var(--text-primary); flex: 1; }
.rh-day-stats { font-size: 11.5px; color: var(--text-muted); }
.rh-entries { display: flex; flex-direction: column; }
.rh-entry {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px var(--space-lg); border-bottom: 1px solid var(--border-light);
}
.rh-entry:last-child { border-bottom: none; }
.rh-entry-check {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px;
  color: var(--text-muted);
}
.rh-entry.rh-done .rh-entry-check { background: #d1fae5; border-color: #6ee7b7; color: #059669; }
.rh-entry-body { flex: 1; min-width: 0; }
.rh-entry-title { font-size: 13.5px; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rh-entry.rh-done .rh-entry-title { color: var(--text-muted); }
.rh-entry-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; display: flex; gap: 4px; }
.rh-entry-nota {
  margin-top: 6px; font-size: 13px; color: var(--text-secondary); line-height: 1.55;
  background: #f8f9ff; border-left: 3px solid #c7d2fe; padding: 6px 10px; border-radius: 0 6px 6px 0;
}

/* ============================================================
   REUNIÕES
   ============================================================ */
.meeting-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.meeting-item {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg); display: flex; align-items: center; gap: var(--space-lg);
  box-shadow: var(--shadow-sm); transition: var(--transition); cursor: pointer;
}
.meeting-item:hover { box-shadow: var(--shadow); border-color: #c7d2fe; }
.meeting-item.status-realizada { opacity: .7; }
.meeting-item.status-cancelada { opacity: .5; text-decoration: line-through; }
.mi-date  { text-align: center; min-width: 48px; flex-shrink: 0; }
.mi-date .day   { font-size: 22px; font-weight: 800; color: var(--primary); line-height: 1; }
.mi-date .month { font-size: 10px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); }
.mi-info  { flex: 1; }
.mi-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.mi-meta  { font-size: 12px; color: var(--text-muted); margin-top: 3px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mi-actions { display: flex; gap: var(--space-xs); flex-shrink: 0; }

.pauta-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border-light);
  font-size: 13.5px; color: var(--text-secondary);
}
.pauta-item:last-child { border-bottom: none; }
.pauta-item input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--primary); flex-shrink: 0; }
.pauta-item.done > span { text-decoration: line-through; color: var(--text-muted); }
.acao-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.acao-item:last-child { border-bottom: none; }
.acao-desc { flex: 1; font-size: 13px; color: var(--text-primary); }
.acao-meta { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }

/* ============================================================
   NOTAS
   ============================================================ */
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--space-md); }
.note-card {
  border-radius: var(--radius); padding: var(--space-md);
  cursor: pointer; transition: var(--transition);
  border: 1px solid transparent; position: relative;
  min-height: 150px; display: flex; flex-direction: column;
}
.note-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.note-card.cat-geral    { background: #eff6ff; border-color: #bfdbfe; }
.note-card.cat-reuniao  { background: #faf5ff; border-color: #e9d5ff; }
.note-card.cat-conversa { background: #f0fdf4; border-color: #bbf7d0; }
.note-card.cat-ideia    { background: #fffbeb; border-color: #fde68a; }
.note-card.cat-followup { background: #fff7ed; border-color: #fed7aa; }
.note-card .nh { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
.note-card .n-title { font-size: 13.5px; font-weight: 700; color: var(--text-primary); line-height: 1.3; }
.note-card .n-pin   { font-size: 14px; color: var(--warning); flex-shrink: 0; }
.note-card .n-body  { font-size: 12.5px; color: var(--text-secondary); flex: 1; line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; }
.note-card .nf        { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.note-card .nf-meta   { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
.note-card .nf-actions{ display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.note-card .n-del   { opacity: 0; transition: opacity .15s; }
.note-card:hover .n-del { opacity: 1; }

/* ============================================================
   EQUIPES
   ============================================================ */
.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-md); }
.dept-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.dc-header { padding: 14px var(--space-md); display: flex; align-items: center; justify-content: space-between; }
.dc-name  { font-size: 14px; font-weight: 700; color: #fff; }
.dc-badge { font-size: 11px; background: rgba(255,255,255,.2); color: #fff; padding: 2px 8px; border-radius: 10px; }
.dept-sac         .dc-header { background: #3b82f6; }
.dept-logistica   .dc-header { background: #8b5cf6; }
.dept-faturamento .dc-header { background: #10b981; }
.dept-estoque     .dc-header { background: #f59e0b; }
.dept-marketing   .dc-header { background: #ec4899; }
.dept-financeiro  .dc-header { background: #06b6d4; }
.dc-body { padding: var(--space-md); }
.dc-member { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border-light); }
.dc-member:last-child { border-bottom: none; }
.dc-m-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--text-primary); }
.dc-m-role { font-size: 11px; color: var(--text-muted); }

/* ============================================================
   RELATÓRIOS
   ============================================================ */
.stat-row { display: flex; align-items: center; gap: var(--space-md); padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.stat-row:last-child { border-bottom: none; }
.stat-label { flex: 1; font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.stat-bar   { flex: 2; }
.stat-val   { font-size: 13px; font-weight: 700; color: var(--text-primary); min-width: 36px; text-align: right; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  background: #f0f2f8;
}

/* ── Painel esquerdo (branding) ── */
.login-left {
  flex: 1;
  background: linear-gradient(145deg, #1a1d2e 0%, #232747 55%, #2d3a8c 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  position: relative;
  overflow: hidden;
}
.login-left::before {
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(79,110,247,.35) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.login-left::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(168,85,247,.2) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.ll-brand { position: relative; z-index: 1; }
.ll-mark {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, #4f6ef7, #7c3aed);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  box-shadow: 0 8px 24px rgba(79,110,247,.4);
  margin-bottom: 20px;
}
.ll-title {
  font-size: 26px; font-weight: 800;
  color: #fff;
  letter-spacing: -.5px;
  line-height: 1.2;
  margin-bottom: 8px;
}
.ll-sub {
  font-size: 14px;
  color: rgba(255,255,255,.55);
  line-height: 1.5;
  max-width: 300px;
}

.ll-features { position: relative; z-index: 1; margin: auto 0; padding: 40px 0; }
.ll-feat-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.ll-feat-item:last-child { border-bottom: none; }
.ll-feat-icon {
  width: 38px; height: 38px;
  background: rgba(255,255,255,.08);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.ll-feat-text strong {
  display: block;
  font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,.9);
}
.ll-feat-text span {
  font-size: 12px;
  color: rgba(255,255,255,.42);
}

.ll-footer {
  position: relative; z-index: 1;
  font-size: 12px;
  color: rgba(255,255,255,.28);
}

/* ── Painel direito (formulário) ── */
.login-right {
  width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: #fff;
  box-shadow: -8px 0 40px rgba(15,23,42,.06);
}
.login-form-wrap { width: 100%; max-width: 360px; }

.lf-header { margin-bottom: 32px; }
.lf-header h2 {
  font-size: 22px; font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.4px;
  margin-bottom: 6px;
}
.lf-header p { font-size: 13px; color: var(--text-muted); }

.lf-group { margin-bottom: 18px; }
.lf-label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: .3px;
  text-transform: uppercase;
  margin-bottom: 7px;
}
.lf-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-primary);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.lf-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,110,247,.12);
}
.lf-input::placeholder { color: var(--text-muted); }

.lf-pass-wrap { position: relative; }
.lf-pass-wrap .lf-input { padding-right: 44px; }
.lf-pass-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; padding: 4px; cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}
.lf-pass-toggle:hover { color: var(--text-primary); }

.lf-btn {
  width: 100%; height: 48px;
  background: linear-gradient(135deg, #4f6ef7, #3b5bdb);
  color: #fff; border: none;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 700;
  letter-spacing: .2px;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: 0 4px 14px rgba(79,110,247,.38);
  transition: opacity .15s, transform .1s, box-shadow .15s;
}
.lf-btn:hover  { opacity: .93; box-shadow: 0 6px 20px rgba(79,110,247,.45); }
.lf-btn:active { transform: scale(.985); }

.lf-error {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fca5a5;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px; font-weight: 500;
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px;
}

.lf-footer {
  text-align: center;
  margin-top: 28px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Responsivo ── */
@media (max-width: 768px) {
  .login-left   { display: none; }
  .login-right  { width: 100%; padding: 32px 24px; box-shadow: none; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.flex            { display: flex; }
.flex-col        { flex-direction: column; }
.items-center    { align-items: center; }
.items-start     { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-wrap { flex-wrap: wrap; }
.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-auto { margin-top: auto; }
.text-primary   { color: var(--text-primary)   !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-muted)     !important; }
.text-danger    { color: var(--danger)         !important; }
.text-success   { color: var(--success)        !important; }
.text-warning   { color: var(--warning)        !important; }
.text-info      { color: var(--info)           !important; }
.fs-11 { font-size: 11px; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-15 { font-size: 15px; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.w-full  { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 1100px) {
  .kanban-board { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-240px); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .page-content { padding: var(--space-md); }
  .kanban-board { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 0 var(--space-md); }
  .dept-grid { grid-template-columns: 1fr; }
  .standup-grid { grid-template-columns: 1fr; }
  .mobile-menu-btn { display: flex !important; }
}
@media (max-width: 480px) {
  .kpi-grid   { grid-template-columns: 1fr; }
  .form-row   { grid-template-columns: 1fr; }
  .notes-grid { grid-template-columns: 1fr; }
}

/* Mobile overlay + toggle */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99; }
.sidebar-overlay.open { display: block; }
.mobile-menu-btn {
  display: none; width: 36px; height: 36px;
  align-items: center; justify-content: center;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  font-size: 20px; color: var(--text-secondary); margin-right: var(--space-sm);
}
