/* Estilos mínimos para o layout quando o CSS principal não estiver disponível */
html, body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f7f8fa;
  color: #333;
}

/* Garantir cálculo de dimensões consistente */
*, *::before, *::after { box-sizing: border-box; }

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 16px;
}

/* Header */
header, .header-container {
  background-color: #4D5F86;
  color: #fff;
}
.header-container { position: relative; }
.logo-container img { display: block; margin: 0 auto; }

/* Formulários */
.form-control {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 6px;
  outline: none;
  background: #fff;
}
.form-control:focus {
  border-color: #4D5F86;
  box-shadow: 0 0 0 3px rgba(77,95,134,0.15);
}

.btn {
  background: #4D5F86;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: filter .2s ease;
}
.btn:hover { filter: brightness(1.05); }

/* Cartão de login */
.login-card {
  width: 100%;
  max-width: 900px;
  margin: 30px auto;
  background: #fff;
  padding: 20px 22px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.05);
  overflow: hidden;
}
.login-card h2 {
  margin: 0 0 10px 0;
  font-weight: 600;
  color: #4D5F86;
  text-align: center;
}
.login-card .form-group { margin-bottom: 12px; }
.login-card .form-control { width: 100%; }
.login-card .actions { text-align: center; margin-top: 10px; }
.login-card .helper { text-align: center; margin-top: 8px; }
.login-card .helper a { color: #4D5F86; text-decoration: none; }
.login-card .helper a:hover { text-decoration: underline; }

/* Alerts */
.alert {
  padding: 10px 12px;
  border-radius: 6px;
  margin: 10px 0;
}
.alert-success { background: #e6f4ea; color: #0f5132; }
.alert-danger  { background: #f8d7da; color: #842029; }

/* Menu hambúrguer e sidebar */
.hamburger-menu { position: relative; }
.menu-toggle { width: 30px; cursor: pointer; margin: 8px 12px; position: absolute; left: 12px; top: 12px; z-index: 1101; }
.menu-toggle span {
  display: block;
  height: 3px;
  background: #fff;
  margin: 5px 0;
  border-radius: 2px;
}
.sidebar {
  position: fixed;
  top: 0;
  left: -260px;
  width: 240px;
  height: 100vh;
  background: #334566;
  color: #fff;
  box-shadow: 2px 0 8px rgba(0,0,0,0.15);
  transition: left .25s ease;
  padding-top: 60px;
  z-index: 1000;
}
.sidebar.active { left: 0; }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar ul li { border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar ul li a {
  display: block;
  color: #fff;
  text-decoration: none;
  padding: 12px 16px;
}
.sidebar ul li a:hover { background: rgba(255,255,255,0.08); }

/* Footer */
footer { background: #f1f2f6; color: #333; margin-top: 20px; }
.footer-content { padding: 16px; }
.footer-copyright { text-align: center; padding: 10px; font-size: 12px; }

@media (max-width: 480px) {
  .login-card { margin: 15px auto; padding: 16px; }
}

/* Dashboard grid 10x20 */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(100px, 1fr));
  grid-auto-rows: minmax(40px, auto);
  gap: 8px;
  margin-top: 16px;
}
.grid-row-label {
  grid-column: 1 / -1;
  padding: 6px 8px;
  background: rgba(77,95,134,0.08);
  color: #4D5F86;
  border-radius: 6px;
  font-weight: 600;
}
.grid-cell {
  border: 1px dashed rgba(0,0,0,0.15);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.8);
  padding: 6px;
  min-height: 40px;
}
.btn-grid {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 4px;
  background: #17a2b8;
  color: #fff;
  text-decoration: none;
  max-width: 100%;
  white-space: normal;
}
.btn-grid .btn-icon { margin-right: 6px; display: inline-block; }
.btn-grid:hover {
  background: #138496;
}
.grid-empty {
  color: transparent;
}