
/* ===== Base layout: mobile-first, light theme ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  background: #f4f6fb; /* light, comfortable background */
  color: #222;
}

/* ===== Login page (modern + intuitive) ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, #ffffff 0%, #eef2ff 45%, #f4f6fb 100%);
}

.login-logo {
  max-width: 170px;
  height: auto;
}

.login-card {
  border-radius: 18px;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
}

.form-control.with-icon {
  padding-left: 2.6rem;
}

.btn-toggle-password {
  border: 0;
  background: transparent;
  padding: 0 10px;
  color: #475569;
}

/* Global containers */
main {
  padding-bottom: 4rem;
}

.card {
  border-radius: 16px;
  border: 1px solid #e2e6f0;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

/* Headings */
h1, h2, h3, h4, h5 {
  font-weight: 600;
}

/* ===== Buttons & inputs: larger and easier to tap ===== */
.btn,
.form-control,
.form-select {
  font-size: 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: 8px; /* square feel, not pills */
}

/* Bootstrap's .btn-sm is too small for touch. Keep it slightly smaller on desktop,
   but still comfortable on mobile. */
.btn-sm {
  padding: 0.75rem 1rem;
  font-size: 0.98rem;
}

.btn-square {
  border-radius: 10px;
}

/* Full-width, high-contrast primary action buttons (ex.: Detalhes) */
.btn-action {
  min-height: 52px;
  font-weight: 600;
}

/* Action cell wrapper: keeps “Ações / Detalhes” usable on mobile */
.actions-wrap {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Action wrapper to avoid broken "Ações" area on mobile */
.actions-wrap {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Colorful actions with clear meaning */
.btn-primary {
  background: #2563eb;  /* blue */
  border-color: #2563eb;
}

.btn-primary:hover,
.btn-primary:focus {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.btn-success {
  background: #16a34a;  /* green - concluir */
  border-color: #16a34a;
}

.btn-success:hover,
.btn-success:focus {
  background: #15803d;
  border-color: #15803d;
}

.btn-warning {
  background: #f97316;  /* orange - em andamento */
  border-color: #f97316;
  color: #111;
}

.btn-warning:hover,
.btn-warning:focus {
  background: #ea580c;
  border-color: #ea580c;
  color: #111;
}

.btn-info {
  background: #0ea5e9; /* cyan/blue - detalhes */
  border-color: #0ea5e9;
  color: #fff;
}

.btn-info:hover,
.btn-info:focus {
  background: #0284c7;
  border-color: #0284c7;
  color: #fff;
}

.btn-danger {
  background: #dc2626;  /* red */
  border-color: #dc2626;
}

.btn-info {
  background: #0ea5e9; /* cyan/blue - detalhes */
  border-color: #0ea5e9;
  color: #081018;
}

.btn-info:hover,
.btn-info:focus {
  background: #0284c7;
  border-color: #0284c7;
  color: #081018;
}

.btn-outline-secondary {
  border-radius: 8px;
}

/* Make badges more readable on mobile */
.badge {
  font-size: 0.8rem;
  padding: 0.45rem 0.6rem;
  border-radius: 999px;
}

/* ===== Navigation bar ===== */
.navbar {
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
}

.navbar-brand img {
  max-height: 40px;
}

/* ===== Tables: turn into cards on mobile (no horizontal scroll) ===== */
.table {
  margin-bottom: 0;
}

.table thead th {
  white-space: nowrap;
}


@media (max-width: 768px) {
  /* Hide table header and transform rows into cards on small screens */
  table.table {
    width: 100%;
  }

  table.table thead {
    display: none;
  }

  table.table tbody,
  table.table tr,
  table.table td {
    display: block;
    width: 100%;
  }

  table.table tr {
    margin-bottom: 1rem;
    padding: 0.85rem 0.9rem;
    border-radius: 12px;
    border: 1px solid #e2e6f0;
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.05);
  }

  table.table td {
    padding: 0.3rem 0;
    border: 0;
  }

  table.table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 2px;
    font-weight: 600;
  }

  table.table td:last-child {
    padding-bottom: 0.1rem;
  }

  /* Make action buttons full-width when they are alone in a cell */
  table.table td .btn-group,
  table.table td .btn {
    width: 100%;
  }

  .actions-wrap {
    display: grid;
    width: 100%;
  }

  .actions-wrap {
    display: grid;
    gap: 0.4rem;
    justify-content: stretch;
  }

  table.table td .btn + .btn {
    margin-top: 0.4rem;
  }
}

/* ===== Forms & spacing ===== */

.form-label {
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.form-text {
  font-size: 0.8rem;
}

/* Tighten vertical spacing a bit on small screens */
@media (max-width: 576px) {
  .container,
  .container-fluid {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .card {
    margin-bottom: 1.1rem;
  }
}

/* ===== Optional: Auto dark mode, but keep light as default ===== */
@media (prefers-color-scheme: dark) {
  body {
    background: #020617;
    color: #f9fafb;
  }

  .card {
    background: #020617;
    border-color: #111827;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.65);
  }

  .navbar {
    background: #020617;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
  }

  .table-responsive tr {
    background: #020617;
    border-color: #111827;
  }
}
