  /* === RESET + BASE === */
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  body {
    font-family: 'Roboto', sans-serif;
    background: #fff;
    color: #000;
  }
  .hidden { display: none!important; }

  /* === HEADER === */
  header {
    background: #000;
    color: #fff;
    padding: 20px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  }
  header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
  }
  .menu button {
    background: #0052a3;
    color: #fff;
    border: none;
    padding: 8px 20px;
    margin: 0 5px;
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
    transition: all .3s;
    font-size: .9rem;
  }
  .menu button.active,
  .menu button:hover {
    background: #fff;
    color: #000;
    transform: scale(1.05);
  }

/* === CONTRATO === */ 
#contratoArea {
  font-family: "Times New Roman", serif !important;
  font-size: 12pt !important;
  color: #000 !important;
  text-align: justify !important;
  line-height: 1.6 !important;
  /* margem no container, caso alguém visualize antes de imprimir */
  margin: 3cm 2cm 2cm 3cm !important;
  padding: 0 !important;
}
#contratoArea h2 {
  font-size: 13pt !important;
  margin-bottom: .5em !important;
  text-align: center !important;
}
#contratoArea p {
  margin: 0 0 .8em !important;
}
#contratoArea table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin-bottom: 1em !important;
}
#contratoArea th,
#contratoArea td {
  border: 1px solid #333 !important;
  padding: 6px 8px !important;
  font-size: 12pt !important;
}

/* === FLUXO DE CAIXA – STICKY CABEÇALHO + PRIMEIRA COLUNA “Categoria” === */

#tab-fluxo .table-responsive.detalhe table.detalhe {
  overflow: visible !important;
  position: relative;
}

#tab-fluxo table.detalhe {
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: right;
  width: auto !important;            
  min-width: max-content !important;
}

#tab-fluxo table.detalhe th,
#tab-fluxo table.detalhe td {
  border: 1px solid #000;
  padding: 6px 8px;
}

#tab-fluxo table.detalhe thead th {
  position: sticky;
  top: 0;
  background: 	#ADD8E6;
  color: #000;
  z-index: 5;
  text-align: center;
}

#tab-fluxo table.detalhe th:first-child,
#tab-fluxo table.detalhe td:first-child {
  position: sticky;
  left: 0;
  background: #ADD8E6;
  z-index: 4;
  text-align: left;
}


#tab-fluxo table.detalhe thead th:first-child {
  z-index: 6;
}


#tab-fluxo table.detalhe tfoot th:first-child {
  position: sticky;
  left: 0;
  background: #333;
  color: #fff;
  z-index: 4;
}

@media print {
  body * {
    visibility: hidden !important;
  }
  #contratoArea,
  #contratoArea * {
    visibility: visible !important;
  }

  /* define margens de impressão corretas */
  @page {
    size: A4 portrait;
    margin: 3cm 2cm 2cm 3cm;
  }
  /* garante que a cor de fundo / bordas sejam impressas */
  #contratoArea {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

    /* === STATUS === */
.badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;    /* negrito */
  color: #000;          /* texto preto */
}

/* atrasados */
.badge-atrasado {
  background-color: #FF0000;
}

/* a alugar */
.badge-a-alugar {
  background-color: #B0E0E6;
}

/* a vencer */
.badge-a-vencer {
  background-color: #FF8C00;
}

/* alugado */
.badge-alugado {
  background-color: #FFF000;
}

/* concluído */
.badge-concluido {
  background-color: #006400;
}

/* cancelado */
.badge-cancelado {
  background-color: #FF0000;
}

    /* === CONTAINER === */
    .container { max-width:1200px; margin:20px auto; padding:0 15px; }
    .page { animation:fadeIn .4s ease; }
    @keyframes fadeIn{from{opacity:0;}to{opacity:1;}}

    /* === TABS === */
    .tabs{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;text-align:center;gap:10px;margin-bottom:20px;}
    .tab-btn{background:#0052a3;color:#fff;border:none;padding:8px 16px;border-radius:30px;cursor:pointer;transition:all .3s;font-weight:500;font-size:.85rem;}
    .tab-btn.active,.tab-btn:hover{background:#000;color:#fff;transform:scale(1.03);}
    .tab-content{background:#fff;padding:20px;border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,.1);}

    /* === TABELAS RESPONSIVAS === */
    .table-responsive{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;margin-bottom:20px;}
    .table-responsive table{width:100%;border-collapse:collapse;margin:0;border-radius:8px;overflow:hidden;box-shadow:0 2px 6px rgba(0,0,0,.1);font-size:.75rem;}
    .table-responsive th,.table-responsive td{padding:4px 8px;text-align:left;}
    th{background:#e9ecef;font-weight:600;}
    tr:nth-child(even){background:#f7f8f9;}

    /* === BOTÕES === */
    .btn{background:#000;color:#fff;border:none;padding:8px 16px;border-radius:30px;font-weight:600;cursor:pointer;transition:all .3s;margin-bottom:10px;font-size:.85rem;}
    .btn:hover{background:#333;}
    .btn-action{background:#444;color:#fff;border:none;padding:4px 8px;border-radius:20px;cursor:pointer;transition:background .3s;margin:2px;font-size:.7rem;}
    .btn-action:hover{background:#666;}

    /* === MODAIS === */
    .modal-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.6);z-index:200;}
    .modal-container{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:#fff;border-radius:10px;width:90%;max-width:500px;max-height:90vh;overflow-y:auto;padding:20px;z-index:201;box-shadow:0 4px 12px rgba(0,0,0,.15);}
    .modal-header{font-size:1.2rem;margin-bottom:12px;border-bottom:1px solid #ddd;padding-bottom:6px;}
    .modal-body label{font-weight:500;display:block;margin-top:10px;font-size:.85rem;}
    .modal-body input,.modal-body select,.modal-body textarea{width:100%;padding:6px;margin-top:4px;border:1px solid #ccc;border-radius:5px;font-size:.85rem;}
    .modal-footer{margin-top:16px;text-align:right;}
    .modal-footer button{padding:6px 14px;margin-left:8px;border:none;border-radius:30px;font-weight:600;cursor:pointer;transition:background .3s;font-size:.85rem;}
    .modal-footer button.cancel{background:#ddd;color:#333;}
    .modal-footer button.save{background:#000;color:#fff;}
    .modal-footer button.cancel:hover{background:#ccc;}
    .modal-footer button.save:hover{background:#444;}

/* === TOAST NOTIFICATIONS === */
#toast-container {
  position: fixed;
  top: 85px; /* Abaixo do header */
  right: 20px;
  z-index: 1001; /* Acima da maioria dos elementos */
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 20px;
  border-radius: 8px;
  color: #fff;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

/* Tipos de Toast */
.toast.success { background-color: #28a745; }
.toast.error   { background-color: #dc3545; }
.toast.info    { background-color: #17a2b8; }

/* === STATS CARDS (DASHBOARD) === */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 5fr));
  gap: 15px;
  margin-bottom: 30px;
}

.stat-card {
  background-color: #ececec;
  padding: 15px;
  border-radius: 12px;
  text-align: center;
  border-left: 10px solid #8d8d8d;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}
.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.stat-card h4 {
  font-size: 0.9rem;
  color: #525557;
  margin-bottom: 8px;
  font-weight: 500;
}

.stat-card .stat-number {
  font-size: 1.5rem;
  font-weight: bold;
  color: #343a40;
}

/* Cores específicas para cada status */
.stat-card.alugado   { border-color: #FFF000; }
.stat-card.a-vencer  { border-color: #FF8C00; }
.stat-card.atrasado  { border-color: #FF0000; }
.stat-card.a-alugar  { border-color: #B0E0E6; }


@media print {
  .page { animation: none; }

  .app-sidebar,
  .page-header,
  .workspace-status {
    display: none !important;
  }
}
