/* ══════════════════════════════════════════
   CONTAS — novo layout
   ══════════════════════════════════════════ */

/* ── Toolbar ── */
.ct-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 0 10px;
}

.ct-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--card-bg, #fff);
  flex: 1; min-width: 160px;
}
.ct-search-icon { color: var(--text-muted, #94a3b8); font-size: 1rem; }
.ct-search {
  border: none; outline: none; background: transparent;
  font-size: 0.85rem; color: var(--cor-texto, #1e293b);
  width: 100%;
}

/* toggle */
.ct-toggle-wrap {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 0.83rem; color: var(--cor-texto, #1e293b);
  white-space: nowrap;
}
.ct-toggle-input { display: none; }
.ct-toggle-track {
  position: relative;
  width: 36px; height: 20px;
  border-radius: 10px;
  background: #cbd5e1;
  transition: background .2s;
  flex-shrink: 0;
}
.ct-toggle-input:checked + .ct-toggle-track { background: #3b82f6; }
.ct-toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: left .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.ct-toggle-input:checked + .ct-toggle-track .ct-toggle-thumb { left: 18px; }

.ct-btn-exportar {
  border: 1.5px solid var(--border-color, #e2e8f0);
  background: var(--card-bg, #fff);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--cor-texto, #1e293b);
  white-space: nowrap;
}
.ct-btn-exportar:hover { background: var(--hover-bg, #f1f5f9); }

/* ── Grupos ── */
.ct-grupo { margin-bottom: 20px; }
.ct-grupo-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.ct-grupo-titulo {
  font-size: 1rem; font-weight: 700;
  color: var(--cor-texto, #1e293b);
}
.ct-grupo-count {
  font-size: 0.75rem; font-weight: 600;
  background: var(--hover-bg, #f1f5f9);
  color: var(--text-muted, #64748b);
  border-radius: 999px;
  padding: 2px 8px;
}
.ct-grupo-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  overflow: hidden;
}

/* ── Item ── */
.ct-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color, #f1f5f9);
}
.ct-item:last-child { border-bottom: none; }
.ct-item:hover { background: var(--hover-bg, #f8fafc); }
.ct-item-inativa { opacity: 0.45; }

.ct-item-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.ct-item-avatar-icon {
  color: inherit;
  border-radius: 50%;
  overflow: hidden;
  background: none;
  border: none;
}
.ct-item-avatar-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ct-item-nome {
  font-size: 0.88rem; font-weight: 600;
  color: var(--cor-texto, #1e293b);
  flex: 1; min-width: 0;
}

.ct-item-centro {
  display: flex; align-items: center; gap: 20px;
  flex-shrink: 0;
}
.ct-item-meta {
  display: flex; flex-direction: column; gap: 2px;
}
.ct-meta-label {
  font-size: 0.7rem; color: var(--text-muted, #64748b);
}
.ct-meta-valor {
  font-size: 0.82rem; font-weight: 600;
  color: var(--cor-texto, #1e293b);
}
.ct-badge-disponivel {
  display: inline-block;
  background: #dcfce7; color: #16a34a;
  font-size: 0.72rem; font-weight: 700;
  border-radius: 6px;
  padding: 2px 8px;
}
.ct-chip {
  display: inline-block;
  background: var(--hover-bg, #f1f5f9);
  color: var(--cor-texto, #1e293b);
  font-size: 0.8rem; font-weight: 600;
  border-radius: 6px;
  padding: 2px 10px;
}

/* ── Menu ⋮ ── */
.ct-item-actions {
  position: relative;
  flex-shrink: 0;
}
.ct-item-menu-btn {
  background: none; border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-muted, #94a3b8);
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}
.ct-item-menu-btn:hover { background: var(--hover-bg, #f1f5f9); }
.ct-dropdown {
  position: fixed;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  z-index: 100;
  min-width: 120px;
  display: flex; flex-direction: column;
  padding: .3rem 0;
}
.ct-dropdown button {
  background: none; border: none; cursor: pointer;
  text-align: left; padding: .5rem 1rem;
  font-size: .85rem; color: var(--cor-texto, #1e293b);
}
.ct-dropdown button:hover { background: var(--hover-bg, #f1f5f9); }
.ct-menu-excluir { color: #ef4444 !important; }

/* ── FAB ── */
.ct-fab {
  position: fixed;
  bottom: max(28px, calc(env(safe-area-inset-bottom) + 16px));
  right: max(28px, calc(env(safe-area-inset-right) + 16px));
  width: 52px; height: 52px;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  border: none; cursor: pointer;
  font-size: 1.6rem; line-height: 1;
  box-shadow: 0 4px 16px rgba(16,185,129,.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  transition: transform .15s;
}
.ct-fab:hover { transform: scale(1.08); }

/* ── Modal ── */
.ct-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
}
.ct-modal {
  background: var(--card-bg, #fff);
  border-radius: 8px;
  padding: 0;
  width: 100%; max-width: min(580px, calc(100% - 32px));
  display: flex; flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
  max-height: 92vh;
  overflow: visible;
}
.ct-modal-body {
  overflow-y: auto;
  flex: 1;
}
.ct-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 1.15rem; font-weight: 700;
  padding: 24px 28px 0;
}
.ct-modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.1rem; color: var(--text-muted, #94a3b8); padding: 4px;
}
.ct-modal-body { padding: 0 28px; }
.ct-modal-header { padding: 24px 28px 0; }

.ct-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding-top: 20px; }
.ct-label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 0.82rem; color: var(--text-muted, #64748b); font-weight: 600;
  padding-top: 16px;
}
.ct-label-check { flex-direction: row; align-items: center; gap: 8px; }

.ct-input {
  border: none;
  border-bottom: 2px solid var(--border-color, #e2e8f0);
  border-radius: 0;
  padding: 8px 2px;
  font-size: 1rem; outline: none;
  background: transparent;
  color: var(--cor-texto, #1e293b);
  width: 100%;
}
.ct-input:focus { border-bottom-color: #10b981; }
select.ct-input { cursor: pointer; }

/* Tipo + help */
.ct-input-icon-wrap { display: flex; align-items: center; gap: 6px; }
.ct-input-icon-wrap .ct-input { flex: 1; }
.ct-help {
  width: 18px; height: 18px; border-radius: 50%;
  background: #e2e8f0; color: #64748b;
  font-size: .7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: help; flex-shrink: 0;
}

/* Moeda */
.ct-label-moeda { position: relative; }
.ct-label-moeda-title { font-size: .78rem; color: #10b981; font-weight: 600; }
.ct-moeda-select { display: flex; align-items: center; gap: 6px; }
.ct-moeda-flag-img { width: 24px; height: auto; border-radius: 2px; flex-shrink: 0; }
.ct-input-moeda { color: #10b981 !important; border-bottom-color: #10b981 !important; font-weight: 600; }

/* Nome + ícone banco */
.ct-nome-wrap { display: flex; align-items: center; gap: 10px; }
.ct-nome-wrap .ct-input { flex: 1; }
.ct-bank-icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--hover-bg, #f1f5f9);
  border: 2px solid var(--border-color, #e2e8f0);
  cursor: pointer; font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: border-color .15s;
}
.ct-bank-icon-btn:hover { border-color: #10b981; }

/* Saldo + credor/devedor */
.ct-saldo-wrap { display: flex; align-items: center; gap: 14px; }
.ct-saldo-wrap .ct-input { flex: 1; }
.ct-radio-group { display: flex; gap: 16px; flex-shrink: 0; }
.ct-radio-label {
  display: flex; align-items: center; gap: 6px;
  font-size: .9rem; cursor: pointer; white-space: nowrap;
  color: var(--cor-texto, #1e293b); font-weight: 400;
}
.ct-radio-label input[type="radio"] { display: none; }
.ct-radio-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid #cbd5e1;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .12s;
}
.ct-radio-label input:checked + .ct-radio-dot {
  border-color: #3b82f6;
  background: #3b82f6;
  box-shadow: inset 0 0 0 3px #fff;
}

/* +info */
.ct-info-toggle { padding-top: 8px; cursor: pointer; }
.ct-info-link { color: #10b981; font-size: .85rem; font-weight: 600; }
#ct-info-extra { padding-top: 4px; }

/* Footer */
.ct-modal-footer {
  padding: 16px 28px 20px;
  display: flex;
  justify-content: flex-end;
}
.ct-btn-save-group {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
}
.ct-btn-save-main {
  background: #10b981; color: #fff;
  border: none;
  padding: 10px 22px;
  cursor: pointer; font-size: .9rem; font-weight: 700;
  transition: background .15s;
}
.ct-btn-save-main:hover { background: #059669; }
.ct-btn-save-plus {
  background: #059669; color: #fff;
  border: none;
  border-left: 1px solid rgba(255,255,255,.3);
  padding: 10px 14px;
  cursor: pointer; font-size: 1.1rem; font-weight: 700;
  transition: background .15s;
}
.ct-btn-save-plus:hover { background: #047857; }

.ct-section-sub {
  font-size: 0.8rem; font-weight: 700;
  color: var(--text-muted, #64748b);
  margin: 4px 0 2px; padding: 0;
}
.ct-error { color: #ef4444; font-size: 0.82rem; padding-top: 4px; }
.ct-empty {
  text-align: center; color: var(--text-muted, #94a3b8);
  padding: 32px 0; font-size: 0.9rem;
}

/* ── Modal de ícones ── */
.ct-icon-modal {
  background: var(--card-bg, #fff);
  border-radius: 14px;
  width: 100%; max-width: min(480px, calc(100% - 32px));
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  max-height: 80vh;
  overflow: hidden;
  display: flex; flex-direction: column;
}
#ct-picker-view-grid {
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px;
  overflow: hidden;
}
#ct-picker-view-form {
  display: flex; flex-direction: column;
  overflow: hidden;
}
.ct-icon-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .95rem; font-weight: 700;
}
.ct-icon-modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 1rem; color: var(--text-muted, #94a3b8);
}
.ct-icon-modal-close:hover { color: #475569; }
.ct-picker-btn-novo {
  background: #0ea5e9; color: #fff; border: none;
  border-radius: 6px; padding: .3rem .7rem;
  font-size: .78rem; font-weight: 600; cursor: pointer;
}
.ct-picker-btn-novo:hover { background: #0284c7; }
.ct-picker-btn-voltar {
  background: none; border: none; cursor: pointer;
  font-size: .85rem; color: #64748b; display: flex; align-items: center; gap: .3rem;
}
.ct-picker-btn-voltar:hover { color: #1e293b; }
/* Formulário inline */
.ct-picker-form-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  display: flex; flex-direction: column; gap: .75rem;
}
.ct-picker-form-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-color, #e2e8f0);
  display: flex; justify-content: flex-end;
}
/* Paste zone no picker */
.ct-picker-paste-zone {
  border: 2px dashed #cbd5e1; border-radius: 8px;
  padding: 1rem; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s;
  outline: none; min-height: 90px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem;
}
.ct-picker-paste-zone:focus,
.ct-picker-paste-zone.ct-picker-drag-over { border-color: #0ea5e9; background: #f0f9ff; }
.ct-picker-paste-hint { display: flex; flex-direction: column; align-items: center; gap: .15rem; pointer-events: none; }
.ct-picker-paste-hint strong { font-size: .875rem; color: #1e293b; }
.ct-picker-paste-hint span { font-size: .75rem; color: #94a3b8; }
.ct-picker-clear-btn {
  background: none; border: none; cursor: pointer;
  font-size: .72rem; color: #94a3b8; text-decoration: underline;
}
.ct-picker-clear-btn:hover { color: #ef4444; }
.ct-icon-search {
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 9px;
  padding: 9px 12px;
  font-size: .88rem;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  background: var(--hover-bg, #f8fafc);
}
.ct-icon-search:focus { border-color: #10b981; }
.ct-icon-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  overflow-y: auto;
  max-height: 340px;
}
.ct-icon-cel-wrap {
  position: relative;
}
.ct-icon-cel-wrap:hover .ct-icon-del { opacity: 1; }
.ct-icon-del {
  position: absolute; top: 2px; right: 2px;
  width: 16px; height: 16px;
  background: #ef4444; color: #fff; border: none; border-radius: 50%;
  font-size: .6rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s;
  padding: 0;
}
.ct-icon-del:hover { background: #dc2626; }
.ct-icon-cel {
  width: 100%;
  background: none; border: 1px solid transparent; cursor: pointer;
  border-radius: 10px; padding: 10px 4px 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; transition: background .1s, border-color .1s;
}
.ct-icon-cel:hover { background: var(--hover-bg, #f1f5f9); border-color: var(--border-color, #e2e8f0); }
.ct-icon-cel-add { border: 1.5px dashed #cbd5e1; }
.ct-icon-cel-add:hover { border-color: #0ea5e9; background: #f0f9ff !important; }
.ct-icon-cel-add:hover span:first-child { color: #0ea5e9 !important; }
.ct-icon-ativo { background: #f0fdf4 !important; border-color: #10b981 !important; }
.ct-icon-label {
  font-size: .68rem; color: var(--text-muted, #64748b);
  text-align: center; line-height: 1.2;
  max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Fatura — mantém estilos existentes */
.fatura-header { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:16px; }
.fatura-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:12px; margin-bottom:16px; }
.fatura-stat { display:flex; flex-direction:column; gap:4px; background:var(--bg,#f8fafc); border-radius:8px; padding:10px 12px; }
.fatura-stat.destaque { background:var(--blue-soft,#eff6ff); }
.fatura-stat-label { font-size:.72rem; text-transform:uppercase; letter-spacing:.05em; color:var(--text-sub,#64748b); }
.fatura-stat-valor { font-size:1rem; font-weight:700; }
.fatura-stat-valor.red { color:#ef4444; }
.fatura-stat-valor.green { color:#22c55e; }
.badge { display:inline-block; padding:3px 10px; border-radius:999px; font-size:.75rem; font-weight:700; }
.badge-open { background:#dcfce7; color:#16a34a; }
.badge-closed { background:#f3f4f6; color:var(--text-sub,#64748b); }
.import-opcoes { display:flex; gap:20px; flex-wrap:wrap; margin:12px 0; }
.import-preview-header { display:flex; justify-content:space-between; align-items:center; padding:12px 0 8px; border-top:1px solid var(--border,#e2e8f0); margin-top:16px; flex-wrap:wrap; gap:8px; }
.import-preview-header .action-row { margin-top:0; }
.red { color:#ef4444; }
.green { color:#22c55e; }
.icon-btn { background:transparent; border:none; cursor:pointer; font-size:1rem; color:var(--text-sub,#64748b); padding:4px 6px; border-radius:6px; line-height:1; }
.icon-btn:hover { background:var(--blue-soft,#eff6ff); color:var(--blue,#3b82f6); }
.icon-btn.danger:hover { background:#fee2e2; color:#ef4444; }

/* ══════════════════════════════════════════
   RESPONSIVO
   ══════════════════════════════════════════ */
@media (max-width: 480px) {
  .ct-row-2 { grid-template-columns: 1fr; gap: 12px; }
  .ct-modal-header,
  .ct-modal-body { padding-left: 18px; padding-right: 18px; }
  .ct-modal-footer { padding: 14px 18px 18px; }
  .ct-icon-grid { grid-template-columns: repeat(4, 1fr); }
  .ct-item-centro { gap: 12px; }
}
