/* Painel corporativo — Seu Escudo de Chamadas */
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Instrument+Sans:wght@500;600;700&display=swap");

:root {
  --ink: #0c1a24;
  --ink-soft: #3d5163;
  --muted: #6b7f90;
  --line: rgba(12, 26, 36, 0.08);
  --teal: #1aa88f;
  --teal-dark: #0b6b5c;
  --teal-glow: rgba(26, 168, 143, 0.14);
  --surface: #ffffff;
  --canvas: #eef3f6;
  --canvas-2: #e4ecef;
  --warn: #c98512;
  --danger: #c43d4b;
  --sidebar-w: 248px;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(12, 26, 36, 0.04), 0 12px 32px rgba(12, 26, 36, 0.06);
  --shadow-hover: 0 4px 8px rgba(12, 26, 36, 0.04), 0 18px 40px rgba(12, 26, 36, 0.09);
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Instrument Sans", "DM Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

.hub-body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  background:
    radial-gradient(ellipse 80% 50% at 0% 0%, rgba(26, 168, 143, 0.09), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(12, 26, 36, 0.05), transparent 50%),
    linear-gradient(180deg, var(--canvas) 0%, var(--canvas-2) 100%);
  background-attachment: fixed;
}

/* ——— Shell: sidebar + conteúdo ——— */
.admin-shell {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem 1.1rem;
  color: #e8f4f1;
  background:
    linear-gradient(165deg, #0a3d36 0%, #0c1a24 48%, #0a1620 100%);
  box-shadow: 4px 0 32px rgba(12, 26, 36, 0.18);
}

.admin-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.5rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1rem;
}

.admin-sidebar__logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px;
}

.admin-sidebar__brand-text {
  min-width: 0;
}

.admin-sidebar__product {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #fff;
}

.admin-sidebar__tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(159, 227, 212, 0.75);
  margin-top: 2px;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  overflow-y: auto;
  padding: 0 0.25rem;
}

.admin-nav__label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.35);
  padding: 0.85rem 0.75rem 0.4rem;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  color: rgba(232, 244, 241, 0.82);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.admin-nav a i {
  font-size: 1.15rem;
  opacity: 0.9;
  width: 1.25rem;
  text-align: center;
}

.admin-nav a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.admin-nav a.is-active {
  background: linear-gradient(135deg, rgba(26, 168, 143, 0.35), rgba(26, 168, 143, 0.15));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(26, 168, 143, 0.35);
}

.admin-sidebar__foot {
  margin-top: auto;
  padding: 1rem 0.5rem 0.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-sidebar__status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: rgba(232, 244, 241, 0.7);
  padding: 0.5rem 0.35rem;
}

.admin-sidebar__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3dd6a5;
  box-shadow: 0 0 0 3px rgba(61, 214, 165, 0.25);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(61, 214, 165, 0.2); }
  50% { box-shadow: 0 0 0 5px rgba(61, 214, 165, 0.08); }
}

.admin-sidebar__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.admin-sidebar__links a {
  font-size: 0.72rem;
  color: rgba(159, 227, 212, 0.85);
  text-decoration: none;
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
}

.admin-sidebar__links a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.admin-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  padding: 1.5rem 1.75rem 3rem;
}

/* Mobile bar */
.admin-mobile-bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 30;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin: -1.5rem -1rem 1.25rem;
  background: rgba(12, 26, 36, 0.92);
  backdrop-filter: blur(12px);
  color: #fff;
}

.admin-mobile-bar img {
  height: 28px;
  width: auto;
  filter: brightness(0) invert(1);
}

.admin-menu-btn {
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.admin-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(12, 26, 36, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

body.nav-open .admin-sidebar-backdrop {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* Page intro */
.page-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  animation: fade-up 0.45s ease both;
}

.page-intro__eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-dark);
  margin-bottom: 0.35rem;
}

.page-intro__title {
  font-family: var(--display);
  font-size: clamp(1.45rem, 2.5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 0.35rem;
  color: var(--ink);
}

.page-intro__desc {
  margin: 0;
  color: var(--ink-soft);
  max-width: 36rem;
  font-size: 0.95rem;
}

.page-intro__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(12, 26, 36, 0.04);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.meta-chip--ok {
  background: var(--teal-glow);
  border-color: rgba(26, 168, 143, 0.25);
  color: var(--teal-dark);
}

.meta-chip--alert {
  background: rgba(196, 61, 75, 0.08);
  border-color: rgba(196, 61, 75, 0.2);
  color: var(--danger);
}

/* Section titles */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.25rem 0 0.35rem;
  padding-top: 0.35rem;
}

.section-head h2 {
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

/* Finance KPIs */
.hub-finance-cards {
  margin-bottom: 0.15rem;
}

.hub-finance-card {
  position: relative;
  overflow: hidden;
  min-height: 148px;
  padding: 1.35rem 1.4rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  animation: fade-up 0.5s ease both;
}

.hub-finance-card:nth-child(1) { animation-delay: 0.05s; }
.hub-finance-card:nth-child(2) { animation-delay: 0.1s; }
.hub-finance-card:nth-child(3) { animation-delay: 0.15s; }

.hub-finance-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.hub-finance-card::after {
  content: "";
  position: absolute;
  right: -20px;
  top: -20px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  opacity: 0.35;
  pointer-events: none;
}

.hub-finance-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.85rem;
  background: rgba(255, 255, 255, 0.55);
}

.hub-finance-card--green {
  background: linear-gradient(145deg, #edf8f4 0%, #d4f0e6 55%, #c5e9db 100%);
  border-color: rgba(26, 168, 143, 0.18);
}

.hub-finance-card--green::after {
  background: #1aa88f;
}

.hub-finance-card--yellow {
  background: linear-gradient(145deg, #fff9ed 0%, #ffefd0 55%, #ffe8b8 100%);
  border-color: rgba(201, 133, 18, 0.18);
}

.hub-finance-card--yellow::after {
  background: #e6a82a;
}

.hub-finance-card--pink {
  background: linear-gradient(145deg, #fff5f6 0%, #fde4e7 55%, #f9d0d6 100%);
  border-color: rgba(196, 61, 75, 0.15);
}

.hub-finance-card--pink::after {
  background: #c43d4b;
}

.hub-finance-card__title {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

.hub-finance-card--green .hub-finance-card__title { color: #0b6b5c; }
.hub-finance-card--yellow .hub-finance-card__title { color: #9a6410; }
.hub-finance-card--pink .hub-finance-card__title { color: #a32e3a; }

.hub-finance-card__value {
  font-family: var(--display);
  font-size: clamp(1.55rem, 2.4vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.4rem;
  color: var(--ink);
}

.hub-finance-card--green .hub-finance-card__value { color: #0a4f44; }
.hub-finance-card--yellow .hub-finance-card__value { color: #7a4e0c; }
.hub-finance-card--pink .hub-finance-card__value { color: #8e2430; }

.hub-finance-card__meta {
  font-size: 0.8rem;
  color: var(--ink-soft);
  opacity: 0.9;
  margin: 0;
}

/* Cards */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--surface);
  transition: box-shadow 0.2s ease;
  animation: fade-up 0.5s ease both;
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

.card-header {
  background: transparent;
  padding: 1.15rem 1.35rem 0.35rem;
  border-bottom: 0 !important;
}

.card-title {
  font-family: var(--display);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.card-header small,
.card-header .text-muted {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted) !important;
}

.card-body {
  padding: 0.85rem 1.35rem 1.35rem;
}

.list-group-item {
  background: transparent;
  border-color: var(--line);
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.list-group-item strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.hub-chart-box {
  position: relative;
  height: 260px;
}

.hub-chart-box--services {
  height: 240px;
}

.hub-chart-box--main {
  height: 340px;
  position: relative;
  padding-top: 0.35rem;
  box-sizing: border-box;
}

.hub-chart-box--main canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Badges */
.badge {
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  padding: 0.35em 0.65em;
  border-radius: 6px;
  text-transform: capitalize;
}

.badge-soft {
  background: var(--teal-glow);
  color: var(--teal-dark);
  font-weight: 600;
  border-radius: 999px;
  padding: 0.4em 0.75em;
}

.bg-success.light {
  background: rgba(26, 168, 143, 0.12) !important;
  color: var(--teal-dark) !important;
}

.bg-primary.light {
  background: rgba(54, 120, 180, 0.12) !important;
  color: #1a5a8c !important;
}

.bg-warning.light {
  background: rgba(201, 133, 18, 0.14) !important;
  color: #8a5a0a !important;
}

/* Renewal items */
.renew-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.05rem;
  margin-bottom: 0.65rem;
  background: #fbfcfd;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.renew-item:last-child {
  margin-bottom: 0;
}

.renew-item:hover {
  border-color: rgba(26, 168, 143, 0.25);
}

.renew-item--late {
  border-color: rgba(196, 61, 75, 0.28);
  background: linear-gradient(90deg, #fff8f8 0%, #fff 60%);
}

.renew-item--soon {
  border-color: rgba(201, 133, 18, 0.28);
  background: linear-gradient(90deg, #fffbf3 0%, #fff 60%);
}

/* Tables */
.hub-table {
  --bs-table-bg: transparent;
}

.hub-table > :not(caption) > * > * {
  vertical-align: middle;
  padding: 0.8rem 1.15rem;
  border-color: var(--line);
}

.hub-table thead th {
  font-size: 0.7rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: #f7fafb;
  white-space: nowrap;
}

.hub-table tbody tr {
  transition: background 0.12s ease;
}

.hub-table tbody tr:hover {
  background: rgba(26, 168, 143, 0.04);
}

/* Buttons */
.btn-sm {
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.35rem 0.7rem;
}

.btn-success {
  background: var(--teal);
  border-color: var(--teal);
}

.btn-success:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.btn-outline-success {
  color: var(--teal-dark);
  border-color: rgba(26, 168, 143, 0.45);
}

.btn-outline-success:hover {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.alert {
  border-radius: var(--radius-sm);
  border: 0;
  box-shadow: var(--shadow);
}

.alert-success {
  background: linear-gradient(90deg, #e8f7f2, #fff);
  color: var(--teal-dark);
}

.module-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.module-row:last-child {
  border-bottom: 0;
}

.module-row__left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink-soft);
}

.module-row__left i {
  color: var(--teal);
  font-size: 1.1rem;
}

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

/* Responsive */
@media (max-width: 991.98px) {
  .admin-sidebar {
    transform: translateX(-105%);
    transition: transform 0.25s ease;
  }

  body.nav-open .admin-sidebar {
    transform: translateX(0);
  }

  .admin-main {
    margin-left: 0;
    padding: 1.25rem 1rem 2.5rem;
  }

  .admin-mobile-bar {
    display: flex;
    margin: -1.25rem -1rem 1.15rem;
  }

  .hub-finance-card {
    min-height: 128px;
  }

  .hub-chart-box--main {
    height: 280px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
