/* ============================================================
   LAKE FLOW - Identidade visual
   Azul ciano -> Azul -> Indigo -> Roxo
   ============================================================ */

:root {
  --lf-cyan:      #29B6F6;
  --lf-blue:      #2F6BFF;
  --lf-blue-dark: #1D4ED8;
  --lf-indigo:    #4F46E5;
  --lf-purple:    #6D3EF0;
  --lf-violet:    #7C3AED;

  --lf-gradient: linear-gradient(135deg, #29B6F6 0%, #2F6BFF 45%, #7C3AED 100%);

  --lf-navy:      #0F1E3D;
  --lf-text:      #101935;
  --lf-text-2:    #64748B;
  --lf-text-3:    #94A3B8;

  --lf-bg:        #F7F9FC;
  --lf-surface:   #FFFFFF;
  --lf-surface-2: #F1F5F9;
  --lf-border:    #E2E8F0;
  --lf-border-2:  #CBD5E1;

  --lf-success:   #10B981;
  --lf-warning:   #F59E0B;
  --lf-danger:    #EF4444;

  --lf-r-sm: 6px;
  --lf-r:    10px;
  --lf-r-lg: 16px;

  --lf-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --lf-shadow: 0 1px 2px rgba(15,30,61,.05);
  --lf-shadow-md: 0 6px 20px rgba(15,30,61,.08);
  --lf-shadow-lg: 0 24px 60px rgba(15,30,61,.18);
}

/* ---------- Reset local ---------- */

#lakeflow-root, #lakeflow-root * { box-sizing: border-box; }
#lakeflow-root {
  font-family: var(--lf-font);
  color: var(--lf-text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
#lakeflow-root h1, #lakeflow-root h2, #lakeflow-root h3, #lakeflow-root p { margin: 0; }
#lakeflow-root ul { margin: 0; padding: 0; list-style: none; }

.lakeflow-login-wall {
  max-width: 420px; margin: 3rem auto; padding: 2rem; text-align: center;
  border: 1px solid var(--lf-border); border-radius: var(--lf-r-lg); background: #fff;
}
.lakeflow-btn, #lakeflow-root .lf-btn-primary {
  display: inline-block; padding: 10px 20px; border-radius: var(--lf-r);
  background: var(--lf-gradient); color: #fff; text-decoration: none; font-weight: 600; border: none; cursor: pointer;
}
.lf-boot, .lf-loading {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 320px; color: var(--lf-text-2);
}
.lf-spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--lf-border); border-top-color: var(--lf-blue);
  animation: lf-spin .8s linear infinite;
}
@keyframes lf-spin { to { transform: rotate(360deg); } }

/* ---------- Layout ---------- */

.lf-app {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 82vh;
  background: var(--lf-bg);
  border: 1px solid var(--lf-border);
  border-radius: var(--lf-r-lg);
  overflow: hidden;
}

.lf-nav {
  background: var(--lf-surface);
  border-right: 1px solid var(--lf-border);
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 22px;
}
.lf-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.lf-brand-name { font-size: 19px; font-weight: 700; letter-spacing: -.3px; color: var(--lf-navy); }
.lf-brand-name span {
  background: var(--lf-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lf-brand-sub { font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--lf-text-3); }

.lf-nav nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.lf-nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border: none; background: none; cursor: pointer;
  border-radius: var(--lf-r); color: var(--lf-text-2); font: inherit; font-weight: 500;
  text-align: left; transition: all .16s ease;
}
.lf-nav-item:hover { background: var(--lf-surface-2); color: var(--lf-text); }
.lf-nav-item.active { background: rgba(47,107,255,.09); color: var(--lf-blue); font-weight: 600; }

.lf-nav-user {
  display: flex; align-items: center; gap: 10px;
  padding-top: 14px; border-top: 1px solid var(--lf-border);
}
.lf-nav-user-name { font-weight: 600; font-size: 13px; }

.lf-main { padding: 26px 30px 40px; overflow-x: hidden; }
.lf-menu-btn { display: none; }

.lf-page { display: flex; flex-direction: column; gap: 20px; }
.lf-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lf-page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -.4px; color: var(--lf-navy); }

/* ---------- Textos ---------- */

.lf-muted { color: var(--lf-text-2); }
.lf-sm { font-size: 12px; }
.lf-strong { font-weight: 600; }
.lf-late { color: var(--lf-danger); font-weight: 600; }
.lf-spacer { flex: 1; }

/* ---------- Botoes ---------- */

.lf-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--lf-r);
  border: 1px solid var(--lf-border-2); background: #fff; color: var(--lf-text);
  font: inherit; font-weight: 500; cursor: pointer; transition: all .16s ease;
}
.lf-btn:hover { border-color: var(--lf-blue); color: var(--lf-blue); }
.lf-btn-sm { padding: 6px 12px; font-size: 13px; }
.lf-btn-primary { background: var(--lf-gradient); color: #fff; border: none; font-weight: 600; }
.lf-btn-primary:hover { color: #fff; filter: brightness(1.06); }
.lf-btn-danger { border-color: #FECACA; color: var(--lf-danger); }
.lf-btn-danger:hover { background: #FEF2F2; border-color: var(--lf-danger); color: var(--lf-danger); }

.lf-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--lf-r-sm);
  border: none; background: none; color: var(--lf-text-2); cursor: pointer;
}
.lf-icon-btn:hover { background: var(--lf-surface-2); color: var(--lf-text); }

.lf-link {
  display: inline-flex; align-items: center; gap: 5px;
  border: none; background: none; color: var(--lf-blue); font: inherit; font-weight: 500; cursor: pointer; padding: 0;
}

/* ---------- Formularios ---------- */

#lakeflow-root input, #lakeflow-root select, #lakeflow-root textarea {
  width: 100%; padding: 9px 12px; font: inherit; color: var(--lf-text);
  background: #fff; border: 1px solid var(--lf-border); border-radius: var(--lf-r-sm);
  transition: border-color .16s ease, box-shadow .16s ease;
}
#lakeflow-root input[type="checkbox"] { width: auto; }
#lakeflow-root input[type="color"] { height: 38px; padding: 3px; }
#lakeflow-root input:focus, #lakeflow-root select:focus, #lakeflow-root textarea:focus {
  outline: none; border-color: var(--lf-blue); box-shadow: 0 0 0 3px rgba(47,107,255,.12);
}
#lakeflow-root input:disabled, #lakeflow-root textarea:disabled, #lakeflow-root select:disabled {
  background: var(--lf-surface-2); color: var(--lf-text-2); cursor: not-allowed;
}
#lakeflow-root textarea { resize: vertical; line-height: 1.6; }

.lf-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lf-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.lf-field-full { grid-column: 1 / -1; }
.lf-field label { font-size: 12px; font-weight: 600; color: var(--lf-text-2); }
.lf-hint { font-size: 11px; color: var(--lf-text-3); }

.lf-inline { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.lf-inline-tight { gap: 6px; margin-bottom: 0; }
.lf-inline .lf-btn { flex-shrink: 0; }

.lf-search { position: relative; display: flex; align-items: center; }
.lf-search i { position: absolute; left: 11px; color: var(--lf-text-3); }
.lf-search input { padding-left: 34px; min-width: 220px; }
.lf-search-wide input { min-width: 340px; }

/* ---------- Toolbar / tabs ---------- */

.lf-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.lf-toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lf-toolbar select { width: auto; min-width: 190px; }
.lf-range { font-size: 14px; color: var(--lf-navy); margin-left: 6px; }

.lf-tabs {
  display: inline-flex; gap: 3px; padding: 3px;
  background: var(--lf-surface-2); border-radius: var(--lf-r);
}
.lf-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border: none; background: none; border-radius: var(--lf-r-sm);
  font: inherit; font-weight: 500; color: var(--lf-text-2); cursor: pointer; transition: all .16s ease;
}
.lf-tab:hover { color: var(--lf-text); }
.lf-tab.active { background: #fff; color: var(--lf-blue); font-weight: 600; box-shadow: var(--lf-shadow); }
.lf-tabs-sm { margin-bottom: 18px; }

/* ---------- Cards e stats ---------- */

.lf-card {
  background: var(--lf-surface); border: 1px solid var(--lf-border);
  border-radius: var(--lf-r-lg); padding: 20px;
}
.lf-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.lf-card-head h2 { font-size: 16px; font-weight: 600; color: var(--lf-navy); }

.lf-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.lf-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.lf-stat {
  display: flex; align-items: center; gap: 13px;
  background: var(--lf-surface); border: 1px solid var(--lf-border);
  border-radius: var(--lf-r-lg); padding: 16px 18px;
}
.lf-stat-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.lf-tone-blue   { background: var(--lf-blue); }
.lf-tone-indigo { background: var(--lf-indigo); }
.lf-tone-purple { background: var(--lf-purple); }
.lf-tone-cyan   { background: var(--lf-cyan); }
.lf-stat-value { font-size: 21px; font-weight: 700; color: var(--lf-navy); letter-spacing: -.4px; }
.lf-stat-label { font-size: 12px; color: var(--lf-text-2); }

.lf-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }

/* ---------- Listas ---------- */

.lf-list li, .lf-timeline li {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--lf-border);
}
.lf-list li:last-child, .lf-timeline li:last-child { border-bottom: none; }
.lf-list li > div:first-child, .lf-timeline li > div { flex: 1; min-width: 0; }
.lf-time { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--lf-navy); width: 44px; flex-shrink: 0; }
.lf-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.lf-subsection { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--lf-border); }
.lf-subsection h3 { font-size: 14px; font-weight: 600; color: var(--lf-navy); margin-bottom: 8px; }

/* ---------- Avatares e badges ---------- */

.lf-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--lf-gradient); color: #fff; font-size: 12px; font-weight: 600;
}
.lf-avatar-sm { width: 26px; height: 26px; font-size: 10px; }
.lf-avatar-lg { width: 46px; height: 46px; font-size: 15px; }

.lf-badge {
  display: inline-block; padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.lf-pri-alta  { background: #FEE2E2; color: #991B1B; }
.lf-pri-media { background: #FEF3C7; color: #92400E; }
.lf-pri-baixa { background: #D1FAE5; color: #065F46; }

.lf-st-agendado   { background: #E0E7FF; color: #3730A3; }
.lf-st-confirmado { background: #DBEAFE; color: #1E40AF; }
.lf-st-presente   { background: #D1FAE5; color: #065F46; }
.lf-st-falta      { background: #FEE2E2; color: #991B1B; }
.lf-st-cancelado  { background: #F1F5F9; color: #64748B; }

.lf-status-ativo    { background: #D1FAE5; color: #065F46; }
.lf-status-pausado, .lf-status-afastado { background: #FEF3C7; color: #92400E; }
.lf-status-inativo  { background: #F1F5F9; color: #64748B; }
.lf-status-alta     { background: #E0E7FF; color: #3730A3; }

.lf-tag {
  display: inline-block; padding: 3px 9px; border-radius: var(--lf-r-sm);
  background: rgba(79,70,229,.09); color: var(--lf-indigo); font-size: 11px; font-weight: 600;
}
.lf-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }

/* ---------- Kanban ---------- */

.lf-board {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(258px, 1fr);
  gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start;
}
.lf-col {
  background: var(--lf-surface-2); border-radius: var(--lf-r-lg);
  padding: 14px; min-height: 340px; display: flex; flex-direction: column;
}
.lf-col-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.lf-col-head h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--lf-text-2); }
.lf-count {
  background: #fff; color: var(--lf-blue); font-size: 11px; font-weight: 700;
  padding: 1px 8px; border-radius: 20px;
}
.lf-col-body { display: flex; flex-direction: column; gap: 9px; flex: 1; }
.lf-col-empty { text-align: center; color: var(--lf-text-3); font-size: 12px; padding: 20px 0; }

.lf-task {
  background: #fff; border: 1px solid var(--lf-border); border-radius: var(--lf-r);
  padding: 12px; cursor: pointer; transition: all .16s ease;
}
.lf-task:hover { border-color: var(--lf-blue); box-shadow: var(--lf-shadow-md); transform: translateY(-1px); }
.lf-task.dragging { opacity: .45; }
.lf-task-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.lf-task-title { font-weight: 600; font-size: 13.5px; line-height: 1.4; margin-bottom: 9px; }
.lf-task-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 9px; border-top: 1px solid var(--lf-surface-2);
}
.lf-task-meta { display: flex; align-items: center; gap: 11px; font-size: 11.5px; color: var(--lf-text-2); }
.lf-task-meta span, .lf-task-meta > * { display: inline-flex; align-items: center; gap: 3px; }

/* ---------- Agenda ---------- */

.lf-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.lf-week-single { grid-template-columns: 1fr; }
.lf-day {
  background: var(--lf-surface); border: 1px solid var(--lf-border);
  border-radius: var(--lf-r); padding: 10px; min-height: 260px;
  display: flex; flex-direction: column;
}
.lf-day-today { border-color: var(--lf-blue); box-shadow: 0 0 0 3px rgba(47,107,255,.09); }
.lf-day-head {
  display: flex; align-items: baseline; gap: 6px;
  padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--lf-border);
}
.lf-day-name { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--lf-text-3); }
.lf-day-num { font-size: 17px; font-weight: 700; color: var(--lf-navy); }
.lf-day-body { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.lf-day-empty { text-align: center; color: var(--lf-text-3); font-size: 11px; padding: 14px 0; }
.lf-day-add {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  margin-top: 8px; padding: 6px; border: 1px dashed var(--lf-border-2); border-radius: var(--lf-r-sm);
  background: none; color: var(--lf-text-3); font: inherit; font-size: 11px; cursor: pointer;
}
.lf-day-add:hover { border-color: var(--lf-blue); color: var(--lf-blue); }

.lf-appt {
  display: flex; flex-direction: column; gap: 1px; text-align: left;
  padding: 8px 9px; border: 1px solid var(--lf-border); border-left: 3px solid var(--lf-blue);
  border-radius: var(--lf-r-sm); background: #fff; cursor: pointer; font: inherit;
  transition: all .16s ease;
}
.lf-appt:hover { box-shadow: var(--lf-shadow-md); transform: translateX(1px); }
.lf-appt-time { font-size: 11px; font-weight: 700; color: var(--lf-navy); font-variant-numeric: tabular-nums; }
.lf-appt-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-appt-meta { font-size: 10.5px; color: var(--lf-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-st-border-cancelado { opacity: .5; text-decoration: line-through; }
.lf-st-border-falta { background: #FEF2F2; }
.lf-st-border-presente { background: #F0FDF4; }

/* ---------- Tabela ---------- */

.lf-table-wrap {
  background: #fff; border: 1px solid var(--lf-border);
  border-radius: var(--lf-r-lg); overflow: hidden;
}
.lf-table { width: 100%; border-collapse: collapse; }
.lf-table th {
  text-align: left; padding: 12px 16px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px; color: var(--lf-text-3);
  background: var(--lf-surface-2); border-bottom: 1px solid var(--lf-border);
}
.lf-table td { padding: 12px 16px; border-bottom: 1px solid var(--lf-border); vertical-align: middle; }
.lf-table tbody tr { cursor: pointer; transition: background .14s ease; }
.lf-table tbody tr:hover { background: var(--lf-surface-2); }
.lf-table tbody tr:last-child td { border-bottom: none; }
.lf-cell-user { display: flex; align-items: center; gap: 10px; }

/* ---------- Pessoa ---------- */

.lf-person {
  display: flex; gap: 13px; align-items: flex-start;
  background: #fff; border: 1px solid var(--lf-border); border-radius: var(--lf-r-lg);
  padding: 16px; cursor: pointer; transition: all .16s ease;
}
.lf-person:hover { border-color: var(--lf-blue); box-shadow: var(--lf-shadow-md); }
.lf-person-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.lf-person-meta { display: flex; flex-direction: column; gap: 3px; margin-top: 5px; }
.lf-person-meta li { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--lf-text-2); }

/* ---------- Prontuarios ---------- */

.lf-records { display: flex; flex-direction: column; gap: 10px; }
.lf-record {
  background: #fff; border: 1px solid var(--lf-border); border-left: 3px solid var(--lf-indigo);
  border-radius: var(--lf-r); padding: 14px 16px; cursor: pointer; transition: all .16s ease;
}
.lf-record:hover { box-shadow: var(--lf-shadow-md); }
.lf-record-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.lf-record-badges { display: flex; align-items: center; gap: 8px; color: var(--lf-text-3); }
.lf-record-text { font-size: 13px; color: var(--lf-text-2); line-height: 1.6; }

.lf-lock {
  display: flex; align-items: center; gap: 9px; margin-top: 16px;
  padding: 11px 14px; background: var(--lf-surface-2); border-radius: var(--lf-r);
  font-size: 13px; font-weight: 500; cursor: pointer;
}

/* ---------- Notas / alertas ---------- */

.lf-note {
  display: flex; align-items: flex-start; gap: 9px; margin-top: 14px;
  padding: 11px 14px; background: rgba(47,107,255,.07); border-radius: var(--lf-r);
  font-size: 12.5px; color: #1E3A8A; line-height: 1.55;
}
.lf-alert {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 14px 16px; background: #FFFBEB; border: 1px solid #FDE68A;
  border-radius: var(--lf-r); color: #92400E;
}
.lf-chiprow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.lf-chip {
  padding: 4px 11px; border-radius: 20px; border: 1px solid #FDE68A;
  background: #fff; color: #92400E; font: inherit; font-size: 12px; cursor: pointer;
}
.lf-chip:hover { background: #FEF3C7; }

/* ---------- Checklist / log ---------- */

.lf-check li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--lf-border);
}
.lf-check label { display: flex; align-items: center; gap: 9px; flex: 1; cursor: pointer; font-size: 13.5px; }
.lf-check .done { text-decoration: line-through; color: var(--lf-text-3); }

.lf-log li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--lf-border); }
.lf-log li:last-child { border-bottom: none; }
.lf-log p { font-size: 13px; }

/* ---------- Empty ---------- */

.lf-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7px; padding: 40px 20px; text-align: center; color: var(--lf-text-3);
}
.lf-empty-title { font-weight: 600; color: var(--lf-text-2); }

/* ---------- Modal ---------- */

.lf-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(15,30,61,.5); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 4vh 16px; overflow-y: auto;
  animation: lf-fade .18s ease;
}
@keyframes lf-fade { from { opacity: 0; } to { opacity: 1; } }
.lf-modal {
  background: #fff; border-radius: var(--lf-r-lg); box-shadow: var(--lf-shadow-lg);
  width: 100%; max-width: 520px; margin: auto 0;
  animation: lf-rise .22s ease;
}
.lf-modal-wide { max-width: 780px; }
@keyframes lf-rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.lf-modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 20px 22px 14px; border-bottom: 1px solid var(--lf-border);
}
.lf-modal-head h2 { font-size: 17px; font-weight: 700; color: var(--lf-navy); }
.lf-modal-head p { font-size: 12.5px; }
.lf-modal-body { padding: 20px 22px; }
.lf-modal-foot {
  display: flex; align-items: center; gap: 10px;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--lf-border);
}

/* ---------- Toast ---------- */

.lf-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 100000; padding: 12px 20px; border-radius: var(--lf-r);
  background: var(--lf-navy); color: #fff; font-size: 13.5px; font-weight: 500;
  box-shadow: var(--lf-shadow-lg); animation: lf-toast-in .22s ease;
}
.lf-toast-err { background: var(--lf-danger); }
@keyframes lf-toast-in { from { transform: translate(-50%, 12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ---------- Responsivo ---------- */

@media (max-width: 900px) {
  .lf-app { grid-template-columns: 1fr; }
  .lf-nav {
    position: fixed; inset: 0 auto 0 0; z-index: 9999; width: 232px;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: var(--lf-shadow-lg);
  }
  .lf-nav-open { transform: none; }
  .lf-menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; margin-bottom: 14px;
    border: 1px solid var(--lf-border); border-radius: var(--lf-r-sm);
    background: #fff; cursor: pointer;
  }
  .lf-main { padding: 18px 16px 32px; }
  .lf-grid-2 { grid-template-columns: 1fr; }
  .lf-form { grid-template-columns: 1fr; }
  .lf-week { grid-template-columns: 1fr; }
  .lf-search input, .lf-search-wide input { min-width: 0; width: 100%; }
  .lf-toolbar select { width: 100%; }
  .lf-page-head h1 { font-size: 20px; }
}

/* ---------- Impressao ---------- */

@media print {
  .lf-nav, .lf-toolbar, .lf-page-head button, .lf-modal-foot { display: none !important; }
  .lf-app { border: none; grid-template-columns: 1fr; }
}

/* ============================================================
   NOTIFICACOES E MENCOES
   ============================================================ */

.lf-bell { position: relative; margin-top: auto; }
.lf-bell.has-unread { color: var(--lf-blue); font-weight: 600; }
.lf-bell-count {
  position: absolute; right: 10px;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
  background: var(--lf-danger); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 20px;
}

.lf-notif-wrap {
  position: fixed; inset: 0; z-index: 99998;
  background: rgba(15,30,61,.28);
  display: flex; align-items: flex-start; justify-content: flex-start;
  padding: 60px 0 0 244px;
}
.lf-notif-panel {
  width: 340px; max-height: 70vh; overflow-y: auto;
  background: #fff; border: 1px solid var(--lf-border);
  border-radius: var(--lf-r-lg); box-shadow: var(--lf-shadow-lg);
  animation: lf-rise .18s ease;
}
.lf-notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-bottom: 1px solid var(--lf-border);
  position: sticky; top: 0; background: #fff; border-radius: var(--lf-r-lg) var(--lf-r-lg) 0 0;
}
.lf-notif-list li {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 12px 16px; border-bottom: 1px solid var(--lf-border); cursor: pointer;
  transition: background .14s ease;
}
.lf-notif-list li:hover { background: var(--lf-surface-2); }
.lf-notif-list li:last-child { border-bottom: none; }
.lf-notif-list li.unread { background: rgba(47,107,255,.045); }
.lf-notif-list li.unread .lf-strong::after {
  content: ''; display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--lf-blue); margin-left: 6px; vertical-align: middle;
}
.lf-notif-icon {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.lf-nt-mencao      { background: var(--lf-purple); }
.lf-nt-indicacao   { background: var(--lf-blue); }
.lf-nt-agendamento { background: var(--lf-cyan); }

.lf-commentbox { position: relative; margin-bottom: 14px; }
.lf-commentbox .lf-inline { margin-bottom: 0; }
.lf-suggest {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 10;
  margin-top: 4px; background: #fff;
  border: 1px solid var(--lf-border); border-radius: var(--lf-r);
  box-shadow: var(--lf-shadow-md); overflow: hidden;
}
.lf-suggest li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; cursor: pointer; transition: background .14s ease;
}
.lf-suggest li:hover { background: rgba(47,107,255,.07); }

.lf-mention {
  background: rgba(79,70,229,.12); color: var(--lf-indigo);
  padding: 1px 5px; border-radius: 4px; font-weight: 600;
}

.lf-btn-on {
  background: rgba(47,107,255,.09);
  border-color: var(--lf-blue); color: var(--lf-blue); font-weight: 600;
}

@media (max-width: 900px) {
  .lf-notif-wrap { padding: 60px 12px 0; justify-content: center; }
  .lf-notif-panel { width: 100%; max-width: 380px; }
}

/* ============================================================
   TELA DE LOGIN
   ============================================================ */

.lf-login {
  font-family: var(--lf-font);
  min-height: 78vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 20px; padding: 40px 16px;
  background:
    radial-gradient(1000px 400px at 50% -10%, rgba(47,107,255,.09), transparent 70%),
    var(--lf-bg);
}
.lf-login-card {
  width: 100%; max-width: 396px;
  background: #fff; border: 1px solid var(--lf-border);
  border-radius: var(--lf-r-lg); box-shadow: var(--lf-shadow-md);
  padding: 34px 32px 28px; text-align: center;
}
.lf-login-logo { width: 210px; height: auto; margin: 0 auto 4px; display: block; }
.lf-login-sub { margin: 0 0 22px; font-size: 13.5px; color: var(--lf-text-2); }

.lf-login form { text-align: left; }
.lf-login label {
  display: block; margin-bottom: 5px;
  font-size: 12px; font-weight: 600; color: var(--lf-text-2);
}
.lf-login input[type="text"],
.lf-login input[type="password"] {
  width: 100%; box-sizing: border-box;
  padding: 11px 13px; margin-bottom: 15px;
  font: inherit; font-size: 14px; color: var(--lf-text);
  background: #fff; border: 1px solid var(--lf-border); border-radius: var(--lf-r-sm);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.lf-login input[type="text"]:focus,
.lf-login input[type="password"]:focus {
  outline: none; border-color: var(--lf-blue);
  box-shadow: 0 0 0 3px rgba(47,107,255,.12);
}
.lf-login-check {
  display: flex !important; align-items: center; gap: 8px;
  margin-bottom: 18px; font-weight: 500 !important; color: var(--lf-text-2);
  font-size: 13px; cursor: pointer;
}
.lf-login-check input { width: auto; margin: 0; }

.lf-login-btn {
  width: 100%; padding: 12px;
  background: var(--lf-gradient); color: #fff;
  border: none; border-radius: var(--lf-r);
  font: inherit; font-size: 14.5px; font-weight: 600;
  cursor: pointer; transition: filter .16s ease, transform .16s ease;
}
.lf-login-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.lf-login-btn:active { transform: none; }

.lf-login-link {
  display: inline-block; margin-top: 16px;
  font-size: 12.5px; color: var(--lf-text-2); text-decoration: none;
}
.lf-login-link:hover { color: var(--lf-blue); text-decoration: underline; }

.lf-login-erro {
  padding: 11px 14px; margin-bottom: 18px;
  background: #FEF2F2; border: 1px solid #FECACA; border-radius: var(--lf-r-sm);
  color: #991B1B; font-size: 13px; text-align: left;
}
.lf-login-foot { margin: 0; font-size: 12px; color: var(--lf-text-3); }

/* ============================================================
   EDITOR DE ETAPAS
   ============================================================ */

.lf-colsedit { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.lf-colsedit li {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; background: var(--lf-surface-2); border-radius: var(--lf-r);
}
.lf-colsedit-n {
  width: 22px; height: 22px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 50%;
  font-size: 11px; font-weight: 700; color: var(--lf-text-2);
}
.lf-colsedit input { flex: 1; min-width: 0; background: #fff; }
.lf-colsedit-c {
  flex-shrink: 0; padding: 2px 9px; border-radius: 20px;
  background: rgba(47,107,255,.1); color: var(--lf-blue);
  font-size: 11px; font-weight: 700;
}
.lf-colsedit .lf-icon-btn { width: 28px; height: 28px; flex-shrink: 0; }
.lf-colsedit .lf-icon-btn:disabled { opacity: .3; cursor: not-allowed; }
.lf-colsedit .lf-icon-btn:disabled:hover { background: none; }
.lf-icon-danger:hover { background: #FEF2F2 !important; color: var(--lf-danger) !important; }

.lf-btn-dash {
  width: 100%; justify-content: center;
  border-style: dashed; border-color: var(--lf-border-2);
  color: var(--lf-text-2); background: none;
}
.lf-btn-dash:hover { border-color: var(--lf-blue); background: rgba(47,107,255,.04); }

.lf-nav-user-info { flex: 1; min-width: 0; }
.lf-nav-user-info p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-nav-user .lf-icon-btn { flex-shrink: 0; text-decoration: none; }

/* ============================================================
   V3 - TOPBAR, GRUPOS DE MENU, QUADROS
   ============================================================ */

.lf-topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.lf-spin i { animation: lf-spin 1s linear infinite; }

.lf-navgroup { margin-bottom: 12px; }
.lf-navgroup-title {
  font-size: 10px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase;
  color: var(--lf-text-3); padding: 0 12px; margin-bottom: 5px;
}
.lf-brand-name { font-size: 19px; font-weight: 700; letter-spacing: -.3px; color: var(--lf-navy); }

/* Seletor de quadros */
.lf-boardbar {
  display: flex; gap: 7px; flex-wrap: wrap; align-items: center;
  padding-bottom: 14px; border-bottom: 1px solid var(--lf-border);
}
.lf-boardchip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border: 1.5px solid var(--lf-border); border-radius: 22px;
  background: #fff; font: inherit; font-size: 13px; font-weight: 500;
  color: var(--lf-text-2); cursor: pointer; transition: all .16s ease;
}
.lf-boardchip:hover { border-color: var(--lf-border-2); color: var(--lf-text); }
.lf-boardchip.active { color: var(--lf-navy); font-weight: 600; box-shadow: var(--lf-shadow); }
.lf-boardchip-add { border-style: dashed; color: var(--lf-text-3); }
.lf-boardchip-add:hover { border-color: var(--lf-blue); color: var(--lf-blue); }
.lf-chipcount {
  padding: 0 7px; border-radius: 20px; background: var(--lf-surface-2);
  font-size: 11px; font-weight: 700; color: var(--lf-text-2);
}
.lf-toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Card com cor, capa, etiquetas e botao concluir */
.lf-task { position: relative; overflow: hidden; }
.lf-task-color { position: absolute; inset: 0 auto 0 0; width: 4px; }
.lf-task-cover {
  display: block; width: calc(100% + 24px); margin: -12px -12px 10px;
  max-height: 116px; object-fit: cover;
}
.lf-task-done {
  width: 24px; height: 24px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--lf-border-2); border-radius: 50%;
  background: #fff; color: var(--lf-text-3); cursor: pointer; transition: all .16s ease;
}
.lf-task-done:hover { background: var(--lf-success); border-color: var(--lf-success); color: #fff; }
.lf-avatars { display: flex; align-items: center; }
.lf-avatars .lf-avatar { margin-left: -6px; border: 2px solid #fff; }
.lf-avatars .lf-avatar:first-child { margin-left: 0; }
.lf-avatar-more { background: var(--lf-surface-2) !important; color: var(--lf-text-2); font-size: 9px; }
.lf-done { color: var(--lf-success); font-weight: 600; }
.lf-col-arch { margin-left: auto; }

/* Responsaveis */
.lf-members { position: relative; }
.lf-memberchips { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.lf-memberchip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 6px 4px 4px; border-radius: 20px;
  background: var(--lf-surface-2); font-size: 12.5px; font-weight: 500;
}
.lf-chipx {
  width: 18px; height: 18px; border: none; border-radius: 50%;
  background: rgba(15,30,61,.08); color: var(--lf-text-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lf-chipx:hover { background: var(--lf-danger); color: #fff; }
.lf-memberlist {
  margin-top: 8px; max-height: 240px; overflow-y: auto;
  border: 1px solid var(--lf-border); border-radius: var(--lf-r); background: #fff;
}
.lf-memberlist li {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  cursor: pointer; border-bottom: 1px solid var(--lf-surface-2);
}
.lf-memberlist li:last-child { border-bottom: none; }
.lf-memberlist li:hover { background: var(--lf-surface-2); }
.lf-memberlist li.on { background: rgba(47,107,255,.06); color: var(--lf-blue); }
.lf-memberlist li > div { flex: 1; min-width: 0; }

/* Etiquetas em botao */
.lf-labelrow { display: flex; flex-wrap: wrap; gap: 6px; }
.lf-labelbtn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border: 1px solid transparent; border-radius: 20px;
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all .16s ease;
}
.lf-labelbtn:hover { filter: brightness(.96); }
.lf-tag {
  display: inline-block; padding: 3px 9px; border-radius: 5px;
  font-size: 11px; font-weight: 700;
}

/* Paleta */
.lf-colorpicker { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.lf-swatch {
  width: 26px; height: 26px; border-radius: 8px; border: 2px solid transparent;
  cursor: pointer; padding: 0; transition: transform .14s ease;
}
.lf-swatch:hover { transform: scale(1.1); }
.lf-swatch.on { border-color: var(--lf-navy); box-shadow: 0 0 0 2px #fff inset; }
.lf-swatch-none {
  background: #fff; border: 1.5px dashed var(--lf-border-2); color: var(--lf-text-3);
  display: flex; align-items: center; justify-content: center;
}

/* Checklists */
.lf-checklist {
  padding: 14px; margin-bottom: 12px;
  background: var(--lf-surface-2); border-radius: var(--lf-r);
}
.lf-checklist-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.lf-checklist-title {
  flex: 1; background: transparent !important; border: none !important;
  font-weight: 700 !important; font-size: 14px !important; padding: 4px 6px !important;
}
.lf-checklist-title:focus { background: #fff !important; }
.lf-checklist-pct { font-size: 12px; font-weight: 700; color: var(--lf-blue); }
.lf-progress { height: 5px; border-radius: 3px; background: var(--lf-border); overflow: hidden; margin-bottom: 8px; }
.lf-progress span { display: block; height: 100%; background: var(--lf-gradient); transition: width .25s ease; }
.lf-checkdate {
  flex-shrink: 0; padding: 2px 7px; border-radius: 20px;
  background: rgba(16,185,129,.13); color: #065F46; font-size: 10.5px; font-weight: 700;
}
.lf-check li { border-bottom-color: rgba(226,232,240,.7); }

/* Entregas */
.lf-deliveries li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 12px; margin-bottom: 7px;
  background: var(--lf-surface-2); border-radius: var(--lf-r); color: var(--lf-text-2);
}
.lf-deliveries li > div { flex: 1; min-width: 0; }
.lf-a { color: var(--lf-blue); text-decoration: none; word-break: break-all; }
.lf-a:hover { text-decoration: underline; }
.lf-linkpreview {
  margin-top: 8px; padding: 10px 12px;
  background: var(--lf-surface-2); border-radius: var(--lf-r);
  font-size: 12.5px; line-height: 1.6; word-break: break-word;
}

/* Anexos */
.lf-dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 26px 16px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--lf-border-2); border-radius: var(--lf-r-lg);
  color: var(--lf-text-2); transition: all .16s ease;
}
.lf-dropzone:hover, .lf-dropzone.on { border-color: var(--lf-blue); background: rgba(47,107,255,.04); color: var(--lf-blue); }
.lf-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px; margin-top: 14px;
}
.lf-gallery figure { margin: 0; border: 1px solid var(--lf-border); border-radius: var(--lf-r); overflow: hidden; background: #fff; }
.lf-gallery img { display: block; width: 100%; height: 96px; object-fit: cover; }
.lf-filebox {
  display: flex; align-items: center; justify-content: center;
  height: 96px; background: var(--lf-surface-2); color: var(--lf-danger);
}
.lf-gallery figcaption {
  display: flex; align-items: center; gap: 4px; padding: 5px 6px 5px 9px;
  font-size: 11px; color: var(--lf-text-2);
}
.lf-gallery figcaption span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Calendario mensal do marketing */
.lf-month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.lf-month-wd {
  padding: 6px 0; text-align: center;
  font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--lf-text-3);
}
.lf-mday {
  min-height: 104px; padding: 6px; background: #fff;
  border: 1px solid var(--lf-border); border-radius: var(--lf-r-sm);
  display: flex; flex-direction: column; gap: 4px;
}
.lf-mday.fora { background: var(--lf-surface-2); opacity: .6; }
.lf-mday.hoje { border-color: var(--lf-blue); box-shadow: 0 0 0 2px rgba(47,107,255,.1); }
.lf-mday-n { font-size: 12px; font-weight: 700; color: var(--lf-text-2); }
.lf-mday.hoje .lf-mday-n { color: var(--lf-blue); }
.lf-mday-body { display: flex; flex-direction: column; gap: 3px; }
.lf-mtask {
  display: flex; flex-direction: column; text-align: left; gap: 1px;
  padding: 4px 6px; border: none; border-left: 3px solid var(--lf-blue); border-radius: 4px;
  background: var(--lf-surface-2); cursor: pointer; font: inherit; transition: all .14s ease;
}
.lf-mtask:hover { background: rgba(47,107,255,.09); }
.lf-mtask-b { font-size: 9px; font-weight: 700; color: var(--lf-text-3); text-transform: uppercase; letter-spacing: .3px; }
.lf-mtask-t { font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Barra de proporcao */
.lf-barwrap { display: flex; flex-direction: column; gap: 10px; }
.lf-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--lf-surface-2); }
.lf-bar span { display: block; }
.lf-barleg { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--lf-text-2); }
.lf-barleg li { display: flex; align-items: center; gap: 6px; }
.lf-barleg strong { color: var(--lf-navy); }

/* Tons extras */
.lf-tone-green { background: var(--lf-success); }
.lf-tone-red   { background: var(--lf-danger); }
.lf-badge.lf-neutral { background: var(--lf-surface-2); color: var(--lf-text-2); }
.lf-btn-ok { border-color: rgba(16,185,129,.4); color: #047857; }
.lf-btn-ok:hover { background: rgba(16,185,129,.08); border-color: var(--lf-success); color: #047857; }
.lf-modal-accent { height: 4px; border-radius: var(--lf-r-lg) var(--lf-r-lg) 0 0; }
.lf-archlist li { gap: 10px; }

@media (max-width: 900px) {
  .lf-month { font-size: 11px; }
  .lf-mday { min-height: 72px; }
  .lf-mtask-b { display: none; }
  .lf-gallery { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
}

/* ============================================================
   V3.1 - AUTOSAVE, ACESSOS, CARD COLORIDO
   ============================================================ */

/* Card com cor e estado de concluido */
.lf-task-color { position: absolute; inset: 0 0 auto 0; width: auto; height: 5px; }
.lf-task { padding-top: 15px; }
.lf-task-ok { opacity: .8; }
.lf-risc { text-decoration: line-through; color: var(--lf-text-2); }
.lf-task-actions { display: flex; align-items: center; gap: 5px; }
.lf-task-arch {
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 50%;
  background: none; color: var(--lf-text-3); cursor: pointer; transition: all .16s ease;
}
.lf-task-arch:hover { background: var(--lf-surface-2); color: var(--lf-text); }
.lf-task-done.on { background: var(--lf-success); border-color: var(--lf-success); color: #fff; }
.lf-task-done.on:hover { background: #059669; }
.lf-tags { margin-bottom: 8px; }

/* Indicador de salvamento */
.lf-autohint {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 12px; font-size: 12px; color: var(--lf-text-3);
}
.lf-autosave {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
  background: var(--lf-surface-2); color: var(--lf-text-2);
}
.lf-autosave.salvo { background: rgba(16,185,129,.12); color: #047857; }
.lf-autosave.salvando i { animation: lf-spin 1s linear infinite; }
.lf-btn-ok.on { background: rgba(16,185,129,.12); border-color: var(--lf-success); font-weight: 600; }

/* Comentarios e itens editaveis */
.lf-log li { align-items: flex-start; }
.lf-log-body { flex: 1; min-width: 0; }

.lf-delivery-edit { flex-wrap: wrap; align-items: flex-start; }


/* Acessos */
.lf-accessbox {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 14px 16px; border-radius: var(--lf-r);
  background: var(--lf-surface-2); color: var(--lf-text-2);
}
.lf-accessbox-ok { background: rgba(16,185,129,.09); color: #065F46; }
.lf-accessbox code {
  padding: 2px 7px; border-radius: 5px; background: #fff;
  font-size: 13px; font-weight: 700; color: var(--lf-navy);
  border: 1px solid var(--lf-border);
}
.lf-person-side { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; flex-shrink: 0; }

/* Barra inferior do menu */
.lf-nav-actions { display: flex; gap: 6px; margin-top: 10px; }
.lf-nav-actions .lf-btn { flex: 1; justify-content: center; padding: 7px 8px; font-size: 12px; }
.lf-btn-exit { text-decoration: none; }
.lf-btn-exit:hover { border-color: var(--lf-danger); color: var(--lf-danger); }
.lf-nav-user { padding-bottom: 0; border-bottom: none; }

/* Troca obrigatoria de senha */
.lf-app-locked {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  grid-template-columns: none; min-height: 70vh; padding: 40px 20px;
}
.lf-locked-inner { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lf-locked-inner h1 { font-size: 22px; font-weight: 700; color: var(--lf-navy); margin-top: 8px; }

/* ============================================================
   V3.2 - ACOES SEMPRE VISIVEIS (editar / excluir)
   ============================================================ */

/* Grupo de botoes de acao — visivel sempre, inclusive no celular */
.lf-itemactions {
  display: flex; align-items: center; gap: 2px; flex-shrink: 0;
  padding: 2px; border-radius: 8px; background: rgba(15,30,61,.04);
}
.lf-itemactions .lf-icon-btn {
  width: 28px; height: 28px; border-radius: 6px;
  color: var(--lf-text-2); text-decoration: none;
}
.lf-itemactions .lf-icon-btn:hover { background: #fff; color: var(--lf-blue); box-shadow: var(--lf-shadow); }
.lf-itemactions .lf-icon-danger:hover { background: #FEF2F2; color: var(--lf-danger); box-shadow: none; }

.lf-log li { align-items: flex-start; gap: 10px; }
.lf-check li { gap: 8px; }
.lf-deliveries li { align-items: center; }

/* Anexos: legenda e acoes */
.lf-gallery figure { position: relative; display: flex; flex-direction: column; }
.lf-gallery figcaption { padding: 6px 8px 4px; }
.lf-renameinput {
  width: 100%; padding: 3px 6px !important; font-size: 11px !important;
  border-radius: 4px !important;
}
.lf-gallery .lf-itemactions {
  margin: 0 6px 6px; justify-content: center; background: var(--lf-surface-2);
}
.lf-gallery .lf-itemactions .lf-icon-btn { width: 30px; height: 26px; }

@media (max-width: 900px) {
  .lf-itemactions { background: transparent; }
  .lf-itemactions .lf-icon-btn { width: 34px; height: 34px; }
}

/* ============================================================
   V3.3 - BOTOES DE ACAO COM CONTORNO + LOGO CLICAVEL
   ============================================================ */

/* Botao de acao: contorno e cor proprias, sempre legivel */
.lf-actbtn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 7px;
  border: 1px solid var(--lf-border-2); background: #fff;
  font: inherit; font-size: 12px; font-weight: 600;
  color: var(--lf-text-2); cursor: pointer; text-decoration: none;
  transition: all .15s ease; white-space: nowrap;
}
.lf-actbtn:hover { border-color: var(--lf-blue); color: var(--lf-blue); background: rgba(47,107,255,.06); }
.lf-actbtn-danger { border-color: #FCA5A5; color: #B91C1C; }
.lf-actbtn-danger:hover { border-color: var(--lf-danger); color: #B91C1C; background: #FEF2F2; }

.lf-itemactions { background: none; padding: 0; gap: 6px; }

/* Em espacos apertados, so o icone */
.lf-check .lf-actbtn, .lf-gallery .lf-actbtn { padding: 5px 8px; }
.lf-check .lf-actbtn span, .lf-gallery .lf-actbtn span { display: none; }

/* Botoes do card no quadro */
.lf-task-arch, .lf-task-done { border: 1px solid var(--lf-border-2) !important; background: #fff; }
.lf-task-arch { color: var(--lf-text-2); }
.lf-task-arch:hover { border-color: var(--lf-blue) !important; color: var(--lf-blue); }
.lf-task-done { color: var(--lf-text-2); }
.lf-task-done.on { border-color: var(--lf-success) !important; }

/* Logo clicavel */
.lf-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; margin: -6px -8px 0;
  border: none; background: none; border-radius: var(--lf-r);
  cursor: pointer; font: inherit; text-align: left;
  transition: background .15s ease;
}
.lf-brand:hover { background: var(--lf-surface-2); }
.lf-brand:active { transform: scale(.985); }

@media (max-width: 900px) {
  .lf-actbtn { padding: 8px 12px; font-size: 13px; }
  .lf-log .lf-actbtn span, .lf-deliveries .lf-actbtn span { display: none; }
}

/* ============================================================
   V3.4 - ICONES EMBUTIDOS (sem fonte externa)
   ============================================================ */

.lf-ic { flex-shrink: 0; vertical-align: -0.16em; display: inline-block; }
#lakeflow-root button .lf-ic, #lakeflow-root a .lf-ic { pointer-events: none; }
.lf-actbtn .lf-ic, .lf-btn .lf-ic { vertical-align: middle; }
.lf-icon-btn .lf-ic { vertical-align: middle; }
.lf-spin .lf-ic, .lf-autosave.salvando .lf-ic { animation: lf-spin 1s linear infinite; }

/* ============================================================
   V3.5 - FICHA DO PACIENTE E LINHA DO TRATAMENTO
   ============================================================ */

.lf-ficha { display: flex; flex-direction: column; gap: 16px; }

.lf-ficha-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.lf-ficha-id { display: flex; align-items: center; gap: 14px; }
.lf-ficha-id h2 { font-size: 20px; font-weight: 700; color: var(--lf-navy); }
.lf-ficha-nums { display: flex; gap: 26px; flex-wrap: wrap; }
.lf-ficha-nums div { display: flex; flex-direction: column; }
.lf-ficha-nums strong { font-size: 21px; font-weight: 700; color: var(--lf-navy); letter-spacing: -.5px; }
.lf-ficha-nums span { font-size: 11.5px; color: var(--lf-text-2); }

/* Plano terapeutico */
.lf-plano { display: flex; flex-direction: column; gap: 14px; }
.lf-plano h4 {
  margin: 0 0 3px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .7px; color: var(--lf-text-3);
}
.lf-plano p { font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; }
.lf-note-plan { background: rgba(124,58,237,.07); color: #4C1D95; }

/* Linha do tratamento */
.lf-linha { display: flex; flex-direction: column; gap: 0; counter-reset: sessao; }
.lf-linha li { display: flex; gap: 14px; position: relative; padding-bottom: 14px; }
.lf-linha li::before {
  content: ''; position: absolute; left: 15px; top: 34px; bottom: 0;
  width: 2px; background: var(--lf-border);
}
.lf-linha li:last-child::before { display: none; }

.lf-linha-n {
  width: 32px; height: 32px; flex-shrink: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--lf-gradient); color: #fff;
  font-size: 12.5px; font-weight: 700;
}
.lf-linha-corpo {
  flex: 1; min-width: 0;
  border: 1px solid var(--lf-border); border-radius: var(--lf-r);
  background: #fff; overflow: hidden; transition: border-color .16s ease;
}
.lf-linha li.aberto .lf-linha-corpo { border-color: var(--lf-blue); box-shadow: var(--lf-shadow-md); }
.lf-linha-topo {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 11px 14px; cursor: pointer;
}
.lf-linha-topo:hover { background: var(--lf-surface-2); }
.lf-linha-acoes { display: flex; align-items: center; gap: 8px; color: var(--lf-text-3); flex-shrink: 0; }
.lf-linha-resumo {
  padding: 0 14px 12px; font-size: 12.5px; color: var(--lf-text-2); line-height: 1.6;
}
.lf-linha-detalhe {
  padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 12px;
  border-top: 1px solid var(--lf-surface-2);
}
.lf-linha-detalhe h4 {
  margin: 0 0 3px; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .7px; color: var(--lf-text-3);
}
.lf-linha-detalhe p { font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; }
.lf-linha-detalhe .lf-btn { align-self: flex-start; }

.lf-proximas { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--lf-border); }
.lf-proximas h4 {
  margin: 0 0 8px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .7px; color: var(--lf-text-3);
}
.lf-chip-quiet {
  border-color: var(--lf-border) !important; background: var(--lf-surface-2) !important;
  color: var(--lf-text-2) !important; cursor: default;
}
.lf-tabs .lf-tab .lf-ic { margin-right: 4px; }

@media (max-width: 900px) {
  .lf-ficha-nums { gap: 18px; }
  .lf-ficha-nums strong { font-size: 18px; }
  .lf-linha li { gap: 10px; }
}

/* ============================================================
   V4 - TELA CHEIA, TEMA ESCURO, CONTRASTE E MOBILE
   ============================================================ */

/* ---------- Ocupa a tela inteira ---------- */
#lakeflow-root { display: block; }
.lf-app {
  min-height: calc(100vh - 2px);
  height: auto;
  border: none;
  border-radius: 0;
  align-items: stretch;
}
.lf-nav { min-height: 100%; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.lf-main { min-height: 100vh; display: flex; flex-direction: column; }
.lf-page { flex: 1; }

/* ---------- Contraste dos botoes ---------- */
/* O botao primario perdia legibilidade no hover — agora escurece o fundo */
.lf-btn-primary {
  background: var(--lf-gradient);
  color: #FFFFFF !important;
  text-shadow: 0 1px 1px rgba(15,30,61,.18);
}
.lf-btn-primary:hover {
  background: linear-gradient(135deg, #1E88D6 0%, #1E4FD8 45%, #5B21B6 100%);
  filter: none;
  color: #FFFFFF !important;
  box-shadow: 0 4px 14px rgba(47,107,255,.32);
}
.lf-btn-primary:focus-visible { outline: 3px solid rgba(47,107,255,.4); outline-offset: 2px; }
.lf-login-btn:hover { background: linear-gradient(135deg, #1E88D6 0%, #1E4FD8 45%, #5B21B6 100%); filter: none; }

.lf-btn:hover { background: rgba(47,107,255,.07); }
.lf-btn-danger:hover { background: #FEF2F2; }
.lf-nav-item:focus-visible, .lf-btn:focus-visible, .lf-actbtn:focus-visible {
  outline: 2px solid var(--lf-blue); outline-offset: 2px;
}

/* ---------- Etapas arrastaveis ---------- */
.lf-colsedit li { cursor: default; transition: transform .12s ease, box-shadow .12s ease; }
.lf-colsedit-drag {
  display: flex; align-items: center; color: var(--lf-text-3);
  cursor: grab; padding: 2px; flex-shrink: 0;
}
.lf-colsedit-drag:active { cursor: grabbing; }
.lf-colsedit li.arrastando { opacity: .45; }
.lf-colsedit li.alvo { box-shadow: inset 0 3px 0 var(--lf-blue); }

/* ---------- Perfil e foto ---------- */
.lf-perfilfoto { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.lf-avatar-xl, .lf-fotogrande {
  width: 82px; height: 82px; border-radius: 50%; font-size: 26px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.lf-fotogrande { object-fit: cover; border: 3px solid var(--lf-surface); box-shadow: var(--lf-shadow-md); }
.lf-avatar-img { object-fit: cover; }

/* ---------- Escolha de tema ---------- */
.lf-temas { display: flex; gap: 10px; flex-wrap: wrap; }
.lf-tema {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 16px; min-width: 104px;
  border: 2px solid var(--lf-border); border-radius: var(--lf-r-lg);
  background: var(--lf-surface); font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--lf-text-2); cursor: pointer; transition: all .16s ease;
}
.lf-tema:hover { border-color: var(--lf-border-2); }
.lf-tema.on { border-color: var(--lf-blue); color: var(--lf-blue); background: rgba(47,107,255,.06); }
.lf-tema-preview { width: 100%; height: 34px; border-radius: 7px; border: 1px solid var(--lf-border); }
.lf-tema-claro  { background: linear-gradient(135deg, #FFFFFF 50%, #F1F5F9 50%); }
.lf-tema-escuro { background: linear-gradient(135deg, #1E293B 50%, #0F172A 50%); }
.lf-tema-auto   { background: linear-gradient(135deg, #FFFFFF 50%, #0F172A 50%); }

/* ---------- Financeiro ---------- */
.lf-valor { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.lf-tone-amber { background: var(--lf-warning); }
.lf-pay-pago      { background: #D1FAE5; color: #065F46; }
.lf-pay-pendente  { background: #FEF3C7; color: #92400E; }
.lf-pay-vencida   { background: #FEE2E2; color: #991B1B; }
.lf-pay-pacote, .lf-pay-isento, .lf-pay-cancelado { background: #F1F5F9; color: #475569; }

/* ============================================================
   TEMA ESCURO
   ============================================================ */

#lakeflow-root[data-lf-theme="escuro"] {
  --lf-navy:      #F1F5F9;
  --lf-text:      #E2E8F0;
  --lf-text-2:    #94A3B8;
  --lf-text-3:    #64748B;
  --lf-bg:        #0F172A;
  --lf-surface:   #1E293B;
  --lf-surface-2: #263449;
  --lf-border:    #334155;
  --lf-border-2:  #475569;
  --lf-shadow:    0 1px 2px rgba(0,0,0,.4);
  --lf-shadow-md: 0 6px 20px rgba(0,0,0,.45);
  --lf-shadow-lg: 0 24px 60px rgba(0,0,0,.6);
  color: var(--lf-text);
}
#lakeflow-root[data-lf-theme="escuro"] .lf-app,
#lakeflow-root[data-lf-theme="escuro"] .lf-login { background: var(--lf-bg); }
#lakeflow-root[data-lf-theme="escuro"] .lf-nav,
#lakeflow-root[data-lf-theme="escuro"] .lf-card,
#lakeflow-root[data-lf-theme="escuro"] .lf-task,
#lakeflow-root[data-lf-theme="escuro"] .lf-modal,
#lakeflow-root[data-lf-theme="escuro"] .lf-day,
#lakeflow-root[data-lf-theme="escuro"] .lf-mday,
#lakeflow-root[data-lf-theme="escuro"] .lf-appt,
#lakeflow-root[data-lf-theme="escuro"] .lf-stat,
#lakeflow-root[data-lf-theme="escuro"] .lf-person,
#lakeflow-root[data-lf-theme="escuro"] .lf-record,
#lakeflow-root[data-lf-theme="escuro"] .lf-table-wrap,
#lakeflow-root[data-lf-theme="escuro"] .lf-linha-corpo,
#lakeflow-root[data-lf-theme="escuro"] .lf-boardchip,
#lakeflow-root[data-lf-theme="escuro"] .lf-notif-panel,
#lakeflow-root[data-lf-theme="escuro"] .lf-suggest,
#lakeflow-root[data-lf-theme="escuro"] .lf-memberlist,
#lakeflow-root[data-lf-theme="escuro"] .lf-gallery figure,
#lakeflow-root[data-lf-theme="escuro"] .lf-tema { background: var(--lf-surface); }

#lakeflow-root[data-lf-theme="escuro"] input,
#lakeflow-root[data-lf-theme="escuro"] select,
#lakeflow-root[data-lf-theme="escuro"] textarea,
#lakeflow-root[data-lf-theme="escuro"] .lf-btn,
#lakeflow-root[data-lf-theme="escuro"] .lf-actbtn {
  background: var(--lf-surface-2); color: var(--lf-text); border-color: var(--lf-border);
}
#lakeflow-root[data-lf-theme="escuro"] .lf-btn:hover,
#lakeflow-root[data-lf-theme="escuro"] .lf-actbtn:hover { background: rgba(47,107,255,.18); color: #93C5FD; border-color: #3B82F6; }
#lakeflow-root[data-lf-theme="escuro"] .lf-actbtn-danger { color: #FCA5A5; border-color: #7F1D1D; }
#lakeflow-root[data-lf-theme="escuro"] .lf-actbtn-danger:hover { background: rgba(239,68,68,.18); color: #FCA5A5; }
#lakeflow-root[data-lf-theme="escuro"] .lf-btn-danger { color: #FCA5A5; border-color: #7F1D1D; }
#lakeflow-root[data-lf-theme="escuro"] .lf-btn-danger:hover { background: rgba(239,68,68,.16); }
#lakeflow-root[data-lf-theme="escuro"] .lf-btn-primary,
#lakeflow-root[data-lf-theme="escuro"] .lf-login-btn { background: var(--lf-gradient); color: #fff !important; }

#lakeflow-root[data-lf-theme="escuro"] .lf-col,
#lakeflow-root[data-lf-theme="escuro"] .lf-checklist,
#lakeflow-root[data-lf-theme="escuro"] .lf-deliveries li,
#lakeflow-root[data-lf-theme="escuro"] .lf-tabs,
#lakeflow-root[data-lf-theme="escuro"] .lf-accessbox,
#lakeflow-root[data-lf-theme="escuro"] .lf-linkpreview { background: var(--lf-surface-2); }
#lakeflow-root[data-lf-theme="escuro"] .lf-tab.active { background: var(--lf-surface); color: #93C5FD; }
#lakeflow-root[data-lf-theme="escuro"] .lf-nav-item.active,
#lakeflow-root[data-lf-theme="escuro"] .lf-bell.has-unread { background: rgba(47,107,255,.18); color: #93C5FD; }
#lakeflow-root[data-lf-theme="escuro"] .lf-table th { background: var(--lf-surface-2); }
#lakeflow-root[data-lf-theme="escuro"] .lf-table tbody tr:hover { background: var(--lf-surface-2); }
#lakeflow-root[data-lf-theme="escuro"] .lf-count,
#lakeflow-root[data-lf-theme="escuro"] .lf-chipcount { background: var(--lf-surface-2); color: #93C5FD; }
#lakeflow-root[data-lf-theme="escuro"] .lf-alert { background: rgba(245,158,11,.12); border-color: #78350F; color: #FCD34D; }
#lakeflow-root[data-lf-theme="escuro"] .lf-chip { background: var(--lf-surface); border-color: #78350F; color: #FCD34D; }
#lakeflow-root[data-lf-theme="escuro"] .lf-note { background: rgba(47,107,255,.14); color: #BFDBFE; }
#lakeflow-root[data-lf-theme="escuro"] .lf-toast { background: #000; }
#lakeflow-root[data-lf-theme="escuro"] .lf-overlay { background: rgba(0,0,0,.66); }
#lakeflow-root[data-lf-theme="escuro"] .lf-brand:hover { background: var(--lf-surface-2); }
#lakeflow-root[data-lf-theme="escuro"] .lf-brand-name { color: #F1F5F9; }
#lakeflow-root[data-lf-theme="escuro"] .lf-progress { background: var(--lf-border); }
#lakeflow-root[data-lf-theme="escuro"] .lf-mday.fora { background: #172033; }
#lakeflow-root[data-lf-theme="escuro"] .lf-mtask { background: var(--lf-surface-2); }
#lakeflow-root[data-lf-theme="escuro"] .lf-swatch.on { border-color: #fff; }
#lakeflow-root[data-lf-theme="escuro"] .lf-accessbox code { background: var(--lf-bg); color: var(--lf-text); }

/* Badges no escuro */
#lakeflow-root[data-lf-theme="escuro"] .lf-pri-alta,
#lakeflow-root[data-lf-theme="escuro"] .lf-pay-vencida,
#lakeflow-root[data-lf-theme="escuro"] .lf-st-falta { background: rgba(239,68,68,.2); color: #FCA5A5; }
#lakeflow-root[data-lf-theme="escuro"] .lf-pri-media,
#lakeflow-root[data-lf-theme="escuro"] .lf-pay-pendente { background: rgba(245,158,11,.2); color: #FCD34D; }
#lakeflow-root[data-lf-theme="escuro"] .lf-pri-baixa,
#lakeflow-root[data-lf-theme="escuro"] .lf-pay-pago,
#lakeflow-root[data-lf-theme="escuro"] .lf-status-ativo,
#lakeflow-root[data-lf-theme="escuro"] .lf-st-presente { background: rgba(16,185,129,.2); color: #6EE7B7; }
#lakeflow-root[data-lf-theme="escuro"] .lf-st-agendado,
#lakeflow-root[data-lf-theme="escuro"] .lf-st-confirmado { background: rgba(59,130,246,.2); color: #93C5FD; }
#lakeflow-root[data-lf-theme="escuro"] .lf-neutral,
#lakeflow-root[data-lf-theme="escuro"] .lf-status-inativo,
#lakeflow-root[data-lf-theme="escuro"] .lf-st-cancelado { background: var(--lf-surface-2); color: var(--lf-text-2); }

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 900px) {
  .lf-app { min-height: 100vh; }
  .lf-nav { height: 100vh; position: fixed; }
  .lf-main { padding: 14px 12px 28px; }
  .lf-topbar { position: sticky; top: 0; z-index: 50; padding: 8px 0; background: var(--lf-bg); }
  .lf-page-head { gap: 10px; }
  .lf-page-head h1 { font-size: 19px; }
  .lf-page-head > button, .lf-page-head .lf-btn { width: 100%; justify-content: center; }
  .lf-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .lf-stat { padding: 12px; gap: 9px; }
  .lf-stat-icon { width: 34px; height: 34px; border-radius: 10px; }
  .lf-stat-value { font-size: 17px; }
  .lf-card { padding: 14px; }
  .lf-toolbar { gap: 8px; }
  .lf-toolbar-left, .lf-toolbar-right { width: 100%; }
  .lf-tabs { width: 100%; overflow-x: auto; }
  .lf-tab { white-space: nowrap; }
  .lf-board { grid-auto-columns: 84vw; }
  .lf-boardbar { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 10px; }
  .lf-boardchip { white-space: nowrap; }
  .lf-table-wrap { overflow-x: auto; }
  .lf-table { min-width: 640px; }
  .lf-modal { max-width: 100%; margin: 0; }
  .lf-overlay { padding: 12px 8px; }
  .lf-modal-foot { flex-wrap: wrap; }
  .lf-modal-foot .lf-btn { flex: 1; justify-content: center; }
  .lf-ficha-nums { width: 100%; justify-content: space-between; gap: 12px; }
  .lf-temas { width: 100%; }
  .lf-tema { flex: 1; min-width: 0; }
  .lf-nav-actions { flex-direction: column; }
}

@media (max-width: 560px) {
  .lf-stats { grid-template-columns: 1fr; }
  .lf-board { grid-auto-columns: 90vw; }
  .lf-ficha-nums strong { font-size: 16px; }
  .lf-ficha-nums span { font-size: 10.5px; }
}

/* ============================================================
   V4.1 - GRAFICOS, VIDEO E TEXTO LONGO
   ============================================================ */

/* ---------- Texto longo nunca vaza do quadro ---------- */
#lakeflow-root p, #lakeflow-root span, #lakeflow-root td, #lakeflow-root li, #lakeflow-root a {
  overflow-wrap: anywhere; word-break: break-word; min-width: 0;
}
.lf-person-body, .lf-person-meta, .lf-nav-user-info, .lf-cell-user > div,
.lf-list li > div, .lf-timeline li > div, .lf-tele-info { min-width: 0; max-width: 100%; }

/* E-mail e telefone: corta com reticencias em vez de estourar */
.lf-person-meta li {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lf-person-meta li .lf-ic { flex-shrink: 0; }
.lf-nav-user-name, .lf-legenda-nome, .lf-barrash-nome {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lf-quebra { overflow-wrap: anywhere; }
.lf-table td { max-width: 260px; overflow-wrap: anywhere; }
.lf-suggest li > div, .lf-memberlist li > div { overflow: hidden; }
.lf-memberlist li p, .lf-suggest li p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-accessbox { overflow-wrap: anywhere; }
.lf-modal-head h2 { overflow-wrap: anywhere; }

/* ---------- Rosca ---------- */
.lf-donutwrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.lf-donut { flex-shrink: 0; }
.lf-fatia { transition: opacity .16s ease; }
.lf-fatia:hover { opacity: .82; }
.lf-donut-valor { font-size: 19px; font-weight: 700; fill: var(--lf-navy); }
.lf-donut-rot { font-size: 10.5px; fill: var(--lf-text-2); }
.lf-donut-vazio { font-size: 12px; fill: var(--lf-text-3); }

.lf-legenda { flex: 1; min-width: 190px; display: flex; flex-direction: column; gap: 9px; }
.lf-legenda li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.lf-legenda-nome { flex: 1; color: var(--lf-text-2); }
.lf-legenda-valor { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--lf-navy); white-space: nowrap; }
.lf-legenda-pct {
  min-width: 40px; text-align: right; font-size: 11.5px; font-weight: 700; color: var(--lf-text-3);
}
.lf-legenda-inline { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--lf-text-2); }

/* ---------- Colunas ---------- */
.lf-colunas { position: relative; display: flex; padding-left: 46px; }
.lf-colunas-grade {
  position: absolute; inset: 0 0 22px 0;
  display: flex; flex-direction: column; justify-content: space-between;
}
.lf-linha-grade { position: relative; border-top: 1px dashed var(--lf-border); }
.lf-linha-grade span {
  position: absolute; left: 0; top: -7px; width: 42px; text-align: right;
  font-size: 10px; color: var(--lf-text-3);
}
.lf-colunas-area { flex: 1; display: flex; align-items: flex-end; gap: 6px; position: relative; }
.lf-coluna { display: flex; flex-direction: column; align-items: center; height: 100%; }
.lf-coluna-barras {
  flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px;
  padding-bottom: 4px;
}
.lf-barra {
  width: 40%; max-width: 26px; min-height: 3px;
  background: var(--lf-blue); border-radius: 4px 4px 0 0;
  transition: opacity .16s ease;
}
.lf-barra:hover { opacity: .8; }
.lf-barra-2 { background: var(--lf-success); }
.lf-coluna-rot { font-size: 10.5px; color: var(--lf-text-2); padding-top: 4px; }

/* ---------- Barras horizontais ---------- */
.lf-barrash { display: flex; flex-direction: column; gap: 13px; }
.lf-barrash-topo { display: flex; align-items: baseline; gap: 10px; margin-bottom: 5px; }
.lf-barrash-nome { flex: 1; font-size: 13px; font-weight: 600; color: var(--lf-navy); }
.lf-barrash-trilho { height: 9px; border-radius: 5px; background: var(--lf-surface-2); overflow: hidden; }
.lf-barrash-trilho span { display: block; height: 100%; border-radius: 5px; transition: width .3s ease; }

.lf-mininums {
  display: flex; gap: 20px; margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--lf-border); flex-wrap: wrap;
}
.lf-mininums div { display: flex; flex-direction: column; }
.lf-mininums strong { font-size: 16px; font-weight: 700; color: var(--lf-navy); }
.lf-mininums span { font-size: 11px; color: var(--lf-text-2); }

/* ---------- Teleatendimento ---------- */
.lf-teleList { display: flex; flex-direction: column; }
.lf-teleList li {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 0; border-bottom: 1px solid var(--lf-border); flex-wrap: wrap;
}
.lf-teleList li:last-child { border-bottom: none; }
.lf-tele-hora {
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: 15px;
  color: var(--lf-navy); width: 52px; flex-shrink: 0;
}
.lf-tele-info { flex: 1; min-width: 160px; }
.lf-tele-acoes { display: flex; gap: 7px; flex-wrap: wrap; }

.lf-passos { display: flex; flex-direction: column; gap: 10px; counter-reset: passo; padding-left: 0; }
.lf-passos li {
  position: relative; padding-left: 34px; font-size: 13.5px; line-height: 1.6; color: var(--lf-text-2);
}
.lf-passos li::before {
  counter-increment: passo; content: counter(passo);
  position: absolute; left: 0; top: 0;
  width: 23px; height: 23px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--lf-surface-2); color: var(--lf-blue);
  font-size: 11.5px; font-weight: 700;
}
.lf-passos strong { color: var(--lf-navy); }

/* ---------- Janela flutuante da chamada ---------- */
.lf-chamada {
  position: fixed; right: 22px; bottom: 22px; z-index: 99990;
  width: min(680px, calc(100vw - 44px)); height: min(460px, calc(100vh - 120px));
  display: flex; flex-direction: column;
  background: #0F172A; border-radius: var(--lf-r-lg); overflow: hidden;
  box-shadow: 0 24px 70px rgba(0,0,0,.5);
  transition: width .2s ease, height .2s ease;
}
.lf-chamada.mini { width: 292px; height: 194px; }
.lf-chamada-barra {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px 8px 13px; background: #111C33; color: #E2E8F0; flex-shrink: 0;
}
.lf-chamada-tit {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lf-chamada-tit .lf-muted { color: #94A3B8; }
.lf-chamada-btns { display: flex; gap: 2px; flex-shrink: 0; }
.lf-chamada-btns .lf-icon-btn { color: #94A3B8; }
.lf-chamada-btns .lf-icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.lf-chamada-btns .lf-icon-danger:hover { background: var(--lf-danger); color: #fff; }
.lf-aovivo {
  width: 8px; height: 8px; border-radius: 50%; background: #EF4444; flex-shrink: 0;
  animation: lf-pulso 1.6s ease-in-out infinite;
}
@keyframes lf-pulso { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.lf-chamada-video { flex: 1; position: relative; background: #0F172A; }
.lf-chamada-video iframe { width: 100% !important; height: 100% !important; border: 0; }
.lf-chamada-aviso {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  color: #94A3B8; font-size: 13px; text-align: center; padding: 20px;
}
.lf-chamada-erro { color: #FCA5A5; }
.lf-chamada.mini .lf-chamada-video { pointer-events: auto; }

@media (max-width: 900px) {
  .lf-chamada { right: 8px; left: 8px; bottom: 8px; width: auto; height: 56vh; }
  .lf-chamada.mini { width: 176px; height: 118px; left: auto; }
  .lf-donutwrap { justify-content: center; }
  .lf-legenda { min-width: 100%; }
  .lf-tele-hora { width: 44px; font-size: 14px; }
  .lf-tele-acoes { width: 100%; }
  .lf-tele-acoes .lf-btn, .lf-tele-acoes .lf-actbtn { flex: 1; justify-content: center; }
}

/* Escuro */
#lakeflow-root[data-lf-theme="escuro"] .lf-barrash-trilho,
#lakeflow-root[data-lf-theme="escuro"] .lf-passos li::before { background: var(--lf-surface-2); }
#lakeflow-root[data-lf-theme="escuro"] .lf-donut-valor { fill: #F1F5F9; }

/* ============================================================
   V5 - CARD COMPLETO, CHECKLIST RICA, AUDIO E REORDENACAO
   ============================================================ */

/* ---------- Card aberto: tudo a vista ---------- */
.lf-modal-wide { max-width: 1080px; }
.lf-cardgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.lf-cardcol { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.lf-bloco {
  border: 1px solid var(--lf-border); border-radius: var(--lf-r-lg);
  padding: 15px; background: var(--lf-surface);
}
.lf-bloco-tit {
  display: flex; align-items: center; gap: 7px; margin: 0 0 12px;
  font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  color: var(--lf-text-2);
}
.lf-bloco-tit .lf-count { margin-left: auto; }
.lf-bloco .lf-form { gap: 12px; }

/* ---------- Caixa de comentario que cresce ---------- */
.lf-cbox {
  border: 1px solid var(--lf-border); border-radius: var(--lf-r);
  background: var(--lf-surface); overflow: hidden;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.lf-cbox:focus-within { border-color: var(--lf-blue); box-shadow: 0 0 0 3px rgba(47,107,255,.12); }
.lf-cbox textarea {
  width: 100%; border: none !important; box-shadow: none !important;
  background: transparent !important; resize: none; min-height: 76px; padding: 11px 13px !important;
  line-height: 1.6;
}
.lf-cbox textarea:focus { outline: none; }
.lf-cbox-pe {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 10px; border-top: 1px solid var(--lf-border); background: var(--lf-surface-2);
}
.lf-cbox-img { position: relative; margin: 0 13px 10px; display: inline-block; }
.lf-cbox-img img { max-height: 130px; border-radius: var(--lf-r-sm); display: block; }
.lf-cbox-img .lf-chipx { position: absolute; top: -7px; right: -7px; background: var(--lf-danger); color: #fff; }

/* ---------- Comentarios ---------- */
.lf-log { margin-top: 14px; }
.lf-log-topo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.lf-log-topo .lf-itemactions { margin-left: auto; }
.lf-log-texto { font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; }
.lf-log-com { background: var(--lf-surface-2); border-radius: var(--lf-r); padding: 11px 12px; border-bottom: none; margin-bottom: 8px; }
.lf-log-img { display: block; margin-top: 8px; }
.lf-log-img img {
  max-width: 100%; max-height: 260px; border-radius: var(--lf-r-sm);
  border: 1px solid var(--lf-border); display: block;
}

/* ---------- Checklist rica ---------- */
.lf-checkli { flex-direction: column; align-items: stretch; gap: 0; }
.lf-checkli-linha { display: flex; align-items: center; gap: 10px; width: 100%; }
.lf-checkli-linha label { flex: 1; min-width: 0; }
.lf-checkli-meta { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.lf-checkdue {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px;
  background: rgba(245,158,11,.16); color: #92400E; font-size: 10.5px; font-weight: 700;
}
.lf-checkdue.atrasado { background: rgba(239,68,68,.16); color: #991B1B; }
.lf-checkdue.feito { background: rgba(16,185,129,.16); color: #065F46; }
.lf-checkli-det {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin: 8px 0 4px; padding: 10px; background: var(--lf-surface); border-radius: var(--lf-r-sm);
}

/* ---------- Modelos de checklist ---------- */
.lf-modelos {
  margin-top: 10px; padding: 12px; border-radius: var(--lf-r);
  background: var(--lf-surface-2); display: flex; flex-direction: column; gap: 8px;
}
.lf-modelo {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 11px; background: var(--lf-surface);
  border: 1px solid var(--lf-border); border-radius: var(--lf-r-sm);
}
.lf-modelo > div:first-child { flex: 1; min-width: 0; }

/* ---------- Audio ---------- */
.lf-fig-audio { grid-column: span 2; }
.lf-audiobox { padding: 12px 10px; background: var(--lf-surface-2); }
.lf-audiobox audio { width: 100%; height: 38px; }

/* ---------- Reordenacao de cards ---------- */
.lf-slot { position: relative; }
.lf-slot.alvo::before {
  content: ''; position: absolute; top: -5px; left: 0; right: 0;
  height: 3px; border-radius: 2px; background: var(--lf-blue);
}
.lf-task { cursor: grab; }
.lf-task:active { cursor: grabbing; }

@media (max-width: 900px) {
  .lf-cardgrid { grid-template-columns: 1fr; gap: 14px; }
  .lf-checkli-det { grid-template-columns: 1fr; }
  .lf-checkli-linha { flex-wrap: wrap; }
  .lf-fig-audio { grid-column: 1 / -1; }
}

/* Escuro */
#lakeflow-root[data-lf-theme="escuro"] .lf-bloco,
#lakeflow-root[data-lf-theme="escuro"] .lf-cbox,
#lakeflow-root[data-lf-theme="escuro"] .lf-modelo { background: var(--lf-surface); }
#lakeflow-root[data-lf-theme="escuro"] .lf-cbox-pe,
#lakeflow-root[data-lf-theme="escuro"] .lf-log-com,
#lakeflow-root[data-lf-theme="escuro"] .lf-modelos,
#lakeflow-root[data-lf-theme="escuro"] .lf-audiobox { background: var(--lf-surface-2); }
#lakeflow-root[data-lf-theme="escuro"] .lf-checkdue { background: rgba(245,158,11,.2); color: #FCD34D; }
#lakeflow-root[data-lf-theme="escuro"] .lf-checkdue.atrasado { background: rgba(239,68,68,.2); color: #FCA5A5; }
#lakeflow-root[data-lf-theme="escuro"] .lf-checkdue.feito { background: rgba(16,185,129,.2); color: #6EE7B7; }

/* ============================================================
   V5.1 - VISOR DE IMAGEM, MODELOS DE CARD, PERIODO
   ============================================================ */

/* ---------- Visor de imagem em tela cheia ---------- */
.lf-lightbox {
  position: fixed; inset: 0; z-index: 100001;
  background: rgba(8,14,28,.93);
  display: flex; align-items: center; justify-content: center;
  padding: 62px 20px 24px; cursor: zoom-out;
  animation: lf-fade .16s ease;
}
.lf-lightbox img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; border-radius: var(--lf-r);
  box-shadow: 0 24px 70px rgba(0,0,0,.6); cursor: default;
}
.lf-lightbox-barra {
  position: absolute; top: 14px; right: 16px;
  display: flex; gap: 8px;
}
.lf-lightbox-barra .lf-btn {
  background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25);
  text-decoration: none;
}
.lf-lightbox-barra .lf-btn:hover { background: rgba(255,255,255,.22); color: #fff; }

/* ---------- Menu de modelos ---------- */
.lf-dropwrap { position: relative; }
.lf-dropmenu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  min-width: 290px; max-height: 340px; overflow-y: auto;
  background: var(--lf-surface); border: 1px solid var(--lf-border);
  border-radius: var(--lf-r); box-shadow: var(--lf-shadow-lg);
  padding: 5px;
}
.lf-dropmenu li { display: flex; align-items: center; gap: 4px; }
.lf-dropmenu li > button:first-child {
  flex: 1; display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 9px 11px; border: none; background: none; border-radius: var(--lf-r-sm);
  font: inherit; color: var(--lf-text); cursor: pointer; min-width: 0;
}
.lf-dropmenu li > button:first-child:hover { background: var(--lf-surface-2); }
.lf-dropmenu li > button:first-child div { min-width: 0; }

/* ---------- Comentario ainda nao publicado ---------- */
.lf-log-pend {
  border: 1px dashed var(--lf-border-2);
  background: rgba(245,158,11,.07) !important;
}

@media (max-width: 900px) {
  .lf-lightbox { padding: 56px 10px 14px; }
  .lf-dropmenu { right: auto; left: 0; min-width: 260px; }
}

#lakeflow-root[data-lf-theme="escuro"] .lf-dropmenu { background: var(--lf-surface); }

/* ============================================================
   V5.2 - REACOES, ETIQUETAS E NOTIFICACOES
   ============================================================ */

/* ---------- Reacoes no comentario ---------- */
.lf-reacoes { display: flex; align-items: center; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.lf-reacao {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  border: 1px solid var(--lf-border); background: var(--lf-surface);
  font: inherit; font-size: 12px; font-weight: 600; color: var(--lf-text-2);
  cursor: pointer; transition: all .14s ease; line-height: 1.4;
}
.lf-reacao span { font-size: 13px; }
.lf-reacao:hover { border-color: var(--lf-blue); }
.lf-reacao.on { background: rgba(47,107,255,.12); border-color: var(--lf-blue); color: var(--lf-blue); }
.lf-reacao-add { color: var(--lf-text-3); padding: 4px 8px; }

.lf-emojibar {
  position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 70;
  display: flex; gap: 2px; padding: 5px;
  background: var(--lf-surface); border: 1px solid var(--lf-border);
  border-radius: 22px; box-shadow: var(--lf-shadow-md);
}
.lf-emojibar button {
  width: 32px; height: 32px; border: none; background: none; border-radius: 50%;
  font-size: 17px; cursor: pointer; transition: transform .12s ease, background .12s ease;
}
.lf-emojibar button:hover { background: var(--lf-surface-2); transform: scale(1.15); }

/* ---------- Excluir etiqueta ---------- */
.lf-labelwrap { position: relative; display: inline-flex; }
.lf-labelx {
  position: absolute; top: -5px; right: -5px;
  width: 17px; height: 17px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: none; background: var(--lf-danger); color: #fff; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.lf-labelx:hover { background: #B91C1C; }

/* ---------- Notificacoes ---------- */
.lf-notif-filtro {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-bottom: 1px solid var(--lf-border);
  font-size: 12.5px; color: var(--lf-text-2); cursor: pointer;
}
.lf-notif-filtro input { width: auto; }
.lf-notif-list li { position: relative; }
.lf-notif-x { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; }
.lf-notif-list li > div { padding-right: 22px; }

#lakeflow-root[data-lf-theme="escuro"] .lf-reacao,
#lakeflow-root[data-lf-theme="escuro"] .lf-emojibar { background: var(--lf-surface-2); }
