/* --- Base e Tipografia (Estilo Apple) --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

body {
    background-color: #f5f5f7; /* Cinza claro da Apple */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1d1d1f; /* Preto principal da Apple */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    justify-content: center; /* Centraliza horizontalmente */
    align-items: center;    /* Centraliza verticalmente */
    min-height: 100vh;      /* Garante que o corpo ocupe 100% da altura da tela */
    margin: 0;              /* Remove margens padrão do navegador */
}

/* --- Container Principal --- */
.main-container {
    max-width: 64rem; /* Equivalente a max-w-5xl */
    margin-left: auto;
    margin-right: auto;
    padding: 2.5rem 1rem;
}

@media (min-width: 640px) {
    .main-container {
        padding: 2.5rem;
    }
}


/* --- Títulos --- */
.header h1 {
    font-size: 2.25rem; /* Um pouco maior e mais impactante */
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #000;
}

.header p {
    font-size: 1rem;
    color: #6e6e73; /* Cinza secundário da Apple */
    margin-top: 4px;
}


/* --- Cartão/Wrapper de Conteúdo --- */
.content-wrapper {
    background-color: #ffffff;
    border-radius: 16px; /* Bordas bem arredondadas */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    margin-top: 2rem;
}


/* --- Botões (Estilo Apple) --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-decoration: none; /* Para links estilizados como botões */
}

.btn i {
    margin-right: 0.5rem;
}

.btn-primary {
    background-color: #007aff; /* Azul Apple */
    color: #fff;
}

.btn-primary:hover {
    background-color: #0071e3;
}

.btn-secondary {
    background-color: #e8e8ea;
    color: #1d1d1f;
}

.btn-secondary:hover {
    background-color: #dcdce1;
}

.btn-destructive {
    background-color: #f5f5f7;
    color: #d9363e;
}

.btn-destructive:hover {
    background-color: #e8e8ea;
}

.btn-success {
    background-color: #34c759;
    color: #fff;
}
.btn-success:hover {
    background-color: #2fb351;
}

.btn:disabled {
    background-color: #e8e8ea;
    color: #86868b;
    cursor: not-allowed;
}
.btn:disabled i {
    animation: fa-spin 2s infinite linear; /* Re-adiciona a animação de spin do JS */
}

/* --- Formulários e Inputs --- */
.form-input, .form-select {
    width: 100%;
    border: 1px solid #d2d2d7;
    background-color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus, .form-select:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
}
.input-with-icon {
    position: relative;
}
.input-with-icon i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #86868b;
}
.input-with-icon .form-input {
    padding-left: 2.5rem;
}


/* --- Tabela --- */
.table-wrapper {
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

.data-table th, .data-table td {
    padding: 1rem 1.25rem;
    text-align: left;
    white-space: nowrap;
}

.data-table thead {
    border-bottom: 1px solid #d2d2d7;
}

.data-table th {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6e6e73;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tbody tr {
    border-bottom: 1px solid #f5f5f7;
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background-color: #f5f5f7;
}

.data-table td .form-input {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
}

/* --- Badges de Status --- */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.5;
}

.status-pago { background-color: #e5f7e9; color: #34c759; }
.status-pendente { background-color: #ffeeee; color: #ff3b30; }
.status-aguardando { background-color: #fff5e5; color: #ff9500; }
.status-expirado { background-color: #f0e8f4; color: #af52de; }


/* --- Paginação --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}
.pagination button {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background-color: #e8e8ea;
    color: #1d1d1f;
    transition: background-color 0.2s;
}
.pagination button:hover {
    background-color: #dcdce1;
}
.pagination button.active {
    background-color: #007aff;
    color: white;
    font-weight: 600;
}

/* --- Estilos da Página de Login --- */
.login-container {
  background-color: #ffffff;
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 24rem; /* 384px */
  text-align: center;
}

.login-header .logo-icon {
  background-color: #007aff;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.login-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1d1d1f;
  margin-bottom: 0.5rem;
}

.login-header p {
  color: #6e6e73;
  margin-bottom: 2rem;
}

.login-form .input-with-icon {
  margin-bottom: 1.25rem;
}

.login-form .btn {
  width: 100%;
  margin-top: 1.5rem;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  margin-top: 1rem;
}

.form-options .forgot-password {
  color: #007aff;
  text-decoration: none;
  font-weight: 500;
}
.form-options .forgot-password:hover {
  text-decoration: underline;
}

.error {
  color: #ff3b30;
  text-align: center;
  margin-top: 1.5rem;
  font-weight: 500;
}

/* --- Componente Checkbox Customizado --- */
.checkbox-container {
  display: flex;
  align-items: center;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  color: #333;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  height: 20px;
  width: 20px;
  background-color: #e8e8ea;
  border-radius: 6px;
  margin-right: 8px;
  transition: background-color 0.2s;
  border: 1px solid #d2d2d7;
}

.checkbox-container:hover input ~ .checkmark {
  background-color: #dcdce1;
}

.checkbox-container input:checked ~ .checkmark {
  background-color: #007aff;
  border-color: #007aff;
}

.checkmark:after {
  content: "";
  position: relative;
  display: none;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  -webkit-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
  display: block;
}

/* Adicionado para alinhar os botões no cabeçalho de cobranças */
.header-actions {
    display: flex;
    gap: 0.75rem; /* Espaçamento entre os botões */
}
.kpi-container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1rem;
    }
    .kpi-card {
        background-color: #fff;
        border: 1px solid #e5e5e5;
        border-radius: 12px;
        padding: 1.5rem;
        box-shadow: 0 4px 12px rgba(0,0,0,0.05);
        border-left: 5px solid #ff9500; /* Laranja para pendente */
    }
    .kpi-card.kpi-paid {
        border-left-color: #34c759; /* Verde para pago */
    }
    .kpi-card h4 {
        margin: 0 0 0.5rem 0;
        font-size: 1rem;
        font-weight: 500;
        color: #6e6e73;
    }
    .kpi-card p {
        margin: 0;
        font-size: 2rem;
        font-weight: 600;
        color: #1d1d1f;
    }