/* ==========================================================================
   Painel SaaS - Tema Claro Profissional (Versão Compacta e Detalhada)
   Bordas, sombras e linhas visíveis | Tamanhos equilibrados
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --white:          #FFFFFF;
  --bg:             #F9FAFB;
  --gray-50:        #F9FAFB;
  --gray-100:       #F3F4F6;
  --gray-200:       #E5E7EB;
  --gray-300:       #D1D5DB;
  --gray-400:       #9CA3AF;
  --gray-600:       #4B5563;
  --gray-700:       #374151;
  --gray-900:       #111827;

  --green:          #15803D;          /* Verde mais escuro e profissional */
  --green-hover:    #166534;
  --green-light:    #F0FDF4;
  --red:            #B91C1C;
  --red-hover:      #991B1B;

  --shadow:         0 2px 8px rgba(0,0,0,0.08);
  --shadow-card:    0 4px 12px rgba(0,0,0,0.1);
  --radius:         8px;
  --transition:     all 0.18s ease;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--gray-900);
  font-size: 14px;                    /* Base menor para compactar */
  line-height: 1.45;
}

/* Login */
.login-container {
  max-width: 380px;
  margin: 12vh auto;
  padding: 2rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--gray-200);
}

.login-container h1 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.login-container input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  margin: 0.6rem 0;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.login-container input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(21,128,61,0.15);
  outline: none;
}

.login-container button {
  width: 100%;
  padding: 0.75rem;
  background: var(--green);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.login-container button:hover {
  background: var(--green-hover);
}

/* Layout Principal */
.main-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  position: fixed;
  height: 100vh;
  box-shadow: 2px 0 6px rgba(0,0,0,0.05);
}

.sidebar ul {
  list-style: none;
  padding: 0.5rem 0;
}

.sidebar a {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.2rem;
  color: var(--gray-700);
  text-decoration: none;
  font-size: 0.92rem;
  transition: var(--transition);
}

.sidebar a:hover {
  background: var(--gray-50);
  color: var(--green);
}

.sidebar a.active {
  background: var(--green-light);
  color: var(--green);
  font-weight: 600;
}

.content {
  margin-left: 240px;
  padding: 1.5rem 2rem;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--gray-200);
}

.card h2 {
  font-size: 0.9rem;
  color: var(--gray-600);
  margin-bottom: 0.4rem;
}

.card p {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-900);
}

/* Tabelas - com bordas e linhas claras */
.table-container {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--gray-200);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.9rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

th {
  background: var(--gray-50);
  color: var(--gray-600);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover {
  background: var(--green-light);
}

/* Tags */
.tag {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.tag-approved   { background: var(--green); color: white; }
.tag-pending    { background: #D97706; color: white; }
.tag-cancelled  { background: var(--red); color: white; }
.tag-pix        { background: #6366f1; color: white; }
.tag-vale       { background: var(--green); color: white; }

/* Botões */
.btn, button {
  padding: 0.1rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--green);
  color: white;
  border: none;
}

.btn-primary:hover {
  background: var(--green-hover);
}

.btn-danger {
  background: var(--red);
  color: white;
  border: none;
}

.btn-danger:hover {
  background: var(--red-hover);
}

/* Modal - botões lado a lado */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius);
  width: 90%;
  max-width: 480px;
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--gray-200);
}

.modal-content h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.modal-footer button,
.modal-content button {
  flex: 0 0 auto !important;      /* Evita que estiquem ou quebrem */
  min-width: 100px !important;
  padding: 8px 16px !important;
  height: 38px !important;
  font-size: 14px !important;
}

.modal-footer button {
  min-width: 100px;
}

.modal-footer button:first-child {
  background: #6b7280 !important; /* Cinza para Cancelar */
  color: white !important;
}

.modal-footer button:last-child {
  background: #15803d !important; /* Verde para Confirmar/Salvar */
  color: white !important;
}

/* Inputs gerais */
input, select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.92rem;
}

input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(21,128,61,0.1);
  outline: none;
}

/* Responsivo */
@media (max-width: 992px) {
  .sidebar { width: 220px; }
  .content { margin-left: 220px; }
}

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
  .content {
    margin-left: 0;
    padding: 1rem;
  }
}

/* Ajustes específicos para o modal - espaçamento e botões lado a lado */

/* Todos os elementos dentro do modal (inputs, selects, etc) */
.modal-content .form-group {
  margin-bottom: 1.1rem;      /* Espaço entre label + input e o próximo campo */
}

.modal-content label {
  margin-bottom: 0.4rem;      /* Espaço pequeno entre label e input */
  display: block;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
  margin-bottom: 0.8rem;      /* Espaço pequeno abaixo de cada input */
}

/* Espaço entre o último input e os botões */
.modal-content button:not(.modal-footer button) {
  margin-top: 0.5rem;         /* Se houver botão dentro do corpo */
}

/* Modal footer - botões lado a lado com espaçamento */
.modal-footer {
  display: flex !important;
  flex-direction: row !important;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;                  /* Espaço entre os botões (ajuste se quiser mais ou menos) */
  margin-top: 1.2rem;         /* Espaço acima dos botões */
  padding-top: 0.8rem;
  border-top: 1px solid var(--gray-200); /* linha separadora opcional */
}

.modal-footer button {
  min-width: 100px;           /* Largura mínima para não ficar muito estreito */
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  height: 38px;
}

/* Caso os botões ainda fiquem empilhados (forçar horizontal) */
.modal-footer button {
  flex: 0 0 auto;             /* Evita que estiquem */
}


/* Tags de status - complementando as existentes */
.tag-approved {
  background: #15803D;    /* Verde aprovado */
  color: white;
}

.tag-pending {
  background: #D97706;    /* Laranja aguardando */
  color: white;
}

.tag-cancelled {
  background: #B91C1C;    /* Vermelho cancelado */
  color: white;
}

.tag-gray {
  background: #6B7280;    /* Cinza para desconhecido */
  color: white;
}