@keyframes crypto-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes sg-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sg-login-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sg-login-pan {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-1.5%, 1%, 0) scale(1.03); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}

.crypto-float {
  animation: crypto-float 5s ease-in-out infinite;
}

.sg-login-rise {
  animation: sg-login-rise 560ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sg-login-rise-delay-1 { animation-delay: 80ms; }
.sg-login-rise-delay-2 { animation-delay: 160ms; }
.sg-login-rise-delay-3 { animation-delay: 240ms; }

.sg-login-page {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

.sg-login-hero {
  background:
    radial-gradient(900px 520px at 18% 12%, rgba(14, 165, 233, 0.28), transparent 55%),
    radial-gradient(700px 480px at 88% 78%, rgba(56, 189, 248, 0.14), transparent 50%),
    linear-gradient(160deg, #07111f 0%, #0F172A 48%, #0B2740 100%);
}

.sg-login-hero-mesh {
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 40% 30%, black 20%, transparent 72%);
  animation: sg-login-pan 18s ease-in-out infinite;
}

.sg-login-mock {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 24px 60px rgba(0, 0, 0, 0.35);
}

.sg-pwa-banner,
.sg-pwa-hero {
  animation: sg-login-rise 560ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sg-pwa-banner .sg-btn,
.sg-pwa-hero a {
  white-space: nowrap;
}

html {
  scroll-behavior: smooth;
}

::selection {
  background: rgba(14, 165, 233, 0.25);
}

[x-cloak] {
  display: none !important;
}

.sg-app-bg {
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(14, 165, 233, 0.08), transparent 55%),
    radial-gradient(900px 400px at 100% 0%, rgba(15, 23, 42, 0.04), transparent 50%),
    #f8fafc;
  transition: background-color 200ms ease;
}

.dark .sg-app-bg {
  background:
    radial-gradient(1000px 480px at 0% -10%, rgba(14, 165, 233, 0.10), transparent 55%),
    radial-gradient(800px 360px at 100% 0%, rgba(56, 189, 248, 0.05), transparent 50%),
    #020617;
}

.sg-surface {
  border-radius: 1rem;
  border: 1px solid rgb(226 232 240);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 200ms ease, background-color 200ms ease, box-shadow 200ms ease;
}

.dark .sg-surface {
  border-color: rgb(30 41 59);
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.sg-surface-hover {
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.sg-surface-hover:hover {
  border-color: rgb(203 213 225);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.dark .sg-surface-hover:hover {
  border-color: rgb(51 65 85);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.sg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.75rem;
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.sg-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.35);
}

.sg-btn:active {
  transform: translateY(1px);
}

.sg-btn-primary {
  background: #0EA5E9;
  color: #fff;
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.25);
}

.sg-btn-primary:hover {
  background: #0284C7;
}

.sg-btn-dark {
  background: #0F172A;
  color: #fff;
}

.sg-btn-dark:hover {
  background: #1E293B;
}

.dark .sg-btn-dark {
  background: #0EA5E9;
  color: #0F172A;
}

.dark .sg-btn-dark:hover {
  background: #38BDF8;
}

.sg-btn-ghost {
  border: 1px solid rgb(226 232 240);
  background: transparent;
  color: inherit;
}

.sg-btn-ghost:hover {
  border-color: #0EA5E9;
  color: #0284C7;
}

.dark .sg-btn-ghost {
  border-color: rgb(51 65 85);
}

.dark .sg-btn-ghost:hover {
  border-color: #0EA5E9;
  color: #38BDF8;
}

.sg-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.75rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(203 213 225);
  transition: background-color 140ms ease, color 140ms ease;
}

.sg-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.sg-nav-item:hover .sg-nav-icon {
  background: rgba(14, 165, 233, 0.18);
  color: #38BDF8;
}

.sg-nav-item-active {
  background: rgba(14, 165, 233, 0.14);
  color: #38BDF8;
}

.sg-nav-item-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  border-radius: 999px;
  background: #0EA5E9;
}

.sg-nav-item-active .sg-nav-icon {
  background: rgba(14, 165, 233, 0.22);
  color: #38BDF8;
}

.sg-nav-icon {
  display: inline-flex;
  height: 2rem;
  width: 2rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 0.625rem;
  background: rgba(255, 255, 255, 0.05);
  color: rgb(148 163 184);
  transition: background-color 140ms ease, color 140ms ease;
}

.sg-menu-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.875rem;
  transition: background-color 120ms ease;
}

.sg-menu-item:hover {
  background: rgb(248 250 252);
}

.dark .sg-menu-item:hover {
  background: rgb(30 41 59);
}

.sg-menu-icon {
  display: inline-flex;
  height: 1.5rem;
  width: 1.5rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  color: rgb(100 116 139);
}

.dark .sg-menu-icon {
  color: rgb(148 163 184);
}

.sg-kpi {
  position: relative;
  overflow: hidden;
  animation: sg-fade-up 360ms ease both;
}

.sg-kpi::after {
  content: "";
  position: absolute;
  inset: auto -20% -40% auto;
  width: 7rem;
  height: 7rem;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.08);
  pointer-events: none;
}

.sg-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.sg-badge-neutral {
  background: rgba(255, 255, 255, 0.06);
  color: rgb(51 65 85);
}

.dark .sg-badge-neutral {
  background: rgb(30 41 59);
  color: rgb(203 213 225);
}

.sg-badge-cyan {
  background: rgba(14, 165, 233, 0.12);
  color: #0EA5E9;
}

.dark .sg-badge-cyan {
  background: rgba(14, 165, 233, 0.18);
  color: #7DD3FC;
}

.sg-badge-amber {
  background: rgba(245, 158, 11, 0.12);
  color: #B45309;
}

.dark .sg-badge-amber {
  background: rgba(245, 158, 11, 0.16);
  color: #FCD34D;
}

.sg-badge-emerald {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.dark .sg-badge-emerald {
  background: rgba(16, 185, 129, 0.16);
  color: #6EE7B7;
}

.sg-badge-red {
  background: rgba(239, 68, 68, 0.12);
  color: #B91C1C;
}

.dark .sg-badge-red {
  background: rgba(239, 68, 68, 0.16);
  color: #FCA5A5;
}

.sg-input {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  padding: 0.55rem 0.85rem;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.sg-input:focus,
.sg-input:focus-visible {
  border-color: #0ea5e9;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.dark .sg-input {
  border-color: #334155;
  background: #0f172a;
  color: #f1f5f9;
}

.dark .sg-input:focus,
.dark .sg-input:focus-visible {
  border-color: #38bdf8;
  background: #020617;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.sg-input::placeholder {
  color: rgb(148 163 184);
}

dialog.sg-dialog,
#modal-atividade {
  color-scheme: light dark;
}

#modal-atividade .sg-input {
  color-scheme: inherit;
}

.sg-table-wrap {
  overflow-x: auto;
}

.sg-table {
  width: 100%;
  min-width: 640px;
  font-size: 0.875rem;
}

.sg-table thead {
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgb(100 116 139);
}

.dark .sg-table thead {
  background: rgba(2, 6, 23, 0.55);
  color: rgb(148 163 184);
}

.sg-table th,
.sg-table td {
  padding: 0.85rem 1.15rem;
}

.sg-table tbody tr {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  transition: background-color 120ms ease;
}

.dark .sg-table tbody tr {
  border-top-color: rgb(30 41 59);
}

.sg-table tbody tr:hover {
  background: rgba(248, 250, 252, 0.9);
}

.dark .sg-table tbody tr:hover {
  background: rgba(30, 41, 59, 0.45);
}

.sg-sidebar-scroll::-webkit-scrollbar {
  width: 6px;
}

.sg-sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 999px;
}

dialog.sg-evidencia-viewer {
  width: min(96vw, 56rem);
  max-height: 92vh;
  margin: auto;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.45);
}

dialog.sg-evidencia-viewer::backdrop {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(4px);
}

.dark dialog.sg-evidencia-viewer {
  border-color: rgb(51 65 85);
  background: #0f172a;
  color: #e2e8f0;
}

.sg-evidencia-viewer__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.dark .sg-evidencia-viewer__bar {
  border-bottom-color: rgb(30 41 59);
}

.sg-evidencia-viewer__title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  font-size: 0.875rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sg-evidencia-viewer__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .sg-evidencia-viewer__bar {
    flex-wrap: wrap;
  }

  .sg-evidencia-viewer__title {
    flex: 1 1 100%;
  }

  .sg-evidencia-viewer__actions {
    width: 100%;
    justify-content: flex-end;
  }
}

.sg-evidencia-viewer__open,
.sg-evidencia-viewer__close,
.sg-evidencia-viewer__file a {
  border-radius: 0.65rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}

.sg-evidencia-viewer__open,
.sg-evidencia-viewer__file a {
  color: #0284c7;
  border: 1px solid rgba(14, 165, 233, 0.35);
  background: #fff;
}

.sg-evidencia-viewer__close {
  border: none;
  background: #0EA5E9;
  color: #fff;
  cursor: pointer;
}

.sg-evidencia-viewer__body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  max-height: calc(92vh - 4rem);
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
}

.dark .sg-evidencia-viewer__body {
  background: rgb(2 6 23);
}

.sg-evidencia-viewer__img {
  max-width: 100%;
  max-height: calc(92vh - 5.5rem);
  object-fit: contain;
  border-radius: 0.5rem;
}

.sg-evidencia-viewer__pdf {
  width: 100%;
  height: calc(92vh - 5.5rem);
  min-height: 60vh;
  border: 0;
  border-radius: 0.5rem;
  background: #fff;
}

.sg-evidencia-viewer__file {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.875rem;
  color: #64748b;
}

.sg-evidencia-viewer__file p {
  margin: 0 0 0.75rem;
}

.sg-evidencia-thumb {
  cursor: zoom-in;
}

.sg-evidencia-doc {
  cursor: pointer;
}
