/* ===== Tema Painel Boletos MP ===== */
:root {
  --mp-blue: #009ee3;
  --mp-blue-dark: #007eb5;
  --sidebar-bg: #101828;
  --sidebar-hover: #1d2939;
  --sidebar-active: #0c75b4;
  --content-bg: #f4f6f9;
  --text: #1d2939;
  --muted: #667085;
  --border: #e4e7ec;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, .12);
}

html, body { height: 100%; }

body {
  background: var(--content-bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ===== Layout com sidebar ===== */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: #d0d5dd;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand {
  padding: 22px 20px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .2px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.sidebar .brand small {
  display: block;
  font-weight: 400;
  font-size: .72rem;
  color: #98a2b3;
  margin-top: 2px;
}

.sidebar nav { padding: 14px 12px; flex: 1; }

.side-nav .nav-label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #667085;
  padding: 14px 10px 6px;
}

.side-nav a.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin-bottom: 2px;
  border-radius: 8px;
  color: #d0d5dd;
  text-decoration: none;
  font-size: .92rem;
  transition: background .15s, color .15s;
}

.side-nav a.nav-item:hover { background: var(--sidebar-hover); color: #fff; }

.side-nav a.nav-item.active {
  background: linear-gradient(90deg, var(--sidebar-active), var(--mp-blue));
  color: #fff;
  font-weight: 600;
}

.sidebar .user-box {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: .85rem;
  color: #98a2b3;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: none;
  background: var(--sidebar-bg);
  color: #fff;
  padding: 12px 16px;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1040;
}

.topbar .brand { font-weight: 700; font-size: 1rem; }

.content { padding: 28px 32px 64px; flex: 1; }

@media (max-width: 991.98px) {
  .sidebar { display: none; }
  .topbar { display: flex; }
  .content { padding: 20px 16px 56px; }
}

/* Offcanvas (menu mobile) usa o mesmo estilo da sidebar */
.offcanvas.sidebar-offcanvas {
  background: var(--sidebar-bg);
  color: #d0d5dd;
  width: 264px;
}
.offcanvas.sidebar-offcanvas .btn-close { filter: invert(1); }
.offcanvas.sidebar-offcanvas .brand { color: #fff; font-weight: 700; font-size: 1.05rem; }
.offcanvas.sidebar-offcanvas nav { padding: 6px 12px 14px; }

/* ===== Tipografia / pagina ===== */
.page-title { font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; }
.page-sub { color: var(--muted); font-size: .9rem; margin-top: -4px; }

/* ===== Cards ===== */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: #fff;
}

.card-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: .95rem;
  padding: 14px 18px;
  border-radius: var(--radius) var(--radius) 0 0 !important;
}

.card-body { padding: 18px; }

/* Stats */
.stat-card { position: relative; overflow: hidden; }
.stat-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--stat-color, var(--mp-blue));
}
.stat-card .stat-value { font-size: 1.5rem; font-weight: 800; line-height: 1.1; color: var(--stat-color, var(--text)); }
.stat-card .stat-label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }

/* ===== Tabelas ===== */
.table { margin-bottom: 0; }
.table thead th {
  background: #f9fafb;
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
}
.table tbody td { padding: 12px 14px; font-size: .9rem; }
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: 0; }

/* Tabela vira lista empilhada no mobile (sem scroll lateral) */
/* Mobile: esconde a barra de rolagem (scroll por toque continua) */
@media (max-width: 767.98px) {
  html, body {
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  body::-webkit-scrollbar,
  *::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }
}

@media (max-width: 767.98px) {
  .table-mobile-stack thead { display: none; }
  .table-mobile-stack tbody tr {
    display: block;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
  }
  .table-mobile-stack tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 5px 0;
    border: 0;
  }
  .table-mobile-stack tbody td::before {
    content: attr(data-label);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    flex-shrink: 0;
  }
  .table-mobile-stack tbody td:empty::before { content: none; }
  .table-mobile-stack tbody td[colspan] { display: block; text-align: center; }
  .table-mobile-stack .row-actions { justify-content: flex-end; padding-top: 8px; flex-wrap: wrap; row-gap: 6px; }
  .table-mobile-stack .row-actions::before { content: none; }
}

/* ===== Badges de status ===== */
.badge { font-weight: 600; font-size: .75rem; padding: .45em .7em; border-radius: 999px; }
.status-pending, .status-action_required, .status-processing, .status-in_process { background: #fef0c7; color: #b54708; }
.status-approved, .status-processed { background: #d1fadf; color: #067647; }
.status-rejected, .status-cancelled, .status-error, .status-failed { background: #fee4e2; color: #b42318; }
.status-refunded, .status-charged_back { background: #e0eaff; color: #3538cd; }
.status-expired { background: #f2f4f7; color: #475467; }

/* Tipo de cobranca */
.method-pix { background: #e0eaff; color: #3538cd; }
.method-boleto { background: #f2f4f7; color: #475467; }

/* ===== Botoes ===== */
.btn { border-radius: 8px; font-weight: 500; }
.btn-primary {
  --bs-btn-bg: var(--mp-blue);
  --bs-btn-border-color: var(--mp-blue);
  --bs-btn-hover-bg: var(--mp-blue-dark);
  --bs-btn-hover-border-color: var(--mp-blue-dark);
  --bs-btn-active-bg: var(--mp-blue-dark);
  --bs-btn-active-border-color: var(--mp-blue-dark);
}
.btn-outline-primary {
  --bs-btn-color: var(--mp-blue-dark);
  --bs-btn-border-color: #7cccf0;
  --bs-btn-hover-bg: #e1f5fe;
  --bs-btn-hover-border-color: #7cccf0;
  --bs-btn-hover-color: var(--mp-blue-dark);
  --bs-btn-active-bg: #b3e5fc;
  --bs-btn-active-border-color: #4fc3f7;
}

/* ===== Forms ===== */
.form-label { font-size: .82rem; font-weight: 600; color: #344054; margin-bottom: 5px; }
.form-control, .form-select {
  border-radius: 8px;
  border-color: #d0d5dd;
  font-size: .9rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--mp-blue);
  box-shadow: 0 0 0 3px rgba(0, 158, 227, .12);
}

/* ===== Login ===== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0c4a6e 0%, #007eb5 45%, #009ee3 100%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
}

.login-card .logo {
  text-align: center;
  margin-bottom: 26px;
}

.login-card .logo .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--mp-blue), var(--mp-blue-dark));
  color: #fff;
  font-weight: 800;
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.login-card .logo h4 { font-weight: 700; margin: 0; }
.login-card .logo p { color: var(--muted); font-size: .85rem; margin: 4px 0 0; }

/* ===== Util ===== */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; }
.table td { vertical-align: middle; }
.text-muted { color: var(--muted) !important; }

/* Modal refinado */
.modal-content { border-radius: var(--radius); border: 0; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--border); }
.modal-title { font-weight: 700; font-size: 1.05rem; }
