/* ============================================================
   ELYON SISTEMA - CSS Principal
   Design clean inspirado no projetos.elyonengenharia.com.br
   Mobile-first obrigatório
   ============================================================ */

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

:root {
  /* Cores primárias (mantém identidade Elyon) */
  --navy:        #1B2A4A;
  --navy-light:  #243558;
  --navy-dark:   #111e36;
  --gold:        #C9A84C;
  --gold-light:  #e0c070;

  /* Hierarquia de atividades - paleta do sistema antigo (projetos.elyonengenharia.com.br) */
  --row-mae:           #193B5D;   /* mae: navy escuro */
  --row-mae-fg:        #ffffff;
  --row-filha:         #3D81F0;   /* filha: azul vibrante */
  --row-filha-fg:      #ffffff;
  --row-neta:          #BFDEFC;   /* neta: azul claro */
  --row-neta-fg:       #686A6E;
  --row-bisneta:       #D6E9FD;   /* bisneta: azul clarissimo */
  --row-bisneta-fg:    #686A6E;
  --row-etapa:         #ffffff;   /* etapa: fundo branco */
  --row-etapa-fg:      #686A6E;

  /* Status */
  --status-atrasado:    #e53e3e;
  --status-aberto:      #718096;
  --status-aberto-7:    #e53e3e;
  --status-aberto-15:   #dd6b20;
  --status-aberto-30:   #d69e2e;
  --status-em-andamento:#3182ce;
  --status-paralisado:  #744210;
  --status-ok:          #38a169;
  --status-na:          #a0aec0;

  /* UI */
  --bg:          #f4f6f9;
  --surface:     #ffffff;
  --border:      #e2e8f0;
  --border-dark: #cbd5e0;
  --text:        #1a202c;
  --text-muted:  #718096;
  --text-light:  #a0aec0;

  /* Sidebar */
  --sidebar-w:   220px;
  --header-h:    56px;

  --radius:      6px;
  --radius-lg:   10px;
  --shadow:      0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg:   0 4px 16px rgba(0,0,0,.12);

  font-size: 14px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
}

body { background: var(--bg); min-height: 100vh; }
a { text-decoration: none; color: inherit; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* ── LOGIN ────────────────────────────────────────────────── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
}

.login-container { width: 100%; max-width: 400px; padding: 1.5rem; }

.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 2rem;
  justify-content: center;
}

.logo-icon svg { display: block; }

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-name {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: .15em;
  color: var(--navy);
}

.logo-sub {
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .25em;
  color: var(--gold);
  text-transform: uppercase;
}

.login-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  text-align: center;
}

.login-form { display: flex; flex-direction: column; gap: 1rem; }

.login-erro {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: var(--radius);
  padding: .6rem .9rem;
  color: var(--status-atrasado);
  font-size: .85rem;
}

/* ── APP HEADER ───────────────────────────────────────────── */
.app-body { display: flex; flex-direction: column; min-height: 100vh; }

.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.header-left { display: flex; align-items: center; gap: .75rem; }

.header-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.header-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.header-logo .logo-name {
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: #fff;
}

.header-logo .logo-sub {
  font-size: .55rem;
  letter-spacing: .2em;
  color: var(--gold);
}

.header-right { display: flex; align-items: center; gap: .75rem; }

.user-badge {
  font-size: .8rem;
  color: rgba(255,255,255,.7);
  display: none;
}

@media (min-width: 640px) { .user-badge { display: inline; } }

.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: rgba(255,255,255,.8);
  border-radius: 2px;
  transition: .2s;
}

/* ── LAYOUT SIDEBAR + CONTENT ─────────────────────────────── */
.app-layout {
  display: flex;
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  flex-shrink: 0;
  padding: 1.25rem 0;
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform .25s ease;
  z-index: 90;
}

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

@media (min-width: 1024px) {
  .sidebar { transform: translateX(0); }
  .main-content { margin-left: var(--sidebar-w); transition: margin-left .25s ease; }

  /* Sidebar colapsada no desktop */
  .sidebar.collapsed { transform: translateX(-100%); }
  .sidebar.collapsed ~ .main-content { margin-left: 0; }
}

.nav-list { list-style: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem 1.25rem;
  color: rgba(255,255,255,.65);
  font-size: .85rem;
  font-weight: 500;
  transition: background .15s, color .15s;
  cursor: pointer;
}

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

.nav-item.active {
  background: rgba(201,168,76,.15);
  color: var(--gold-light);
  border-left: 3px solid var(--gold);
}

.nav-item svg { flex-shrink: 0; opacity: .8; }
.nav-item.active svg { opacity: 1; }

/* Conteúdo principal */
.main-content {
  flex: 1;
  padding: 1.5rem;
  min-width: 0;
  overflow-x: hidden;
}

/* ── TABS (sections) ──────────────────────────────────────── */
.tab-section { display: none; }
.tab-section.active { display: block; }

/* ── PAGE HEADER ──────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.25rem;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--navy);
}

.page-subtitle {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .15rem;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}

/* ── BOTÕES ───────────────────────────────────────────────── */
.btn-primary {
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: .5rem 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}

.btn-primary:hover { background: var(--navy-light); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary.btn-block { width: 100%; padding: .65rem; }

.btn-secondary {
  background: #e53e3e;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: .5rem 1rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius);
  padding: .45rem .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: .15s;
}

.btn-outline:hover { border-color: var(--navy); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .45rem .9rem;
  cursor: pointer;
  transition: .15s;
}

.btn-ghost:hover { background: var(--bg); }

.btn-icon {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .4rem .8rem;
  font-size: .8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.btn-sair {
  background: transparent;
  border: 1px solid rgba(255,255,255,.3);
  color: rgba(255,255,255,.85);
  border-radius: var(--radius);
  padding: .35rem .8rem;
  font-size: .8rem;
  cursor: pointer;
  transition: .15s;
}

.btn-sair:hover { border-color: rgba(255,255,255,.6); color: #fff; }

/* ── FORM FIELDS ──────────────────────────────────────────── */
.field-group { display: flex; flex-direction: column; gap: .35rem; }

.field-group label {
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.field-group input,
.field-group select,
.field-group textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .55rem .75rem;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s;
  width: 100%;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  outline: none;
  border-color: var(--navy);
}

.required { color: var(--status-atrasado); }

/* ── OBRA SELECTOR ────────────────────────────────────────── */
.obra-select {
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius);
  padding: .45rem .75rem;
  background: var(--surface);
  color: var(--navy);
  font-weight: 500;
  cursor: pointer;
  min-width: 200px;
}

.obra-info-bar {
  display: flex;
  gap: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .6rem 1rem;
  margin-bottom: .75rem;
  font-size: .82rem;
}

.info-label { color: var(--text-muted); margin-right: .3rem; }

.table-controls {
  display: flex;
  gap: .5rem;
  margin-bottom: .75rem;
}

/* ── TABELA DE ATIVIDADES ─────────────────────────────────── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 180px);
  -webkit-overflow-scrolling: touch;
  position: relative;
}

/* Indicador de scroll lateral (gradiente sutil na borda direita) */
.table-wrap::after {
  content: '';
  position: sticky;
  right: 0;
  top: 0;
  bottom: 0;
  width: 20px;
  pointer-events: none;
  background: linear-gradient(to left, rgba(0,0,0,.06), transparent);
}

.atividades-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1200px; /* aumentado para caber TIPO + mais colunas */
  font-size: .82rem;
}

.atividades-table thead tr {
  background: #f0ebe0;  /* Bege creme - igual ao site original */
}

.atividades-table th {
  padding: .6rem .75rem;
  text-align: left;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  /* Header fixo ao scrollar */
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f0ebe0;
}

.atividades-table td {
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

/* ── Linhas por nivel de hierarquia (4 niveis + etapa) ────── */
/* Paleta identica ao projetos.elyonengenharia.com.br */

/* MAE - navy escuro, bold uppercase */
.row-mae td {
  background: var(--row-mae);
  color: var(--row-mae-fg);
  font-weight: 700;
  font-size: .83rem;
}

/* FILHA - azul vibrante */
.row-filha td {
  background: var(--row-filha);
  color: var(--row-filha-fg);
  font-weight: 600;
}

/* NETA - azul claro, texto escuro */
.row-neta td {
  background: var(--row-neta);
  color: var(--row-neta-fg);
  font-weight: 400;
}

/* BISNETA - azul clarissimo, texto escuro */
.row-bisneta td {
  background: var(--row-bisneta);
  color: var(--row-bisneta-fg);
  font-weight: 400;
  font-size: .8rem;
}

/* ETAPA - fundo branco, texto cinza (igual sistema antigo) */
.row-etapa td {
  background: var(--row-etapa);
  color: var(--row-etapa-fg);
  font-weight: 400;
  border-bottom: 1px solid var(--border);
}

/* Hover para todos os niveis - outline sutil, sem clarao branco */
.row-mae:hover td,
.row-filha:hover td { /* sem efeito na linha inteira - evita clarao branco */ }
.row-neta:hover td { background: #a8d0f5; }
.row-bisneta:hover td { background: #c5ddf7; }
.row-etapa:hover td { background: #f0f4f8; }

/* ── Badge de TIPO (coluna antes do nome) ────────────────── */
.tipo-badge {
  display: inline-block;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .05em;
  padding: .12rem .4rem;
  border-radius: 3px;
  text-transform: uppercase;
  white-space: nowrap;
}

.tipo-mae      { background: var(--gold); color: #1a1a2e; }
.tipo-filha    { background: rgba(255,255,255,.2); color: #fff; }
.tipo-neta     { background: rgba(0,0,0,.08); color: #555; }
.tipo-bisneta  { background: rgba(0,0,0,.06); color: #777; }
.tipo-etapa    { background: transparent; color: #888; border: 1px solid #ccc; }

/* Coluna TIPO - largura fixa */
.col-tipo { width: 60px; min-width: 60px; }

/* Ações na linha */
.row-actions {
  display: flex;
  gap: .3rem;
  align-items: center;
}

.action-icon {
  background: none;
  border: none;
  cursor: pointer;
  opacity: .55;
  padding: 3px;
  border-radius: 3px;
  transition: opacity .15s;
  color: inherit;
}

.action-icon:hover { opacity: 1; }
.action-icon:has(.badge-count) { opacity: .85; }

/* ── STATUS BADGES ────────────────────────────────────────── */
/* Minimalista: dot colorido + texto, sem pill/background */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  text-transform: uppercase;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Cores dos dots e texto - linhas claras (filha-2 / fundo branco) */
.status-badge.atrasado    { color: #c0392b; }
.status-badge.atrasado    .status-dot { background: #c0392b; }
.status-badge.aberto_7    { color: #c0392b; }
.status-badge.aberto_7    .status-dot { background: #c0392b; }
.status-badge.aberto_15   { color: #d35400; }
.status-badge.aberto_15   .status-dot { background: #d35400; }
.status-badge.aberto_30   { color: #b7950b; }
.status-badge.aberto_30   .status-dot { background: #b7950b; }
.status-badge.aberto      { color: #7f8c8d; }
.status-badge.aberto      .status-dot { background: #95a5a6; }
.status-badge.em_andamento{ color: #2471a3; }
.status-badge.em_andamento .status-dot { background: #2471a3; }
.status-badge.paralisado  { color: #7d6608; }
.status-badge.paralisado  .status-dot { background: #b7950b; }
.status-badge.ok          { color: #1e8449; }
.status-badge.ok          .status-dot { background: #27ae60; }
.status-badge.na          { color: #aab7b8; }
.status-badge.na          .status-dot { background: #aab7b8; }

/* Em linhas escuras (mae, filha) - texto mais claro */
.row-mae .status-badge,
.row-filha .status-badge { color: rgba(255,255,255,.8); }
.row-mae .status-badge .status-dot,
.row-filha .status-badge .status-dot { opacity: .85; }

.row-mae .status-badge.atrasado,
.row-filha .status-badge.atrasado { color: #f1948a; }
.row-mae .status-badge.atrasado .status-dot,
.row-filha .status-badge.atrasado .status-dot { background: #f1948a; }
.row-mae .status-badge.aberto_7,
.row-filha .status-badge.aberto_7 { color: #f1948a; }
.row-mae .status-badge.aberto_7 .status-dot,
.row-filha .status-badge.aberto_7 .status-dot { background: #f1948a; }
.row-mae .status-badge.ok,
.row-filha .status-badge.ok { color: #82e0aa; }
.row-mae .status-badge.ok .status-dot,
.row-filha .status-badge.ok .status-dot { background: #82e0aa; }

/* Em linhas claras (neta, bisneta, etapa) - cores normais, ja herdam do padrao */

/* ── DASHBOARD CARDS ──────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .75rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.kpi-label {
  font-size: .72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.kpi-value.danger  { color: var(--status-atrasado); }
.kpi-value.warning { color: var(--status-aberto-15); }
.kpi-value.success { color: var(--status-ok); }
.kpi-value.info    { color: var(--status-em-andamento); }

/* Tabela do dashboard (por colaborador) */
.dashboard-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
  min-width: 700px;
}

.dashboard-table th {
  background: var(--navy);
  color: rgba(255,255,255,.85);
  padding: .55rem .75rem;
  text-align: center;
  font-size: .73rem;
  font-weight: 600;
  letter-spacing: .04em;
}

.dashboard-table th:first-child { text-align: left; }

.dashboard-table td {
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.dashboard-table td:first-child { text-align: left; font-weight: 600; }
.dashboard-table tr:last-child td { border-bottom: none; }
.dashboard-table tr:hover td { background: #f8fafc; }

.num-atrasado { color: var(--status-atrasado); font-weight: 700; }
.num-ok       { color: var(--status-ok); font-weight: 600; }

/* ── DASHBOARD ESSENCIAL - Layout novo ────────────────────── */
.dash-filtro-row {
  display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem;
}
.dash-filtro-label { font-size: .8rem; font-weight: 600; color: var(--navy); white-space: nowrap; }
.dash-filtro-select { max-width: 280px; font-size: .82rem; }

.dash-section { margin-bottom: 1.5rem; }
.dash-section-title {
  font-size: .85rem; font-weight: 700; color: var(--navy);
  text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: .6rem; padding-bottom: .3rem;
  border-bottom: 2px solid var(--border);
}

.dash-top-row { display: flex; gap: 1.5rem; margin-bottom: 1.5rem; align-items: flex-start; }
.dash-cards-wrap { flex: 1; min-width: 0; }
.dash-donut-wrap { flex: 0 0 300px; text-align: center; }

.kpi-sub {
  font-size: .7rem; color: var(--text-muted); font-weight: 500;
}

/* Linhas de colaboradores no STATUS GERAL */
.dash-colab-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .35rem 0; border-top: 1px solid var(--border);
}
.dash-colab-row:first-of-type { margin-top: .5rem; }
.dash-colab-name {
  flex: 0 0 90px; font-size: .72rem; font-weight: 700;
  color: var(--navy); text-transform: uppercase; letter-spacing: .02em;
}
.dashboard-grid-sm { gap: .4rem; }
.kpi-card-sm {
  padding: .25rem .5rem; min-width: 50px; text-align: center;
}
.kpi-value-sm { font-size: .85rem; font-weight: 700; }
.kpi-highlight-danger { background: rgba(229,62,62,.12); border-color: rgba(229,62,62,.3); }
.kpi-highlight-ok { background: rgba(56,161,105,.12); border-color: rgba(56,161,105,.3); }
.kpi-value.warning-alt  { color: var(--status-aberto-7, #d69e2e); }
.kpi-value.warning-dark { color: #c05621; }

/* Bolinhas de status (LINHA DE PROJETOS) */
.dash-dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; margin-right: 4px; vertical-align: middle;
}
.dot-ok        { background: #38a169; }
.dot-andamento { background: #3182ce; }
.dot-atrasado  { background: #e53e3e; }
.dot-aberto    { background: #1a365d; }
.dot-aberto7   { background: #d69e2e; }
.dot-aberto15  { background: #dd6b20; }
.dot-aberto30  { background: #c05621; }
.dot-paralisado{ background: #718096; }

/* CONTROLE GERAL PROJETOS - Estilo planilha Google Sheets */
.dash-linha-proj { min-width: 1100px; }
.dash-linha-proj td { font-size: .78rem; white-space: nowrap; }

.dash-sheet-style th {
  font-size: .68rem; padding: .45rem .5rem; letter-spacing: .02em;
}
.dash-sheet-style td { padding: .4rem .5rem; }

/* Colunas especificas */
.lp-obra { min-width: 140px; text-align: left !important; }
.lp-m3   { min-width: 50px; }
.lp-etapa { min-width: 70px; }
.lp-contrato { min-width: 75px; }
.lp-mae  { min-width: 80px; }
.lp-obra-cell { text-align: left !important; font-weight: 700; }
.lp-m3-cell { font-weight: 600; }
.lp-etapa-cell { font-size: .72rem; }
.lp-contrato-cell { font-weight: 500; }

/* Celulas de data com cor por status (estilo Sheets) */
.lp-cell { text-align: center; font-size: .76rem; font-weight: 500; }
.lp-empty { color: var(--text-muted); }
.lp-ok { background: #c6f6d5 !important; color: #276749 !important; font-weight: 600; }
.lp-andamento { background: #bee3f8 !important; color: #2a4365 !important; font-weight: 600; }
.lp-atrasado { background: #fed7d7 !important; color: #e53e3e !important; font-weight: 700; }
.lp-aberto7  { color: #e53e3e !important; font-weight: 600; }
.lp-aberto15 { color: #c05621 !important; font-weight: 500; }
.lp-aberto30 { color: #975a16 !important; }
.lp-paralisado { background: #fed7d7 !important; color: #9b2c2c !important; font-style: italic; }

/* Separador visual entre projeto e execucao (coluna PRODUCAO em diante) */
.dash-sheet-style th.lp-mae:nth-child(n+9) { background: #1a472a; }
.dash-sheet-style .lp-cell:nth-child(n+9):not(.lp-empty) { border-left: 2px solid #c6f6d5; }

/* Mini-tabelas por fase */
.dash-mini-tables-row {
  display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem;
}
.dash-mini-table {
  flex: 0 1 calc(25% - .75rem); min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.dash-mini-title {
  background: var(--navy); color: rgba(255,255,255,.85);
  font-size: .75rem; font-weight: 600; text-transform: uppercase;
  padding: .5rem .75rem; letter-spacing: .04em;
}
.dash-mini-tbody { width: 100%; border-collapse: collapse; font-size: .78rem; }
.dash-mini-tbody td { padding: .4rem .6rem; border-bottom: 1px solid var(--border); }
.dash-mini-tbody tr:last-child td { border-bottom: none; }
.dash-mini-tbody tr:hover td { background: #f8fafc; }
.dash-mini-empty { padding: 1rem; text-align: center; color: var(--text-muted); font-size: .8rem; }

/* Badges nas mini-tabelas */
.dash-badge {
  display: inline-block; padding: .15rem .45rem; border-radius: 3px;
  font-size: .68rem; font-weight: 600; color: #fff;
}
.dash-badge.dot-ok        { background: #38a169; }
.dash-badge.dot-andamento { background: #3182ce; }
.dash-badge.dot-atrasado  { background: #e53e3e; }
.dash-badge.dot-aberto    { background: #1a365d; }
.dash-badge.dot-aberto7   { background: #d69e2e; }
.dash-badge.dot-aberto15  { background: #dd6b20; }
.dash-badge.dot-aberto30  { background: #c05621; }
.dash-badge.dot-paralisado{ background: #718096; }

/* Resumo financeiro */
.dash-fin-cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin-bottom: .5rem;
}
.dash-fin-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .75rem 1rem;
  display: flex; flex-direction: column; gap: .2rem;
}
.dash-fin-label { font-size: .7rem; font-weight: 500; text-transform: uppercase; color: var(--text-muted); letter-spacing: .04em; }
.dash-fin-value { font-size: 1.1rem; font-weight: 700; color: var(--navy); }
.dash-fin-green { color: #38a169; }
.dash-fin-red   { color: #e53e3e; }

/* Barra de progresso no detalhamento */
.dash-progress-bar {
  height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; margin-bottom: 2px;
}
.dash-progress-fill {
  height: 100%; background: #38a169; border-radius: 3px; transition: width .3s;
}
.dash-progress-label { font-size: .68rem; color: var(--text-muted); font-weight: 600; }

/* Detalhamento por obra */
.dash-detail-table { min-width: 900px; }

/* ── CRONOGRAMA SIMPLIFICADO ──────────────────────────────── */
.cron-simp-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

.cron-simp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
  min-width: 1100px;
}

.cron-simp-table th {
  background: var(--navy);
  color: rgba(255,255,255,.85);
  padding: .5rem .6rem;
  text-align: center;
  font-size: .7rem;
  letter-spacing: .04em;
  white-space: nowrap;
}

.cron-simp-table td {
  padding: .4rem .6rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.cron-simp-table td:first-child,
.cron-simp-table td:nth-child(2) { text-align: left; }

.cell-ok      { background: #c6f6d5; color: #276749; font-weight: 600; }
.cell-atrasado{ background: #fed7d7; color: #9b2c2c; font-weight: 600; }
.cell-andando { background: #bee3f8; color: #2a69ac; font-weight: 600; }
.cell-vazio   { color: var(--text-muted); }

/* Status badge na cron.simp */
.obra-status { padding: .2rem .5rem; border-radius: 3px; font-size: .7rem; font-weight: 600; }
.obra-status.ativa     { background: #c6f6d5; color: #276749; }
.obra-status.paralisada{ background: #fed7d7; color: #9b2c2c; }
.obra-status.concluida { background: #e9d8fd; color: #553c9a; }

/* ── MODAL ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 1rem; font-weight: 700; }

.modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}

.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-body { padding: 1.25rem 1.5rem; }

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

.form-grid .field-group:first-child,
.form-grid .field-group:nth-child(2) { grid-column: span 2; }
/* Endereco tambem span 2 (eh o 2o campo no form de obra) */

@media (max-width: 480px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .field-group:first-child,
  .form-grid .field-group:nth-child(2) { grid-column: span 1; }
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

/* ── ESTADOS VAZIOS / LOADING ─────────────────────────────── */
.empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .9rem;
}

.loading-state {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .85rem;
}

/* ── SCROLLBAR ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 3px; }

/* ── MOBILE ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .main-content { padding: 1rem; }
  .page-title { font-size: 1.1rem; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .modal { max-width: 100%; }
}

@media (max-width: 480px) {
  .obra-info-bar { flex-direction: column; gap: .4rem; }
  .page-header { flex-direction: column; }
  .page-actions { width: 100%; }
  .obra-select { width: 100%; }
}

/* ── MENU COLUNAS ──────────────────────────────────────────── */
.colunas-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: .5rem;
  z-index: 100;
  min-width: 160px;
}

.col-toggle-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: .82rem;
  color: var(--text);
  white-space: nowrap;
}
.col-toggle-item:hover { background: var(--bg); }
.col-toggle-item input { cursor: pointer; accent-color: var(--navy); }

/* ── EDIÇÃO INLINE ─────────────────────────────────────────── */
.celula-editavel { cursor: text; }
.celula-editavel:hover { background: rgba(0,0,0,.04); }
.row-mae .celula-editavel:hover {
  background: var(--row-mae);
  outline: 1px dashed rgba(255,255,255,.18);
  outline-offset: -1px;
}
.row-filha .celula-editavel:hover {
  background: var(--row-filha);
  outline: 1px dashed rgba(255,255,255,.18);
  outline-offset: -1px;
}
.row-neta .celula-editavel:hover,
.row-bisneta .celula-editavel:hover,
.row-etapa .celula-editavel:hover { background: rgba(0,0,0,.05); }

.inline-edit-input {
  background: var(--surface);
  border: 1.5px solid var(--navy);
  border-radius: 3px;
  padding: .15rem .35rem;
  font-size: .78rem;
  width: 100%;
  color: var(--text);
  outline: none;
}

/* Input inline em linhas escuras: fundo transparente, texto branco */
.row-mae .inline-edit-input,
.row-filha .inline-edit-input {
  background: #1e3a5f;
  border-color: rgba(255,255,255,.3);
  color: #fff;
  color-scheme: dark;
}

/* ── CRITICIDADE ───────────────────────────────────────────── */
.toggle-crit { color: var(--text-muted); }
.toggle-crit.crit-ativo { color: #e53e3e; }
.row-mae .toggle-crit, .row-filha .toggle-crit { color: rgba(255,255,255,.45); }
.row-mae .toggle-crit.crit-ativo, .row-filha .toggle-crit.crit-ativo { color: #fc8181; }
.row-neta .toggle-crit, .row-bisneta .toggle-crit,
.row-etapa .toggle-crit { color: #aaa; }
.row-neta .toggle-crit.crit-ativo, .row-bisneta .toggle-crit.crit-ativo,
.row-etapa .toggle-crit.crit-ativo { color: #e53e3e; }
/* Criticidade: faixa vermelha na row inteira (igual sistema antigo) */
tr.critica td {
  color: #ef4444 !important;
}
tr.critica td .tipo-badge { opacity: .85; }
tr.critica .toggle-crit.crit-ativo { color: #ef4444; }
tr.critica td a, tr.critica td span { color: #ef4444; }

.action-icon-disabled { opacity: .35; pointer-events: none; }

/* ── MODAL COMENTÁRIOS / ANEXOS ────────────────────────────── */
.upload-area { border: 2px dashed var(--border); border-radius: var(--radius); }
.upload-placeholder {
  display: flex; flex-direction: column; align-items: center;
  gap: .4rem; padding: 1.5rem; cursor: pointer; color: var(--text-muted);
  font-size: .85rem;
}
.upload-placeholder:hover { background: var(--bg); }

.comentario-item {
  border-bottom: 1px solid var(--border);
  padding: .6rem 0;
}
.comentario-meta {
  display: flex; gap: .5rem; align-items: baseline;
  font-size: .75rem; margin-bottom: .25rem;
}
.comentario-meta strong { color: var(--navy); }
.comentario-meta span { color: var(--text-muted); }
.comentario-texto { font-size: .85rem; color: var(--text); }

/* ── CRON.SIMP ─────────────────────────────────────────────── */
.cs-table-wrap { overflow-x: auto; }

.cs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
  white-space: nowrap;
}

.cs-table th {
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  font-size: .7rem;
  letter-spacing: .04em;
  padding: .55rem .65rem;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,.1);
}

.cs-table td {
  padding: .45rem .65rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.cs-table tr:hover td { background: var(--bg); }

.cs-nome { text-align: left !important; font-weight: 600; color: var(--navy); }
.cs-m3  { color: var(--text-muted); }

.cs-ok     { background: #dcfce7; color: #15803d; font-weight: 600; }
.cs-futuro { background: #fff; color: var(--text); }
.cs-vazio  { background: #f8f9fa; color: var(--text-muted); }

.cs-legenda {
  display: flex; gap: 1.2rem; margin-top: .8rem;
  font-size: .75rem; color: var(--text-muted);
  align-items: center;
}
.cs-ok-ex::before     { content: ''; display: inline-block; width: 10px; height: 10px; background: #dcfce7; border: 1px solid #86efac; border-radius: 2px; margin-right: .3rem; }
.cs-futuro-ex::before { content: ''; display: inline-block; width: 10px; height: 10px; background: #fff; border: 1px solid var(--border); border-radius: 2px; margin-right: .3rem; }
.cs-vazio-ex::before  { content: ''; display: inline-block; width: 10px; height: 10px; background: #f1f5f9; border: 1px solid var(--border); border-radius: 2px; margin-right: .3rem; }

/* ── MÓDULO USUÁRIOS ─────────────────────────────────────── */

/* Badges de perfil */
.perfil-badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: .18rem .55rem;
  border-radius: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.perfil-diretor     { background: #1B2A4A; color: #e0c070; border-color: #1B2A4A; }
.perfil-projetista  { background: #0f4c8a; color: #bfdbfe; border-color: #0f4c8a; }
.perfil-calculista  { background: #134e4a; color: #99f6e4; border-color: #134e4a; }
.perfil-financeiro  { background: #44337a; color: #d9b6f0; border-color: #44337a; }
.perfil-operacional { background: #744210; color: #fde68a; border-color: #744210; }

/* Linha inativa na tabela */
.usuario-inativo td { opacity: .5; }

/* Botões de ação em texto */
.row-actions-text {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.btn-link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 600;
  color: var(--navy);
  padding: .15rem 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-link:hover { color: var(--gold); }
.btn-link-danger  { color: #c0392b !important; }
.btn-link-danger:hover  { color: #e74c3c !important; }
.btn-link-success { color: #1e8449 !important; }
.btn-link-success:hover { color: #27ae60 !important; }

/* ============================================================
   TIMESHEET
   ============================================================ */
.ts-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
  padding: .75rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.ts-field { display: flex; flex-direction: column; gap: .25rem; }
.ts-field label { font-size: .72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.ts-select, .ts-input {
  padding: .4rem .6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: .82rem;
}
.ts-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1rem;
}
.ts-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
}
.ts-section-full { grid-column: 1 / -1; }
.ts-section-title {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.ts-table { font-size: .8rem; }
.ts-table th { font-size: .72rem; }
.ts-resumo { margin-top: .75rem; text-align: right; }
.ts-total { font-size: .85rem; color: var(--gold); }

/* Resumo mensal - cards de semana */
.ts-semana-card {
  margin-bottom: .75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.ts-semana-header {
  display: flex;
  justify-content: space-between;
  padding: .4rem .6rem;
  background: rgba(201,168,76,.08);
  font-size: .78rem;
  font-weight: 600;
}
.ts-semana-body { padding: .3rem .6rem; }
.ts-semana-item {
  display: flex;
  justify-content: space-between;
  font-size: .75rem;
  padding: .15rem 0;
  color: var(--text-muted);
}
.ts-total-mes {
  text-align: right;
  margin-top: .75rem;
  font-size: .9rem;
  color: var(--gold);
}

/* Contadores de status (Minhas Atividades) */
.ts-counter {
  display: flex; flex-direction: column; align-items: center;
  padding: .4rem .8rem; border-radius: 6px; min-width: 65px;
  background: var(--bg-hover); border: 1px solid var(--border);
}
.ts-counter-label { font-size: .65rem; font-weight: 600; text-transform: uppercase; color: var(--text-muted); }
.ts-counter-valor { font-size: 1.1rem; font-weight: 700; }
.ts-counter-atrasado { background: rgba(229,62,62,.15); border-color: rgba(229,62,62,.3); }
.ts-counter-atrasado .ts-counter-valor { color: #e53e3e; }
.ts-counter-aberto .ts-counter-valor { color: var(--text); }
.ts-counter-aberto7 { background: rgba(214,158,46,.12); border-color: rgba(214,158,46,.25); }
.ts-counter-aberto7 .ts-counter-valor { color: #d69e2e; }
.ts-counter-aberto15 { background: rgba(221,107,32,.10); border-color: rgba(221,107,32,.20); }
.ts-counter-aberto15 .ts-counter-valor { color: #dd6b20; }
.ts-counter-aberto30 { background: rgba(192,86,33,.08); border-color: rgba(192,86,33,.18); }
.ts-counter-aberto30 .ts-counter-valor { color: #c05621; }
.ts-counter-subtotal { background: rgba(49,130,206,.12); border-color: rgba(49,130,206,.25); }
.ts-counter-subtotal .ts-counter-valor { color: #3182ce; }
.ts-counter-paralisado { background: rgba(113,128,150,.12); border-color: rgba(113,128,150,.25); }
.ts-counter-paralisado .ts-counter-valor { color: #718096; }
.ts-counter-ok { background: rgba(56,161,105,.15); border-color: rgba(56,161,105,.3); }
.ts-counter-ok .ts-counter-valor { color: #38a169; }

/* Responsivo mobile */
@media (max-width: 768px) {
  .ts-grid { grid-template-columns: 1fr; }
  .ts-controls { flex-direction: column; align-items: stretch; }
}

/* ============================================================
   PECAS
   ============================================================ */
.pecas-resumo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
.resumo-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .75rem 1rem;
  display: flex;
  flex-direction: column;
}
.resumo-label { font-size: .68rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.resumo-valor { font-size: 1.4rem; font-weight: 700; color: var(--text); }
.resumo-sub { font-size: .72rem; color: var(--text-muted); margin-top: .15rem; }
.resumo-bar { height: 4px; background: var(--border); border-radius: 2px; margin-top: .4rem; }
.resumo-bar-fill { height: 100%; background: var(--gold); border-radius: 2px; transition: width .3s; }

.pecas-actions { margin-bottom: .75rem; }
.pecas-table { font-size: .78rem; }
.pecas-table th { font-size: .68rem; white-space: nowrap; }
.pecas-table td { white-space: nowrap; }
.peca-nome { font-weight: 600; }
.text-right { text-align: right; }

/* Status colors por linha */
.peca-sem-calculo { }
.peca-com-calculo { background: rgba(150,150,150,.08); }
.peca-detalhada { background: rgba(52,152,219,.06); }
.peca-liberada { background: rgba(39,174,96,.06); }

/* Select de status inline */
.peca-status-select {
  padding: .2rem .3rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: .72rem;
  font-weight: 600;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
select.peca-sem-calculo { color: var(--text-muted); }
select.peca-com-calculo { color: #7f8c8d; }
select.peca-detalhada { color: #2980b9; }
select.peca-liberada { color: #27ae60; }

/* ── PRODUCAO ──────────────────────────────────────────────── */
.prod-actions { margin-bottom: 1rem; }

.prod-table { font-size: .82rem; }
.prod-table th { white-space: nowrap; padding: .4rem .5rem; }
.prod-table td { padding: .3rem .4rem; }

.prod-obra-header td {
  background: var(--bg-secondary);
  font-weight: 600;
  font-size: .85rem;
  color: var(--gold);
  padding: .5rem .6rem;
  border-left: 3px solid var(--gold);
}

.prod-tipo-cell {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .03em;
  white-space: nowrap;
  min-width: 80px;
}
.prod-tipo-header { min-width: 80px; }
.prod-total { font-weight: 600; }

.prod-contrato .prod-tipo-cell { color: var(--gold); }
.prod-planejado .prod-tipo-cell { color: #3498db; }
.prod-realizado .prod-tipo-cell { color: #27ae60; }

.prod-contrato td { background: rgba(201,168,76,.05); }
.prod-planejado td { background: rgba(52,152,219,.05); }
.prod-realizado td { background: rgba(39,174,96,.05); }

.prod-mes-atual {
  background: rgba(201,168,76,.12);
  border-left: 2px solid var(--gold);
  border-right: 2px solid var(--gold);
}
th.prod-mes-atual { color: var(--gold); }

.prod-input {
  width: 55px;
  padding: .2rem .3rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: .8rem;
  text-align: right;
}
.prod-input:focus {
  border-color: var(--gold);
  outline: none;
}

.prod-status-select {
  padding: .2rem .3rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: .75rem;
}

.prod-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

/* Mobile producao: scroll horizontal */
@media (max-width: 768px) {
  .prod-table { min-width: 900px; }
  .prod-input { width: 45px; font-size: .75rem; }
}

/* ── FINANCEIRO ────────────────────────────────────────────── */
.fin-table { font-size: .85rem; }
.fin-table th { white-space: nowrap; }

.fin-receita { color: #27ae60; }
.fin-despesa { color: #e74c3c; }

.fin-obra-nome {
  font-weight: 500;
  color: var(--gold);
}
.fin-obra-nome:hover { text-decoration: underline; }

.fin-row-receita td { border-left: 3px solid #27ae60; }
.fin-row-despesa td { border-left: 3px solid #e74c3c; }

.fin-status-select {
  padding: .2rem .3rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: .75rem;
  cursor: pointer;
}
.fin-status-pago { color: #27ae60; }
.fin-status-atrasado { color: #e74c3c; }
.fin-status-pendente { color: var(--gold); }

@media (max-width: 768px) {
  .fin-table { min-width: 700px; }
}

/* ── GANTT ────────────────────────────────────────────────── */

/* Toggle Tabela/Gantt */
.view-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.view-btn {
  padding: .4rem .8rem;
  font-size: .8rem;
  font-weight: 500;
  background: var(--bg);
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: all .2s;
}
.view-btn.active {
  background: var(--gold);
  color: #1a1a2e;
}
.view-btn:hover:not(.active) {
  background: var(--card);
}

/* Gantt controls */
.gantt-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.gantt-zoom {
  display: flex;
  gap: .25rem;
}
.gantt-zoom-btn {
  padding: .3rem .6rem;
  font-size: .75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: all .2s;
}
.gantt-zoom-btn.active {
  background: var(--gold);
  color: #1a1a2e;
  border-color: var(--gold);
}

/* Gantt empty state */
.gantt-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 1rem;
  font-size: .9rem;
}

/* ── Frappe-gantt dark theme overrides ────────────────────── */


/* SVG background */
#gantt-chart .gantt .grid-background {
  fill: var(--card);
}
#gantt-chart .gantt .grid-header {
  fill: var(--bg);
  stroke: var(--border);
}
#gantt-chart .gantt .grid-row {
  fill: var(--card);
}
#gantt-chart .gantt .grid-row:nth-child(even) {
  fill: rgba(255,255,255,.02);
}
#gantt-chart .gantt .row-line {
  stroke: var(--border);
}
#gantt-chart .gantt .tick {
  stroke: var(--border);
  stroke-dasharray: 4;
  opacity: .3;
}

/* Header text (months, days) */
#gantt-chart .gantt .upper-text,
#gantt-chart .gantt .lower-text {
  fill: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
}

/* Today highlight */
#gantt-chart .gantt .today-highlight {
  fill: rgba(201,168,76,.1);
  stroke: var(--gold);
  stroke-width: 1;
  opacity: .6;
}

/* Bars */
#gantt-chart .gantt .bar {
  rx: 4;
  ry: 4;
}
#gantt-chart .gantt .bar-label {
  fill: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
}
#gantt-chart .gantt .bar-wrapper:hover .bar {
  filter: brightness(1.15);
}

/* Mae bars - gold, slightly taller appearance via class */
#gantt-chart .gantt .gantt-bar-mae .bar {
  fill: #C9A84C;
  stroke: #a88b3d;
  stroke-width: 1;
}
#gantt-chart .gantt .gantt-bar-mae .bar-progress {
  fill: #a88b3d;
}

/* Filha bars by status */
#gantt-chart .gantt .gantt-bar-ok .bar {
  fill: #27ae60;
}
#gantt-chart .gantt .gantt-bar-ok .bar-progress {
  fill: #219a52;
}
#gantt-chart .gantt .gantt-bar-atrasado .bar {
  fill: #e74c3c;
}
#gantt-chart .gantt .gantt-bar-atrasado .bar-progress {
  fill: #c0392b;
}
#gantt-chart .gantt .gantt-bar-em_andamento .bar {
  fill: #f39c12;
}
#gantt-chart .gantt .gantt-bar-em_andamento .bar-progress {
  fill: #d68910;
}
#gantt-chart .gantt .gantt-bar-aberto .bar {
  fill: #3498db;
}
#gantt-chart .gantt .gantt-bar-aberto .bar-progress {
  fill: #2980b9;
}

/* Etapa bars - gold milestone */
#gantt-chart .gantt .gantt-bar-etapa .bar {
  fill: #d4ac0d;
  stroke: #b7950b;
  stroke-width: 1;
}
#gantt-chart .gantt .gantt-bar-etapa .bar-progress {
  fill: #b7950b;
}

/* Arrows (dependencies) */
#gantt-chart .gantt .arrow {
  stroke: var(--text-muted);
  stroke-width: 1.5;
  opacity: .5;
}

/* Hide popup (we disabled it but just in case) */
#gantt-chart .gantt .popup-wrapper {
  display: none;
}

/* Handle (drag) */
#gantt-chart .gantt .handle {
  fill: rgba(255,255,255,.3);
  cursor: ew-resize;
}

@media (max-width: 768px) {
  .gantt-controls { flex-direction: column; gap: .5rem; }
  .view-toggle { align-self: flex-start; }
  
}

/* ============================================================
   KANBAN
   3 colunas: BACKLOG / FAZENDO / FEITO
   Drag-and-drop via SortableJS
   ============================================================ */

.kanban-toolbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.kanban-board {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: .5rem;
  min-height: 400px;
  align-items: flex-start;
}

.kanban-coluna {
  flex: 1;
  min-width: 280px;
  max-width: 400px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
}

.kanban-coluna-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.kanban-coluna-titulo {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--navy);
  text-transform: uppercase;
}

.kanban-coluna-count {
  font-size: .7rem;
  font-weight: 600;
  background: var(--navy);
  color: #fff;
  padding: .15rem .45rem;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.kanban-coluna-body {
  padding: .5rem;
  flex: 1;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.kanban-placeholder {
  text-align: center;
  color: var(--text-light);
  font-size: .8rem;
  padding: 2rem .5rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
}

/* Card */
.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--status-em-andamento);
  border-radius: var(--radius);
  padding: .75rem;
  cursor: grab;
  transition: box-shadow .15s, transform .1s;
  user-select: none;
}

.kanban-card:hover {
  box-shadow: var(--shadow);
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
  margin-bottom: .35rem;
}

.kanban-card-titulo {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
}

.kanban-card-actions {
  display: flex;
  gap: .15rem;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .15s;
}

.kanban-card:hover .kanban-card-actions {
  opacity: 1;
}

.kanban-card-desc {
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kanban-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: .5rem;
  flex-wrap: wrap;
}

.kanban-card-tags {
  display: flex;
  gap: .35rem;
  align-items: center;
  flex-wrap: wrap;
}

.kanban-card-obra {
  font-size: .65rem;
  font-weight: 600;
  background: rgba(201,168,76,.12);
  color: var(--gold);
  padding: .1rem .4rem;
  border-radius: 3px;
  white-space: nowrap;
}

.kanban-card-prioridade {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.kanban-card-meta {
  display: flex;
  gap: .5rem;
  align-items: center;
  font-size: .7rem;
  color: var(--text-muted);
}

.kanban-card-resp {
  font-weight: 500;
}

.kanban-card-data {
  font-size: .7rem;
  color: var(--text-muted);
}

.kanban-data-atrasada {
  color: var(--status-atrasado);
  font-weight: 600;
}

/* Drag feedback */
.kanban-ghost {
  opacity: .4;
}

.kanban-chosen {
  transform: rotate(2deg);
  box-shadow: var(--shadow-lg);
}

.kanban-drag {
  opacity: .9;
}

/* Mobile: scroll horizontal */
@media (max-width: 768px) {
  .kanban-board {
    flex-direction: column;
    min-height: auto;
  }
  .kanban-coluna {
    min-width: 100%;
    max-width: 100%;
  }
  .kanban-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .kanban-toolbar .obra-select {
    width: 100%;
  }
}

/* ============================================================
   OBRAS - Pagina Dados de Entrada
   Lista de obras + Formulario detalhado em 7 secoes colapsaveis
   ============================================================ */

/* -- Lista de obras -- */
.obras-table th { font-size: .72rem; }
.obras-table td { white-space: nowrap; }
.obras-codigo {
  font-size: .68rem; font-weight: 700; letter-spacing: .04em;
  padding: .15rem .45rem; border-radius: 3px;
  background: var(--navy); color: var(--gold);
  display: inline-block;
}
.obras-nome { font-weight: 600; color: var(--navy); cursor: pointer; }
.obras-nome:hover { text-decoration: underline; color: var(--gold); }

/* -- Voltar -- */
.obra-voltar {
  display: flex; align-items: center; gap: .4rem;
  font-size: .82rem; color: var(--text-muted); cursor: pointer;
  margin-bottom: 1rem; padding: .3rem 0;
}
.obra-voltar:hover { color: var(--navy); }

/* -- Header detalhe -- */
.obra-detalhe-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem; flex-wrap: wrap; gap: .75rem;
}
.obra-detalhe-titulo { font-size: 1.1rem; font-weight: 700; color: var(--navy); }

/* -- Secoes colapsaveis -- */
.obra-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: .75rem;
  overflow: hidden;
}
.obra-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem;
  background: var(--bg);
  cursor: pointer;
  user-select: none;
  transition: background .15s;
  border-bottom: 1px solid transparent;
}
.obra-section-header:hover { background: #eef1f5; }
.obra-section.open .obra-section-header { border-bottom-color: var(--border); }

.obra-section-titulo {
  font-size: .82rem; font-weight: 600;
  color: var(--navy); letter-spacing: .02em;
  display: flex; align-items: center; gap: .5rem;
}
.obra-section-titulo svg { color: var(--gold); }

.obra-section-chevron {
  transition: transform .2s;
  color: var(--text-muted);
}
.obra-section.open .obra-section-chevron { transform: rotate(180deg); }

.obra-section-body {
  padding: 1rem 1.25rem;
  display: none;
}
.obra-section.open .obra-section-body { display: block; }

/* -- Form grid -- */
.obra-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
}
.obra-form-grid .span-2 { grid-column: span 2; }
.obra-form-grid .span-3 { grid-column: span 3; }

.obra-form-grid .form-group { margin-bottom: 0; }
.obra-form-grid label {
  display: block;
  font-size: .72rem; font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .25rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.obra-form-grid .form-input {
  width: 100%;
  padding: .4rem .6rem;
  font-size: .82rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s;
}
.obra-form-grid .form-input:focus {
  border-color: var(--navy);
  outline: none;
}
.obra-form-grid textarea.form-input {
  resize: vertical;
  min-height: 50px;
}

/* -- Quantitativos sub-headers -- */
.obra-quant-header {
  font-size: .72rem; font-weight: 700; color: var(--gold);
  text-transform: uppercase; letter-spacing: .06em;
  padding: .4rem 0; margin-top: .75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .5rem;
}
.obra-quant-header:first-child { margin-top: 0; }

/* -- Doc links -- */
.obra-doc-input {
  display: flex; align-items: center; gap: .4rem;
}
.obra-doc-input .form-input { flex: 1; }
.obra-doc-open {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: var(--radius);
  color: var(--navy);
  background: var(--bg);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.obra-doc-open:hover { color: var(--gold); border-color: var(--gold); }

/* -- Save bar -- */
.obra-save-bar {
  position: sticky; bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: .75rem 1rem;
  display: flex; justify-content: flex-end; gap: .5rem;
  z-index: 20;
  margin-top: 1rem;
  box-shadow: 0 -2px 8px rgba(0,0,0,.06);
}

/* -- Obras toolbar e acoes -- */
.obras-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: .5rem 0; margin-bottom: .5rem;
}
.obras-toolbar-info { font-size: .78rem; color: var(--text-muted); }
.row-actions-icons { display: flex; gap: .25rem; }
.action-icon { background: none; border: none; cursor: pointer; padding: .25rem; border-radius: 3px; color: var(--text-muted); }
.action-icon:hover { background: rgba(0,0,0,.06); color: var(--text); }

/* -- Visualizar obra (somente leitura) -- */
.view-container { display: flex; flex-direction: column; gap: 1rem; }
.view-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 1rem 1.25rem;
}
.view-section-title {
  font-weight: 600; font-size: .85rem; color: var(--primary);
  margin-bottom: .6rem; padding-bottom: .4rem;
  border-bottom: 1px solid var(--border);
}
.view-section-body { display: flex; flex-wrap: wrap; gap: .15rem .5rem; }
.view-field { font-size: .8rem; width: calc(33% - .5rem); min-width: 180px; padding: .2rem 0; }
.view-label { color: var(--text-muted); }
.view-value { color: var(--text); font-weight: 500; }
.view-value a { color: var(--primary); text-decoration: none; }
.view-value a:hover { text-decoration: underline; }
.view-sub {
  width: 100%; font-size: .75rem; font-weight: 600; color: var(--gold, #d4a843);
  margin-top: .5rem; padding-top: .3rem; border-top: 1px dashed var(--border);
}

/* -- View cards (resumo atividades/pecas/financeiro) -- */
.view-cards-row {
  display: flex; gap: .5rem; flex-wrap: wrap; width: 100%; margin-bottom: .5rem;
}
.view-card {
  flex: 1; min-width: 80px; text-align: center; padding: .5rem .4rem;
  background: rgba(0,0,0,.03); border-radius: 6px;
  font-size: 1.1rem; font-weight: 700; color: var(--text);
}
.view-card small { display: block; font-size: .65rem; font-weight: 400; color: var(--text-muted); margin-top: .15rem; }
.view-card-red { color: #e53e3e; background: rgba(229,62,62,.06); }
.view-card-green { color: #38a169; background: rgba(56,161,105,.06); }
.view-card-blue { color: #3182ce; background: rgba(49,130,206,.06); }
.view-card-yellow { color: #dd6b20; background: rgba(221,107,32,.06); }
.view-card-gray { color: #718096; background: rgba(113,128,150,.06); }

/* -- Print -- */
/* ── Notificações (sininho) ──────────────────────────────── */
.notif-wrapper { position: relative; }
.notif-btn { background: none; border: none; cursor: pointer; color: var(--text-light); position: relative; padding: .25rem; }
.notif-btn:hover { color: #fff; }
.notif-badge { position: absolute; top: -4px; right: -4px; background: #e53e3e; color: #fff; font-size: .6rem; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.notif-dropdown { position: absolute; top: 100%; right: 0; width: 340px; max-height: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.3); z-index: 1000; overflow: hidden; }
.notif-header { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.notif-header strong { font-size: .85rem; color: var(--text); }
.notif-ler-todas { background: none; border: none; color: var(--primary); cursor: pointer; font-size: .75rem; }
.notif-ler-todas:hover { text-decoration: underline; }
.notif-list { overflow-y: auto; max-height: 340px; }
.notif-empty { padding: 2rem 1rem; text-align: center; color: var(--text-muted); font-size: .8rem; }
.notif-item { padding: .75rem 1rem; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.notif-item:hover { background: rgba(255,255,255,.05); }
.notif-item.lida { opacity: .6; }
.notif-titulo { font-size: .8rem; font-weight: 600; color: var(--text); margin-bottom: .2rem; }
.notif-msg { font-size: .75rem; color: var(--text-muted); margin-bottom: .2rem; }
.notif-meta { font-size: .65rem; color: var(--text-muted); }

@media print {
  @page { margin: 15mm; }
  .no-print, .sidebar, .top-bar, .page-header, .app-header, .app-sidebar { display: none !important; }
  .app-main, .main-content { margin: 0 !important; padding: 0 !important; }
  .view-section { break-inside: avoid; border: 1px solid #ddd; margin-bottom: .5rem; }
  .view-container { gap: .5rem; }
  .view-field a { word-break: break-all; }
  body { background: white; color: #000; font-size: 10pt; }
  .obra-detalhe-header { margin-bottom: 1rem; }
  .obra-detalhe-titulo { font-size: 14pt; }
  /* Item 2 do aditivo (12/05/2026): print do dashboard */
  .dashboard-table { font-size: 9pt; }
  .dashboard-table th, .dashboard-table td { padding: 4px 6px; }
}

@media (max-width: 768px) {
  .view-field { width: calc(50% - .5rem); }
}
@media (max-width: 480px) {
  .view-field { width: 100%; }
}

/* -- Google Drive Explorer -- */
.drive-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: .5rem 0; margin-bottom: .5rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: .5rem;
}
.drive-breadcrumb { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.drive-bc-link { color: var(--primary); cursor: pointer; font-size: .8rem; }
.drive-bc-link:hover { text-decoration: underline; }
.drive-bc-sep { color: var(--text-muted); font-size: .75rem; }
.drive-bc-current { font-weight: 600; font-size: .8rem; color: var(--text); }
.drive-toolbar-actions { display: flex; gap: .35rem; }
.btn-sm { font-size: .72rem; padding: .3rem .6rem; }
.btn-danger-text { color: #e53e3e; }
.btn-danger-text:hover { background: rgba(229,62,62,.08); }

.drive-file-list { display: flex; flex-direction: column; gap: 2px; }

.drive-file-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .6rem; border-radius: 4px;
  transition: background .15s;
}
.drive-file-item:hover { background: rgba(0,0,0,.03); }

.drive-folder-item { cursor: pointer; }
.drive-folder-item:hover { background: rgba(246,173,85,.08); }

.drive-file-icon { flex-shrink: 0; width: 24px; text-align: center; }
.drive-file-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.drive-file-name { font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-file-size { font-size: .68rem; color: var(--text-muted); }
.drive-file-meta { font-size: .7rem; color: var(--text-muted); white-space: nowrap; }
.drive-file-actions { flex-shrink: 0; }

.drive-btn-open {
  color: var(--primary); padding: .2rem; border-radius: 3px;
  display: inline-flex; align-items: center;
}
.drive-btn-open:hover { background: rgba(49,130,206,.1); }

.drive-loading, .drive-error, .drive-empty {
  padding: 1.5rem; text-align: center; color: var(--text-muted); font-size: .82rem;
}
.drive-error { color: #e53e3e; }

.drive-vincular { padding: .75rem 0; }
.drive-vincular code {
  background: rgba(0,0,0,.06); padding: .15rem .4rem; border-radius: 3px;
  font-size: .65rem; word-break: break-all;
}

/* -- Responsive -- */
@media (max-width: 768px) {
  .obra-form-grid { grid-template-columns: 1fr 1fr; }
  .obra-form-grid .span-3 { grid-column: span 2; }
  .obra-detalhe-header { flex-direction: column; }
  .drive-toolbar { flex-direction: column; align-items: flex-start; }
  .drive-file-meta { display: none; }
}
@media (max-width: 480px) {
  .obra-form-grid { grid-template-columns: 1fr; }
  .obra-form-grid .span-2,
  .obra-form-grid .span-3 { grid-column: span 1; }
}

/* ── DASHBOARD ESSENCIAL - Mobile ─────────────────────────── */
@media (max-width: 768px) {
  .dash-top-row { flex-direction: column; }
  .dash-donut-wrap { flex: 1; max-width: 100%; }
  .dashboard-grid { grid-template-columns: repeat(3, 1fr); }
  .dash-mini-tables-row { flex-direction: column; }
  .dash-filtro-row { flex-direction: column; align-items: flex-start; }
  .dash-filtro-select { max-width: 100%; }
  .dash-fin-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Obras - Filtros ────────────────────────────────────── */
.obras-filtros {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.obras-filtros input,
.obras-filtros select {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: .78rem;
  min-width: 120px;
}
.obras-filtros input::placeholder { color: var(--text-muted); }
.obras-filtros input:focus,
.obras-filtros select:focus {
  border-color: var(--primary);
  outline: none;
}
.obras-table { font-size: .78rem; }
.obras-table th { white-space: nowrap; font-size: .7rem; }
.obras-table td { white-space: nowrap; }
.obras-codigo-badge {
  display: inline-block;
  background: var(--primary);
  color: #1a1a2e;
  font-weight: 700;
  font-size: .7rem;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: .5px;
}
@media (max-width: 768px) {
  .obras-filtros { flex-direction: column; }
  .obras-filtros input,
  .obras-filtros select { width: 100%; min-width: 0; }
}

/* ── CRON.SIMP - Cronograma Executivo Consolidado ──────────── */
.cron-filtro-row {
  display: flex; gap: 8px; align-items: center;
  margin-bottom: 12px; flex-wrap: wrap;
}
.cron-filtro-label { font-size: .78rem; color: var(--text-muted); }
.cron-filtro-select {
  background: var(--bg-secondary); border: 1px solid var(--border);
  color: var(--text-primary); padding: 5px 10px;
  border-radius: 6px; font-size: .78rem;
}
.cron-filtro-count { font-size: .72rem; color: var(--text-muted); margin-left: auto; }
.cron-toggle-cols {
  font-size: .72rem; padding: 4px 10px; border-radius: 5px;
  cursor: pointer; border: 1px solid var(--border);
  background: var(--bg-secondary); color: var(--text-muted);
  transition: all .2s;
}
.cron-toggle-cols.cron-toggle-active {
  border-color: var(--primary); color: var(--primary);
}
.cron-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cron-table {
  width: 100%; border-collapse: collapse;
  font-size: .73rem; white-space: nowrap;
}
.cron-table th {
  background: var(--bg-secondary); color: var(--text-muted);
  font-size: .66rem; font-weight: 600; text-transform: uppercase;
  padding: 6px 5px; border-bottom: 2px solid var(--border);
  position: sticky; top: 0; z-index: 2;
}
.cron-table td { padding: 4px 5px; border-bottom: 1px solid var(--border); }
.cron-col-obra { min-width: 110px; }
.cron-col-m3 { min-width: 50px; text-align: center; }
.cron-col-tipo { min-width: 36px; text-align: center; }
.cron-col-contrato { min-width: 68px; text-align: center; }
.cron-col-mae { min-width: 68px; text-align: center; }
.cron-col-status { min-width: 70px; text-align: center; }
.cron-obra-nome { font-weight: 600; vertical-align: middle; }
.cron-m3 { text-align: center; vertical-align: middle; color: var(--text-muted); font-size: .7rem; }
.cron-tipo-cell { text-align: center; }
.cron-tipo-label {
  font-size: .6rem; font-weight: 700; color: var(--text-muted);
  letter-spacing: .3px;
}
.cron-contrato-cell { text-align: center; font-size: .7rem; }
.cron-status-cell { text-align: center; vertical-align: middle; }
.cron-cell { text-align: center; font-size: .7rem; }
.cron-cell-empty { color: var(--text-muted); opacity: .5; }
.cron-cell-contrato { color: var(--text-secondary); }
.cron-cell-realizado-ok { background: rgba(56,161,105,.18); color: #38a169; font-weight: 600; }
/* Linhas com fundo sutil por tipo */
.cron-row-contrato { background: rgba(25,59,93,.12); }
.cron-row-previsto { background: transparent; }
.cron-row-realizado { background: rgba(56,161,105,.05); }
/* Separador entre obras (borda top grossa) */
.cron-obra-separator td { border-top: 2px solid var(--border); }
/* Classes de cor por status (celulas MAE) */
.cron-st-atrasado { background: rgba(229,62,62,.18) !important; color: #e53e3e !important; font-weight: 600; }
.cron-st-aberto_7 { background: rgba(214,158,46,.15) !important; color: #d69e2e !important; font-weight: 600; }
.cron-st-aberto_15 { background: rgba(221,107,32,.12) !important; color: #dd6b20 !important; font-weight: 600; }
.cron-st-aberto_30 { background: rgba(192,86,33,.10) !important; color: #c05621 !important; font-weight: 600; }
.cron-st-em_andamento { background: rgba(49,130,206,.15) !important; color: #3182ce !important; font-weight: 600; }
.cron-st-ok { background: rgba(56,161,105,.20) !important; color: #38a169 !important; font-weight: 600; }
.cron-st-paralisado { background: rgba(113,128,150,.15) !important; color: #718096 !important; font-weight: 600; }
.cron-st-aberto { color: var(--text-secondary); font-weight: 600; }
/* Mobile: scroll horizontal + label compacto */
@media (max-width: 768px) {
  .cron-table { font-size: .68rem; }
  .cron-table th { font-size: .6rem; padding: 4px 3px; }
  .cron-table td { padding: 3px 3px; }
  .cron-col-obra { min-width: 90px; }
}

/* ── Predecessora select (inline edit) ─────────── */
.inline-edit-pred {
  min-width: 200px;
  max-width: 300px;
  font-size: .75rem;
}
/* GAP desabilitado (nao-MAE) - sem opacity pra nao esbranquicar sobre table-wrap branco */
.celula-disabled {
  cursor: default;
  pointer-events: none;
}
/* GAP/AJUSTE preenchido - destaque visual */
.celula-preenchida {
  font-weight: 700;
  color: #e53e3e !important;
}
/* Predecessora cell: cursor pointer quando editavel */
.celula-predecessora { cursor: pointer; }


/* ── STATUS GERAL - tabela consolidada ────────────────────── */
.sg-table { width: 100%; border-collapse: collapse; margin-top: .5rem; }
.sg-th { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; padding: .5rem .75rem; text-align: center; color: var(--text-muted); border-bottom: 2px solid var(--border); }
.sg-th-nome { width: 120px; }
.sg-cell { text-align: center; padding: .5rem .75rem; border-left: 1px solid var(--border); }
.sg-cell-total { border-left: 2px solid var(--border); }
.sg-nome { font-size: .78rem; font-weight: 600; color: var(--navy); padding: .4rem .75rem; white-space: nowrap; }
.sg-nome-geral { font-size: .85rem; }
.sg-pct { font-size: .85rem; font-weight: 600; display: block; opacity: .7; margin-top: .15rem; }
.sg-val { font-size: 1.5rem; font-weight: 700; color: var(--navy); display: block; line-height: 1.1; }
.sg-row-geral td.sg-cell { padding: 1rem .75rem; border-bottom: 2px solid var(--border); }
.sg-row-geral .sg-pct { font-size: .85rem; }
.sg-cell-colab { padding: .35rem .75rem; }
.sg-val-colab { font-size: .82rem; color: var(--text-secondary); }
.sg-hl-danger { background: rgba(229,62,62,.08); }
.sg-hl-ok { background: rgba(56,161,105,.08); }
.sg-cell-total .sg-pct { font-size: 1.3rem; color: var(--navy); }
.sg-cell-total .sg-val-colab { font-weight: 700; color: var(--navy); }
/* Status colors */
.sg-pct.danger, .sg-val-colab.danger { color: #e53e3e; }
.sg-pct.warning-alt { color: #d69e2e; }
.sg-pct.warning { color: #dd6b20; }
.sg-pct.warning-dark { color: #c05621; }
.sg-pct.success, .sg-val-colab.success { color: #38a169; }
.sg-pct.info, .sg-val-colab.info { color: #3182ce; }
.sg-hl-info { background: rgba(49,130,206,.08); }
/* Filtro checkboxes */
.sg-filter-row { display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: center; justify-content: flex-end; margin-bottom: .5rem; }
.sg-filter-label { display: flex; align-items: center; gap: .25rem; font-size: .72rem; color: var(--text-secondary); cursor: pointer; white-space: nowrap; }
.sg-filter-label input { cursor: pointer; accent-color: var(--navy); }
.sg-filter-todos { margin-right: .5rem; padding-right: .75rem; border-right: 1px solid var(--border); }
.sg-filter-todos span { font-weight: 700; color: var(--navy); }


/* ── Kanban: solicitante + comentarios ──────────────────── */
.kanban-card-solicitante { font-size: .65rem; color: var(--text-muted); font-style: italic; }
.kanban-card-anexo { font-size: .65rem; color: var(--gold); text-decoration: none; font-weight: 600; padding: 1px 6px; border: 1px solid var(--gold); border-radius: 3px; }
.kanban-card-anexo:hover { background: rgba(212,175,55,.15); }
.kanban-comentario { padding: .4rem 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.kanban-comentario:last-child { border-bottom: none; }
.kanban-comentario-autor { font-size: .75rem; font-weight: 600; color: var(--gold); margin-right: .5rem; }
.kanban-comentario-data { font-size: .65rem; color: var(--text-muted); }
.kanban-comentario-texto { font-size: .78rem; color: var(--text-primary); margin: .15rem 0 0; }

/* ── Gantt Chart - Tema Claro ─────────────────────────────── */

#gantt-chart svg.gantt {
  background: #ffffff;
}
/* Zoom toolbar */
.gantt-zoom {
  display: flex;
  gap: 4px;
  align-items: center;
}
.gantt-zoom-btn {
  padding: 6px 14px;
  font-size: .78rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
}
.gantt-zoom-btn:hover {
  background: rgba(201,168,76,.15);
  color: var(--gold);
  border-color: var(--gold);
}
.gantt-zoom-btn.active {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
}
/* Barras do Gantt */
#gantt-chart .gantt-bar-mae .bar {
  fill: #C9A84C !important;
  rx: 4;
}
#gantt-chart .gantt-bar-mae .bar-progress {
  fill: #a88b3d !important;
}
#gantt-chart .gantt-bar-etapa .bar {
  fill: #d4ac0d !important;
  rx: 4;
}
#gantt-chart .gantt-bar-ok .bar {
  fill: #38a169 !important;
  rx: 3;
}
#gantt-chart .gantt-bar-ok .bar-progress {
  fill: #2f855a !important;
}
#gantt-chart .gantt-bar-atrasado .bar {
  fill: #e53e3e !important;
  rx: 3;
}
#gantt-chart .gantt-bar-atrasado .bar-progress {
  fill: #c53030 !important;
}
#gantt-chart .gantt-bar-andamento .bar {
  fill: #3182ce !important;
  rx: 3;
}
#gantt-chart .gantt-bar-andamento .bar-progress {
  fill: #2b6cb0 !important;
}
#gantt-chart .gantt-bar-aberto .bar {
  fill: #a0aec0 !important;
  rx: 3;
}
#gantt-chart .gantt-bar-aberto .bar-progress {
  fill: #718096 !important;
}
/* Labels das barras */
#gantt-chart .bar-label {
  fill: #1a202c !important;
  font-size: 11px !important;
  font-weight: 500 !important;
}
#gantt-chart .gantt-bar-mae .bar-label {
  font-weight: 700 !important;
  font-size: 12px !important;
}
/* Header */
#gantt-chart .grid-header {
  fill: #f1f5f9 !important;
}
#gantt-chart .upper-text {
  fill: #1a202c !important;
  font-weight: 700 !important;
}
#gantt-chart .lower-text {
  fill: #4a5568 !important;
}
/* Today button styling */
#gantt-chart .gantt-container .today-button {
  background: var(--gold) !important;
  color: #000 !important;
  border-radius: 4px;
  font-weight: 600;
}

/* ── Gantt Compacto: mais dados na tela ──────────────── */

/* Barras menores: altura e padding reduzidos */
#gantt-chart .gantt .bar-wrapper {
  cursor: pointer;
}
#gantt-chart .gantt .bar {
  height: 22px !important;
}
#gantt-chart .gantt .bar-progress {
  height: 22px !important;
}
#gantt-chart .gantt .bar-label {
  font-size: 10px !important;
  dominant-baseline: central !important;
}
#gantt-chart .gantt .gantt-bar-mae .bar {
  height: 26px !important;
}
#gantt-chart .gantt .gantt-bar-mae .bar-progress {
  height: 26px !important;
}
#gantt-chart .gantt .gantt-bar-mae .bar-label {
  font-size: 11px !important;
  font-weight: 700 !important;
}
/* Reduzir espaco entre linhas do grid */
#gantt-chart .gantt .grid-row {
  height: 32px !important;
}
#gantt-chart .gantt .row-line {
  stroke-width: 0.5 !important;
}
/* Header mais compacto */
#gantt-chart .gantt .upper-text {
  font-size: 12px !important;
}
#gantt-chart .gantt .lower-text {
  font-size: 10px !important;
}

/* ── Scrollbars visiveis e estilizadas ──────────────── */
#gantt-chart::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
#gantt-chart::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 6px;
}
#gantt-chart::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 6px;
  border: 2px solid #f1f5f9;
}
#gantt-chart::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}
#gantt-chart::-webkit-scrollbar-corner {
  background: #f1f5f9;
}
/* Firefox scrollbar */


/* ── Top Scrollbar Mirror (Gantt) ────────────────────── */
#gantt-top-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  border: 1px solid #e2e8f0;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: #f8fafc;
}
#gantt-top-scroll::-webkit-scrollbar {
  height: 12px;
}
#gantt-top-scroll::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 6px;
}
#gantt-top-scroll::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 6px;
  border: 2px solid #f1f5f9;
}
#gantt-top-scroll::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}
/* Ajustar border-radius do chart quando top scroll existe */
#gantt-top-scroll + 

/* ── Gantt Chart - Bloco unico definitivo ──────────────── */
#gantt-chart {
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  overflow-x: auto;
  overflow-y: hidden;
  min-height: 300px;
  /* Sem max-height: chart expande inteiro, pagina cuida do scroll vertical */
}
/* Quando top scroll existe, ajustar bordas */
#gantt-top-scroll + #gantt-chart {
  border-radius: 0 0 8px 8px;
  border-top: none;
}
/* Scrollbar horizontal estilizada */
#gantt-chart::-webkit-scrollbar {
  height: 12px;
}
#gantt-chart::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 6px;
}
#gantt-chart::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 6px;
  border: 2px solid #f1f5f9;
}
#gantt-chart::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}
#gantt-chart {
  scrollbar-width: auto;
  scrollbar-color: #94a3b8 #f1f5f9;
}

/* ── Scrollbar da pagina - mais visivel e estilizada ──────── */
::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 7px;
  border: 3px solid #f1f5f9;
}
::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}
::-webkit-scrollbar-corner {
  background: #f1f5f9;
}
/* Firefox */
html {
  scrollbar-width: auto;
  scrollbar-color: #94a3b8 #f1f5f9;
}

/* ── Botoes zoom +/- ────────────────────────────────── */
.gantt-scale-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
}
.gantt-scale-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  line-height: 1;
}
.gantt-scale-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #1e293b;
}
.gantt-scale-btn:active {
  transform: scale(0.95);
}
.gantt-scale-label {
  font-size: 12px;
  color: #64748b;
  min-width: 36px;
  text-align: center;
  font-weight: 600;
}

/* ── Botoes zoom +/- inferior (flutuante canto direito) ── */
.gantt-scale-bottom {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  padding: 8px 12px;
  background: rgba(255,255,255,0.95);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  position: sticky;
  bottom: 12px;
  float: right;
  margin-top: -50px;
  margin-right: 8px;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ── Botao Today do frappe-gantt (removido - nao funciona bem) ── */
#gantt-chart .today-button {
  display: none !important;
}


/* Quando sticky header existe, ajustar chart */
#gantt-sticky-header + #gantt-top-scroll + #gantt-chart,
#gantt-sticky-header + #gantt-chart {
  border-radius: 0 0 8px 8px;
  border-top: none;
}


/* ── Badge de contagem nos icones de acao ──────────────── */
.action-icon {
  position: relative;
}


/* ── Botao Exportar Observacoes PDF ──────────────────── */
.btn-export-obs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #C9A84C;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-export-obs:hover {
  background: #b8963f;
}
.btn-export-obs svg {
  flex-shrink: 0;
}



/* ── Icones de acao com conteudo (comentarios/anexos) ──────── */
.action-icon {
  position: relative;
}
.action-icon.has-content {
  opacity: 1 !important;
}
.badge-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #e53e3e;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  pointer-events: none;
}

/* ── Botao excluir comentario ──────────────────────────── */
.comentario-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.btn-delete-comment {
  background: none;
  border: none;
  color: #a0aec0;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
}
.btn-delete-comment:hover {
  color: #e53e3e;
  background: rgba(229,62,62,0.1);
}

/* ── Timesheet v2: formulario inline ──────────────────────── */
.ts-lancamento-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.ts-lancamento-form .ts-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 120px;
  flex: 1;
}
.ts-lancamento-form .ts-field label {
  font-size: 11px;
  font-weight: 600;
  color: #4a5568;
}
.ts-lancamento-form .ts-field-btn {
  min-width: auto;
  flex: 0;
  justify-content: flex-end;
}
.ts-lancamento-form .ts-select,
.ts-lancamento-form .ts-input {
  padding: 6px 10px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
}
.ts-lancamento-form .ts-select:focus,
.ts-lancamento-form .ts-input:focus {
  border-color: #C9A84C;
  outline: none;
  box-shadow: 0 0 0 2px rgba(201,168,76,0.15);
}
.ts-resumo {
  padding: 8px 16px;
  text-align: right;
}
.ts-total {
  font-size: 13px;
  color: #2d3748;
}
.text-right {
  text-align: right;
}

@media (max-width: 768px) {
  .ts-lancamento-form {
    flex-direction: column;
  }
  .ts-lancamento-form .ts-field {
    min-width: 100%;
  }
}

/* ── Timesheet: linha de observacao ───────────────────────── */
.ts-obs-row {
  display: flex;
  gap: 10px;
  padding: 0 16px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  margin-top: -8px;
}
.ts-obs-row .ts-input {
  padding: 8px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
}
.ts-obs-row .ts-input:focus {
  border-color: #C9A84C;
  outline: none;
  box-shadow: 0 0 0 2px rgba(201,168,76,0.15);
}

/* ── Dashboard: filtro status obra ────────────────────────── */
.dash-status-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 16px;
  padding-right: 16px;
  border-right: 1px solid var(--border);
}

/* ── Dashboard: botao PDF ─────────────────────────────────── */
.btn-pdf-dash {
  padding: 6px 14px;
  font-size: .78rem;
  margin-left: 10px;
  white-space: nowrap;
}

/* ── Gantt Fabrica (#gantt-fab-chart) - barras de cor para Producao ── */
#gantt-fab-chart .gantt-bar-mae .bar { fill: #C9A84C !important; stroke: #a88b3d; stroke-width: 1; rx: 4; }
#gantt-fab-chart .gantt-bar-mae .bar-progress { fill: #a88b3d !important; }
#gantt-fab-chart .gantt-bar-ok .bar { fill: #38a169 !important; rx: 3; }
#gantt-fab-chart .gantt-bar-ok .bar-progress { fill: #2f855a !important; }
#gantt-fab-chart .gantt-bar-em_andamento .bar { fill: #f39c12 !important; rx: 3; }
#gantt-fab-chart .gantt-bar-em_andamento .bar-progress { fill: #d68910 !important; }
#gantt-fab-chart .gantt-bar-atrasado .bar { fill: #e53e3e !important; rx: 3; }
#gantt-fab-chart .gantt-bar-atrasado .bar-progress { fill: #c53030 !important; }
#gantt-fab-chart .gantt-bar-aberto .bar { fill: #a0aec0 !important; rx: 3; }
#gantt-fab-chart .gantt-bar-aberto .bar-progress { fill: #718096 !important; }
#gantt-fab-chart .gantt-bar-etapa .bar { fill: #d4ac0d !important; stroke: #b7950b; stroke-width: 1; rx: 4; }
#gantt-fab-chart .gantt-bar-etapa .bar-progress { fill: #b7950b !important; }

/* ── Kanban Atividades (view dentro do modulo Atividades) ──── */

/* Toggle buttons */
.atv-view-toggle { display: flex; gap: 0; margin-right: auto; }
.atv-view-btn {
  padding: 6px 14px; font-size: .78rem; font-weight: 600;
  border: 1px solid var(--border); background: var(--card);
  color: var(--text-secondary); cursor: pointer; transition: all .15s;
}
.atv-view-btn:first-child { border-radius: 6px 0 0 6px; }
.atv-view-btn:last-child { border-radius: 0 6px 6px 0; border-left: none; }
.atv-view-active {
  background: var(--gold); color: #000; border-color: var(--gold);
}

/* Board layout */
.kb-atv-board {
  display: flex; gap: 12px; padding: 12px 0;
  overflow-x: auto; min-height: 400px; align-items: flex-start;
}
.kb-atv-col {
  flex: 1; min-width: 220px; max-width: 320px;
  background: rgba(255,255,255,.03); border: 1px solid var(--border);
  border-radius: 10px; display: flex; flex-direction: column;
}
.kb-atv-col-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.kb-atv-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.kb-atv-col-title { font-size: .82rem; font-weight: 600; color: var(--text-primary); }
.kb-atv-col-count {
  margin-left: auto; font-size: .72rem; font-weight: 700;
  color: var(--text-muted); background: rgba(255,255,255,.06);
  padding: 2px 8px; border-radius: 10px;
}
.kb-atv-col-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: 65vh; }
.kb-atv-vazio { font-size: .75rem; color: var(--text-muted); text-align: center; padding: 20px 0; }

/* Cards */
.kb-atv-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.kb-atv-card:hover {
  border-color: var(--gold); box-shadow: 0 2px 8px rgba(201,168,76,.15);
}
.kb-atv-card-mae {
  border-left: 3px solid var(--gold); background: rgba(201,168,76,.06);
}
.kb-atv-card-top { margin-bottom: 4px; }
.kb-atv-card-nome { font-size: .8rem; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.kb-atv-card-mae .kb-atv-card-nome { color: #1a2332; font-weight: 700; text-transform: uppercase; font-size: .78rem; }
.kb-atv-card-resp { font-size: .7rem; color: var(--gold); font-weight: 600; margin-bottom: 4px; }
.kb-atv-card-datas { font-size: .68rem; color: var(--text-muted); }
.kb-atv-card-real { font-size: .68rem; color: var(--text-secondary); font-weight: 600; }
.kb-atv-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }

/* Mobile */
@media (max-width: 768px) {
  .kb-atv-board { flex-direction: column; }
  .kb-atv-col { max-width: 100%; min-width: 100%; }
}

/* ── CALCULISTA v4 - Stepper + Ring + Detail ─────────────────── */

/* Utilitarios */
.btn-sm {
  padding: 5px 12px; font-size: .75rem;
  border-radius: 6px; cursor: pointer;
  font-weight: 500; transition: all .15s ease; border: none;
}
.btn-outline {
  background: transparent; color: var(--row-filha);
  border: 1px solid var(--border-dark);
}
.btn-outline:hover { background: var(--row-filha); color: #fff; border-color: var(--row-filha); }

/* ── Empty state ─────────────────────────── */
.calc-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 4rem 2rem; gap: .75rem;
  color: var(--text-muted);
}
.calc-empty p { font-size: .92rem; margin: 0; }
.calc-empty-hint { font-size: .78rem; color: var(--text-light); }
.calc-btn-init {
  margin-top: .5rem; padding: .6rem 1.5rem;
  background: var(--row-filha); color: #fff;
  border: none; border-radius: 8px; font-size: .82rem;
  font-weight: 600; cursor: pointer; transition: background .15s;
}
.calc-btn-init:hover { background: var(--row-mae); }

/* ── Card de obra ────────────────────────── */
.calc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  transition: box-shadow .2s ease;
  overflow: hidden;
}
.calc-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.09); }

/* Card header */
.calc-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem; gap: 1rem; flex-wrap: wrap;
}
.calc-card-info h3 {
  font-size: 1.05rem; font-weight: 700;
  color: var(--text); margin: 0 0 2px; line-height: 1.2;
}
.calc-card-sub {
  font-size: .78rem; color: var(--text-muted); font-weight: 500;
}
.calc-card-meta {
  display: flex; align-items: center; gap: .75rem;
}

/* Anel de progresso SVG */
.calc-card-pct { width: 52px; height: 52px; }
.calc-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.calc-ring-bg {
  fill: none; stroke: var(--bg); stroke-width: 3;
}
.calc-ring-fill {
  fill: none; stroke: #3D81F0; stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray .5s ease;
}
.calc-ring-text {
  fill: var(--text); font-size: 9px; font-weight: 700;
  text-anchor: middle; dominant-baseline: middle;
  transform: rotate(90deg); transform-origin: 18px 18px;
}

/* Tags */
.calc-card-tags { display: flex; flex-direction: column; gap: 3px; }
.calc-tag {
  font-size: .7rem; font-weight: 600; padding: 2px 8px;
  border-radius: 10px; background: var(--bg); color: var(--text-muted);
  white-space: nowrap; text-align: center;
}
.calc-tag-red { color: #e53e3e; background: rgba(229,62,62,.08); }

/* ══════════════════════════════════════════ */
/* STEPPER HORIZONTAL                        */
/* ══════════════════════════════════════════ */
.calc-stepper {
  display: flex;
  padding: .25rem 1.5rem 1rem;
  position: relative;
}

.calc-step {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  position: relative; cursor: pointer;
  padding: .5rem .25rem;
  border-radius: 10px;
  transition: background .15s;
}
.calc-step:hover { background: rgba(61,129,240,.04); }
.calc-step-active { background: rgba(61,129,240,.06); }

/* Dot (circulo do step) */
.calc-step-dot {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 800;
  position: relative; z-index: 2;
  transition: all .2s ease;
  flex-shrink: 0;
}

/* Status do dot */
.calc-st-pendente .calc-step-dot {
  background: var(--bg); color: var(--text-light);
  border: 2px solid var(--border-dark);
}
.calc-st-ok .calc-step-dot {
  background: #38a169; color: #fff;
  border: 2px solid #2f855a;
  box-shadow: 0 2px 8px rgba(56,161,105,.3);
}
.calc-st-atrasado .calc-step-dot {
  background: #e53e3e; color: #fff;
  border: 2px solid #c53030;
  box-shadow: 0 2px 8px rgba(229,62,62,.3);
  animation: calcPulse 2s infinite;
}
.calc-st-semana .calc-step-dot {
  background: #dd6b20; color: #fff;
  border: 2px solid #c05621;
  box-shadow: 0 2px 8px rgba(221,107,32,.25);
}
.calc-st-quinzena .calc-step-dot {
  background: #d69e2e; color: #fff;
  border: 2px solid #b7791f;
  box-shadow: 0 2px 8px rgba(214,158,46,.25);
}

@keyframes calcPulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(229,62,62,.3); }
  50% { box-shadow: 0 2px 16px rgba(229,62,62,.5); }
}

/* Linha conectora */
.calc-step-line {
  position: absolute;
  top: calc(.5rem + 20px); /* padding-top + metade do dot */
  left: calc(50% + 22px);
  right: calc(-50% + 22px);
  height: 3px;
  background: var(--border);
  z-index: 1;
  border-radius: 2px;
  transition: background .3s;
}
.calc-line-done { background: #38a169; }

/* Labels abaixo do dot */
.calc-step-label {
  font-size: .76rem; font-weight: 600;
  color: var(--text); margin-top: .5rem;
  text-align: center;
}
.calc-step-sub {
  font-size: .68rem; font-weight: 700;
  text-align: center; margin-top: 1px;
}
.calc-step-date {
  font-size: .68rem; color: var(--text-muted);
  text-align: center; margin-top: 1px;
}

/* ══════════════════════════════════════════ */
/* PAINEL EXPANDIDO (detail)                 */
/* ══════════════════════════════════════════ */
.calc-detail {
  margin: 0 1.5rem 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border);
  animation: calcSlideDown .2s ease;
}
@keyframes calcSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.calc-detail-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .75rem;
}
.calc-detail-title {
  font-size: .85rem; font-weight: 700;
}
.calc-detail-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 4px;
  border-radius: 6px; display: flex;
  transition: background .15s;
}
.calc-detail-close:hover { background: var(--border); }

.calc-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .75rem;
}
.calc-detail-wide { grid-column: 1 / -1; }

.calc-detail-field {
  display: flex; flex-direction: column; gap: 3px;
}
.calc-detail-field label {
  font-size: .68rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .04em;
}
.calc-detail-field input {
  padding: .45rem .6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px; font-size: .82rem;
  color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.calc-detail-field input:focus {
  border-color: #3D81F0;
  box-shadow: 0 0 0 3px rgba(61,129,240,.12);
}
.calc-detail-val {
  font-size: .82rem; color: var(--text); font-weight: 500;
  padding: .45rem 0;
}

/* ══════════════════════════════════════════ */
/* CARD FOOTER (finance + actions)           */
/* ══════════════════════════════════════════ */
.calc-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: .65rem 1.5rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap; gap: .5rem;
  min-height: 44px;
}
.calc-finance {
  display: flex; gap: 1.25rem; font-size: .78rem; color: var(--text-muted);
}
.calc-finance strong { color: var(--text); }
.calc-btn-add {
  background: transparent; color: var(--row-filha);
  border: 1px solid var(--border-dark);
  padding: 4px 12px; border-radius: 6px;
  font-size: .75rem; font-weight: 500;
  cursor: pointer; transition: all .15s;
}
.calc-btn-add:hover { background: var(--row-filha); color: #fff; border-color: var(--row-filha); }

/* ══════════════════════════════════════════ */
/* RESUMO - KPI Bar + Rows                   */
/* ══════════════════════════════════════════ */
.calc-kpi-bar {
  display: flex; align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  overflow: hidden;
}
.calc-kpi {
  flex: 1; padding: 1.25rem 1rem;
  text-align: center;
  border-right: 1px solid var(--border);
}
.calc-kpi:last-child { border-right: none; }
.calc-kpi-main {
  flex: 1.3;
  background: linear-gradient(135deg, rgba(61,129,240,.06), rgba(56,161,105,.04));
}
.calc-kpi-num {
  font-size: 1.4rem; font-weight: 800;
  color: var(--text); line-height: 1.1;
}
.calc-kpi-main .calc-kpi-num { font-size: 2rem; color: var(--row-filha); }
.calc-kpi-num small { font-size: .6em; font-weight: 700; }
.calc-kpi-label {
  font-size: .68rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .03em;
  font-weight: 600; margin-top: 3px;
}

/* Resumo rows */
.calc-resumo-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .85rem 1.25rem;
  margin-bottom: .5rem;
  gap: 1rem; flex-wrap: wrap;
  transition: box-shadow .15s ease;
}
.calc-resumo-row:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); }

.calc-rr-info { flex: 1; min-width: 160px; }
.calc-rr-info strong { font-size: .88rem; color: var(--text); display: block; }
.calc-rr-meta {
  font-size: .75rem; color: var(--text-muted); margin-top: 2px;
  display: flex; gap: .5rem;
}

.calc-rr-bar {
  display: flex; align-items: center; gap: .5rem;
  min-width: 140px;
}
.calc-bar-track {
  flex: 1; height: 6px; background: var(--bg);
  border-radius: 3px; overflow: hidden;
}
.calc-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3D81F0, #38a169);
  border-radius: 3px;
  transition: width .4s ease;
}
.calc-rr-pct {
  font-size: .75rem; font-weight: 600;
  color: var(--text-muted); min-width: 32px; text-align: right;
}

.calc-rr-val {
  text-align: right; min-width: 130px;
  font-size: .85rem; font-weight: 600; color: var(--text);
}

/* ── Calculista Timeline Gantt - fundo claro + cores por status ──── */
#calc-gantt-chart { background: #fff; border-radius: 8px; border: 1px solid #e2e8f0; }
#calc-gantt-chart svg.gantt { background: #f8f9fa; }
.calc-gantt-ok .bar { fill: #38a169 !important; }
.calc-gantt-ok .bar-progress { fill: #2d8a4e !important; }
.calc-gantt-atrasado .bar { fill: #e53e3e !important; }
.calc-gantt-atrasado .bar-progress { fill: #c0392b !important; }
.calc-gantt-semana .bar { fill: #dd6b20 !important; }
.calc-gantt-semana .bar-progress { fill: #c05621 !important; }
.calc-gantt-quinzena .bar { fill: #d69e2e !important; }
.calc-gantt-quinzena .bar-progress { fill: #b7950b !important; }
.calc-gantt-pendente .bar { fill: #a0aec0 !important; }
.calc-gantt-pendente .bar-progress { fill: #718096 !important; }
.calc-gantt-ok .bar-label, .calc-gantt-atrasado .bar-label,
.calc-gantt-semana .bar-label, .calc-gantt-quinzena .bar-label { fill: #fff !important; }
.calc-gantt-pendente .bar-label { fill: #2d3748 !important; }

/* ── Calculista Mobile ───────────────────── */
@media (max-width: 768px) {
  .calc-stepper { flex-wrap: wrap; gap: .25rem; padding: .25rem 1rem 1rem; }
  .calc-step { min-width: 60px; }
  .calc-step-dot { width: 34px; height: 34px; font-size: .72rem; }
  .calc-step-line { display: none; }
  .calc-step-label { font-size: .68rem; }

  .calc-card-head { flex-direction: column; align-items: flex-start; padding: 1rem; }
  .calc-card-meta { align-self: flex-start; }
  .calc-detail { margin: 0 1rem 1rem; }
  .calc-detail-grid { grid-template-columns: 1fr 1fr; }
  .calc-card-foot { padding: .65rem 1rem; }
  .calc-finance { flex-wrap: wrap; gap: .5rem; }

  .calc-kpi-bar { flex-wrap: wrap; }
  .calc-kpi { min-width: calc(50% - 1px); border-bottom: 1px solid var(--border); }
  .calc-kpi-main { min-width: 100%; }

  .calc-resumo-row { flex-direction: column; align-items: flex-start; }
  .calc-rr-bar { width: 100%; }
  .calc-rr-val { text-align: left; }
}

/* Gantt tipo filter checkboxes */
.gantt-tipo-filter {
  display: flex;
  gap: 16px;
  padding: 8px 0;
  margin-bottom: 4px;
}
.gantt-tipo-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #4a5568;
  cursor: pointer;
  user-select: none;
}
.gantt-tipo-label input[type="checkbox"] {
  accent-color: #C9A84C;
  cursor: pointer;
}

/* Filtros extras do Gantt (nome + colaborador) */
.gantt-extra-filters { display:flex; gap:12px; padding:4px 8px 8px; align-items:center; }
.gantt-filter-input { padding:6px 10px; border:1px solid #d1d5db; border-radius:6px; font-size:13px; width:220px; }
.gantt-filter-input:focus { outline:none; border-color:#C9A84C; box-shadow:0 0 0 2px rgba(201,168,76,0.2); }
.gantt-filter-select { padding:6px 10px; border:1px solid #d1d5db; border-radius:6px; font-size:13px; background:#fff; cursor:pointer; }
.gantt-filter-select:focus { outline:none; border-color:#C9A84C; }

/* ==== CHAT (restaurado 17/04/2026 do bk 08/04 pos-item7) ==== */
/* ═══════════════════════════════════════════════════════════
   CHAT POR OBRA - Modulo 6
   Layout WhatsApp-like: sidebar obras + area de conversa
   ═══════════════════════════════════════════════════════════ */

.chat-layout {
  display: flex;
  height: calc(100vh - 140px);
  background: var(--surface, #1a1d23);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border, #2a2d35);
}

/* ── Sidebar (lista de obras) ─────────────────────────── */
.chat-sidebar {
  width: 320px;
  min-width: 280px;
  border-right: 1px solid var(--border, #2a2d35);
  display: flex;
  flex-direction: column;
  background: var(--bg, #12141a);
}

.chat-sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, #2a2d35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-sidebar-header h3 {
  margin: 0;
  font-size: .95rem;
  color: var(--text, #e0e0e0);
}

.chat-filtro-select {
  background: var(--surface, #1a1d23);
  color: var(--text, #e0e0e0);
  border: 1px solid var(--border, #2a2d35);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: .8rem;
}

.chat-obras-list {
  flex: 1;
  overflow-y: auto;
}

.chat-obra-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #2a2d35);
  cursor: pointer;
  position: relative;
  transition: background .15s;
}

.chat-obra-item:hover {
  background: rgba(201, 168, 76, 0.08);
}

.chat-obra-item.active {
  background: rgba(201, 168, 76, 0.15);
  border-left: 3px solid #C9A84C;
}

.chat-obra-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.chat-obra-nome {
  font-weight: 600;
  font-size: .85rem;
  color: var(--text, #e0e0e0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.chat-obra-tempo {
  font-size: .7rem;
  color: #888;
  white-space: nowrap;
}

.chat-obra-preview {
  font-size: .78rem;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-preview-autor {
  color: #C9A84C;
  font-weight: 500;
}

.chat-obra-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  background: #C9A84C;
  color: #000;
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.chat-no-obras {
  padding: 20px;
  text-align: center;
  color: #666;
  font-size: .85rem;
}

/* ── Area principal (conversa) ────────────────────────── */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #555;
  font-size: .9rem;
}

.chat-conversa-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #2a2d35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg, #12141a);
}

.chat-conversa-nome {
  font-weight: 600;
  font-size: .95rem;
  color: var(--text, #e0e0e0);
}

.chat-conversa-status {
  font-size: .7rem;
  color: #C9A84C;
  text-transform: uppercase;
  margin-left: 8px;
}

.chat-btn-voltar {
  display: none;
  background: none;
  border: none;
  color: var(--text, #e0e0e0);
  cursor: pointer;
  padding: 4px;
}

/* ── Mensagens ────────────────────────────────────────── */
.chat-mensagens {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-date-sep {
  text-align: center;
  margin: 12px 0 8px;
}

.chat-date-sep span {
  background: var(--surface, #1a1d23);
  color: #888;
  font-size: .7rem;
  padding: 3px 12px;
  border-radius: 10px;
  border: 1px solid var(--border, #2a2d35);
}

.chat-msg {
  display: flex;
  margin-bottom: 2px;
}

.chat-msg-mine {
  justify-content: flex-end;
}

.chat-msg-other {
  justify-content: flex-start;
}

.chat-msg-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 12px;
  position: relative;
}

.chat-msg-mine .chat-msg-bubble {
  background: var(--surface, #1a1d23); border: 1px solid #C9A84C;
  border-bottom-right-radius: 4px;
}

.chat-msg-other .chat-msg-bubble {
  background: var(--surface, #1a1d23);
  border: 1px solid var(--border, #2a2d35);
  border-bottom-left-radius: 4px;
}

.chat-msg-autor {
  font-size: .82rem;
  font-weight: 600;
  color: #C9A84C;
  margin-bottom: 2px;
}

.chat-msg-texto {
  font-size: .95rem;
  color: var(--text, #e0e0e0);
  line-height: 1.4;
  word-wrap: break-word;
}

.chat-msg-mine .chat-msg-texto {
  color: var(--text, #e0e0e0);
}

.chat-msg-img {
  margin: 4px 0;
}

.chat-msg-img img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity .15s;
}

.chat-msg-img img:hover {
  opacity: 0.85;
}

.chat-msg-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 2px;
}

.chat-msg-time {
  font-size: .75rem;
  color: #999;
}

.chat-msg-mine .chat-msg-time {
  color: #888;
}

.chat-msg-delete {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: .85rem;
  padding: 0 2px;
  line-height: 1;
  opacity: 0;
  transition: opacity .15s;
}

.chat-msg-bubble:hover .chat-msg-delete {
  opacity: 1;
}

.chat-msg-delete:hover {
  color: #ef4444;
}

.chat-empty-msgs {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: .85rem;
  gap: 4px;
}

.chat-erro {
  text-align: center;
  color: #ef4444;
  padding: 20px;
}

/* ── Input area ───────────────────────────────────────── */
.chat-input-area {
  border-top: 1px solid var(--border, #2a2d35);
  padding: 10px 16px;
  background: var(--bg, #12141a);
}

.chat-anexo-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px;
  background: var(--surface, #1a1d23);
  border-radius: 8px;
  border: 1px solid var(--border, #2a2d35);
}

.chat-anexo-preview img {
  max-height: 80px;
  max-width: 120px;
  border-radius: 6px;
}

.chat-anexo-remove {
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-btn-anexo {
  cursor: pointer;
  color: #888;
  padding: 6px;
  border-radius: 6px;
  transition: background .15s;
  display: flex;
}

.chat-btn-anexo:hover {
  background: var(--surface, #1a1d23);
  color: #C9A84C;
}

.chat-input {
  flex: 1;
  background: var(--surface, #1a1d23);
  border: 1px solid var(--border, #2a2d35);
  border-radius: 20px;
  padding: 10px 16px;
  color: var(--text, #e0e0e0);
  font-size: .85rem;
  outline: none;
  transition: border-color .15s;
}

.chat-input:focus {
  border-color: #C9A84C;
}

.chat-btn-enviar {
  background: #C9A84C;
  color: #000;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}

.chat-btn-enviar:hover {
  background: #d4b85c;
}

/* ── Overlay imagem fullscreen ────────────────────────── */
.chat-img-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: pointer;
}

.chat-img-overlay img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  cursor: default;
}

.chat-img-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.2);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  cursor: pointer;
}

/* ── CHAT AVATAR + @MENCAO ─────────────────────────────── */
.chat-avatar {
  width: 32px; height: 32px; min-width: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700; color: #fff;
  margin-right: 8px; margin-top: 4px; align-self: flex-start;
}

.chat-msg-other { display: flex; align-items: flex-start; }

.chat-mencao-highlight {
  background: rgba(201,168,76,.2); color: #C9A84C; font-weight: 600;
  border-radius: 3px; padding: 0 2px;
}

.chat-mencao-dropdown {
  position: absolute; bottom: 100%; left: 0; right: 0;
  background: var(--surface, #1a202c); border: 1px solid var(--border, #2d3748);
  border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,.4);
  max-height: 200px; overflow-y: auto; z-index: 100; margin-bottom: 4px;
}

.chat-mencao-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  cursor: pointer; transition: background .15s;
}

.chat-mencao-item:hover, .chat-mencao-item.active { background: rgba(201,168,76,.12); }

.chat-mencao-avatar {
  width: 28px; height: 28px; min-width: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 700; color: #fff;
}

.chat-mencao-nome { color: #e2e8f0; font-size: .85rem; }

.chat-mencao-perfil { color: #718096; font-size: .72rem; margin-left: auto; }


/* === CONFIRM MODAL (restaurado do bk pos-item7, mesmo sumiço do chat CSS) === */
.confirm-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.15s ease;
}
.confirm-box {
  background: var(--surface, #1e293b); border: 1px solid var(--border, #334155);
  border-radius: 12px; padding: 1.5rem; min-width: 320px; max-width: 480px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.confirm-msg {
  color: var(--text, #e2e8f0); font-size: 0.95rem; line-height: 1.5;
  margin-bottom: 1.25rem;
}
.confirm-btns {
  display: flex; gap: 0.75rem; justify-content: flex-end;
}
.confirm-btn-cancel {
  padding: 0.5rem 1.25rem; border-radius: 6px; font-size: 0.85rem;
  background: transparent; border: 1px solid var(--border, #475569);
  color: var(--text-secondary, #94a3b8); cursor: pointer; font-weight: 500;
}
.confirm-btn-cancel:hover { background: rgba(255,255,255,0.05); }
.confirm-btn-ok {
  padding: 0.5rem 1.25rem; border-radius: 6px; font-size: 0.85rem;
  background: #ef4444; border: none; color: #fff; cursor: pointer; font-weight: 600;
}
.confirm-btn-ok:hover { background: #dc2626; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }


/* logo real Elyon (substitui SVG inline + texto ELYON/ENGENHARIA) - implementado 11/05/2026 */
.header-logo-img {
  height: 34px;
  width: auto;
  display: block;
}
.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.login-logo-img {
  height: 56px;
  width: auto;
  display: block;
}

/* Producao: pintar celulas com volume no mes (Adriano 06/06) */
.prod-com-volume { background:#ffe9a8 !important; }
.prod-com-volume .prod-input { background:transparent; }
