@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@500;600;700&display=swap');

:root {
  --bg: #0B1020;
  --panel: #0E1628;
  --card: #121A2F;
  --stroke: #1F2A44;
  --text: #E6EDFF;
  --muted: #8FA5CC;
  --bg-primary: #0B1020;
  --bg-secondary: #0E1628;
  --blue-main: #3B82F6;
  --blue-light: #60A5FA;
  --cyan-accent: #38BDF8;
  --green-success: #22C55E;
  --yellow-highlight: #FACC15;
  --red-alert: #EF4444;
  --text-primary: #E6EDFF;
  --text-secondary: #8FA5CC;
  --text-muted: #64748B;
  --glass-bg: rgba(15, 23, 42, 0.72);
  --glass-blur: blur(8px);
  --glass-stroke: rgba(59, 130, 246, 0.15);
  --card-glow: rgba(59, 130, 246, 0.25);
  --bg-image: none;
  --bg-overlay: none;
  --danger: #FF5A5A;
  --success: #22C55E;
  --warning: #F59E0B;
  --blue-primary: #3B82F6;
  --blue-neon: #60A5FA;
  --blue-electric: #38BDF8;
  --accent-purple: #6D28D9;
  --gradient: linear-gradient(120deg, #3B82F6 0%, #60A5FA 45%, #F59E0B 100%);
  --radius: 16px;
  --shadow: 0 14px 40px rgba(6, 10, 24, 0.45);
  --shadow-soft: 0 10px 28px rgba(6, 10, 24, 0.35);
}

body.theme-light {
  --bg: #F8FAFC;
  --panel: #FFFFFF;
  --card: #FFFFFF;
  --stroke: #E2E8F0;
  --text: #0F172A;
  --muted: #64748B;
  --gradient: linear-gradient(120deg, #3B82F6 0%, #60A5FA 50%, #38BDF8 100%);
}

body.theme-dark {
  --bg: #0B1020;
  --panel: #0C1426;
  --card: #121A2F;
  --stroke: #1F2A44;
  --text: #E6EDFF;
  --muted: #8FA5CC;
  --gradient: linear-gradient(120deg, #3B82F6 0%, #60A5FA 45%, #38BDF8 100%);
}

body.theme-minimal {
  --bg: #0F172A;
  --panel: #111827;
  --card: #111827;
  --stroke: #1F2937;
  --text: #E2E8F0;
  --muted: #94A3B8;
  --gradient: linear-gradient(120deg, #3B82F6 0%, #60A5FA 45%, #22D3EE 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body.theme-blue-galaxy {
  --bg: #0B1220;
  --panel: #0F172A;
  --card: rgba(15, 23, 42, 0.75);
  --stroke: rgba(59, 130, 246, 0.18);
  --text: #E5E7EB;
  --muted: #94A3B8;
  --bg-primary: #0B1220;
  --bg-secondary: #0F172A;
  --blue-main: #3B82F6;
  --blue-light: #60A5FA;
  --cyan-accent: #22D3EE;
  --green-success: #22C55E;
  --yellow-highlight: #FACC15;
  --red-alert: #EF4444;
  --text-primary: #E5E7EB;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --glass-bg: rgba(15, 23, 42, 0.75);
  --glass-blur: blur(8px);
  --glass-stroke: rgba(59, 130, 246, 0.15);
  --card-glow: rgba(59, 130, 246, 0.35);
  --gradient: linear-gradient(120deg, #3B82F6 0%, #60A5FA 45%, #22D3EE 100%);
  --bg-overlay: linear-gradient(rgba(11, 18, 32, 0.75), rgba(11, 18, 32, 0.85));
  --bg-image:
    radial-gradient(circle at 20% 20%, rgba(96, 165, 250, 0.18), transparent 40%),
    radial-gradient(circle at 70% 15%, rgba(34, 211, 238, 0.16), transparent 38%),
    radial-gradient(circle at 50% 70%, rgba(109, 40, 217, 0.12), transparent 45%),
    radial-gradient(circle at 15% 80%, rgba(59, 130, 246, 0.2), transparent 50%);
}

body.theme-light {
  background: #F8FAFC;
}

body.theme-dark,
body.theme-minimal {
  background: var(--bg);
}

body.theme-blue-galaxy {
  background:
    var(--bg-overlay),
    var(--bg-image),
    radial-gradient(circle at 20% 10%, rgba(56, 189, 248, 0.12), transparent 40%),
    radial-gradient(circle at 80% 15%, rgba(59, 130, 246, 0.12), transparent 45%),
    radial-gradient(circle at 70% 80%, rgba(109, 40, 217, 0.08), transparent 50%),
    var(--bg);
  position: relative;
  background-attachment: fixed;
}

body.theme-blue-galaxy::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.35) 0.6px, transparent 1px),
    radial-gradient(circle at 25% 70%, rgba(255, 255, 255, 0.3) 0.7px, transparent 1.2px),
    radial-gradient(circle at 60% 35%, rgba(255, 255, 255, 0.28) 0.6px, transparent 1px),
    radial-gradient(circle at 80% 55%, rgba(255, 255, 255, 0.25) 0.7px, transparent 1.2px),
    radial-gradient(circle at 90% 15%, rgba(255, 255, 255, 0.35) 0.6px, transparent 1px),
    radial-gradient(circle at 40% 85%, rgba(255, 255, 255, 0.25) 0.7px, transparent 1.2px);
  background-size: 280px 280px, 320px 320px, 360px 360px, 300px 300px, 420px 420px, 380px 380px;
  opacity: 0.45;
  z-index: 0;
}

h1, h2, h3, h4, h5 {
  font-family: 'Poppins', 'Inter', sans-serif;
  color: var(--text);
}

.dashboard-church {
  color: var(--blue-neon);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 6px 0 2px;
  line-height: 1.4;
  word-break: break-word;
}

.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.dashboard-subtitle {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.dashboard-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: var(--blue-neon);
  font-size: 0.8rem;
}

.dashboard-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.dashboard-tabs .tab {
  border: 1px solid rgba(59, 130, 246, 0.2);
  background: rgba(12, 18, 35, 0.8);
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  transition: all 180ms ease;
}

.dashboard-tabs .tab.active,
.dashboard-tabs .tab:hover {
  color: var(--text);
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.2);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-card {
  background: rgba(12, 18, 35, 0.85);
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.kpi-card.kpi-compact {
  max-width: none;
}

.kpi-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  margin-top: 8px;
}

.kpi-up {
  color: var(--success);
}

.gauge {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(var(--blue-electric) calc(var(--value) * 1%), rgba(59, 130, 246, 0.12) 0);
  display: grid;
  place-items: center;
  margin: 8px 0 10px;
}

.gauge span {
  font-size: 1.6rem;
  font-weight: 700;
}

.kpi-note {
  font-size: 0.85rem;
}

.dashboard-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-row-priority {
  margin-bottom: 18px;
}

.dashboard-v2 {
  position: relative;
}

.dashboard-v2::before {
  content: "";
  position: absolute;
  inset: -6px -4px;
  border-radius: 18px;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(96, 165, 250, 0.16) 1px, transparent 0),
    linear-gradient(135deg, rgba(30, 64, 175, 0.08), rgba(14, 23, 48, 0.04));
  background-size: 16px 16px, auto;
  opacity: 0.42;
  z-index: 0;
}

.dashboard-v2 > * {
  position: relative;
  z-index: 1;
}

.dashboard-header-v2 h1 {
  font-size: clamp(1.6rem, 2.3vw, 2.3rem);
  letter-spacing: -0.01em;
}

.dashboard-user-welcome {
  padding: 8px 12px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 999px;
  background: rgba(10, 18, 36, 0.45);
}

.dashboard-v2 .dashboard-pill {
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.15);
}

.dashboard-v2 .kpi-card,
.dashboard-v2 .chart-card,
.dashboard-v2 .section-card {
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.dashboard-v2 .kpi-card:hover,
.dashboard-v2 .chart-card:hover,
.dashboard-v2 .section-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 20px 40px rgba(4, 10, 24, 0.52), 0 0 18px rgba(56, 189, 248, 0.1);
}

.dashboard-v2 .kpi-label {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
}

.dashboard-v2 .kpi-value {
  font-size: clamp(1.9rem, 2.5vw, 2.4rem);
}

.dashboard-v2 .kpi-note {
  margin-top: 8px;
  color: #8ea5c8;
}

.dashboard-v2 .chart-card .section-title,
.dashboard-v2 .section-card .section-title {
  font-size: 1.1rem;
}

.dashboard-v2 .rank-item {
  background: linear-gradient(180deg, rgba(15, 25, 49, 0.78), rgba(10, 18, 36, 0.8));
}

.dashboard-v2 [data-tv-slide="0"],
.dashboard-v2 [data-tv-slide="1"] {
  animation: dashboard-rise 360ms ease both;
}

.dashboard-v2 [data-tv-slide="1"] {
  animation-delay: 80ms;
}

@keyframes dashboard-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
}

.rank-list {
  display: grid;
  gap: 10px;
  max-height: 230px;
  overflow: auto;
  padding-right: 4px;
}

.rank-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(12, 18, 35, 0.8);
  border: 1px solid rgba(59, 130, 246, 0.16);
}

.rank-badge {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(59, 130, 246, 0.2);
  color: var(--blue-neon);
  font-weight: 600;
}

.rank-name {
  flex: 1;
}

.rank-value {
  font-weight: 600;
  color: var(--blue-neon);
}

.alerts-compact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.alert-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(12, 18, 35, 0.75);
  border: 1px solid rgba(59, 130, 246, 0.16);
  color: var(--text);
}

.alert-icon {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.2);
  color: var(--blue-neon);
  display: grid;
  place-items: center;
  font-weight: 700;
}

.alert-number {
  font-weight: 700;
}

.alert-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.empty-state {
  color: var(--muted);
  font-size: 0.9rem;
}

a {
  color: inherit;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  align-items: stretch;
}

.sidebar {
  background: var(--panel);
  border-right: 1px solid rgba(59, 130, 246, 0.12);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: width 220ms ease, transform 220ms ease;
  overflow: visible;
  z-index: 50;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  min-height: 120px;
  height: 120px;
  border-radius: var(--radius);
  background: transparent;
  border: none;
  box-shadow: none;
}

.sidebar .brand img {
  width: 200px;
  height: 100px;
  object-fit: contain;
  transform: none;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: visible;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: all 180ms ease;
  position: relative;
}

.menu-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.menu-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-right: 8px;
}

.menu-group-title span:first-of-type {
  flex: 1;
}

.menu-group-link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.menu-caret-btn {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.menu-caret-btn::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(148, 163, 184, 0.7);
  border-bottom: 2px solid rgba(148, 163, 184, 0.7);
  transform: rotate(-45deg);
  transition: transform 180ms ease, border-color 180ms ease;
}

.menu-group:hover .menu-caret-btn::before,
.menu-group.is-open .menu-caret-btn::before {
  transform: rotate(45deg);
  border-color: rgba(226, 232, 240, 0.9);
}

.menu-group-items {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: calc(100% + 10px);
  min-width: 200px;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(59, 130, 246, 0.12);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.97), rgba(10, 16, 30, 0.95));
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(8, 14, 30, 0.5);
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: max-height 200ms ease, opacity 200ms ease, transform 200ms ease;
  z-index: 50;
}

.menu-group:hover .menu-group-items,
.menu-group.is-open .menu-group-items {
  max-height: 500px;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.menu-subitem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  color: rgba(148, 163, 184, 0.95);
  border: 1px solid transparent;
  transition: all 180ms ease;
  position: relative;
}

.menu-subitem:hover {
  color: var(--text);
  border-color: rgba(59, 130, 246, 0.25);
  background: rgba(59, 130, 246, 0.1);
}

.menu-subitem.active {
  color: var(--text);
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 6px 14px rgba(59, 130, 246, 0.2);
}

.menu-subitem.active::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--blue-neon);
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.6);
}

.menu-subgroup {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-subgroup-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-left: 12px;
  padding-left: 10px;
  border-left: 1px solid rgba(59, 130, 246, 0.2);
}

.menu-subitem.menu-subitem-nested {
  padding-left: 10px;
}

.menu-item.is-alert-pending {
  color: #fef3c7;
  border-color: rgba(245, 158, 11, 0.65);
  background: rgba(245, 158, 11, 0.2);
  box-shadow: 0 10px 22px rgba(245, 158, 11, 0.22);
}

.menu-item.is-alert-pending .menu-icon {
  color: #fbbf24;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.4));
}

.menu-item.is-alert-pending .menu-caret-btn::before {
  border-color: rgba(252, 211, 77, 0.9);
}

.menu-item.is-alert-pending:hover {
  border-color: rgba(245, 158, 11, 0.85);
  background: rgba(245, 158, 11, 0.28);
  box-shadow: 0 12px 26px rgba(245, 158, 11, 0.3);
}

.menu-item:hover {
  color: var(--text);
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.12);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.1);
  transform: translateX(3px);
}

.menu-item.active {
  color: var(--text);
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25);
}

.menu-item:focus-visible,
.menu-subitem:focus-visible,
.menu-group-link:focus-visible,
.menu-caret-btn:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.6);
  outline-offset: 2px;
}

.menu-item.active::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: var(--blue-neon);
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.55);
}

.menu-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.menu .menu-icon {
  color: #94A3B8;
  transition: color 180ms ease, filter 180ms ease;
}

.menu-item:hover .menu-icon,
.menu-subitem:hover .menu-icon {
  color: var(--blue-electric);
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.35));
}

.menu-item.active .menu-icon,
.menu-subitem.active .menu-icon {
  color: var(--blue-neon);
  filter: drop-shadow(0 0 8px rgba(96, 165, 250, 0.45));
}

.menu-subitem .menu-icon {
  width: 18px;
  height: 18px;
}

.menu-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.sidebar-collapsed .menu-label {
  display: none;
}

body.sidebar-collapsed [data-tooltip] {
  position: relative;
}

body.sidebar-collapsed [data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.95);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(59, 130, 246, 0.25);
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  white-space: nowrap;
  z-index: 60;
}

body.sidebar-collapsed [data-tooltip]:hover::after {
  opacity: 1;
}

.contact-icons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
  vertical-align: middle;
}

.contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #94A3B8;
  transition: color 180ms ease, filter 180ms ease;
}

.contact-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-icon:hover {
  color: var(--blue-electric);
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.35));
}

.offerings-mobile-note {
  display: none;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--text);
  font-size: 0.9rem;
}

.mobile-only-note {
  display: none;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--text);
  font-size: 0.9rem;
}

.attendance-row.is-present {
  background: rgba(34, 197, 94, 0.12);
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.25);
}

.attendance-row.is-present td {
  border-color: rgba(34, 197, 94, 0.2);
}

.attendance-row.is-present .attendance-toggle {
  accent-color: #22C55E;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.35);
}

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
  width: 100%;
}

.topbar {
  background: rgba(11, 16, 32, 0.9);
  border-bottom: 1px solid rgba(59, 130, 246, 0.12);
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  backdrop-filter: blur(14px);
  width: 100%;
  position: relative;
  z-index: 120;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  flex-wrap: nowrap;
  min-width: 0;
}

.topbar-tv {
  display: none;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.topbar-tv-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.topbar-tv-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  white-space: nowrap;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(18, 26, 47, 0.85);
  border: 1px solid rgba(59, 130, 246, 0.16);
  border-radius: 999px;
  min-width: 260px;
  max-width: 360px;
  flex: 1 1 320px;
}

.search input {
  background: transparent;
  border: none;
  color: var(--text);
  outline: none;
  width: 100%;
}

.tv-clock {
  display: none;
  min-width: 92px;
  text-align: right;
  font-weight: 600;
  color: var(--text);
}

@media (max-width: 1023px) {
  .topbar-left {
    flex-wrap: wrap;
  }
  .search {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  background: rgba(18, 26, 47, 0.8);
  display: grid;
  place-items: center;
  transition: all 180ms ease;
}

.icon-btn:hover {
  border-color: rgba(63, 185, 255, 0.4);
  box-shadow: 0 0 12px rgba(63, 185, 255, 0.2);
}

.icon-btn.is-alert {
  animation: bell-blink 1.2s infinite;
  border-color: rgba(255, 176, 32, 0.65);
  box-shadow: 0 0 14px rgba(255, 176, 32, 0.35);
}

@keyframes bell-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.05); }
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  border-radius: 999px;
}

.user-pill .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient);
  display: grid;
  place-items: center;
  font-weight: 600;
  color: #0b0e14;
}

.user-menu {
  position: relative;
}

.user-menu-toggle {
  cursor: pointer;
  border: 1px solid var(--stroke);
}

.user-menu-toggle:focus-visible {
  outline: 3px solid rgba(63, 185, 255, 0.35);
  outline-offset: 2px;
}

.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  min-width: 240px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  z-index: 140;
}

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--stroke);
}

.user-menu-actions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.user-menu-message {
  margin-top: 10px;
}

.content {
  padding: 22px 26px;
  background: transparent;
  min-height: calc(100vh - 80px);
  width: 100%;
}

.app-footer {
  margin-top: 24px;
  padding: 16px 0 8px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
}

.dev-gear {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.95rem;
  margin-left: 8px;
  cursor: pointer;
}

.dev-modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 18, 0.6);
  display: grid;
  place-items: center;
  z-index: 80;
}

.dev-modal.hidden {
  display: none;
}

.dev-modal__card {
  width: min(420px, 92vw);
  background: rgba(12, 18, 35, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 16px;
  padding: 20px;
  color: var(--text);
  box-shadow: var(--shadow);
}

.dev-modal__header {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.dev-modal__text {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.dev-modal__form {
  display: grid;
  gap: 10px;
}

.dev-modal__form input {
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(9, 14, 26, 0.7);
  color: var(--text);
  padding: 0 12px;
}

.dev-modal__form button {
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(90deg, #3FB9FF 0%, #7C3AED 55%, #F59E0B 100%);
  color: #0b0e14;
  font-weight: 600;
  border: none;
}

.dev-modal__message {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.dev-modal__link {
  margin-top: 8px;
  display: inline-block;
  color: #7cc4ff;
}

.dev-modal__link.hidden {
  display: none;
}

.dev-modal__link.hidden {
  display: none;
}

.dev-modal__close {
  margin-top: 12px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
}

body.sidebar-collapsed .menu-caret-btn {
  display: none;
}

body.sidebar-collapsed .menu-group-items {
  display: none;
}

body.sidebar-focus .sidebar {
  transform: translateX(-100%);
  width: 0 !important;
  padding: 0;
  border: none;
  overflow: hidden;
}

body.tv-mode .sidebar {
  display: none;
}

body.tv-mode .topbar-left > .topbar-title,
body.tv-mode .topbar-left > .search,
body.tv-mode .topbar-actions > :not(#tv-toggle):not(.tv-clock) {
  display: none !important;
}

body.tv-mode .topbar-tv {
  display: flex;
}

body.tv-mode .tv-clock {
  display: block;
}

body.tv-mode .content {
  padding: 24px 32px;
}

body.tv-mode .kpi-value {
  font-size: 2.6rem;
}

body.tv-mode .kpi-label {
  font-size: 1.05rem;
}

body.tv-mode .kpi-card {
  padding: 22px;
}

body.tv-mode .chart-card {
  min-height: 340px;
}

.tv-only {
  display: none;
}

body.tv-mode .tv-only {
  display: block;
}

body.tv-mode .tv-hide {
  display: none !important;
}

body.tv-mode [data-tv-slide] {
  display: none;
}

body.tv-mode [data-tv-slide].is-active {
  display: block;
}

body.sidebar-overlay-open .sidebar {
  transform: translateX(0);
}

body.sidebar-overlay-open .app-main {
  filter: blur(0.5px);
}

.section-card {
  background: var(--card);
  border: 1px solid rgba(59, 130, 246, 0.16);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
  min-height: 230px;
}

.card-glow {
  position: relative;
  background: linear-gradient(180deg, rgba(18, 26, 47, 0.9), rgba(14, 22, 40, 0.98));
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 18px 40px rgba(8, 14, 30, 0.45);
}

.card-glow::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.15);
  pointer-events: none;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.quick-card {
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(12, 18, 35, 0.85);
  border: 1px solid rgba(59, 130, 246, 0.18);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.quick-card:hover {
  transform: scale(1.02);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 10px 24px rgba(59, 130, 246, 0.2);
}

.metric-card {
  border-radius: 16px;
  padding: 16px;
  background: rgba(12, 18, 35, 0.8);
  border: 1px solid rgba(59, 130, 246, 0.16);
}

.summary-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.3fr) minmax(220px, 1fr);
  gap: 16px;
}

.summary-main {
  border-radius: 18px;
  padding: 18px;
  background: rgba(9, 15, 30, 0.9);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.summary-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.summary-value {
  font-size: 2.4rem;
  font-weight: 700;
}

.summary-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  overflow: hidden;
  margin-top: 8px;
}

.summary-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3B82F6, #38BDF8);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
}

.summary-growth {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--success);
  font-weight: 600;
}

.chart-card {
  border-radius: 18px;
  padding: 18px;
  background: rgba(12, 18, 35, 0.9);
  border: 1px solid rgba(59, 130, 246, 0.18);
  box-shadow: var(--shadow-soft);
}

.chart-card-dashboard {
  min-height: 320px;
}

.chart-canvas-wrap {
  position: relative;
  min-height: 240px;
  height: 240px;
}

.chart-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

@media (min-width: 1200px) {
  .kpi-grid {
    grid-template-columns: minmax(280px, 1.15fr) minmax(240px, 1fr) minmax(220px, 0.8fr) minmax(240px, 1fr);
    align-items: stretch;
  }
}

.alert-card {
  border-radius: 16px;
  padding: 14px;
  background: rgba(12, 18, 35, 0.85);
  border: 1px solid rgba(59, 130, 246, 0.16);
}

.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

body.theme-blue-galaxy .sidebar,
body.theme-blue-galaxy .topbar {
  background: linear-gradient(180deg, rgba(11, 18, 32, 0.85), rgba(8, 12, 24, 0.9));
  backdrop-filter: blur(10px);
}

body.theme-blue-galaxy .card,
body.theme-blue-galaxy .section-card,
body.theme-blue-galaxy .kpi-card,
body.theme-blue-galaxy .metric-card,
body.theme-blue-galaxy .chart-card,
body.theme-blue-galaxy .alert-card {
  background: linear-gradient(180deg, rgba(18, 26, 47, 0.72), rgba(12, 18, 35, 0.82));
  border: 1px solid var(--glass-stroke);
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 16px 36px rgba(6, 10, 24, 0.5);
}

body.theme-blue-galaxy .kpi-card.is-highlight,
body.theme-blue-galaxy .card-glow {
  box-shadow: 0 0 24px var(--card-glow), 0 18px 40px rgba(6, 10, 24, 0.5);
}

body.theme-blue-galaxy .app-shell,
body.theme-blue-galaxy .app-main,
body.theme-blue-galaxy .content,
body.theme-blue-galaxy .sidebar,
body.theme-blue-galaxy .topbar {
  position: relative;
  z-index: 1;
}

body.theme-blue-galaxy .menu-item.active,
body.theme-blue-galaxy .menu-subitem.active {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.5);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  transition: all 180ms ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--gradient);
  color: #0b0e14;
  box-shadow: 0 10px 24px rgba(63, 185, 255, 0.25);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: var(--stroke);
}

.input, .select, .textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--stroke);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  transition: border 160ms ease, box-shadow 160ms ease;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(63, 185, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(63, 185, 255, 0.15);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

th, td {
  border-bottom: 1px solid var(--stroke);
  padding: 10px 12px;
}

tbody tr:hover {
  background: rgba(63, 185, 255, 0.06);
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid transparent;
}

.badge-success { background: rgba(46, 229, 157, 0.12); color: var(--success); border-color: rgba(46, 229, 157, 0.3); }
.badge-warning { background: rgba(255, 176, 32, 0.12); color: var(--warning); border-color: rgba(255, 176, 32, 0.3); }
.badge-danger { background: rgba(255, 90, 90, 0.12); color: var(--danger); border-color: rgba(255, 90, 90, 0.3); }

.glass {
  background: rgba(21, 30, 47, 0.7);
  border: 1px solid rgba(36, 48, 74, 0.6);
  backdrop-filter: blur(16px);
}

input, select, textarea {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: var(--stroke) !important;
  color: var(--text) !important;
}

input::placeholder, textarea::placeholder {
  color: var(--muted);
}

select option {
  background-color: var(--panel);
  color: var(--text);
}

input[type="file"]::file-selector-button {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--stroke);
  padding: 6px 10px;
  border-radius: 10px;
  margin-right: 10px;
  cursor: pointer;
}

.bg-white { background-color: var(--card) !important; }
.text-slate-900 { color: var(--text) !important; }
.text-slate-800 { color: var(--text) !important; }
.text-slate-700 { color: var(--text) !important; }
.text-slate-600 { color: var(--muted) !important; }
.text-slate-500 { color: var(--muted) !important; }
.border-slate-200 { border-color: var(--stroke) !important; }
.border-slate-100 { border-color: var(--stroke) !important; }
.bg-slate-100 { background-color: var(--bg) !important; }
.bg-slate-50 { background-color: rgba(255, 255, 255, 0.02) !important; }
.table-mobile-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.reports-icon-btn {
  width: 38px;
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--blue-neon);
  border-color: rgba(96, 165, 250, 0.35) !important;
  background: rgba(59, 130, 246, 0.12) !important;
}

.reports-icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
  fill: none;
}

.reports-label-mobile {
  display: none;
}

@media (max-width: 1023px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    z-index: 50;
    transform: translateX(-100%);
    width: 10.75rem;
  }
  body.sidebar-overlay-open .sidebar {
    transform: translateX(0);
    width: 10.75rem;
  }
  /* Garantir que os nomes apareçam no mobile ao abrir o menu */
  body.sidebar-overlay-open.sidebar-collapsed .menu-label,
  body.sidebar-collapsed .menu-label,
  body.sidebar-overlay-open .menu-label {
    display: inline-block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
  body.sidebar-overlay-open.sidebar-collapsed .menu-item,
  body.sidebar-overlay-open .menu-item,
  body.sidebar-overlay-open .menu-group-link {
    justify-content: flex-start;
  }
  body.sidebar-overlay-open [data-tooltip]::after {
    display: none !important;
  }
  body.sidebar-collapsed [data-tooltip]::after {
    display: none !important;
  }
  .sidebar .menu-item,
  .sidebar .menu-group-link,
  .sidebar .menu-subitem {
    gap: 8px;
    padding-left: 8px;
    padding-right: 8px;
  }
  .sidebar .menu-icon {
    width: 16px;
    height: 16px;
  }
  .sidebar .menu-label {
    font-size: 11px;
    line-height: 1.2;
  }
  .sidebar .menu-subitem {
    font-size: 11px;
    line-height: 1.2;
  }

  /* Desativar botão Modo TV no mobile */
  #tv-toggle {
    display: none !important;
  }

  .reports-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .reports-title-wrap {
    width: 100%;
    min-width: 0;
  }
  .reports-subtitle {
    display: none;
  }
  .reports-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }
  .reports-action-link {
    padding: 7px 10px !important;
    font-size: 12px !important;
    line-height: 1.2;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
  }
  .reports-btn-daily {
    order: 1;
  }
  .reports-btn-weekly {
    order: 2;
  }
  .reports-btn-trimester {
    order: 3;
  }
  .reports-general-link {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .reports-label-desktop {
    display: none;
  }
  .reports-label-mobile {
    display: inline;
  }
  .reports-links a {
    padding: 9px 10px !important;
    font-size: 12px !important;
    line-height: 1.25;
  }
}

@media (max-width: 1023px) {
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .dashboard-header h1 {
    font-size: 1.25rem;
  }

  .dashboard-church {
    font-size: 0.95rem;
  }

  .dashboard-church .church-sector {
    display: none;
  }

  .dashboard-subtitle {
    font-size: 0.85rem;
    gap: 6px;
    flex-wrap: wrap;
  }

  .dashboard-header .text-sm {
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .dashboard-tabs {
    flex-wrap: wrap;
    gap: 8px;
  }

  .tab {
    padding: 6px 10px;
    font-size: 0.85rem;
  }

  .content {
    padding: 16px;
  }

  /* Topbar mobile: 1a linha com Ajuste + ícones, 2a linha com busca */
  .topbar {
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    padding: 12px;
  }
  .topbar-left {
    order: 1;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }
  .topbar-title {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar-actions {
    order: 2;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
  }
  .search {
    order: 3;
    flex: 1 1 100%;
    max-width: 100%;
  }
  /* Ocultar busca no mobile para liberar espaço */
  .search {
    display: none !important;
  }

  /* Ocultar foco no mobile */
  #focus-toggle {
    display: none !important;
  }

  /* Ocultar bloco TV no mobile */
  .topbar-tv {
    display: none !important;
  }

  /* Ocultar Ofertas no menu apenas no mobile */
  [data-menu-id="offerings"] {
    display: none !important;
  }
  [data-menu-id="cards"],
  [data-menu-id="certificates"] {
    display: none !important;
  }

  /* Botões de ação na lista de alunos (mobile) */
  .students-actions {
    flex-wrap: wrap;
    gap: 6px;
  }
  .students-action-btn {
    padding: 6px 10px !important;
    font-size: 0.75rem !important;
  }
  .students-clear-btn {
    display: none !important;
  }

  .students-import-export {
    display: none !important;
  }

  .people-actions,
  .people-action-btn {
    display: none !important;
  }

  /* Tabela de alunos: mostrar apenas Nome e Status no mobile */
  .students-col-class,
  .students-col-contact,
  .students-col-actions {
    display: none !important;
  }

  /* Ocultar Ofertas no mobile */
  .offerings-content {
    display: none !important;
  }
  .offerings-mobile-note {
    display: block !important;
  }

  .mobile-hide {
    display: none !important;
  }
  .mobile-only-note {
    display: block !important;
  }

  /* Compactar ações no topo para caber em uma linha */
  .topbar .icon-btn {
    width: 36px;
    height: 36px;
  }
  .topbar .menu-icon {
    width: 18px;
    height: 18px;
  }
  .topbar .user-pill {
    padding: 6px;
    gap: 6px;
    min-width: 0;
  }
  .topbar .user-pill .text-xs,
  .topbar .user-pill .text-sm {
    display: none;
  }
  .topbar .user-pill .avatar {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .table-mobile-wrap table {
    min-width: 640px;
  }

.table-mobile-wrap table.sign-table,
.table-mobile-wrap table.signatures {
  min-width: 100%;
}
}

.caderneta-pc-wrap {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.caderneta-pc-card {
  background: rgba(12, 18, 35, 0.88);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 16px 40px rgba(7, 12, 28, 0.45);
  width: min(760px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.caderneta-pc-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
  text-align: center;
}

.caderneta-pc-logo {
  width: 20px;
  height: auto;
  max-width: 20%;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  border: none;
  padding: 0;
}

.caderneta-pc-title {
  margin: 0 0 14px;
  font-size: 3rem;
  font-weight: 700;
  text-align: center;
}

.caderneta-pc-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
}

.caderneta-pc-note {
  margin: 10px 0 16px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
  color: #FCD34D;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.95rem;
  text-align: center;
}

.caderneta-pc-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.caderneta-pc-qrbox {
  width: fit-content;
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  border: 2px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 12px 26px rgba(8, 12, 24, 0.3);
}

.caderneta-pc-link-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 760px;
}

.caderneta-pc-link-row code {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  padding: 10px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.caderneta-pc-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.caderneta-pc-help {
  color: var(--muted);
  margin: 0;
  text-align: center;
  font-size: 1.05rem;
}

.caderneta-pc-download-card {
  position: fixed;
  left: -99999px;
  top: -99999px;
  width: 520px;
  background: #fff;
  color: #0F172A;
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  display: none;
  visibility: hidden;
}

.caderneta-pc-download-logo {
  width: 14px;
  height: auto;
  object-fit: contain;
  margin: 0 auto 6px;
}

.caderneta-pc-download-card h2 {
  margin: 0;
  color: #0F172A;
  font-size: 1.35rem;
}

.caderneta-pc-download-card p {
  margin: 0;
  color: #334155;
  font-size: 0.95rem;
  max-width: 90%;
}

#qrcode-download {
  width: fit-content;
  margin: 8px auto 6px;
}

#caderneta-link-download {
  color: #334155;
  font-size: 0.85rem;
  max-width: 100%;
  word-break: break-all;
}

body.caderneta-pc-page .content {
  min-height: calc(100dvh - 130px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

body.caderneta-pc-page .app-footer {
  display: none;
}

body.caderneta-pc-kiosk .sidebar,
body.caderneta-pc-kiosk .topbar,
body.caderneta-pc-kiosk .app-footer {
  display: none !important;
}

body.caderneta-pc-kiosk .content {
  padding: 0 !important;
  min-height: 100dvh !important;
  display: grid;
  place-items: center;
}

body.caderneta-pc-kiosk .caderneta-pc-title {
  font-size: 3.3rem;
}

@media (max-width: 1023px) {
  .caderneta-pc-card {
    padding: 18px;
    border-radius: 18px;
  }
  .caderneta-pc-title {
    font-size: 2rem;
  }
  .caderneta-pc-logo {
    width: 16px;
    max-width: 22%;
    height: auto;
  }
  .caderneta-pc-link-row {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1023px) {
  .classroom-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .classroom-trimester {
    order: 3;
  }
  .classroom-lg input[type="date"],
  .classroom-lg select {
    height: 44px;
  }
  .classroom-lg input[type="date"] {
    width: 100%;
    font-size: 0.95rem;
    text-align: left;
  }
  .classroom-lg select {
    font-size: 0.95rem;
  }
  .lesson-number-field {
    display: none !important;
  }
  .classroom-lg .total-assistance-field {
    order: 6;
  }
}

.class-alerts-page {
  display: grid;
  gap: 16px;
}

.class-alerts-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.class-alerts-head h1 {
  margin: 0;
  font-size: 1.8rem;
}

.class-alerts-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
}

.class-alerts-filters {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.class-alerts-filters label {
  display: grid;
  gap: 4px;
  min-width: 140px;
}

.class-alerts-filters span {
  font-size: 0.85rem;
  color: var(--muted);
}

.class-alerts-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.class-alerts-kpi {
  background: rgba(12, 18, 35, 0.88);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.class-alerts-kpi .label {
  color: var(--muted);
  font-size: 0.9rem;
}

.class-alerts-kpi .value {
  margin-top: 8px;
  font-size: 1.9rem;
  font-weight: 700;
}

.class-alerts-kpi.kpi-critical {
  border-color: rgba(239, 68, 68, 0.5);
}

.class-alerts-kpi.kpi-open {
  border-color: rgba(245, 158, 11, 0.5);
}

.class-alerts-kpi.kpi-info {
  border-color: rgba(59, 130, 246, 0.5);
}

.class-alerts-kpi.kpi-ok {
  border-color: rgba(34, 197, 94, 0.5);
}

.class-alerts-summary h2,
.class-alerts-feed h2,
.class-alerts-charts h2 {
  margin-top: 0;
}

.class-alerts-summary p {
  margin: 0;
  color: var(--text);
  line-height: 1.6;
}

.class-alerts-list {
  display: grid;
  gap: 12px;
}

.class-alert-card {
  border-radius: 14px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(12, 18, 35, 0.85);
}

.class-alert-card.severity-critico {
  border-color: rgba(239, 68, 68, 0.55);
}

.class-alert-card.severity-atencao {
  border-color: rgba(245, 158, 11, 0.55);
}

.class-alert-card.severity-info {
  border-color: rgba(59, 130, 246, 0.55);
}

.class-alert-card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.class-alert-title-wrap {
  flex: 1;
}

.class-alert-title-wrap h3 {
  margin: 0;
  font-size: 1rem;
}

.class-alert-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.class-alert-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.15);
  font-weight: 700;
}

.class-alert-status {
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: var(--muted);
}

.class-alert-status.status-novo {
  border-color: rgba(239, 68, 68, 0.55);
  color: #FCA5A5;
}

.class-alert-status.status-lido {
  border-color: rgba(245, 158, 11, 0.55);
  color: #FCD34D;
}

.class-alert-status.status-resolvido {
  border-color: rgba(34, 197, 94, 0.55);
  color: #86EFAC;
}

.class-alert-card p {
  margin: 10px 0 0;
  color: var(--text);
}

.class-alert-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.class-alert-actions form {
  margin: 0;
}

.class-alerts-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.class-alerts-charts article:last-child {
  grid-column: 1 / -1;
}

.class-alerts-empty {
  border: 1px dashed rgba(148, 163, 184, 0.45);
  color: var(--muted);
  padding: 18px;
  border-radius: 14px;
  background: rgba(12, 18, 35, 0.6);
}

@media (max-width: 1023px) {
  .class-alerts-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .class-alerts-charts {
    grid-template-columns: 1fr;
  }
}

.alerts-bi-page {
  display: grid;
  gap: 16px;
}

.alerts-bi-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.alerts-bi-head h1 {
  margin: 0;
  font-size: 1.85rem;
}

.alerts-bi-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.alerts-bi-filters label {
  display: grid;
  gap: 4px;
}

.alerts-bi-filters span {
  color: var(--muted);
  font-size: 0.85rem;
}

.alerts-bi-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.alerts-bi-kpi {
  background: rgba(12, 18, 35, 0.88);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.alerts-bi-kpi .label {
  color: var(--muted);
  font-size: 0.9rem;
}

.alerts-bi-kpi .value {
  margin-top: 8px;
  font-size: 1.95rem;
  font-weight: 700;
}

.alerts-bi-kpi.kpi-critical {
  border-color: rgba(239, 68, 68, 0.55);
}

.alerts-bi-kpi.kpi-open {
  border-color: rgba(245, 158, 11, 0.55);
}

.alerts-bi-kpi.kpi-info {
  border-color: rgba(59, 130, 246, 0.55);
}

.alerts-bi-kpi.kpi-ok {
  border-color: rgba(34, 197, 94, 0.55);
}

.alerts-bi-summary h2 {
  margin-top: 0;
}

.alerts-bi-summary p {
  margin: 0;
  line-height: 1.6;
}

.alerts-bi-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.alerts-bi-charts article:last-child {
  grid-column: 1 / -1;
}

.alerts-bi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.alerts-bi-grid h3,
.alerts-bi-page .section-card h3 {
  margin-top: 0;
}

.alerts-bi-grid small {
  color: var(--muted);
}

.alerts-bi-empty {
  margin-top: 8px;
  color: var(--muted);
}

.alerts-bi-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  gap: 8px;
}

.alerts-bi-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.25);
  padding-bottom: 6px;
}

.alerts-bi-month-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 1023px) {
  .alerts-bi-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .alerts-bi-charts,
  .alerts-bi-grid,
  .alerts-bi-month-grid {
    grid-template-columns: 1fr;
  }
}

