/* ────────────────────────────────────────────────────────────────
   MasterFight — main.css
   Pequenos ajustes sobre o Bootstrap 5 para deixar a UI mais
   limpa e consistente. Não sobrescreve variáveis do Bootstrap;
   apenas adiciona estilos específicos do projeto.
──────────────────────────────────────────────────────────────── */

/* Shared visual language */
:root {
  --tw-ink: #172033;
  --tw-muted: #64748b;
  --tw-line: #e5eaf1;
  --tw-blue: #2563eb;
  --tw-shadow: 0 0.65rem 1.6rem rgba(23, 32, 51, 0.07);
}

body {
  font-size: 0.925rem;
  color: var(--tw-ink);
  background:
    radial-gradient(circle at 100% 0%, rgba(219, 234, 254, 0.34), transparent 28rem),
    #f7f9fc !important;
  -webkit-font-smoothing: antialiased;
}

main.container {
  max-width: 1180px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--tw-ink);
  letter-spacing: 0;
}

/* Navbar */
.navbar {
  min-height: 3.6rem;
  background: rgba(23, 32, 51, 0.98) !important;
  box-shadow: 0 0.3rem 1rem rgba(15, 23, 42, 0.14) !important;
}

.navbar-brand {
  letter-spacing: 0.2px;
}

.navbar .nav-link {
  border-radius: 0.45rem;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
}

/* Cards and controls */
.card {
  border: 1px solid var(--tw-line) !important;
  border-radius: 0.75rem;
  box-shadow: 0 0.35rem 1rem rgba(23, 32, 51, 0.06);
}

.btn {
  border-radius: 0.5rem;
  font-weight: 600;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.form-control,
.form-select {
  min-height: 2.55rem;
  color: var(--tw-ink);
  background-color: #fff;
  border-color: #dbe2eb;
  border-radius: 0.5rem;
}

.form-control:focus,
.form-select:focus {
  border-color: #93b4f7;
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.11);
}

.table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: #f8fbff;
  color: var(--tw-ink);
}

.table > :not(caption) > * > * {
  padding: 0.8rem 0.75rem;
  border-bottom-color: var(--tw-line);
}

.table thead th {
  color: var(--tw-muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--tw-line);
}

.table thead.table-dark th {
  color: #e2e8f0;
  background: #202a3a;
  border-bottom-color: #202a3a;
}

.modal-content {
  overflow: hidden;
  border: 1px solid var(--tw-line) !important;
  border-radius: 0.75rem;
  box-shadow: 0 1rem 2.5rem rgba(15, 23, 42, 0.18) !important;
}

.modal-header {
  padding: 1rem 1.25rem;
  background: #fff;
  border-bottom-color: var(--tw-line);
}

.modal-body {
  background: #f7f9fc;
}

.alert {
  border-radius: 0.65rem;
}

.profile-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.profile-card-link:hover .profile-card,
.profile-card-link:focus-visible .profile-card {
  transform: translateY(-4px);
  box-shadow: 0 1rem 2rem rgba(15, 23, 42, 0.12) !important;
}

.profile-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 100%;
}

.profile-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--profile-card-accent, #6c757d);
}

.profile-card--personal {
  --profile-card-accent: #0d6efd;
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.06), rgba(255, 255, 255, 1));
}

.profile-card--financial {
  --profile-card-accent: #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(255, 255, 255, 1));
}

.profile-card--company {
  --profile-card-accent: #198754;
  background: linear-gradient(135deg, rgba(25, 135, 84, 0.08), rgba(255, 255, 255, 1));
}

.profile-card-icon-wrap {
  background: rgba(13, 110, 253, 0.08);
}

.profile-card-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
  font-size: 1.25rem;
  flex: 0 0 auto;
}

.profile-avatar {
  width: 4rem;
  height: 4rem;
  border-radius: 1.25rem;
  background: linear-gradient(135deg, #0f172a, #1d4ed8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 0.75rem 1.5rem rgba(15, 23, 42, 0.25);
}

.profile-summary-box {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1rem;
  padding: 1.25rem;
}

.pix-qr-frame {
  background: #fff;
  border: 1px dashed rgba(15, 23, 42, 0.18);
  border-radius: 1.25rem;
  padding: 1rem;
  width: fit-content;
  max-width: 100%;
}

/* Student billing: compact Store -> POS workspace */
.student-billing-page-header {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--tw-line);
}

.student-billing-eyebrow,
.student-store-kicker,
.student-pos-kicker {
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.student-billing-eyebrow {
  color: #2563eb;
  margin-bottom: 0.35rem;
}

.student-billing-title {
  color: #0f172a;
  font-size: 1.65rem;
  font-weight: 700;
}

.student-config-actions .btn {
  min-width: 8.5rem;
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.student-store-list {
  display: grid;
  gap: 1rem;
}

.student-store-panel {
  display: grid;
  grid-template-columns: minmax(14rem, 17rem) minmax(0, 1fr);
  min-height: 12rem;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 0.85rem;
  box-shadow: 0 0.45rem 1.25rem rgba(15, 23, 42, 0.06);
}

.student-store-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.35rem;
  background: linear-gradient(145deg, #f8fbff, #eef4ff);
  border-right: 1px solid rgba(37, 99, 235, 0.12);
}

.student-store-icon,
.student-pos-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.student-store-icon {
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1rem;
  color: #2563eb;
  font-size: 1.25rem;
  background: #dbeafe;
  border-radius: 0.7rem;
}

.student-store-name {
  max-width: 100%;
  margin: 0.3rem 0 0.65rem;
  overflow-wrap: anywhere;
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 700;
}

.student-store-id {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #64748b;
  font-size: 0.78rem;
}

.student-store-id strong {
  color: #334155;
  font-weight: 600;
}

.student-store-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1.2rem;
}

.student-pos-area {
  min-width: 0;
  padding: 1.35rem;
}

.student-pos-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.student-pos-title {
  margin: 0.25rem 0 0;
  color: #1e293b;
  font-size: 0.95rem;
  font-weight: 700;
}

.student-pos-count {
  flex: 0 0 auto;
  padding: 0.3rem 0.65rem;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 600;
  background: #f1f5f9;
  border-radius: 999px;
}

.student-pos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.75rem;
}

.student-pos-card {
  min-width: 0;
  padding: 1rem;
  background: #fbfdff;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.student-pos-card:hover {
  border-color: #bfdbfe;
  box-shadow: 0 0.5rem 1rem rgba(37, 99, 235, 0.08);
  transform: translateY(-2px);
}

.student-pos-card-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
}

.student-pos-icon {
  width: 2rem;
  height: 2rem;
  color: #2563eb;
  background: #dbeafe;
  border-radius: 0.5rem;
}

.student-pos-card-name {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #1e293b;
  font-size: 0.9rem;
  font-weight: 700;
}

.student-pos-status {
  color: #15803d;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.student-pos-details {
  display: grid;
  gap: 0.55rem;
  margin: 1rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid #e2e8f0;
}

.student-pos-details div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.student-pos-details dt,
.student-pos-details dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.75rem;
}

.student-pos-details dt {
  color: #94a3b8;
}

.student-pos-details dd {
  color: #475569;
  font-weight: 600;
  text-align: right;
}

.student-pos-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.student-pos-card-actions .btn:first-child {
  flex: 1;
}

.student-pos-empty {
  padding: 1rem;
  color: #64748b;
  font-size: 0.8rem;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 0.65rem;
}

.payment-action-content {
  min-height: 12rem;
  padding: 1.5rem;
  overflow-x: hidden;
  background: #f8fafc;
}

.payment-action-content .card {
  max-width: none !important;
  box-shadow: none !important;
}

.payment-action-content .container {
  max-width: none;
  padding: 0;
}

.payment-action-content .payment-action-frame {
  display: block;
  width: 100%;
  height: min(72vh, 42rem);
  border: 0;
  background: #f8fafc;
}

.student-payment-eyebrow {
  margin-bottom: 0.3rem;
  color: #2563eb;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.student-payment-summary,
.student-payment-qr-panel {
  height: 100%;
  padding: 1.35rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  box-shadow: 0 0.35rem 0.9rem rgba(15, 23, 42, 0.05);
}

.student-payment-summary {
  background: linear-gradient(145deg, #f8fbff, #eef4ff);
  border-color: #dbeafe;
}

.student-payment-summary-label {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
}

.student-payment-amount {
  margin: 0.25rem 0 1.4rem;
  color: #0f172a;
  font-size: 1.8rem;
  font-weight: 750;
}

.student-payment-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  color: #64748b;
  font-size: 0.8rem;
  border-top: 1px solid rgba(37, 99, 235, 0.12);
}

.student-payment-summary-row strong {
  color: #334155;
  font-weight: 650;
  text-align: right;
}

.student-payment-qr-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.student-payment-qr-mark {
  color: #16a34a;
  font-size: 1.5rem;
}

.student-payment-qr-image {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 16rem;
  margin-bottom: 1.1rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
}

.student-payment-qr-image img,
.student-payment-qr-image canvas {
  display: block;
  width: min(100%, 15rem);
  height: auto;
  image-rendering: pixelated;
}

.student-payment-copy-label {
  margin-bottom: 0.45rem;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.student-payment-qr-panel textarea {
  min-height: 5.2rem;
  resize: vertical;
  font-size: 0.78rem;
  line-height: 1.45;
}

@media (max-width: 767.98px) {
  .payment-action-content {
    padding: 1rem;
  }

  .student-payment-amount {
    font-size: 1.55rem;
  }

  .student-payment-qr-image {
    min-height: 13rem;
  }
}

@media (max-width: 767.98px) {
  .users-contact-column {
    display: none;
  }

  .student-charge-created {
    display: none;
  }

  .student-billing-toolbar {
    width: 100%;
  }

  .student-billing-toolbar .btn {
    flex: 1;
  }

  .student-config-actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem !important;
  }

  .student-config-actions .btn {
    width: 100%;
    min-width: 0;
    font-size: 0.78rem;
    white-space: nowrap;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .student-store-panel {
    grid-template-columns: 1fr;
  }

  .student-store-summary {
    border-right: 0;
    border-bottom: 1px solid rgba(37, 99, 235, 0.12);
  }

  .student-store-actions {
    margin-top: 1rem;
  }
}

/* Tabelas */
.table thead th {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Badges */
.badge {
  font-weight: 500;
  font-size: 0.75rem;
}

/* Formulários */
.form-label {
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

/* Botões */
.btn {
  font-size: 0.875rem;
}

/* Paginação */
.pagination .page-link {
  font-size: 0.875rem;
}

/* Mensagens Django → mapear para classes Bootstrap */
.alert.error   { --bs-alert-color: var(--bs-danger-text-emphasis); }
.alert.warning { --bs-alert-color: var(--bs-warning-text-emphasis); }
.alert.success { --bs-alert-color: var(--bs-success-text-emphasis); }
