/* Escola Sabatina — overrides de app (desktop + mobile) */

:root {
  --app-navbar-height: 80px;
  --app-footer-height: 0px;
}

body {
  color: #333;
  font-weight: 400;
}

/* Espaço global para navbar/rodapé fixos — não depende de :first-of-type/:last-of-type
   (modais e scripts depois do conteúdo quebravam esse seletor). */
body.has-fixed-navbar {
  padding-top: var(--app-navbar-height);
  padding-bottom: var(--app-footer-height);
}

.has-fixed-navbar .navbar.fixed-top {
  min-height: 64px;
}

.has-fixed-navbar .site-section,
.has-fixed-navbar .site-section:first-of-type,
.has-fixed-navbar .site-section:last-of-type {
  padding: 1.75rem 0 2.25rem;
}

@media (min-width: 768px) {
  :root {
    --app-navbar-height: 96px;
  }
  .has-fixed-navbar .navbar.fixed-top {
    min-height: 76px;
  }
  .has-fixed-navbar .site-section,
  .has-fixed-navbar .site-section:first-of-type,
  .has-fixed-navbar .site-section:last-of-type {
    padding: 2.25rem 0 2.75rem;
  }
}

/* Hero fluido — login e dashboard */
.intro-section,
.intro-section .container > .row {
  height: auto !important;
  min-height: 100dvh;
}

.hero-logo {
  width: 100%;
  max-width: 420px;
  height: auto;
}

.login-nav-logo {
  width: 150px;
  max-width: 100%;
}

.login-brand h1 {
  font-weight: 400;
  font-style: italic;
}

.login-hero-row {
  padding-top: 1rem;
  padding-bottom: 1.25rem;
}

.login-form-col {
  margin-bottom: 1.5rem;
}

@media (max-width: 991.98px) {
  .login-brand {
    text-align: center;
    margin-bottom: 1.25rem;
  }

  .login-brand .hero-logo {
    width: 70%;
    max-width: 260px;
    margin: 1.75rem auto 0.5rem;
  }
}

.form-box {
  padding: 24px;
}

@media (min-width: 768px) {
  .form-box {
    padding: 40px;
  }
}

.btn-login-full {
  width: 100%;
}

@media (min-width: 768px) {
  .btn-login-full {
    width: auto;
  }
}

/* Rodapé: estático no mobile; fixo no desktop com altura previsível */
.has-fixed-navbar .footer-section {
  position: static;
  min-height: 0;
  height: auto;
  margin-top: 1.5rem !important;
  padding: 0.85rem 0 !important;
}

.has-fixed-navbar .footer-section .row {
  justify-content: center;
  align-items: center;
  padding-top: 0 !important;
  margin-top: 0 !important;
}

@media (min-width: 992px) {
  :root {
    --app-footer-height: 88px;
  }
  .has-fixed-navbar .footer-section {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    min-height: var(--app-footer-height);
    height: var(--app-footer-height);
    margin-top: 0 !important;
    padding: 0 !important;
    z-index: 1000;
    display: flex;
    align-items: center;
  }
  .has-fixed-navbar .site-section,
  .has-fixed-navbar .site-section:first-of-type,
  .has-fixed-navbar .site-section:last-of-type {
    padding-bottom: 2.75rem;
  }
}

.has-fixed-navbar .pagination {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

/* Navbar */
.navbar .nav-link {
  padding: 0.7rem 0.9rem;
}

.navbar .nav-link.active,
.navbar .dropdown-item.active {
  font-weight: 700;
  opacity: 1;
  text-decoration: none;
}

.navbar-collapse .navbar-nav .nav-link {
  min-height: 44px;
  display: flex;
  align-items: center;
}

.navbar-user-mobile {
  display: none;
  color: #fff;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 0.5rem;
}

@media (max-width: 991.98px) {
  .navbar-user-mobile {
    display: block;
  }
}

/* Títulos + ação */
.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.page-toolbar h2 {
  margin: 0;
  font-size: 1.6rem;
}

.page-toolbar .btn {
  min-height: 44px;
}

@media (max-width: 767.98px) {
  .page-toolbar .btn-toolbar-action {
    width: 100%;
  }
}

.page-filters .form-group,
.page-filters > [class*="col-"] {
  margin-bottom: 0.75rem;
}

.filter-form .form-group {
  margin-bottom: 0.75rem;
}

@media (max-width: 767.98px) {
  .filter-form .form-control,
  .filter-form .btn {
    width: 100%;
  }
}

/* Tabelas viram cards no mobile */
@media (max-width: 767.98px) {
  .table-as-cards thead {
    display: none;
  }
  .table-as-cards,
  .table-as-cards tbody,
  .table-as-cards tr,
  .table-as-cards td {
    display: block;
    width: 100%;
  }
  .table-as-cards tbody tr {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 0.85rem;
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  }
  .table-as-cards tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    border: 0;
    padding: 0.4rem 0;
  }
  .table-as-cards tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #2f557f;
    flex: 0 0 42%;
  }
  .table-as-cards tbody td[data-label=""]::before,
  .table-as-cards tbody td.td-actions::before {
    display: none;
  }
  .table-as-cards tbody td.td-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.4rem;
    padding-top: 0.65rem;
    margin-top: 0.35rem;
    border-top: 1px solid #edf0f5;
  }
  .table-as-cards .btn-sm {
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
  }
}

.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: #666;
  background: #f8f9fa;
  border-radius: 10px;
}

/* Password toggle */
.password-field {
  position: relative;
}

.password-field .form-control {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #2f557f;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.password-toggle:focus {
  outline: 2px solid #2f557f;
  outline-offset: 2px;
}

/* Toasts */
.toast-stack {
  position: fixed;
  top: 80px;
  right: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
}

.app-toast {
  background: #fff;
  border-left: 4px solid #2f557f;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 0.85rem 1rem;
  border-radius: 8px;
}

.app-toast.is-success { border-left-color: #28a745; }
.app-toast.is-danger { border-left-color: #dc3545; }
.app-toast.is-warning { border-left-color: #ffc107; }

/* Choice buttons Sim/Não */
.choice-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.choice-group label {
  flex: 1 1 140px;
  min-height: 48px;
  margin: 0;
  border: 2px solid #d9dee7;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 600;
}

.choice-group input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-group label.is-on-sim,
.choice-group input:checked + span.choice-sim {
  background: #e8f6ec;
  border-color: #28a745;
  color: #1e7e34;
}

.choice-group .choice-opt {
  width: 100%;
  min-height: 48px;
  border: 2px solid #d9dee7;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 600;
  margin: 0;
}

.choice-group input:checked + .choice-opt.choice-sim {
  background: #e8f6ec;
  border-color: #28a745;
  color: #1e7e34;
}

.choice-group input:checked + .choice-opt.choice-nao {
  background: #fdecea;
  border-color: #dc3545;
  color: #c82333;
}

/* Chamada */
.presenca-toggle {
  min-width: 44px;
  min-height: 44px;
}

.chamada-actions {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding: 0.75rem 0;
  border-top: 1px solid #edf0f5;
  z-index: 5;
}

.dash-hero {
  background: #2f557f;
  color: #fff;
  padding: 1.5rem 0 2rem;
}

.dash-hero h1,
.dash-hero h3,
.dash-hero p {
  color: #fff;
}

.dash-card {
  display: block;
  background: #fff;
  border-radius: 12px;
  padding: 1.15rem 1.2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  color: inherit;
  height: 100%;
  border: 1px solid #edf0f5;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dash-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(47, 85, 127, 0.12);
  color: inherit;
}

.dash-card .dash-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #2f557f;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dash-kpis > [class*="col-md-4"] {
  display: flex;
}

.dash-kpis > [class*="col-md-4"] > .dash-card {
  width: 100%;
}

.dash-card-online {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: 148px;
}

.dash-card-online .dash-value {
  font-size: 2.6rem;
}

@media (min-width: 768px) {
  .dash-kpis > [class*="col-md-4"] {
    align-self: stretch;
  }
  .dash-card-online {
    min-height: 100%;
  }
}

.online-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #28a745;
  box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.2);
  flex-shrink: 0;
}

.online-group h3 .badge {
  font-weight: 600;
  color: #2f557f;
}

.dash-card .dash-label {
  color: #666;
  font-size: 0.95rem;
}

/* Restore semantic button hover (override template) */
.btn:focus-visible {
  outline: 2px solid #2f557f;
  outline-offset: 2px;
  box-shadow: 0 0 0 0.2rem rgba(47, 85, 127, 0.25) !important;
}

.btn-success:hover {
  background-color: #218838 !important;
  border-color: #1e7e34 !important;
  color: #fff !important;
}

.btn-danger:hover {
  background-color: #c82333 !important;
  border-color: #bd2130 !important;
  color: #fff !important;
}

.btn-warning:hover {
  background-color: #e0a800 !important;
  border-color: #d39e00 !important;
  color: #212529 !important;
}

.btn-info:hover {
  background-color: #138496 !important;
  border-color: #117a8b !important;
  color: #fff !important;
}

.btn-primary:hover {
  background-color: #25466a !important;
  border-color: #25466a !important;
  color: #fff !important;
}

.btn-outline-success:hover {
  background-color: #28a745 !important;
  border-color: #28a745 !important;
  color: #fff !important;
}

.btn-outline-danger:hover {
  background-color: #dc3545 !important;
  border-color: #dc3545 !important;
  color: #fff !important;
}

.btn-sm.btn-action {
  min-height: 38px;
}

@media (max-width: 767.98px) {
  .btn-sm.btn-action {
    min-height: 44px;
  }
  .modal-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .modal-footer .btn {
    width: 100%;
    margin: 0.25rem 0;
  }
}

.qr-preview {
  max-width: 220px;
}

.copy-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.copy-row input {
  flex: 1;
}

.char-count {
  font-size: 0.85rem;
  color: #6c757d;
  text-align: right;
}

.nav-tabs .nav-link {
  min-height: 44px;
}

.relatorio-totais {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.relatorio-totais .badge {
  font-size: 0.95rem;
  padding: 0.55rem 0.8rem;
}

.bg-image,
.bg-image-2 {
  background-attachment: scroll;
}
