/* Estilos Gerais - Base do Sistema */

* {
  box-sizing: border-box;
}

body {
  background: #1a202c;
  color: #fff;
  min-height: 100vh;
  display: flex;
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Menu Hambúrguer */
.menu-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1001;
  background: #2d3748;
  border: none;
  color: #fff;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: background 0.2s;
}

.menu-toggle:hover {
  background: #4a5568;
}

@media (max-width: 800px) {
  body {
    flex-direction: column;
  }

  .menu-toggle {
    display: block;
  }
}

aside {
  width: 260px;
  background: #2d3748;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (max-width: 800px) {
  aside {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100vw;
    height: 100vh;
    padding: 60px 16px 16px 16px;
    gap: 12px;
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  aside.open {
    left: 0;
  }

  aside h1 {
    font-size: 1.5rem;
  }
}

aside h1 {
  font-size: 2rem;
  font-weight: bold;
  text-align: center;
}

nav button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: #fff;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 8px;
}

nav button:hover {
  background: #4a5568;
}

main {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  overflow-x: hidden;
  width: 0;
  min-width: 0;
}

@media (max-width: 800px) {
  main {
    padding: 60px 12px 16px 12px;
    width: 100%;
    min-width: 0;
  }
}

.tab-section {
  display: none;
}

.tab-section.active {
  display: block;
}

form input,
form button {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: none;
  margin-bottom: 8px;
}

form input {
  background: #2d3748;
  color: #fff;
}

form button {
  background: #17acaf;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
}

form button:hover {
  background: #17acaf22;
}

ul {
  margin-top: 16px;
  list-style: none;
  padding: 0;
}

/* Overlay para fechar menu */
.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

@media (max-width: 800px) {
  .menu-overlay.active {
    display: block;
    width: 100vw;
    height: 100vh;
  }
}

/* Responsividade geral para formulários */
@media (max-width: 600px) {
  body {
    overflow-x: hidden;
  }
  
  main {
    padding: 60px 8px 16px 8px;
  }
}

@media (max-width: 480px) {
  form input,
  form button {
    padding: 12px;
    font-size: 1rem;
  }
}

/* Touch targets para mobile */
@media (max-width: 800px) {
  nav button {
    padding: 16px 12px;
    font-size: 1rem;
    margin-bottom: 12px;
    min-height: 48px;
    display: flex;
    align-items: center;
  }
  
  /* Espaçamento extra para o último botão */
  nav button:last-child {
    margin-bottom: 20px;
  }
  
  /* Melhor espaçamento para filtros no mobile */
  .filtro-container {
    padding-bottom: 16px;
    border-bottom: 1px solid #4a5568;
    margin-bottom: 16px;
  }
  
  .filtro-container label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.9rem;
  }
  
  .filtro-container select,
  .filtro-container button {
    margin-bottom: 8px;
    padding: 12px;
    font-size: 1rem;
  }
}

/* Estilo para logo OrganizaMEI */
.logo-organizamei {
  max-width: 100%;
  height: auto;
  padding: 0px;
  border-radius: 6px;
  border: 1px solid #17acaf;
}

.version-info {
  text-align: right;
  margin-top: 30px;
  color: #666;
  font-style: italic;
  font-size: 11px;
}


/* PWA Fullscreen Support */
@supports (padding: max(0px)) {
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* Prevent pull-to-refresh on PWA */
body {
  overscroll-behavior-y: contain;
}

/* Hide scrollbars in PWA mode */
@media all and (display-mode: fullscreen), (display-mode: standalone) {
  ::-webkit-scrollbar {
    width: 0px;
    background: transparent;
  }

  /* Improve touch scrolling */
  main {
    -webkit-overflow-scrolling: touch;
  }

  /* Prevent text selection on UI elements */
  nav button, .menu-toggle {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }
}
/* Customização do Notyf para o tema escuro */
.notyf__toast {
  background: #2d3748 !important;
  border: 1px solid #4a5568 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
  padding: 0px !important;
  min-height: 16px !important;
  max-width: 200px !important;
  margin-top: 60px !important;
  border-radius: 0px !important;
  color: #3498db !important;
}

.notyf__toast--success {
  background: #2d3748 !important;
  border-left: 2px solid #38a169 !important;
}

.notyf__toast--error {
  background: #2d3748 !important;
  border-left: 2px solid #e53e3e !important;
}

.notyf__toast--warning {
  background: #2d3748 !important;
  border-left: 2px solid #ecc94b !important;
}

.notyf__message {
  color: #e2e8f0 !important;
  font-size: 0.55rem !important;
  line-height: 1.1 !important;
  font-weight: 400 !important;
}

.notyf__toast--warning .notyf__message {
  color: #1a202c !important;
}

.notyf__icon {
  width: 8px !important;
  height: 8px !important;
  margin-right: 2px !important;
}

.notyf__icon--success {
  background: #38a169 !important;
}

.notyf__icon--error {
  background: #e53e3e !important;
}

.notyf__icon--warning {
  background: #ecc94b !important;
}

/* Responsivo para mobile */
@media (max-width: 800px) {
  .notyf__toast {
    margin-top: 50px !important;
    max-width: 100px !important;
    padding: 1px 3px !important;
  }
  
  .notyf__message {
    font-size: 0.5rem !important;
  }
  
  .notyf__icon {
    width: 6px !important;
    height: 6px !important;
    margin-right: 1px !important;
  }
}

@media (max-width: 480px) {
  .notyf__toast {
    margin-top: 45px !important;
    max-width: 80px !important;
    padding: 1px 2px !important;
  }
  
  .notyf__message {
    font-size: 0.45rem !important;
  }
  
  .notyf__icon {
    width: 5px !important;
    height: 5px !important;
    margin-right: 1px !important;
  }
}

/* Indicador Mini Sempre Ativo */
.mini-sync-indicator {
  position: fixed;
  top: 30px;
  right: 30px;
  z-index: 9999;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.mini-sync-dot {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #ecc94b;
  transition: all 0.3s ease;
}

.mini-sync-indicator:hover .mini-sync-dot {
  transform: scale(1.3);
}

.mini-sync-indicator.success .mini-sync-dot {
  background: #38a169;
}

.mini-sync-indicator.error .mini-sync-dot {
  background: #e53e3e;
  animation: pulse 2s infinite;
}

.mini-sync-indicator.syncing .mini-sync-dot {
  background: #17acaf;
  animation: spin 1s linear infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 800px) {
  .mini-sync-indicator {
    top: 30px;
    right: 30px;
    width: 15px;
    height: 15px;
  }
}

@media (max-width: 480px) {
  .mini-sync-indicator {
    top: 25px;
    right: 25px;
    width: 15px;
    height: 15px;
  }
}