/* app/static/css/app.css ===== RESET BASICO ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== VARIAVEIS DE COR ===== */
:root {
  --bg-sidebar: #0f172a;
  --bg-sidebar-2: #020617;
  --bg-body: #f1f5f9;
  --bg-card: #ffffff;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;

  --text-dark: #0f172a;
  --text-light: #64748b;

  --border: #e2e8f0;
  --radius: 14px;
}

/* ===== BODY ===== */
body {
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: var(--bg-body);
  color: var(--text-dark);
}

/* ===== LAYOUT ===== */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 240px;
  background: linear-gradient(180deg, var(--bg-sidebar), var(--bg-sidebar-2));
  color: #fff;
  padding: 20px 16px;
}

.sidebar-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 25px;
}

.nav-link-custom {
  display: block;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: var(--radius);
  color: #cbd5e1;
  text-decoration: none;
  transition: 0.2s;
}

.nav-link-custom:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-link-active {
  background: rgba(37, 99, 235, 0.25);
  color: #fff;
}

/* ===== CONTEUDO ===== */
.main-content {
  flex: 1;
  padding: 30px;
}

/* ===== TOPO ===== */
.topbar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 20px;
  margin-bottom: 25px;
  font-weight: 600;
}

/* ===== CARDS DO DASHBOARD ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.card-dashboard {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: 0.2s;
}

.card-dashboard:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.card-title {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.card-value {
  font-size: 28px;
  font-weight: bold;
}

/* ===== BOTAO PADRAO ===== */
.btn-primary-custom {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: 0.2s;
  text-decoration: none;
  display: inline-block;
}

.btn-primary-custom:hover {
  background: var(--primary-hover);
}

/* ===== TABELAS ===== */
.table-custom {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.table-custom th,
.table-custom td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.table-custom th {
  background: #f8fafc;
  font-size: 14px;
}

.table-custom tr:hover {
  background: #f1f5f9;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 900px) {
  .sidebar {
    width: 200px;
  }
}

@media (max-width: 700px) {
  .app-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    display: flex;
    overflow-x: auto;
  }

  .nav-link-custom {
    margin-right: 10px;
  }
}
/* =========================================================
   FORM: NOVA PROPOSTA (layout ajustável por variáveis)
   ========================================================= */
:root{
  /* tamanhos do form (mexa aqui quando quiser) */
  --form-gap: 14px;

  --w-data: 260px;

  /* LINHA / BOTÕES / VALOR */
  --w-btn: 120px;
  --w-valor: 280px;

  /* BANCO */
  --w-banco-cod: 160px;
  --w-gerente: 320px;

  /* inputs */
  --inp-h: 42px;
  --inp-pad: 10px 12px;

  /* hints */
  --hint-min: 28px;

  /* danger */
  --danger: #ef4444;
  --danger-hover: #dc2626;
}

/* grid base do form */
.form-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--form-gap);
}
.row-full{ grid-column: 1 / -1; }

.form-label{
  font-size:12px;
  color: var(--text-light);
  margin-bottom:6px;
}

.form-field{
  display:flex;
  flex-direction:column;
  align-items:stretch;
}

.form-hint{
  font-size:12px;
  color: var(--text-light);
  margin-top:6px;
  line-height:1.35;
  min-height: var(--hint-min);
}

/* inputs padrões */
.form-input,
.form-select{
  width:100%;
  padding: var(--inp-pad);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-sizing:border-box;
  height: var(--inp-h);
  background:#fff;
  font-family: inherit;
  font-size: 14px;
}

.form-input:focus,
.form-select:focus{
  outline:none;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
  border-color: rgba(37,99,235,.35);
}

.form-input-disabled{
  background:#f1f5f9;
}

/* bloco LINHA + VALOR */
.grid-linha{
  display:grid;
  grid-template-columns: 1fr var(--w-valor);
  gap: 12px;
  align-items:start;
}

/* dentro de LINHA: select + botões */
.linha-actions{
  display:grid;
  grid-template-columns: 1fr var(--w-btn) var(--w-btn);
  gap: 10px;
  align-items:center;
}

.btn-inline{
  height: var(--inp-h);
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  white-space:nowrap;
}

/* bloco BANCO */
.grid-banco{
  display:grid;
  grid-template-columns: var(--w-banco-cod) 1fr var(--w-gerente);
  gap: var(--form-gap);
  align-items:start;
}

/* box nova linha */
.nova-linha-box{
  margin-top:10px;
  padding-top:10px;
  border-top:1px dashed var(--border);
}

.grid-nova-linha{
  display:grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items:end;
}

.btn-mini{
  height: var(--inp-h);
  display:flex;
  align-items:center;
  justify-content:center;
  white-space:nowrap;
}

/* botões danger */
.btn-danger{
  background: var(--danger) !important;
}
.btn-danger:hover{
  background: var(--danger-hover) !important;
}

/* =========================================================
   MODAL BONITO (Excluir linha)
   ========================================================= */
.modal-bg{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;
}

.modal-box{
  background:#fff;
  border-radius:18px;
  padding:26px;
  width:360px;
  max-width:90%;
  border: 1px solid var(--border);
  box-shadow:0 20px 40px rgba(0,0,0,0.25);
  animation:modalIn .18s ease;
}

@keyframes modalIn{
  from{ transform:scale(.95); opacity:0 }
  to{ transform:scale(1); opacity:1 }
}

.modal-title{
  font-size:18px;
  font-weight:800;
  margin-bottom:10px;
  color: var(--text-dark);
}

.modal-text{
  color:#475569;
  line-height:1.5;
  margin-bottom:18px;
}

.modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

/* responsivo */
@media (max-width: 850px){
  .grid-banco{
    grid-template-columns: 1fr;
  }
  .grid-linha{
    grid-template-columns: 1fr;
  }
  .linha-actions{
    grid-template-columns: 1fr 1fr;
  }
}


/* ================================
   STATUS (Legenda e Linhas)
   ================================ */

.status-badge{
  display:inline-flex;
  align-items:center;
  padding:8px 10px;
  border-radius:12px;
  font-weight:800;
  border:1px solid transparent;
}

/* PREPARAÇÃO → AZUL */
.status-preparacao{
  background:#E0F2FE;   /* azul bem claro */
  border-color:#0284C7; /* azul borda */
  color:#075985;        /* azul escuro texto */
}


/* ANÁLISE → LARANJA */
.status-analise{
  background:#FFEDD5;
  border-color:#FB923C;
  color:#9A3412;
}

/* APROVADO → VERDE */
.status-aprovado{
  background:#DCFCE7;
  border-color:#22C55E;
  color:#166534;
}

/* Linhas da tabela */
.row-preparacao{
  background:#FEF3C7;
  border-left:6px solid #F59E0B;
}

.row-analise{
  background:#FFEDD5;
  border-left:6px solid #FB923C;
}

.row-aprovado{
  background:#DCFCE7;
  border-left:6px solid #22C55E;
}

/* ================================
   PRINT (imprimir só o conteúdo)
   ================================ */
@media print {

  /* some com a sidebar e links */
  .sidebar { display: none !important; }

  /* remove espaçamentos do layout */
  .app-container { padding: 0 !important; margin: 0 !important; }

  /* faz o conteúdo ocupar 100% */
  .main-content {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* opcional: esconder botões na impressão */
  .topbar a, .topbar button { display: none !important; }

  /* garante que os cards não “quebrem” estranho */
  .card-dashboard, .table-custom {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* ================================
   SIDEBAR ORGANIZADA + RODAPÉ FIXO
   ================================ */
.sidebar{
  display:flex;
  flex-direction:column;
}

.sidebar-scroll{
  flex:1;
  overflow:auto;
  padding-right:4px;
}

/* ---------- TÍTULOS DE SEÇÃO ---------- */

/* padrão → Sistema de Propostas */
.sidebar-section-title{
  margin: 14px 0 8px 6px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(226,232,240,.75);
}

/* Lançamentos com cor diferente */
.sidebar-section-title--lanc{
  color: rgba(34,197,94,.85); /* verde elegante */
}

/* divisor visual entre módulos */
.sidebar-divider{
  height: 1px;
  background: rgba(255,255,255,0.10);
  margin: 14px 0 10px 0;
}

/* ---------- LINKS ---------- */

/* sub-links (indentados) */
.nav-link-sub{
  padding-left: 18px;
  font-size: 14px;
  color: #cbd5e1;
}

/* ---------- Logout centralizado ---------- */
.sidebar-logout-link{
  margin-bottom: 10px;

  display: flex;
  align-items: center;        /* centraliza vertical */
  justify-content: center;    /* centraliza horizontal */

  height: 42px;               /* mesma altura visual de botão */
  border-radius: var(--radius);

  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);

  font-weight: 800;
}

.sidebar-logout-link:hover{
  background: rgba(255,255,255,0.12);
}


/* ---------- RODAPÉ FIXO ---------- */
.sidebar-footer{
  margin-top:auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* botão configurações */
.sidebar-config-btn{
  width:100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color:#fff;
  cursor:pointer;
  font-weight: 900;
  transition: .2s;
}
.sidebar-config-btn:hover{
  background: rgba(255,255,255,0.10);
}

/* ================================
   TELA INICIAL: BOTÕES GRANDES
   ================================ */
.home-modules{
  display:grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.home-module-btn{
  display:block;
  text-decoration:none;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: #fff;
  transition: .2s;
}
.home-module-btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.06);
}

.home-module-title{
  font-size: 16px;
  font-weight: 900;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.home-module-sub{
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.5;
}

/* responsivo */
@media (max-width: 900px){
  .home-modules{ grid-template-columns: 1fr; }
}


