/* ============================================================
   CRM Graham Consórcios — style.css
   Identidade Visual v1.0
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

/* ── Variáveis ─────────────────────────────────────────────── */
:root {
  --bg:      #0d0f14;
  --bg2:     #13161e;
  --bg3:     #1a1e28;
  --bg4:     #222637;
  --border:  #2a2f42;
  --border2: #363c54;

  --accent:  #4f8ef7;
  --accent2: #7c5cf5;
  --accent3: #00d4aa;
  --warn:    #f7a24f;
  --danger:  #f75f5f;
  --success: #4fc87a;

  --text:    #e8eaf0;
  --text2:   #9ba3bc;
  --text3:   #5c6480;

  --sw:  220px;
  --swc: 64px;
  --r:   10px;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ══════════════════════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════════════════════ */

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

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--swc);
  min-width: var(--swc);
  height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width .25s ease, min-width .25s ease;
  position: relative;
  z-index: 100;
  flex-shrink: 0;
}

.sidebar:hover {
  width: var(--sw);
  min-width: var(--sw);
}

.sidebar-logo {
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
}

.sidebar-logo img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  opacity: 0;
  transition: opacity .2s ease;
  line-height: 1.2;
}

.sidebar:hover .sidebar-logo-text { opacity: 1; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
}

.nav-section-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 12px 20px 4px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .2s ease;
}

.sidebar:hover .nav-section-label { opacity: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: rgba(255,255,255,.04);
  color: var(--text);
}

.nav-item.active {
  color: var(--accent);
  background: rgba(79,142,247,.08);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-item-label {
  opacity: 0;
  transition: opacity .2s ease;
}

.sidebar:hover .nav-item-label { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  opacity: 0;
  transition: opacity .2s ease;
}

.sidebar:hover .nav-badge { opacity: 1; }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 8px 0;
  flex-shrink: 0;
}

/* ── Main ───────────────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  height: 60px;
  min-height: 60px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 50;
  flex-shrink: 0;
}

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

.topbar-subtitle {
  font-size: 11px;
  color: var(--text3);
  font-weight: 400;
}

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

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--r);
  background: var(--bg3);
  border: 1px solid var(--border);
}

.topbar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.topbar-user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.topbar-user-role {
  font-size: 10px;
  color: var(--text3);
}

/* ── Content ────────────────────────────────────────────────── */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ── Page ───────────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }

/* ══════════════════════════════════════════════════════════════
   COMPONENTES
   ══════════════════════════════════════════════════════════════ */

/* ── Botões ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  transition: opacity .15s ease, transform .15s ease, background .15s ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover { opacity: .88; }
.btn:active { transform: scale(.97); }

.btn svg { width: 14px; height: 14px; }

.btn-primary  { background: var(--accent);  color: #fff; }
.btn-success  { background: var(--success); color: #fff; }
.btn-danger   { background: var(--danger);  color: #fff; }
.btn-purple   { background: var(--accent2); color: #fff; }
.btn-orange   { background: var(--warn);    color: #fff; }
.btn-teal     { background: var(--accent3); color: #000; }

.btn-ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg3); color: var(--text); }

.btn-sm {
  font-size: 11px;
  padding: 4px 9px;
}

.btn-icon {
  padding: 7px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 7px;
}
.btn-icon:hover { color: var(--text); background: var(--bg4); }
.btn-icon svg { width: 15px; height: 15px; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-green  { background: rgba(79,200,122,.15);  color: var(--success); }
.badge-blue   { background: rgba(79,142,247,.15);  color: var(--accent); }
.badge-orange { background: rgba(247,162,79,.15);  color: var(--warn); }
.badge-red    { background: rgba(247,95,95,.15);   color: var(--danger); }
.badge-purple { background: rgba(124,92,245,.15);  color: var(--accent2); }
.badge-teal   { background: rgba(0,212,170,.15);   color: var(--accent3); }
.badge-gray   { background: rgba(155,163,188,.1);  color: var(--text3); }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 11px;
  color: var(--text3);
}

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

/* ── Stat Cards ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}

.stat-card.blue::before   { background: var(--accent); }
.stat-card.green::before  { background: var(--success); }
.stat-card.purple::before { background: var(--accent2); }
.stat-card.orange::before { background: var(--warn); }
.stat-card.red::before    { background: var(--danger); }
.stat-card.teal::before   { background: var(--accent3); }

.stat-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.stat-value {
  font-family: 'DM Mono', monospace;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-value.blue   { color: var(--accent); }
.stat-value.green  { color: var(--success); }
.stat-value.purple { color: var(--accent2); }
.stat-value.orange { color: var(--warn); }
.stat-value.red    { color: var(--danger); }
.stat-value.teal   { color: var(--accent3); }

.stat-meta {
  font-size: 11px;
  color: var(--text3);
}

/* ── Formulários ────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 5px;
}

.form-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 11px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color .15s ease;
}

.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text3); }

.form-input[type="date"],
.form-input[type="time"],
.form-input[type="datetime-local"] {
  color-scheme: dark;
}

select.form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235c6480' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

textarea.form-input {
  resize: vertical;
  min-height: 70px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

/* ── Tabelas ────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--r);
  border: 1px solid var(--border);
}

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

thead th {
  background: var(--bg3);
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 9px 14px;
  text-align: left;
  white-space: nowrap;
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
  font-size: 13px;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover td { background: rgba(255,255,255,.02); }

/* ── Modal ──────────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.78);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  overflow-y: auto;
  transform: translateY(10px);
  transition: transform .2s ease;
}

.overlay.open .modal { transform: translateY(0); }

.modal-lg { max-width: 720px; }
.modal-xl { max-width: 900px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color .15s;
}
.modal-close:hover { color: var(--text); }

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ── Toast ──────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  min-width: 260px;
  max-width: 360px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  animation: toastIn .25s ease;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.warn    { border-left: 3px solid var(--warn); }
.toast.info    { border-left: 3px solid var(--accent); }

.toast-icon { font-size: 16px; flex-shrink: 0; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Divider ────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text3);
  text-align: center;
  gap: 12px;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  opacity: .4;
}

.empty-state-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text2);
}

.empty-state-text {
  font-size: 12px;
  max-width: 280px;
  line-height: 1.6;
}

/* ── Search / Filter Bar ────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.search-input {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-input input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 11px 7px 34px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
}

.search-input input:focus { border-color: var(--accent); }
.search-input input::placeholder { color: var(--text3); }

.search-input svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text3);
}

/* ── Tabs ───────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 20px;
  width: fit-content;
}

.tab {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  cursor: pointer;
  border: none;
  background: none;
  transition: all .15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab:hover { color: var(--text2); }

.tab.active {
  background: var(--bg4);
  color: var(--text);
}

.tab svg { width: 13px; height: 13px; }

/* ── Page Header ────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-header-left {}

.page-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.page-header p {
  font-size: 12px;
  color: var(--text3);
}

.page-header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

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

/* ── Funil ──────────────────────────────────────────────────── */
.funnel-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.funnel-step {
  display: flex;
  align-items: center;
  gap: 12px;
}

.funnel-bar-wrap {
  flex: 1;
  height: 28px;
  background: var(--bg3);
  border-radius: 4px;
  overflow: hidden;
}

.funnel-bar {
  height: 100%;
  border-radius: 4px;
  transition: width .5s ease;
  display: flex;
  align-items: center;
  padding-left: 10px;
}

.funnel-step-name {
  width: 130px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-align: right;
  flex-shrink: 0;
}

.funnel-count {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--text3);
  width: 50px;
  flex-shrink: 0;
}

.funnel-pct {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text3);
  width: 40px;
  flex-shrink: 0;
  text-align: right;
}

/* ── Kanban ─────────────────────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  min-height: calc(100vh - 220px);
}

.kanban-col {
  min-width: 230px;
  max-width: 230px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
}

.kanban-col-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.kanban-col-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.kanban-col-count {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text3);
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 10px;
}

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

.kanban-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer !important;
  transition: border-color .15s, transform .15s;
  user-select: none;
  position: relative;
  z-index: 1;
}

.kanban-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79,142,247,.1);
}

.kanban-card * {
  pointer-events: none;
}

.kanban-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.kanban-card-sub {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 8px;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

/* ── Avatar ─────────────────────────────────────────────────── */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.avatar-sm {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

/* ── Agenda ─────────────────────────────────────────────────── */
.agenda-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.agenda-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agenda-date-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  min-width: 200px;
  text-align: center;
}

/* Calendar Month */
.cal-month {
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.cal-month-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}

.cal-month-day-name {
  padding: 8px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
}

.cal-month-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-day {
  min-height: 88px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 6px;
  cursor: pointer;
  transition: background .15s;
  position: relative;
}

.cal-day:nth-child(7n) { border-right: none; }
.cal-day:hover { background: rgba(255,255,255,.02); }

.cal-day.today { background: rgba(79,142,247,.06); }
.cal-day.today .cal-day-num { color: var(--accent); font-weight: 700; }
.cal-day.other-month .cal-day-num { color: var(--text3); }

.cal-day-num {
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 4px;
}

.cal-event {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 3px;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.cal-event.reuniao  { background: rgba(79,142,247,.2); color: var(--accent); }
.cal-event.tarefa   { background: rgba(92,100,128,.15); color: var(--text3); border: 1px dashed var(--border2); }
.cal-event.recorr   { background: rgba(124,92,245,.2); color: var(--accent2); }

/* Calendar Week/Day */
.cal-week {
  display: grid;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.cal-week-head {
  display: grid;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}

.cal-week-time-col {
  width: 56px;
  flex-shrink: 0;
}

.cal-week-body {
  display: flex;
  overflow-y: auto;
  max-height: calc(100vh - 280px);
}

.cal-time-gutter {
  width: 56px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
}

.cal-time-slot {
  height: 48px;
  display: flex;
  align-items: flex-start;
  padding: 2px 8px 0 0;
  font-size: 10px;
  color: var(--text3);
  font-family: 'DM Mono', monospace;
  justify-content: flex-end;
  border-bottom: 1px solid rgba(42,47,66,.5);
}

.cal-day-col {
  flex: 1;
  border-right: 1px solid var(--border);
  position: relative;
  min-width: 100px;
}

.cal-day-col:last-child { border-right: none; }

.cal-day-slot {
  height: 48px;
  border-bottom: 1px solid rgba(42,47,66,.5);
  transition: background .1s;
  cursor: pointer;
}

.cal-day-slot:hover { background: rgba(255,255,255,.02); }

.cal-event-block {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 600;
  overflow: hidden;
  cursor: pointer;
  z-index: 1;
}

.cal-event-block.reuniao { background: rgba(79,142,247,.3); border-left: 3px solid var(--accent); color: var(--accent); }
.cal-event-block.tarefa  { background: rgba(92,100,128,.1); border-left: 3px dashed var(--border2); color: var(--text3); }
.cal-event-block.recorr  { background: rgba(124,92,245,.25); border-left: 3px solid var(--accent2); color: var(--accent2); }

/* Agenda List */
.agenda-list { display: flex; flex-direction: column; gap: 8px; }

.agenda-list-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color .15s;
  cursor: pointer;
}

.agenda-list-item:hover { border-color: var(--border2); }

.agenda-list-time {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  min-width: 80px;
}

.agenda-list-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.agenda-list-content { flex: 1; }

.agenda-list-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.agenda-list-sub {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}

/* ── Checkbox ───────────────────────────────────────────────── */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ── Separador de seção ─────────────────────────────────────── */
.section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Notificação badge ──────────────────────────────────────── */
.notif-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
}

/* ── Login ──────────────────────────────────────────────────── */
#login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.login-logo {
  margin-bottom: 24px;
}

.login-logo img {
  height: 48px;
  object-fit: contain;
}

.login-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 28px;
}

.login-box .form-group {
  text-align: left;
}

.login-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 10px;
  display: none;
}

/* ── Histórico de interações ────────────────────────────────── */
.historico-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.historico-item {
  display: flex;
  gap: 12px;
  padding-bottom: 16px;
  position: relative;
}

.historico-item::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 26px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.historico-item:last-child::before { display: none; }

.historico-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  border: 2px solid var(--border);
}

.historico-body { flex: 1; }

.historico-titulo {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.historico-data {
  font-size: 10px;
  color: var(--text3);
  margin-top: 2px;
}

.historico-nota {
  font-size: 12px;
  color: var(--text2);
  margin-top: 4px;
  background: var(--bg3);
  border-radius: 6px;
  padding: 6px 10px;
  border-left: 2px solid var(--border2);
}

/* ── Responsivo ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .kanban-board { min-height: 400px; }
  .page-header { flex-direction: column; }
  .filter-bar { flex-direction: column; align-items: stretch; }
}
