:root {
  --azul-principal: #0057B7;
  /* Azul forte da logo */
  --azul-secundario: #007BFF;
  /* Azul médio para botões */
  --azul-hover: #0040A0;
  /* Azul escuro para hover */
  --cinza-texto: #333333;
  /* Texto padrão */
  --cinza-claro: #DDDDDD;
  /* Bordas e separadores */
  --fundo: #FFFFFF;
  /* Fundo branco */
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background-color: var(--fundo);
  color: var(--cinza-texto);
}

header {
  background-color: var(--azul-principal);
  color: white;
  padding: 20px;
  text-align: center;
}

h1,
h2,
h3 {
  color: var(--azul-principal);
  margin-bottom: 10px;
}

.container {
  max-width: 960px;
  margin: auto;
  padding: 20px;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border: 1px solid var(--cinza-claro);
  border-radius: 4px;
  box-sizing: border-box;
}

button,
.btn {
  background-color: var(--azul-secundario);
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: inline-block;
  text-decoration: none;
  font-size: 1rem;
}

button:hover,
.btn:hover {
  background-color: var(--azul-hover);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

table th,
table td {
  border: 1px solid var(--cinza-claro);
  padding: 10px;
  text-align: left;
}

table th {
  background-color: var(--azul-principal);
  color: white;
}

footer {
  background-color: var(--azul-principal);
  color: white;
  text-align: center;
  padding: 15px;
  margin-top: 40px;
}

/* Utilities */
.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.mt-2 {
  margin-top: 20px;
}

.mb-2 {
  margin-bottom: 20px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .container {
    padding: 10px;
  }

  /* Responsive Navigation */
  nav {
    flex-direction: column;
  }

  nav .btn {
    width: 100%;
    margin-bottom: 5px;
  }

  /* Responsive Tables (Card View) - Enhanced */
  table.mobile-cards,
  table.mobile-cards tbody,
  table.mobile-cards tr {
    display: block;
    width: 100%;
  }

  table.mobile-cards thead {
    display: none;
  }

  table.mobile-cards tr {
    background: #fff;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    /* Professional Shadow */
    border: 1px solid #eee;
    overflow: hidden;
  }

  table.mobile-cards td {
    display: block;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    padding: 12px 15px;
    padding-left: 50%;
    text-align: right;
    font-size: 14px;
  }

  table.mobile-cards td:last-child {
    border-bottom: none;
    padding: 10px;
    padding-left: 10px;
    /* Reset padding for action buttons */
    display: flex;
    justify-content: flex-end;
  }

  table.mobile-cards td:before {
    position: absolute;
    top: 12px;
    left: 15px;
    width: 40%;
    padding-right: 10px;
    white-space: nowrap;
    text-align: left;
    font-weight: 600;
    color: #555;
    content: attr(data-label);
  }

  /* View Button in Budget List */
  table.mobile-cards td a.btn {
    width: 100%;
    text-align: center;
    background-color: var(--azul-secundario);
    margin: 0;
  }

  /* Action Buttons in Table (Edit/Delete) - Side by Side */
  table.mobile-cards td[data-label="Ações"] {
    justify-content: space-between;
    /* Space out buttons */
    gap: 10px;
  }

  table.mobile-cards td[data-label="Ações"]:before {
    display: none;
  }

  table.mobile-cards td[data-label="Ações"] button {
    flex: 1;
    /* Equal width buttons */
    padding: 10px !important;
    font-size: 1rem;
    border-radius: 4px;
  }

  /* General Mobile Buttons */
  .container button[type="submit"],
  .container .btn {
    width: 100%;
    margin-bottom: 10px;
    padding: 12px;
  }

  /* Action Buttons in Table (Edit/Delete) - Side by Side */
  table.mobile-cards td[data-label="Ações"] {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
    padding-left: 10px;
    /* Reset padding for flex container */
  }

  table.mobile-cards td[data-label="Ações"]:before {
    display: none;
    /* Hide label for actions to save space */
  }

  table.mobile-cards td[data-label="Ações"] button {
    width: auto !important;
    /* Override full width */
    flex: 0 0 auto;
    padding: 8px 15px !important;
    margin: 0 !important;
    font-size: 0.9rem;
  }

  button,
  .btn {
    width: 100%;
    margin-bottom: 5px;
    box-sizing: border-box;
    text-align: center;
    padding: 12px;
    /* Larger touch area */
  }
}