:root {
  --azul: #1266B5;
  --azul-escuro: #0E4E8C;
  --azul-claro: #4FC1E9;
  --fundo: #FBFCFD;
  --linha: #E6EBF0;
  --texto: #3A4653;
  --texto-suave: #8A96A3;
  --placeholder: #AAB5C1;
  --topbar-h: 62px;
  --sidebar-w: 62px;
}

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

html, body { height: 100%; }

body {
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--texto);
  background: var(--fundo);
  overflow: hidden;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
}

/* ---------- Barra de progresso (dashboard) ---------- */
.progress-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: #DDEAF5;
  overflow: hidden;
  z-index: 40;
  display: none;
}
.page-dashboard .progress-bar { display: block; }
.progress-bar span {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, var(--azul-claro), var(--azul));
  border-radius: 3px;
  animation: indeterminate 1.2s ease-in-out infinite;
}
@keyframes indeterminate {
  0%   { left: -40%; width: 40%; }
  50%  { left: 30%;  width: 55%; }
  100% { left: 100%; width: 40%; }
}

/* ---------- Barra superior ---------- */
.topbar {
  flex: 0 0 var(--topbar-h);
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--linha);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px 0 calc(var(--sidebar-w) + 34px);
}
.topbar-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--azul);
  letter-spacing: .2px;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-icon {
  width: 34px; height: 34px;
  border: none; background: transparent; cursor: pointer;
  border-radius: 8px; display: grid; place-items: center;
}
.topbar-icon:hover { background: #F2F6FA; }
.topbar-icon svg { width: 22px; height: 22px; fill: #7C8896; }

/* ---------- Layout ---------- */
.layout { flex: 1 1 auto; display: flex; min-height: 0; }

/* ---------- Sidebar ---------- */
.sidebar {
  flex: 0 0 var(--sidebar-w);
  background: var(--azul);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0 16px;
  gap: 6px;
}
.side-btn {
  width: 44px; height: 44px;
  border: none; background: transparent; cursor: pointer;
  border-radius: 10px;
  display: grid; place-items: center;
  transition: background .15s;
}
.side-btn:hover { background: rgba(255, 255, 255, .16); }
.side-btn svg { width: 22px; height: 22px; fill: #fff; }
.side-btn.menu svg { width: 25px; height: 25px; }
.side-sep {
  width: 32px; height: 1px;
  background: rgba(255, 255, 255, .3);
  margin: 8px 0;
}
.side-spacer { flex: 1 1 auto; }

/* ---------- Main ---------- */
.main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 50% 45%, #FFFFFF 0%, #F7FAFC 100%);
}

/* Sub-cabeçalho */
.subheader {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 30px 8px;
}
.subheader-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--texto-suave);
}
.subheader-right { display: flex; align-items: center; gap: 16px; }

.search-box {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--linha);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}
.search-box input {
  width: 210px;
  padding: 10px 12px;
  border: none;
  outline: none;
  font-size: 13.5px;
  color: var(--texto);
}
.search-box input::placeholder { color: var(--placeholder); }
.search-btn {
  width: 40px; height: 38px;
  border: none;
  border-left: 1.5px solid var(--linha);
  background: #fff;
  cursor: pointer;
  display: grid; place-items: center;
}
.search-btn:hover { background: #F5F8FB; }
.search-btn svg { width: 18px; height: 18px; fill: #8A96A3; }

.moov-logo svg { display: block; }
.moov-logo.small svg { width: 128px; height: 52px; }
.moov-logo.big svg { width: 320px; height: 128px; }

/* ---------- Palco central ---------- */
.stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 8px 24px;
  gap: 10px;
}
.dash-stage { gap: 6px; }

.welcome-line {
  font-size: 20px;
  color: #44515F;
  letter-spacing: .2px;
}
.welcome-line strong { color: var(--azul); font-weight: 700; }

/* ---------- Card de login ---------- */
.login-card {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(18, 102, 181, .10), 0 2px 6px rgba(18, 102, 181, .05);
  padding: 26px 40px 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}
.login-card .moov-logo.big { margin-bottom: 4px; }
.login-card .welcome-line { margin-bottom: 22px; }

.login-form { width: 100%; }

.input-group {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  border: 1.5px solid #DCE3EA;
  border-radius: 8px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.input-group:focus-within {
  border-color: var(--azul);
  box-shadow: 0 0 0 3px rgba(18, 102, 181, .12);
}
.input-group.invalid { border-color: #D64545; }
.input-icon {
  width: 46px;
  display: grid; place-items: center;
  flex: 0 0 46px;
}
.input-icon svg { width: 20px; height: 20px; fill: #8A96A3; }
.input-group input {
  flex: 1 1 auto;
  border: none;
  outline: none;
  padding: 15px 12px 15px 0;
  font-size: 15px;
  color: var(--texto);
  background: transparent;
}
.input-group input::placeholder { color: var(--placeholder); }
.eye-btn {
  width: 46px; height: 46px;
  border: none; background: transparent; cursor: pointer;
  display: grid; place-items: center;
}
.eye-btn svg { width: 20px; height: 20px; fill: #8A96A3; }
.eye-btn:hover svg { fill: var(--azul); }

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 22px;
}
.check {
  display: flex; align-items: center; gap: 9px;
  font-size: 14px; color: #4A5663; cursor: pointer;
}
.check input {
  width: 18px; height: 18px;
  accent-color: var(--azul);
  border-radius: 4px;
}
.link-forgot { font-size: 14px; color: var(--azul); text-decoration: none; font-weight: 500; }
.link-forgot:hover { text-decoration: underline; }

.btn-enter {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px;
  background: var(--azul);
  color: #fff;
  border: none; border-radius: 8px;
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.btn-enter:hover { background: var(--azul-escuro); }
.btn-enter svg { width: 20px; height: 20px; fill: #fff; transition: transform .15s; }
.btn-enter:hover svg { transform: translateX(3px); }
.btn-enter:disabled { opacity: .7; cursor: progress; }

/* ---------- Loading overlay (dashboard) ---------- */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(251, 252, 253, .82);
  backdrop-filter: blur(1.5px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 5;
  transition: opacity .3s;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }

.loader-spinner {
  width: 46px; height: 46px;
  border: 4px solid #DCEAF6;
  border-top-color: var(--azul);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  font-size: 15px;
  color: #5A6773;
  font-weight: 500;
}

.skeleton-table {
  width: 320px;
  margin-top: 8px;
  display: grid;
  gap: 9px;
}
.sk-row {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #EAF1F8 25%, #F5F9FD 50%, #EAF1F8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.sk-head { height: 20px; width: 60%; }
.sk-row:nth-child(3) { width: 92%; }
.sk-row:nth-child(4) { width: 78%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Ilustrações ---------- */
.illustrations {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: 0 34px 10px;
}
.illu-card {
  flex: 1 1 0;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.illu { width: 100%; max-width: 260px; height: auto; }
.illu-card figcaption {
  font-size: 12px;
  color: var(--texto-suave);
  margin-top: -2px;
  white-space: nowrap;
}

/* ---------- Responsivo ---------- */
@media (max-width: 960px) {
  .subheader-title { display: none; }
  .search-box input { width: 150px; }
  .moov-logo.big svg { width: 240px; height: 96px; }
  .login-card { padding: 22px 26px 28px; }
}
@media (max-width: 700px) {
  .illustrations { gap: 4px; padding: 0 12px 8px; }
  .illu-card figcaption { font-size: 10.5px; }
  .welcome-line { font-size: 17px; }
}
