* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: #F5F5F5;
  color: #212121;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* ---------- Login ---------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1565C0;
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.brand-title {
  font-size: 34px;
  font-weight: 800;
  color: #1565C0;
  text-align: center;
  letter-spacing: 2px;
}

.brand-sub {
  text-align: center;
  color: #757575;
  font-size: 13px;
  margin-bottom: 24px;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #757575;
  margin: 14px 0 4px;
}

input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: #212121;
}

input:focus {
  outline: none;
  border-color: #1565C0;
}

.btn {
  width: 100%;
  padding: 11px 16px;
  margin-top: 14px;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  background: #fff;
  color: #1565C0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn:hover {
  opacity: 0.85;
}

.btn.primary {
  background: #1565C0;
  border-color: #1565C0;
  color: #fff;
}

.btn.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
  width: auto;
  margin-top: 0;
  padding: 6px 14px;
}

.btn.small {
  width: auto;
  margin-top: 0;
  padding: 5px 12px;
  font-size: 12px;
}

.btn.danger {
  border-color: #C62828;
  color: #C62828;
}

.btn.success {
  background: #2E7D32;
  border-color: #2E7D32;
  color: #fff;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.erro {
  color: #C62828;
  font-size: 13px;
  margin-top: 10px;
  padding: 8px 10px;
  background: #FFEBEE;
  border-radius: 6px;
}

.ok {
  color: #2E7D32;
  font-size: 13px;
  margin-top: 10px;
  padding: 8px 10px;
  background: #E8F5E9;
  border-radius: 6px;
}

/* ---------- Layout do app ---------- */

header {
  background: #1565C0;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}

header .brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: 1;
  margin-left: 12px;
}

header .brand-title {
  color: #fff;
  font-size: 22px;
}

header .brand span {
  font-size: 12px;
  opacity: 0.85;
}

.userbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.userbar span {
  font-size: 14px;
  font-weight: 600;
}

.header-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: #eee;
  cursor: pointer;
  white-space: nowrap;
}

.header-check input {
  accent-color: var(--primary);
}

/* ---------- Menu hamburguer / drawer ---------- */

.btn-menu {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 8px;
}

.btn-menu:hover {
  opacity: 0.8;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 90;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  background: #0D47A1;
  color: #fff;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.25);
}

.drawer.aberto {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.drawer-brand {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 2px;
}

.drawer-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  flex: 1;
}

.drawer-nav button {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  text-align: left;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border-left: 4px solid transparent;
}

.drawer-nav button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.drawer-nav button.active {
  color: #fff;
  border-left-color: #FFA000;
  background: rgba(255, 255, 255, 0.08);
}

.drawer-foot {
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.drawer-foot span {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-foot .btn {
  width: auto;
  margin-top: 0;
  padding: 6px 12px;
}

main {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.panel {
  animation: fade 0.2s ease;
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- Filtros / dashboard ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: #fff;
  padding: 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.filters input,
.filters select {
  width: auto;
  flex: 1;
  min-width: 160px;
  padding: 10px 12px;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: #212121;
}

.filters select:focus,
.filters input:focus {
  outline: none;
  border-color: #1565C0;
}

.filters .btn {
  width: auto;
  margin-top: 0;
  padding: 10px 18px;
}

.table-wrap {
  background: #fff;
  border-radius: 10px;
  overflow: auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tbl th {
  background: #1565C0;
  color: #fff;
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  position: sticky;
  top: 0;
}

.tbl td {
  padding: 9px 12px;
  border-bottom: 1px solid #E0E0E0;
}

.tbl tr:nth-child(even) {
  background: #F8F9FA;
}

.tbl .right {
  text-align: right;
}

.tipo {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.tipo-entrada { background: #E8F5E9; color: #2E7D32; }
.tipo-ida { background: #FFF8E1; color: #F57F17; }
.tipo-volta { background: #E3F2FD; color: #1565C0; }
.tipo-saida { background: #FFEBEE; color: #C62828; }
.tipo-outro { background: #EEEEEE; color: #757575; }

.vazio {
  text-align: center;
  color: #757575;
  padding: 30px 0;
  font-size: 14px;
}

/* ---------- Banco de Horas ---------- */

.b-resumo {
  margin-top: 14px;
  padding: 12px 16px;
  background: #E3F2FD;
  border-radius: 8px;
  border: 1px solid #BBDEFB;
}

.b-resumo-linha {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.b-resumo-detalhe {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 13px;
  color: #424242;
}

.banco-pos {
  color: #2E7D32;
  font-weight: 700;
}

.banco-neg {
  color: #C62828;
  font-weight: 700;
}

/* ---------- Cards ---------- */

.card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.card h2 {
  font-size: 16px;
  color: #1565C0;
  margin-bottom: 6px;
}

.card h3 {
  font-size: 14px;
  margin: 16px 0 6px;
}

/* ---------- Abas (cadastros) ---------- */

.tabs {
  display: flex;
  gap: 6px;
  background: #fff;
  padding: 8px;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  flex-wrap: wrap;
}

.tab {
  background: transparent;
  border: none;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #424242;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.tab:hover {
  background: #E3F2FD;
  color: #1565C0;
}

.tab.active {
  background: #1565C0;
  color: #fff;
}

.cad-pane {
  background: #F5F5F5;
  padding-top: 16px;
}

/* ---------- Modal de confirmação ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.modal-card h3 {
  font-size: 17px;
  color: #1565C0;
  margin-bottom: 8px;
}

.modal-card p {
  font-size: 14px;
  color: #424242;
  margin-bottom: 4px;
}

.modal-acoes {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.modal-acoes .btn {
  width: auto;
  margin-top: 0;
}

.hint {
  font-size: 12px;
  color: #757575;
  margin-bottom: 12px;
}

code {
  background: #EEEEEE;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.token-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.token-row input {
  flex: 1;
}

.token-row .btn {
  width: auto;
  margin-top: 0;
  white-space: nowrap;
}

.status {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  background: #EEEEEE;
  color: #757575;
}

.status.ok {
  background: #E8F5E9;
  color: #2E7D32;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  font-size: 14px;
  font-weight: 500;
  color: #212121;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  width: auto;
  padding: 0;
  accent-color: #1565C0;
}

.status.erro {
  background: #FFEBEE;
  color: #C62828;
}

.status.aviso {
  background: #FFF3E0;
  color: #E65100;
}

@media (max-width: 480px) {
  .filters input {
    min-width: 100%;
  }
  header {
    flex-direction: column;
    gap: 8px;
  }
}
