@import url('https://cdn.jsdelivr.net/npm/bulma@1.0.1/css/bulma.min.css');

body {
  background: #f4f7fb !important;
  /* background-image: url('/static/img/logo.jpg'); */
  /* background-size: 160px; */
  background-repeat: repeat-y;
  background-position: center;
  color: #222 !important;
  transition: background 0.4s, color 0.3s;
}

html,
body {
  font-size: 14px;
  /* height: 100%; */
  margin: 0;
  padding: 0;
  overflow-x: auto;
  overflow-x: hidden !important;
}


.login-page {
  background: rgba(255, 255, 255, 0.8) !important;
}

.box-login {
  background: #ececec !important;
  box-shadow: 0 6px 16px 0 rgba(100, 100, 100, 0.09);
  transition: background 0.4s;
}

.input {
  background: rgba(255, 255, 255, 0.8) !important;
  border: 1.2px solid #b9d3ea !important;
  color: #084968 !important;
  border-radius: 8px !important;
  transition: border-color .2s, background .3s, color .3s;
}

.input:focus {
  border-color: #3090ec !important;
  background: #fff !important;
}

.input::placeholder {
  color: #91b5d9 !important;
  opacity: 1;
  transition: color .3s;
}

.card {
  max-width: 250px;
  width: 100%;
  margin: 0 auto;
}

.card-header-basic {
  background: #e3f0fa !important;
  color: #084968 !important;
}

.card-header-basic .card-header-title {
  color: #084968 !important;
}

.card-header-medio {
  background: #e5fbee !important;
  color: #0d6848 !important;
}

.card-header-medio .card-header-title {
  color: #0d6848 !important;
}

.card-header-plus {
  background: #fff5e3 !important;
  color: #91500c !important;
}

.card-header-plus .card-header-title {
  color: #91500c !important;
}

.menu-list li a {
  background: none !important;
  color: #111010 !important;
}




/* --- DARK MODE (manual via .darkmode) --- */
html.darkmode body {
  background: #191c22 !important;
  color: #eaeaea !important;
  /* background-image: url('/static/img/logo.jpg'); */
  /* background-size: 160px; */
  background-repeat: repeat-y;
  background-position: center;
}

html.darkmode .login-page {
  background: rgba(15, 17, 20, 0.80) !important;
}

html.darkmode .box-login {
  background: #262a31 !important;
  box-shadow: 0 6px 16px 0 rgba(10, 10, 10, 0.22);
}

html.darkmode .input {
  background: #23252b !important;
  color: #3ac7ec !important;
  border: 1.2px solid #376a80 !important;
}

html.darkmode .input:focus {
  border-color: #47a4da !important;
  background: #232e40 !important;
  color: #fff !important;
}

html.darkmode .input::placeholder {
  color: #86a1ae !important;
}

html.darkmode .card {
  background: #23252b !important;
  color: #dce3eb !important;
}

html.darkmode .card-header-basic,
html.darkmode .card-header-basic .card-header-title {
  background: #264057 !important;
  color: #6ed0fe !important;
}

html.darkmode .card-header-medio,
html.darkmode .card-header-medio .card-header-title {
  background: #2a463a !important;
  color: #7eedb6 !important;
}

html.darkmode .card-header-plus,
html.darkmode .card-header-plus .card-header-title {
  background: #47391e !important;
  color: #f8a20d !important;
}

html.darkmode .navbar.is-link {
  background: #1e2738 !important;
}

html.darkmode .navbar,
html.darkmode .navbar a {
  color: #fff !important;
}

html.darkmode .title {
  color: #f4f7fb !important;
}

html.darkmode .card-footer {
  background: #91500c !important;
  opacity: .5 !important;
}

html.darkmode .menu-list li a {
  background: none !important;
  color: white !important;
}

.navbar.is-link {
  background: #1e2738;
}

/* --- DARK MODE (sistema: fallback automático) --- */
@media (prefers-color-scheme: dark) {
  body {
    background: #191c22 !important;
    color: #eaeaea !important;
    background-image: url('/static/img/logo.jpg');
    background-size: 160px;
    background-repeat: repeat-y;
    background-position: center;
  }

  .login-page {
    background: rgba(15, 17, 20, 0.80) !important;
  }

  .box-login {
    background: #262a31 !important;
    box-shadow: 0 6px 16px 0 rgba(10, 10, 10, 0.22);
  }

  .input {
    background: #23252b !important;
    color: #3ac7ec !important;
    border: 1.2px solid #376a80 !important;
  }

  .input:focus {
    border-color: #47a4da !important;
    background: #232e40 !important;
    color: #fff !important;
  }

  .input::placeholder {
    color: #86a1ae !important;
  }

  .card {
    background: #23252b !important;
    color: #dce3eb !important;
  }

  .card-header-basic,
  .card-header-basic .card-header-title {
    background: #264057 !important;
    color: #6ed0fe !important;
  }

  .card-header-medio,
  .card-header-medio .card-header-title {
    background: #2a463a !important;
    color: #7eedb6 !important;
  }

  .card-header-plus,
  .card-header-plus .card-header-title {
    background: #47391e !important;
    color: #f8a20d !important;
  }

  .navbar.is-link {
    background: #1e2738 !important;
  }

  .navbar,
  .navbar a {
    color: #fff !important;
  }
}

.darkmode-icon-btn {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  margin: 0 0 0 0.7rem !important;
  padding: 0.1rem !important;
  height: 2rem !important;
  min-width: 2rem !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.darkmode-icon-btn .icon {
  display: flex;
  align-items: center;
  justify-content: center;
}


/* Esconde a barra lateral em telas menores */
@media (max-width: 1024px) {
  .sidebar-dashboard {
    position: fixed;
    top: 60px;
    /* altura da barra superior */
    left: -250px;
    width: 250px !important;
    height: auto;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    transition: left 0.3s ease-in-out;
    z-index: 1000;
  }

  .sidebar-dashboard.active {
    left: 0;
  }
}

/* Sidebar apenas para mobile */
.sidebar-dashboard {
  position: fixed;
  top: 70px;
  /* abaixo da navbar */
  left: -250px;
  /* escondida inicialmente */
  width: 250px;
  height: auto;
  max-height: calc(100vh - 70px);
  overflow-y: auto;
  background-color: #172c44;
  z-index: 1000;
  transition: left 0.3s ease-in-out;
  background: none !important;
}

/* Overlay do menu mobile */
#sidebar-overlay {
  display: none;
  position: fixed;
  top: 70px;
  left: 0;
  width: 100%;
  /* height: calc(100vh - 70px); */
  background: rgba(0, 0, 0, 0.55);
  z-index: 999;
}

/* Sidebar do dashboard */
.sidebar-nav {
  /* background: #172c44; */
  color: #fff;
  height: auto;
  min-height: 100%;
  transition: all 0.3s ease-in-out;
}

@media (max-width: 1023px) {
  .sidebar-nav {
    position: fixed;
    top: 70px;
    left: -250px;
    width: 250px;
    z-index: 1000;
  }

  .sidebar-nav.active {
    left: 0;
  }

  #sidebar-nav-overlay {
    display: block;
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    /* height: calc(100vh - 70px); */
    background: rgba(0, 0, 0, 0.55);
    z-index: 999;
  }
}

/* Sidebar Home (login/cadastro) */
.sidebar-home {
  position: fixed;
  top: 70px;
  left: -250px;
  width: 250px;
  height: auto;
  max-height: calc(100vh - 70px);
  overflow-y: auto;
  background: none !important;
  z-index: 1000;
  transition: left 0.3s ease-in-out;
}

#sidebar-overlay {
  display: none;
}

.sidebar-home.active {
  left: 0;
}

#sidebar-overlay.active {
  display: block;
}

/* No desktop, home sidebar não aparece */
@media (min-width: 1024px) {
  .sidebar-home {
    display: none !important;
  }

  #sidebar-overlay {
    display: none !important;
  }
}

/* Desktop: sidebar sempre visível */
@media (min-width: 1024px) {
  .sidebar-nav {
    display: flex !important;
  }

  #sidebar-nav-overlay {
    display: none !important;
  }

}


/* Ajuste do botão hamburguer no dashboard */
#sidebar-toggle-dash {
  position: fixed;
  top: 50px;
  /* abaixo da navbar */
  left: 1rem;
  z-index: 1100;
  background: #234265;
  border-radius: 8px;
  padding: 0.3rem 0.5rem;
}

#sidebar-toggle-dash span {
  background-color: #fff !important;
}

/* Ajuste do botão hamburguer no home */
#sidebar-toggle {
  position: fixed;
  top: 50px;
  /* abaixo da navbar */
  left: 1rem;
  z-index: 1100;
  background: #234265;
  border-radius: 8px;
  padding: 0.3rem 0.5rem;
}

#sidebar-toggle span {
  background-color: #fff !important;
}

/* Estilo do botão de logout */
.logout-link {
  margin-top: auto;
  padding: 1rem;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.logout-link a {
  color: #ff7373 !important;
  font-weight: 600;
}

.logout-link a:hover {
  color: #ff9b9b !important;
}

/* Mini badge neon verde */
.mini-badge {
  background-color: #00ff7f;
  /* verde neon */
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 0.4rem;
  text-transform: uppercase;
  box-shadow: 0 0 5px #00ff7f, 0 0 10px #00ff7f;
}



/* Oculta login/cadastro no dashboard */
.navbar .navbar-end a[href="/login/"],
.navbar .navbar-end a[href="/cadastro/"] {
  display: none !important;
}



/* Submenu */
.menu-list li ul {
  margin-left: 1.2rem;
  margin-top: 0.3rem;
  display: none;
}

.menu-list li.active>ul {
  display: block;
}

.menu-list li a.toggle-submenu {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.submenu-icon {
  font-size: 0.8rem;
  transition: transform 0.2s;
}

.menu-list li.active>a .submenu-icon {
  transform: rotate(90deg);
}

/* Logout */
.logout-link {
  margin-top: auto;
  padding: 1rem;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.logout-link a {
  color: #ff7373 !important;
  /* font-weight: 600; */
}

.logout-link a:hover {
  color: #ff9b9b !important;
}

/* Estilo para link ativo no menu */
.menu-list a.is-active {
  background-color: rgba(255, 255, 255, 0.15) !important;
  border-left: 3px solid #3273dc;
  font-weight: 600;
}

/* Transição suave ao carregar conteúdo */
/* #dashboard-content {
    transition: opacity 0.2s ease;
} */

/* Overlay para menu mobile no dashboard */
#sidebar-nav-overlay {
  display: none;
  position: fixed;
  top: 70px;
  left: 0;
  width: 100%;
  height: calc(100vh - 70px);
  background: rgba(0, 0, 0, 0.55);
  z-index: 999;
}

#sidebar-nav-overlay.active {
  display: block;
}

/* ========== ESTILOS PARA FORMULÁRIO DE CADASTRO ========== */

/* Modo Claro (Padrão) */
.box {
  background: #f5f5f5 !important;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: background 0.3s, box-shadow 0.3s;
  padding: 1rem !important;
}

.has-background-light {
  background-color: #f5f5f5 !important;
}

.title {
  color: #363636 !important;
  transition: color 0.3s;
}

.label {
  color: #363636 !important;
  font-weight: 600;
  transition: color 0.3s;
}

.has-text-primary {
  color: #00d1b2 !important;
}

/* Inputs e Selects */
.input,
.select select {
  background: #ffffff !important;
  border: 1.5px solid #dbdbdb !important;
  color: #363636 !important;
  border-radius: 6px !important;
  transition: all 0.3s;
}

.input:focus,
.select select:focus {
  border-color: #00d1b2 !important;
  box-shadow: 0 0 0 0.125em rgba(0, 209, 178, 0.25) !important;
}

.input::placeholder {
  color: #b5b5b5 !important;
}

/* Select wrapper */
.select:not(.is-multiple):not(.is-loading)::after {
  border-color: #00d1b2 !important;
}

.select.is-fullwidth {
  width: 100%;
}

.select.is-fullwidth select {
  width: 100%;
}

/* File input */
.file.has-name .file-cta {
  background-color: #ffffff !important;
  border: 1.5px solid #dbdbdb !important;
  color: #363636 !important;
  border-radius: 6px 0 0 6px !important;
  transition: all 0.3s;
}

.file.has-name .file-name {
  background-color: #f5f5f5 !important;
  border: 1.5px solid #dbdbdb !important;
  border-left: none !important;
  color: #363636 !important;
  border-radius: 0 6px 6px 0 !important;
  transition: all 0.3s;
}

.file.has-name .file-cta:hover {
  background-color: #f5f5f5 !important;
}

/* Botões */
.button.is-primary {
  background-color: #00d1b2 !important;
  color: #fff !important;
  border: none !important;
  transition: all 0.3s;
}

.button.is-primary:hover {
  background-color: #00b89c !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 209, 178, 0.3);
}

/* Ícones */
.icon {
  color: #7a7a7a !important;
  transition: color 0.3s;
}

/* ========== MODO DARK ========== */
html.darkmode .box {
  background: #2b2f3a !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

html.darkmode .has-background-light {
  background-color: #2b2f3a !important;
}

html.darkmode .title {
  color: #f0f0f0 !important;
}

html.darkmode .has-text-primary {
  color: #4fd1c5 !important;
}

html.darkmode .label {
  color: #e0e0e0 !important;
}

/* Inputs e Selects no Dark Mode */
html.darkmode .input,
html.darkmode .select select {
  background: #1a1d26 !important;
  border: 1.5px solid #3a3f4f !important;
  color: #e0e0e0 !important;
}

html.darkmode .input:focus,
html.darkmode .select select:focus {
  border-color: #4fd1c5 !important;
  background: #232730 !important;
  box-shadow: 0 0 0 0.125em rgba(79, 209, 197, 0.25) !important;
}

html.darkmode .input::placeholder {
  color: #6b7280 !important;
}

/* Select arrow no dark mode */
html.darkmode .select:not(.is-multiple):not(.is-loading)::after {
  border-color: #4fd1c5 !important;
}

/* File input no dark mode */
html.darkmode .file.has-name .file-cta {
  background-color: #1a1d26 !important;
  border: 1.5px solid #3a3f4f !important;
  color: #e0e0e0 !important;
}

html.darkmode .file.has-name .file-name {
  background-color: #2b2f3a !important;
  border: 1.5px solid #3a3f4f !important;
  border-left: none !important;
  color: #b0b0b0 !important;
}

html.darkmode .file.has-name .file-cta:hover {
  background-color: #232730 !important;
}

/* Botão no dark mode */
html.darkmode .button.is-primary {
  background-color: #4fd1c5 !important;
  color: #1a1d26 !important;
}

html.darkmode .button.is-primary:hover {
  background-color: #38b2ac !important;
  box-shadow: 0 4px 12px rgba(79, 209, 197, 0.4);
}

/* Ícones no dark mode */
html.darkmode .icon {
  color: #9ca3af !important;
}

html.darkmode .icon i {
  color: #9ca3af !important;
}

/* Notification Success */
.notification.is-success {
  background-color: #48c78e !important;
  color: #fff !important;
}

html.darkmode .notification.is-success {
  background-color: #10b981 !important;
  color: #fff !important;
}

.notification.is-success.is-light {
  background-color: #effaf5 !important;
  color: #257953 !important;
}

html.darkmode .notification.is-success.is-light {
  background-color: #064e3b !important;
  color: #6ee7b7 !important;
}

/* Links dentro do box */
.box a.button,
.has-background-light a.button {
  transition: all 0.3s;
}

/* Container responsivo */
@media (max-width: 768px) {
  .column.is-8.is-offset-2 {
    margin: 0 !important;
  }

  .box.p-5 {
    padding: 1.5rem !important;
  }


  .title.is-size-3 {
    font-size: 1.5rem !important;
  }

  .button.is-medium {
    font-size: 1rem !important;
  }

  /* Mobile: Reduzir navbar */
  .navbar-item {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.9rem !important;
  }

  /* Buttons em mobile */
  .button {
    padding: 0.5rem 1rem !important;
    font-size: 0.9rem !important;
  }

  .button.is-medium {
    padding: 0.75rem 1.5rem !important;
  }

  /* Sidebar reduzido mobile */
  .sidebar-nav,
  .sidebar-dashboard {
    width: 200px !important;
  }

  /* Inputs/Selects em mobile */
  .input,
  .select select,
  .textarea {
    font-size: 16px !important;
    /* Evita zoom no iOS */
    padding: 0.5rem 0.75rem !important;
    line-height: 1.5;
  }

  /* Labels e Fields */
  .label {
    font-size: 0.9rem !important;
    margin-bottom: 0.5rem !important;
  }

  .field {
    margin-bottom: 1rem !important;
  }

  /* Tabelas responsivas */
  .table {
    font-size: 0.85rem !important;
  }

  .table thead th {
    padding: 0.5rem !important;
  }

  .table tbody td {
    padding: 0.5rem !important;
  }

  /* Columns stack vertical em mobile */
  .columns {
    flex-direction: column !important;
    gap: 1rem !important;
  }

  .column {
    width: 100% !important;
    margin-bottom: 1rem !important;
  }

  .column.is-8,
  .column.is-4,
  .column.is-6 {
    width: 100% !important;
  }
}

/* Mobile Pequeno (<640px) */
@media (max-width: 640px) {

  html,
  body {
    font-size: 11px !important;
  }

  .navbar-brand {
    flex-shrink: 0;
  }

  .navbar-item {
    padding: 0.3rem 0.5rem !important;
    font-size: 0.8rem !important;
  }

  .darkmode-icon-btn {
    height: 1.5rem !important;
    min-width: 1.5rem !important;
  }

  .title {
    font-size: 1.25rem !important;
  }

  .title.is-size-3 {
    font-size: 1.25rem !important;
  }

  .subtitle {
    font-size: 1rem !important;
  }

  .button {
    padding: 0.4rem 0.8rem !important;
    font-size: 0.8rem !important;
  }

  .button.is-medium {
    padding: 0.5rem 1rem !important;
    font-size: 0.9rem !important;
  }

  /* Sidebar mais estreita */
  .sidebar-nav,
  .sidebar-dashboard {
    width: 180px !important;
    left: -180px !important;
  }

  .sidebar-nav.active,
  .sidebar-dashboard.active {
    left: 0 !important;
  }

  /* Menu items compactos */
  .menu-list li a {
    padding: 0.5rem 1rem !important;
    font-size: 0.85rem !important;
  }

  .logout-link {
    padding: 0.5rem !important;
  }

  .logout-link a {
    font-size: 0.85rem !important;
  }

  /* Input/Select em mobile pequeno */
  .input,
  .select select,
  .textarea {
    font-size: 16px !important;
    padding: 0.4rem 0.5rem !important;
    height: auto !important;
    min-height: 44px !important;
    /* Touch target iOS */
  }

  .label {
    font-size: 0.8rem !important;
    margin-bottom: 0.3rem !important;
  }

  .field {
    margin-bottom: 0.75rem !important;
  }

  /* Cards compactos */
  .card {
    max-width: 100% !important;
    margin: 0.5rem !important;
  }

  /* Tabelas com scroll */
  .table-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .table {
    font-size: 0.75rem !important;
    white-space: nowrap;
  }

  /* Notificações */
  .notification {
    padding: 0.75rem !important;
    font-size: 0.85rem !important;
  }

  /* Box responsivo */
  .box {
    width: 95% !important;
    padding: 1rem !important;
    margin: 1rem auto !important;
  }

  html.darkmode .box {
    width: 95% !important;
    padding: 1rem !important;
    margin: 1rem auto !important;
  }

  /* Formulas buttons em coluna */
  .field.is-grouped {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }

  .field.is-grouped-multiline .control {
    width: 100% !important;
  }

  /* Icons reduzidos */
  .icon.is-large {
    width: 2rem !important;
    height: 2rem !important;
  }

  .icon.is-large i {
    font-size: 1.5rem !important;
  }

  /* Modals em mobile */
  .modal {
    position: fixed !important;
  }

  .modal-card {
    margin: 0 !important;
    width: 100% !important;
    max-width: calc(100% - 2rem) !important;
  }
}

/* Ajustes adicionais para garantir consistência */
html.darkmode .control.has-icons-left .icon.is-left {
  color: #6b7280 !important;
}

html.darkmode .field {
  margin-bottom: 1rem;
}

/* Validação de formulário */
.input.is-danger,
html.darkmode .input.is-danger {
  border-color: #f14668 !important;
}

.input.is-success,
html.darkmode .input.is-success {
  border-color: #48c78e !important;
}

/* Mensagens de erro */
.help.is-danger {
  color: #f14668 !important;
}

html.darkmode .help.is-danger {
  color: #fb7185 !important;
}

/* ========== MODO DARK VIA MEDIA QUERY (Automático) ========== */
@media (prefers-color-scheme: dark) {
  .box {
    background: #2b2f3a !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  }

  .has-background-light {
    background-color: #2b2f3a !important;
  }

  .title {
    color: #f0f0f0 !important;
  }

  .has-text-primary {
    color: #4fd1c5 !important;
  }

  .label {
    color: #e0e0e0 !important;
  }

  .input,
  .select select {
    background: #1a1d26 !important;
    border: 1.5px solid #3a3f4f !important;
    color: #e0e0e0 !important;
  }

  .input:focus,
  .select select:focus {
    border-color: #4fd1c5 !important;
    background: #232730 !important;
    box-shadow: 0 0 0 0.125em rgba(79, 209, 197, 0.25) !important;
  }

  .input::placeholder {
    color: #6b7280 !important;
  }

  .select:not(.is-multiple):not(.is-loading)::after {
    border-color: #4fd1c5 !important;
  }

  .file.has-name .file-cta {
    background-color: #1a1d26 !important;
    border: 1.5px solid #3a3f4f !important;
    color: #e0e0e0 !important;
  }

  .file.has-name .file-name {
    background-color: #2b2f3a !important;
    border: 1.5px solid #3a3f4f !important;
    border-left: none !important;
    color: #b0b0b0 !important;
  }

  .file.has-name .file-cta:hover {
    background-color: #232730 !important;
  }

  .button.is-primary {
    background-color: #4fd1c5 !important;
    color: #1a1d26 !important;
  }

  .button.is-primary:hover {
    background-color: #38b2ac !important;
    box-shadow: 0 4px 12px rgba(79, 209, 197, 0.4);
  }

  .icon {
    color: #9ca3af !important;
  }

  .notification.is-success.is-light {
    background-color: #064e3b !important;
    color: #6ee7b7 !important;
  }
}

#dashboard-content {
  /* overflow-y: auto; */
  overflow: visible;
  height: auto;
  max-height: none;
  min-height: 0;
}

#dashboard-content>.column,
#dashboard-content .box,
#dashboard-content .columns:last-child,
#dashboard-content .field:last-child {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* ========== CORREÇÃO DE BARRA DE ROLAGEM DESNECESSÁRIA ========== */

/* Remove scroll desnecessário */
html {
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  overflow-x: hidden !important;
  overflow-y: auto;
  min-height: 100vh;
  max-height: 100vh;
}

/* Corrige altura das colunas principais */
.columns.is-gapless {
  margin: 0 !important;
  height: calc(100vh - 70px);
  max-height: calc(100vh - 70px);
  overflow: hidden;
}

/* Coluna da sidebar */
.columns.is-gapless>.column.is-2 {
  /* height: calc(100vh - 70px);
  max-height: calc(100vh - 70px); */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 !important;
  margin: 0 !important;
}

/* Coluna do conteúdo */
.columns.is-gapless>.column:not(.is-2) {
  height: calc(100vh - 70px);
  max-height: calc(100vh - 70px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 !important;
  margin: 0 !important;
}

/* Dashboard content */
#dashboard-content {
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
  margin: 0;
  display: flex;
  justify-content: center;

}

/* Remove margens extras do container dentro do dashboard */
#dashboard-content .container {
  margin: 0 !important;
  padding: 0 !important;
  max-width: 100% !important;
}

/* Remove padding extra das sections */
#dashboard-content .section {
  padding: 1rem !important;
  margin: 0 !important;
  justify-content: center !important;
  align-items: space-between !important;
}

/* Box do formulário */
#dashboard-content .box {
  margin: 0 !important;
  padding: 1rem !important;
}

/* Colunas dentro do dashboard content */
#dashboard-content>.column,
#dashboard-content .column {
  padding: 0 !important;
  margin: 0 !important;
}

/* Remove margens das colunas do formulário */
#dashboard-content .columns {
  margin: 0 !important;
}

/* Fields sem margem extra na última */
#dashboard-content .field:last-child,
#dashboard-content .columns:last-child {
  margin-bottom: 0 !important;
}

/* Garante que nada ultrapasse */
* {
  box-sizing: border-box;
}

/* Mobile: permite scroll natural */
@media (max-width: 1023px) {
  .columns.is-gapless {
    height: auto;
    max-height: none;
    min-height: calc(100vh - 70px);
  }

  .columns.is-gapless>.column:not(.is-2) {
    height: auto;
    max-height: none;
    min-height: calc(100vh - 70px);
  }
}

/* Remove padding/margin do Bulma que pode causar scroll */
.column {
  padding: 0 !important;
}

.columns {
  margin: 0 !important;
  justify-content: center !important;
  align-items: space-between !important;
  display: flex !important;
}

/* Ajuste específico para o aside do menu */
aside.menu {
  background: #f5f5f5 !important;
  margin: 0 !important;
  padding: 1rem 0 0 0 !important;
}

html.darkmode p {
  color: #fff !important;
}

html.darkmode strong {
  color: #fff !important;
}

html.darkmode table {
  background: none !important;
}

html.darkmode table th {
  background: #2c2f39 !important;
  color: #fff !important;
}

html.darkmode table td {
  color: #fff !important;
  background: none !important;
}

html.darkmode table tr {
  background: none !important;
  color: #fff !important;
}

html.darkmode table tr:nth-child(even) {
  background: #2c2f39 !important;
}

html.darkmode .table.is-bordered td,
html.darkmode .table.is-bordered th {
  border: none !important;
}

.table.is-bordered td,
.table.is-bordered th {
  border: none !important;
}

/* ========== TABELAS RESPONSIVAS ========== */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table-responsive table {
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
}

@media (max-width: 768px) {
  .table-responsive {
    margin: 0 -1rem;
    border-radius: 0;
    box-shadow: none;
  }

  .table {
    min-width: 500px;
  }

  /* Alternativa: stack em mobile */
  .table.table-stack {
    display: block;
    width: 100%;
  }

  .table.table-stack thead {
    display: none;
  }

  .table.table-stack tbody {
    display: block;
    width: 100%;
  }

  .table.table-stack tr {
    display: block;
    border: 1px solid #f5f5f5;
    margin-bottom: 1rem;
    border-radius: 6px;
    overflow: hidden;
  }

  html.darkmode .table.table-stack tr {
    border-color: #2a2d35;
  }

  .table.table-stack td {
    display: block;
    text-align: right;
    padding-left: 50%;
    position: relative;
    border: none;
    border-bottom: 1px solid #f5f5f5;
  }

  html.darkmode .table.table-stack td {
    border-bottom-color: #2a2d35;
  }

  .table.table-stack td:last-child {
    border-bottom: none;
  }

  .table.table-stack td:before {
    content: attr(data-label);
    position: absolute;
    left: 1rem;
    font-weight: 600;
    text-align: left;
    color: #363636;
  }

  html.darkmode .table.table-stack td:before {
    color: #dce3eb;
  }
}

/* ========== IMAGENS RESPONSIVAS ========== */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

figure {
  margin: 0;
}

figure img {
  width: 100%;
}

/* ========== VÍDEOS/IFRAMES RESPONSIVOS ========== */
iframe,
video {
  max-width: 100%;
  height: auto;
}

html.darkmode aside.menu {
  background: #2c2f39 !important;
}

.card-content {
  /* margin-bottom: 1.5rem!important; */
  /* padding: 1rem;
    left: 2%; */
  justify-content: center !important;
}

.box {
  max-width: 750px !important;
  width: 90% !important;
  align-items: center !important;
  padding: 2rem !important;
  margin: 2rem auto !important;
  justify-content: center !important;
}

/* Tablet (768px+) */
@media (min-width: 768px) {
  .box {
    padding: 3rem !important;
    margin: 3rem auto !important;
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .box {
    width: 750px !important;
    padding: 4rem !important;
    margin: 4rem auto !important;
  }
}

html.darkmode .box {
  max-width: 750px !important;
  width: 90% !important;
  align-items: center !important;
  padding: 2rem !important;
  margin: 2rem auto !important;
  justify-content: center !important;
}

@media (min-width: 768px) {
  html.darkmode .box {
    padding: 3rem !important;
    margin: 3rem auto !important;
  }
}

@media (min-width: 1024px) {
  html.darkmode .box {
    width: 750px !important;
    padding: 4rem !important;
    margin: 4rem auto !important;
  }
}

.column.is-4-desktop {
  flex: none;
  width: 280px;
}

.title {
  padding: 1rem !important;
  text-align: center !important;
}

/* .label {
    text-align: center!important;
  }
  .input {
    text-align: center!important;
  }
  .select {
    text-align: center!important;
  } */


.loading-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #3273dc;
}

.loading-spinner .bi {
  font-size: 2rem;
}

.spin {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

input[type="date"] {
  width: 100%;
}

/* ==== CORREÇÃO: permite que as páginas cresçam naturalmente ==== */

/* Área principal do conteúdo (coluna da direita) */
.columns.is-gapless>.column:not(.is-2),
#dashboard-content {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* Garante que o .box acompanhe o crescimento */
#dashboard-content .box {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  margin-bottom: 3rem !important;
}


/* ==== RESTAURA A ROLAGEM GERAL DA PÁGINA ==== */

/* A página inteira deve poder crescer e rolar */
html,
body {
  height: auto !important;
  min-height: 100vh;
  overflow-y: auto !important;
  /* <- habilita scrollbar externo */
  overflow-x: hidden;
}

/* O container de colunas não pode travar em 100vh */
.columns.is-gapless {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* A coluna de conteúdo (direita) deve crescer naturalmente */
.columns.is-gapless>.column:not(.is-2),
#dashboard-content {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  /* sem scrollbar interno */
}

/* O box cresce junto com a página */
#dashboard-content .box {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* (opcional) Se o sidebar precisar rolar sozinho, mantenha assim */
.sidebar-nav {
  max-height: calc(100vh - 70px);
  overflow-y: auto;
  overflow-x: hidden;
}


/* texto dentro dos botoes de acção */
a.button.is-small *,
html.darkmode a.button.is-small *,
html.darkmode a.button.is-small {
  color: #fff !important;
}

/* Desabilitar visualmente datas inválidas no input date (não funciona em todos navegadores) */
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
}

/* Feedback visual para input com erro */
input[type="date"].is-invalid {
  border-color: #ff3860;
  box-shadow: 0 0 0 0.125em rgba(255, 56, 96, 0.25);
}