/* ============================================================
   SDP Visual Polish — Premium refinement layer
   Scope: body.sdp-redesigned. Pure CSS enhancement, no logic.
   Depends on: design-system.css, sdp-redesign-base.css,
               dashboard-home-redesigned.css, sidebar-redesigned.css

   Purpose: elevate visual quality through micro-interactions,
   refined transitions, staggered entry animations, improved
   typography hierarchy, and enhanced depth/lighting effects.
   ============================================================ */

/* ─────────────────────────────────────────────────────────────
   1. PAGE ENTRY ANIMATION (staggered fade-in)
   ───────────────────────────────────────────────────────────── */

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

@keyframes sdp-scale-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes sdp-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

body.sdp-redesigned .dp-hero {
  animation: sdp-scale-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.sdp-redesigned .dp-card {
  animation: sdp-fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.sdp-redesigned .dp-card:nth-child(1) { animation-delay: 0.06s; }
body.sdp-redesigned .dp-card:nth-child(2) { animation-delay: 0.12s; }
body.sdp-redesigned .dp-card:nth-child(3) { animation-delay: 0.18s; }
body.sdp-redesigned .dp-card:nth-child(4) { animation-delay: 0.24s; }
body.sdp-redesigned .dp-card:nth-child(5) { animation-delay: 0.30s; }
body.sdp-redesigned .dp-card:nth-child(6) { animation-delay: 0.36s; }
body.sdp-redesigned .dp-card:nth-child(7) { animation-delay: 0.42s; }
body.sdp-redesigned .dp-card:nth-child(8) { animation-delay: 0.48s; }

body.sdp-redesigned .dp-news-section,
body.sdp-redesigned .dp-section {
  animation: sdp-fade-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
}

body.sdp-redesigned .dp-quick-card {
  animation: sdp-fade-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.sdp-redesigned .dp-quick-card:nth-child(1) { animation-delay: 0.44s; }
body.sdp-redesigned .dp-quick-card:nth-child(2) { animation-delay: 0.48s; }
body.sdp-redesigned .dp-quick-card:nth-child(3) { animation-delay: 0.52s; }
body.sdp-redesigned .dp-quick-card:nth-child(4) { animation-delay: 0.56s; }
body.sdp-redesigned .dp-quick-card:nth-child(5) { animation-delay: 0.60s; }
body.sdp-redesigned .dp-quick-card:nth-child(6) { animation-delay: 0.64s; }
body.sdp-redesigned .dp-quick-card:nth-child(7) { animation-delay: 0.68s; }
body.sdp-redesigned .dp-quick-card:nth-child(8) { animation-delay: 0.72s; }

@media (prefers-reduced-motion: reduce) {
  body.sdp-redesigned .dp-hero,
  body.sdp-redesigned .dp-card,
  body.sdp-redesigned .dp-news-section,
  body.sdp-redesigned .dp-section,
  body.sdp-redesigned .dp-quick-card {
    animation: none !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   2. HERO SECTION — elevated depth
   ───────────────────────────────────────────────────────────── */

body.sdp-redesigned .dp-hero {
  background:
    radial-gradient(ellipse 80% 60% at 70% -10%, rgba(181, 144, 74, 0.12), transparent 50%),
    linear-gradient(135deg, #16243C 0%, #1B3048 40%, #1F2D4A 70%, #223455 100%) !important;
  border: 1px solid rgba(181, 144, 74, 0.18) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 24px 56px rgba(23, 36, 60, 0.28),
    0 8px 16px rgba(23, 36, 60, 0.12) !important;
}

body.sdp-redesigned .dp-hero::after {
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(181, 144, 74, 0.15) 15%,
    rgba(181, 144, 74, 0.72) 50%,
    rgba(181, 144, 74, 0.15) 85%,
    transparent 100%) !important;
  opacity: 0.6;
}

body.sdp-redesigned .dp-hero-text h1 {
  background: linear-gradient(135deg, #FFFFFF 20%, #F7F0DC 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

body.sdp-redesigned .dp-hero-logo {
  backdrop-filter: blur(8px);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

body.sdp-redesigned .dp-hero-logo:hover {
  transform: scale(1.04);
}

body.sdp-redesigned .dp-hero-date {
  backdrop-filter: blur(8px);
}

body.sdp-redesigned .dp-hero-date .day {
  background: linear-gradient(180deg, #FFFFFF, #E8DFC8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─────────────────────────────────────────────────────────────
   3. STAT CARDS — refined interactions & visual depth
   ───────────────────────────────────────────────────────────── */

body.sdp-redesigned .dp-card {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.28s ease !important;
}

body.sdp-redesigned .dp-card::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle 180px at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(181, 144, 74, 0.06), transparent 60%);
  transition: opacity 0.3s ease;
  pointer-events: none;
}

body.sdp-redesigned .dp-card:hover::after {
  opacity: 1;
}

body.sdp-redesigned .dp-card:hover {
  transform: translateY(-4px) !important;
  border-color: rgba(181, 144, 74, 0.24) !important;
  box-shadow:
    0 1px 1px rgba(31, 45, 74, 0.04),
    0 4px 8px rgba(31, 45, 74, 0.06),
    0 20px 44px rgba(31, 45, 74, 0.12),
    0 0 0 1px rgba(181, 144, 74, 0.08) !important;
}

body.sdp-redesigned .dp-card:active {
  transform: translateY(-1px) !important;
  transition-duration: 0.1s !important;
}

body.sdp-redesigned .dp-card-icon {
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease;
}

body.sdp-redesigned .dp-card:hover .dp-card-icon {
  transform: scale(1.08) rotate(-2deg);
}

body.sdp-redesigned .dp-card-value {
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

body.sdp-redesigned .dp-card:hover .dp-card-value {
  transform: scale(1.02);
}

/* Gold accent line on top — thicker and animated on hover */
body.sdp-redesigned .dp-card::before {
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              background 0.3s ease !important;
}

body.sdp-redesigned .dp-card:hover::before {
  background: linear-gradient(90deg, var(--sdp-preview-gold), var(--color-gold-200, #EDD99A), var(--sdp-preview-gold)) !important;
  transform: scaleX(1.02) !important;
}

/* ─────────────────────────────────────────────────────────────
   4. QUICK ACCESS CARDS — premium micro-interactions
   ───────────────────────────────────────────────────────────── */

body.sdp-redesigned .dp-quick-card {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.26s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.26s ease,
    box-shadow 0.26s ease,
    background 0.26s ease !important;
}

body.sdp-redesigned .dp-quick-card::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(135deg, rgba(181, 144, 74, 0.04), rgba(181, 144, 74, 0.02));
  transition: opacity 0.26s ease;
  pointer-events: none;
}

body.sdp-redesigned .dp-quick-card:hover::after {
  opacity: 1;
}

body.sdp-redesigned .dp-quick-card:hover {
  transform: translateY(-3px) scale(1.01) !important;
  box-shadow:
    0 4px 8px rgba(31, 45, 74, 0.06),
    0 14px 32px rgba(31, 45, 74, 0.10) !important;
}

body.sdp-redesigned .dp-quick-card:active {
  transform: translateY(0) scale(0.98) !important;
  transition-duration: 0.08s !important;
}

body.sdp-redesigned .dp-quick-icon {
  transition:
    transform 0.26s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.26s ease;
}

body.sdp-redesigned .dp-quick-card:hover .dp-quick-icon {
  transform: scale(1.1) rotate(-3deg);
  background: rgba(181, 144, 74, 0.14);
  color: #7A5F23;
}

body.sdp-redesigned .dp-quick-label {
  transition: color 0.2s ease;
}

body.sdp-redesigned .dp-quick-card:hover .dp-quick-label {
  color: var(--sdp-preview-navy);
}

/* ─────────────────────────────────────────────────────────────
   5. TOPBAR — polish & depth
   ───────────────────────────────────────────────────────────── */

body.sdp-redesigned .top-bar {
  backdrop-filter: blur(12px) saturate(1.4);
  background:
    linear-gradient(180deg, rgba(255, 254, 250, 0.96), rgba(255, 254, 250, 0.88)) !important;
  border-bottom: 1px solid rgba(31, 45, 74, 0.08) !important;
  box-shadow:
    0 1px 0 rgba(181, 144, 74, 0.06),
    0 4px 16px rgba(31, 45, 74, 0.06) !important;
}

[data-theme="dark"] body.sdp-redesigned .top-bar {
  background:
    linear-gradient(180deg, rgba(18, 29, 46, 0.96), rgba(13, 21, 35, 0.92)) !important;
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03),
    0 4px 16px rgba(0, 0, 0, 0.20) !important;
}

body.sdp-redesigned .sidebar-toggle-topbar,
body.sdp-redesigned .topbar-menu-toggle {
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

body.sdp-redesigned .sidebar-toggle-topbar:hover,
body.sdp-redesigned .topbar-menu-toggle:hover {
  transform: scale(1.05);
}

body.sdp-redesigned .sidebar-toggle-topbar:active,
body.sdp-redesigned .topbar-menu-toggle:active {
  transform: scale(0.95);
}

/* ─────────────────────────────────────────────────────────────
   6. SIDEBAR — refined collapsed mode fix + polish
   ───────────────────────────────────────────────────────────── */

body.sdp-redesigned .sidebar {
  transition:
    width 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.32s ease !important;
}

/* Collapsed: center everything, consistent icon sizing */
@media (min-width: 769px) {
  body.sdp-redesigned .sidebar.collapsed {
    width: var(--sdp-sidebar-width-collapsed, 72px) !important;
    transform: none !important;
    overflow: visible !important;
  }

  body.sdp-redesigned .sidebar.collapsed .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 0 !important;
    border-bottom: 1px solid var(--sdp-sidebar-line-soft, rgba(31, 45, 74, 0.07));
  }

  body.sdp-redesigned .sidebar.collapsed .sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0 !important;
  }

  body.sdp-redesigned .sidebar.collapsed .sidebar-logo img {
    width: 34px !important;
    height: 34px !important;
    object-fit: contain;
    margin: 0 auto !important;
    display: block;
  }

  body.sdp-redesigned .sidebar.collapsed .sidebar-logo-text {
    display: none !important;
  }

  body.sdp-redesigned .sidebar.collapsed .sidebar-title {
    display: none !important;
  }

  body.sdp-redesigned .sidebar.collapsed .sidebar-text {
    display: none !important;
  }

  body.sdp-redesigned .sidebar.collapsed .sidebar-arrow {
    display: none !important;
  }

  body.sdp-redesigned .sidebar.collapsed .sidebar-submenu {
    display: none !important;
  }

  body.sdp-redesigned .sidebar.collapsed .sidebar-section {
    padding: 8px 0 !important;
  }

  body.sdp-redesigned .sidebar.collapsed .sidebar-item,
  body.sdp-redesigned .sidebar.collapsed .sidebar-item-parent {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 4px auto !important;
    padding: 0 !important;
    border-radius: 10px !important;
    cursor: pointer;
    pointer-events: auto !important;
    transition:
      background 0.2s ease,
      transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  }

  body.sdp-redesigned .sidebar.collapsed .sidebar-item:hover,
  body.sdp-redesigned .sidebar.collapsed .sidebar-item-parent:hover {
    background: var(--sdp-sidebar-hover-bg, rgba(181, 144, 74, 0.09)) !important;
    transform: scale(1.08);
  }

  body.sdp-redesigned .sidebar.collapsed .sidebar-item.active {
    background: rgba(181, 144, 74, 0.14) !important;
    box-shadow: var(--sdp-sidebar-active-glow, 0 6px 14px -8px rgba(181, 144, 74, 0.55)) !important;
  }

  body.sdp-redesigned .sidebar.collapsed .sidebar-icon {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: var(--sdp-sidebar-icon-ink, #4A5567) !important;
    transform: none !important;
  }

  body.sdp-redesigned .sidebar.collapsed .sidebar-item:hover .sidebar-icon,
  body.sdp-redesigned .sidebar.collapsed .sidebar-item-parent:hover .sidebar-icon {
    color: var(--sdp-sidebar-icon-ink-hover, #17243C) !important;
  }

  body.sdp-redesigned .sidebar.collapsed .sidebar-item.active .sidebar-icon {
    color: var(--sdp-sidebar-gold, #B5904A) !important;
  }

  /* Tooltip on hover */
  body.sdp-redesigned .sidebar.collapsed .sidebar-item[data-tooltip],
  body.sdp-redesigned .sidebar.collapsed .sidebar-item-parent[data-tooltip] {
    position: relative;
  }

  body.sdp-redesigned .sidebar.collapsed .sidebar-item[data-tooltip]::after,
  body.sdp-redesigned .sidebar.collapsed .sidebar-item-parent[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%) scale(0.92);
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--sdp-preview-navy, #17243C);
    color: #FFF;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 9999;
  }

  body.sdp-redesigned .sidebar.collapsed .sidebar-item[data-tooltip]:hover::after,
  body.sdp-redesigned .sidebar.collapsed .sidebar-item-parent[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
}

/* ─────────────────────────────────────────────────────────────
   7. SIDEBAR ITEMS — expanded mode polish
   ───────────────────────────────────────────────────────────── */

body.sdp-redesigned .sidebar-item,
body.sdp-redesigned .sidebar-item-parent {
  transition:
    background 0.2s ease,
    padding-left 0.2s ease,
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

body.sdp-redesigned .sidebar-item:active,
body.sdp-redesigned .sidebar-item-parent:active {
  transform: scale(0.97);
}

/* ─────────────────────────────────────────────────────────────
   8. CONTENT AREA — refined glass container
   ───────────────────────────────────────────────────────────── */

body.sdp-redesigned .main-content {
  animation: sdp-fade-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.sdp-redesigned .main-content.dashboard-premium {
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(181, 144, 74, 0.02), transparent 50%),
    rgba(255, 254, 250, 0.78) !important;
}

/* ─────────────────────────────────────────────────────────────
   9. PAGE HEADERS — premium polish for inner pages
   ───────────────────────────────────────────────────────────── */

body.sdp-redesigned .page-header-premium {
  animation: sdp-fade-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

body.sdp-redesigned .page-header-premium::before {
  background: linear-gradient(90deg,
    rgba(181, 144, 74, 0.08),
    var(--sdp-component-gold, #B5904A),
    rgba(181, 144, 74, 0.08)) !important;
  transition: opacity 0.3s ease;
}

/* ─────────────────────────────────────────────────────────────
   10. TABLE / LISTS — refined data views
   ───────────────────────────────────────────────────────────── */

body.sdp-redesigned .table-container,
body.sdp-redesigned .table-container-premium,
body.sdp-redesigned .data-table-container,
body.sdp-redesigned .list-container {
  animation: sdp-fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

body.sdp-redesigned tbody tr {
  transition: background 0.15s ease;
}

body.sdp-redesigned tbody tr:hover {
  background: rgba(181, 144, 74, 0.04) !important;
}

/* ─────────────────────────────────────────────────────────────
   11. BUTTONS / CONTROLS — tactile feel
   ───────────────────────────────────────────────────────────── */

body.sdp-redesigned button,
body.sdp-redesigned .btn,
body.sdp-redesigned [role="button"] {
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

body.sdp-redesigned button:active,
body.sdp-redesigned .btn:active,
body.sdp-redesigned [role="button"]:active {
  transform: scale(0.96);
}

/* ─────────────────────────────────────────────────────────────
   12. FORM INPUTS — focus ring gold accent
   ───────────────────────────────────────────────────────────── */

body.sdp-redesigned input:focus,
body.sdp-redesigned select:focus,
body.sdp-redesigned textarea:focus {
  outline: none !important;
  border-color: var(--color-focus-border, #B5904A) !important;
  box-shadow: 0 0 0 3px rgba(181, 144, 74, 0.18),
              0 1px 2px rgba(31, 45, 74, 0.06) !important;
}

body.sdp-redesigned input,
body.sdp-redesigned select,
body.sdp-redesigned textarea {
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease !important;
}

/* ─────────────────────────────────────────────────────────────
   13. SCROLLBAR — styled subtle
   ───────────────────────────────────────────────────────────── */

body.sdp-redesigned ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

body.sdp-redesigned ::-webkit-scrollbar-track {
  background: transparent;
}

body.sdp-redesigned ::-webkit-scrollbar-thumb {
  background: rgba(31, 45, 74, 0.14);
  border-radius: 3px;
}

body.sdp-redesigned ::-webkit-scrollbar-thumb:hover {
  background: rgba(31, 45, 74, 0.24);
}

[data-theme="dark"] body.sdp-redesigned ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] body.sdp-redesigned ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ─────────────────────────────────────────────────────────────
   14. DARK MODE — enhanced depth & glow effects
   ───────────────────────────────────────────────────────────── */

[data-theme="dark"] body.sdp-redesigned .dp-hero {
  background:
    radial-gradient(ellipse 80% 60% at 70% -10%, rgba(181, 144, 74, 0.08), transparent 50%),
    linear-gradient(135deg, #0D1520 0%, #132033 40%, #162640 70%, #1A2D4A 100%) !important;
  border-color: rgba(181, 144, 74, 0.22) !important;
  box-shadow:
    0 1px 0 rgba(181, 144, 74, 0.06) inset,
    0 24px 56px rgba(0, 0, 0, 0.40),
    0 8px 16px rgba(0, 0, 0, 0.20) !important;
}

[data-theme="dark"] body.sdp-redesigned .dp-card:hover {
  border-color: rgba(181, 144, 74, 0.28) !important;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.10),
    0 4px 8px rgba(0, 0, 0, 0.12),
    0 20px 44px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(181, 144, 74, 0.10) !important;
}

[data-theme="dark"] body.sdp-redesigned .dp-quick-card:hover {
  border-color: rgba(181, 144, 74, 0.32) !important;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.14),
    0 14px 32px rgba(0, 0, 0, 0.24) !important;
}

[data-theme="dark"] body.sdp-redesigned .dp-quick-card:hover .dp-quick-icon {
  background: rgba(181, 144, 74, 0.18);
  color: var(--color-gold-200, #EDD99A);
}

[data-theme="dark"] body.sdp-redesigned .main-content.dashboard-premium {
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(181, 144, 74, 0.03), transparent 50%),
    linear-gradient(180deg, rgba(18, 29, 46, 0.94), rgba(13, 21, 35, 0.94)),
    var(--sdp-preview-panel) !important;
}

[data-theme="dark"] body.sdp-redesigned tbody tr:hover {
  background: rgba(181, 144, 74, 0.06) !important;
}

/* ─────────────────────────────────────────────────────────────
   15. NEWS SECTIONS — polish
   ───────────────────────────────────────────────────────────── */

body.sdp-redesigned .dp-news-section {
  overflow: hidden;
  transition:
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

body.sdp-redesigned .dp-news-section:hover {
  border-color: rgba(31, 45, 74, 0.14);
  box-shadow: 0 14px 34px rgba(31, 45, 74, 0.10);
}

/* ─────────────────────────────────────────────────────────────
   16. SELECTION HIGHLIGHT — branded
   ───────────────────────────────────────────────────────────── */

body.sdp-redesigned ::selection {
  background: rgba(181, 144, 74, 0.22);
  color: var(--sdp-preview-ink);
}

/* ─────────────────────────────────────────────────────────────
   17. LOADING SHIMMER for card values (optional class)
   ───────────────────────────────────────────────────────────── */

body.sdp-redesigned .dp-card-value:empty::after,
body.sdp-redesigned .dp-card-value:has(> :only-child:empty)::after {
  content: "";
  display: block;
  width: 60px;
  height: 1.6em;
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(31, 45, 74, 0.04) 25%, rgba(31, 45, 74, 0.08) 50%, rgba(31, 45, 74, 0.04) 75%);
  background-size: 200% 100%;
  animation: sdp-shimmer 1.5s infinite ease-in-out;
}

/* ─────────────────────────────────────────────────────────────
   18. BADGES / PILLS — refined status indicators
   ───────────────────────────────────────────────────────────── */

body.sdp-redesigned .badge,
body.sdp-redesigned .status-badge,
body.sdp-redesigned .tag {
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

body.sdp-redesigned .badge:hover,
body.sdp-redesigned .status-badge:hover {
  transform: scale(1.04);
}

/* ─────────────────────────────────────────────────────────────
   19. MODALS — premium entrance & backdrop
   ───────────────────────────────────────────────────────────── */

@keyframes sdp-modal-in {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes sdp-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

body.sdp-redesigned .modal-content,
body.sdp-redesigned .modal-dialog,
body.sdp-redesigned [class*="modal"] > div {
  animation: sdp-modal-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.sdp-redesigned .modal-overlay,
body.sdp-redesigned .modal-backdrop {
  animation: sdp-backdrop-in 0.2s ease both;
  backdrop-filter: blur(4px);
}

/* ─────────────────────────────────────────────────────────────
   20. SIDEBAR SUBMENU — smooth expand
   ───────────────────────────────────────────────────────────── */

body.sdp-redesigned .sidebar-submenu {
  transition:
    max-height 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease,
    padding 0.28s ease !important;
  overflow: hidden;
}

body.sdp-redesigned .sidebar-submenu:not(.open):not(.active):not(.expanded) {
  max-height: 0 !important;
  opacity: 0;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

body.sdp-redesigned .sidebar-submenu.open,
body.sdp-redesigned .sidebar-submenu.active,
body.sdp-redesigned .sidebar-submenu.expanded {
  opacity: 1;
}

/* ─────────────────────────────────────────────────────────────
   21. HEADER ICON — hover glow
   ───────────────────────────────────────────────────────────── */

body.sdp-redesigned .page-header-premium .header-icon,
body.sdp-redesigned .section-icon {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.25s ease;
}

body.sdp-redesigned .page-header-premium:hover .header-icon {
  transform: scale(1.06) rotate(-2deg);
  box-shadow: 0 6px 18px rgba(31, 45, 74, 0.12);
}

/* ─────────────────────────────────────────────────────────────
   22. BREADCRUMB — subtle hover
   ───────────────────────────────────────────────────────────── */

body.sdp-redesigned .breadcrumb a,
body.sdp-redesigned .breadcrumb-premium a,
body.sdp-redesigned .reports-breadcrumb a {
  transition: color 0.15s ease, transform 0.15s ease;
}

body.sdp-redesigned .breadcrumb a:hover,
body.sdp-redesigned .breadcrumb-premium a:hover,
body.sdp-redesigned .reports-breadcrumb a:hover {
  color: var(--sdp-preview-gold, #B5904A) !important;
  transform: translateX(2px);
}

/* ─────────────────────────────────────────────────────────────
   23. NOTIFICATION BELL — subtle bounce on unread
   ───────────────────────────────────────────────────────────── */

@keyframes sdp-bell-ring {
  0%, 100% { transform: rotate(0); }
  10% { transform: rotate(8deg); }
  20% { transform: rotate(-6deg); }
  30% { transform: rotate(4deg); }
  40% { transform: rotate(-2deg); }
  50% { transform: rotate(0); }
}

body.sdp-redesigned .notification-bell.has-unread svg,
body.sdp-redesigned .topbar-notifications.has-unread svg {
  animation: sdp-bell-ring 2s ease-in-out 1s 1;
}

/* ─────────────────────────────────────────────────────────────
   24. FOCUS VISIBLE — stronger accessibility ring
   ───────────────────────────────────────────────────────────── */

body.sdp-redesigned a:focus-visible,
body.sdp-redesigned button:focus-visible,
body.sdp-redesigned [role="button"]:focus-visible,
body.sdp-redesigned [tabindex]:focus-visible {
  outline: 2px solid var(--color-focus-border, #B5904A) !important;
  outline-offset: 2px;
  border-radius: inherit;
}

/* ─────────────────────────────────────────────────────────────
   25. SMOOTH REVEAL for late-loading sections
   ───────────────────────────────────────────────────────────── */

body.sdp-redesigned .management-section,
body.sdp-redesigned .search-container-premium,
body.sdp-redesigned .content-card {
  animation: sdp-fade-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

/* ─────────────────────────────────────────────────────────────
   26. MODULE TITLE (hub pages) — elevated header
   ───────────────────────────────────────────────────────────── */

body.sdp-redesigned .module-title,
body.sdp-redesigned .reports-module-title {
  animation: sdp-scale-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 18px 44px rgba(23, 36, 60, 0.22),
    0 6px 12px rgba(23, 36, 60, 0.10) !important;
}

body.sdp-redesigned .module-title h1,
body.sdp-redesigned .reports-module-title h1,
body.sdp-redesigned .module-title h2 {
  background: linear-gradient(135deg, #FFFFFF 20%, #F7F0DC 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─────────────────────────────────────────────────────────────
   27. HUB CARD (grid cards in module pages) — refined
   ───────────────────────────────────────────────────────────── */

body.sdp-redesigned .hub-card,
body.sdp-redesigned .module-card,
body.sdp-redesigned .grid-card {
  transition:
    transform 0.26s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.26s ease,
    border-color 0.26s ease !important;
}

body.sdp-redesigned .hub-card:hover,
body.sdp-redesigned .module-card:hover,
body.sdp-redesigned .grid-card:hover {
  transform: translateY(-3px) !important;
  border-color: rgba(181, 144, 74, 0.20) !important;
  box-shadow:
    0 4px 8px rgba(31, 45, 74, 0.06),
    0 16px 36px rgba(31, 45, 74, 0.12) !important;
}

body.sdp-redesigned .hub-card:active,
body.sdp-redesigned .module-card:active,
body.sdp-redesigned .grid-card:active {
  transform: translateY(0) scale(0.98) !important;
  transition-duration: 0.1s !important;
}

/* Hub card chevron — canonical (vence hub-cards-premium legado quando carregado por último) */
body.sdp-redesigned .hub-card-icon {
  grid-column: 1;
  grid-row: 1;
}

body.sdp-redesigned .hub-card-content {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

body.sdp-redesigned .hub-card-arrow,
body.sdp-redesigned .reports-hub-card .card-arrow {
  grid-column: 3;
  grid-row: 1;
  position: static;
  inset: auto;
  bottom: auto;
  right: auto;
  top: auto;
  align-self: center;
  justify-self: end;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: rgba(181, 144, 74, 0.14);
  color: #8A6A2C;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  line-height: 1 !important;
  font-size: 0 !important;
  opacity: 1;
  backdrop-filter: none;
  transform: none;
  overflow: hidden;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

body.sdp-redesigned .hub-card-arrow svg,
body.sdp-redesigned .reports-hub-card .card-arrow svg {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}

body.sdp-redesigned .hub-card:hover .hub-card-arrow,
body.sdp-redesigned .reports-hub-card:hover .card-arrow {
  transform: translateX(2px);
  background: rgba(181, 144, 74, 0.22);
}

body.sdp-redesigned .hub-card-arrow::before,
body.sdp-redesigned .hub-card-arrow::after,
body.sdp-redesigned .reports-hub-card .card-arrow::before,
body.sdp-redesigned .reports-hub-card .card-arrow::after {
  content: none !important;
  display: none !important;
}

body.sdp-redesigned .reports-hub-card .card-arrow svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.25;
  flex-shrink: 0;
}

[data-theme="dark"] body.sdp-redesigned .hub-card-arrow,
[data-theme="dark"] body.sdp-redesigned .reports-hub-card .card-arrow {
  background: rgba(181, 144, 74, 0.16);
  color: #F3E6C7;
}

@media (max-width: 576px) {
  body.sdp-redesigned .hub-card-arrow,
  body.sdp-redesigned .reports-hub-card .card-arrow {
    width: 32px;
    height: 32px;
    position: static;
    transform: none;
  }

  body.sdp-redesigned .hub-card:hover .hub-card-arrow,
  body.sdp-redesigned .reports-hub-card:hover .card-arrow {
    transform: translateX(2px);
  }
}

/* ─────────────────────────────────────────────────────────────
   28. SMOOTH THEME TRANSITION (light/dark mode switch)
   ───────────────────────────────────────────────────────────── */

body.sdp-redesigned,
body.sdp-redesigned .sidebar,
body.sdp-redesigned .top-bar,
body.sdp-redesigned .main-content {
  transition-property: background, background-color, color, border-color, box-shadow;
  transition-duration: 0.35s;
  transition-timing-function: ease;
}

/* ─────────────────────────────────────────────────────────────
   29. PALETTE HARMONIZATION — override off-palette colors
   ─────────────────────────────────────────────────────────────
   Many pages use Tailwind colors (emerald #10b981, indigo #6366f1,
   blue #3b82f6, violet #8b5cf6) that clash with the navy+gold
   institutional palette. Override them globally for sdp-redesigned.
   ───────────────────────────────────────────────────────────── */

/* --- Primary action buttons (green emerald → navy) --- */
body.sdp-redesigned .btn-add,
body.sdp-redesigned .btn-success,
body.sdp-redesigned .btn-confirm,
body.sdp-redesigned .btn-submit,
body.sdp-redesigned .btn-save,
body.sdp-redesigned [class*="btn-primary"]:not(.btn-primary-vendas) {
  background: var(--sdp-preview-navy, #1F2D4A) !important;
  border-color: var(--sdp-preview-navy, #1F2D4A) !important;
  color: #FFFFFF !important;
}

body.sdp-redesigned .btn-add:hover,
body.sdp-redesigned .btn-success:hover,
body.sdp-redesigned .btn-confirm:hover,
body.sdp-redesigned .btn-submit:hover,
body.sdp-redesigned .btn-save:hover,
body.sdp-redesigned [class*="btn-primary"]:not(.btn-primary-vendas):hover {
  background: var(--color-navy-800, #2A3A5C) !important;
  border-color: var(--color-navy-800, #2A3A5C) !important;
}

/* --- Secondary action buttons (indigo/violet → gold) --- */
body.sdp-redesigned .btn-secondary,
body.sdp-redesigned .btn-info,
body.sdp-redesigned .btn-export,
body.sdp-redesigned .btn-outline {
  background: transparent !important;
  border: 1.5px solid var(--sdp-preview-navy, #1F2D4A) !important;
  color: var(--sdp-preview-navy, #1F2D4A) !important;
}

body.sdp-redesigned .btn-secondary:hover,
body.sdp-redesigned .btn-info:hover,
body.sdp-redesigned .btn-export:hover,
body.sdp-redesigned .btn-outline:hover {
  background: rgba(31, 45, 74, 0.06) !important;
}

/* --- Inline style overrides for hardcoded colors --- */
body.sdp-redesigned [style*="background: #10b981"],
body.sdp-redesigned [style*="background:#10b981"],
body.sdp-redesigned [style*="background-color: #10b981"],
body.sdp-redesigned [style*="background: #059669"],
body.sdp-redesigned [style*="background:#059669"],
body.sdp-redesigned [style*="background-color: #059669"],
body.sdp-redesigned [style*="background: #22c55e"],
body.sdp-redesigned [style*="background:#22c55e"] {
  background: var(--sdp-preview-navy, #1F2D4A) !important;
  border-color: var(--sdp-preview-navy, #1F2D4A) !important;
}

body.sdp-redesigned [style*="background: #6366f1"],
body.sdp-redesigned [style*="background:#6366f1"],
body.sdp-redesigned [style*="background-color: #6366f1"],
body.sdp-redesigned [style*="background: #4f46e5"],
body.sdp-redesigned [style*="background:#4f46e5"],
body.sdp-redesigned [style*="background-color: #4f46e5"],
body.sdp-redesigned [style*="background: #8b5cf6"],
body.sdp-redesigned [style*="background:#8b5cf6"] {
  background: var(--color-navy-800, #2A3A5C) !important;
  border-color: var(--color-navy-800, #2A3A5C) !important;
}

body.sdp-redesigned [style*="background: #3b82f6"],
body.sdp-redesigned [style*="background:#3b82f6"],
body.sdp-redesigned [style*="background-color: #3b82f6"] {
  background: var(--sdp-preview-navy, #1F2D4A) !important;
  border-color: var(--sdp-preview-navy, #1F2D4A) !important;
}

/* --- CSS variable overrides for pages that use --primary-color --- */
body.sdp-redesigned {
  --primary-color: var(--sdp-preview-navy, #1F2D4A);
  --accent-color: var(--sdp-preview-gold, #B5904A);
}

/* --- Status indicator accents (keep semantic but harmonize) ---
   Success: navy-adjacent dark green
   Warning: gold-adjacent amber
   Danger: stays red (critical UX meaning)
   Info: navy                                                   */
body.sdp-redesigned .nd-stat-card.success::before,
body.sdp-redesigned .stat-card.success::before {
  background: var(--color-status-success, #16A34A) !important;
}

body.sdp-redesigned .nd-stat-card.info::before,
body.sdp-redesigned .stat-card.info::before {
  background: var(--sdp-preview-navy, #1F2D4A) !important;
}

/* --- Tab/pill active states that use off-palette colors --- */
body.sdp-redesigned .tab-btn.active,
body.sdp-redesigned .pill-btn.active,
body.sdp-redesigned .filter-btn.active,
body.sdp-redesigned .segmented-btn.active {
  background: var(--sdp-preview-navy, #1F2D4A) !important;
  color: #FFFFFF !important;
  border-color: var(--sdp-preview-navy, #1F2D4A) !important;
}

/* --- Links that use off-palette blue/indigo --- */
body.sdp-redesigned a[style*="color: #3b82f6"],
body.sdp-redesigned a[style*="color:#3b82f6"],
body.sdp-redesigned a[style*="color: #6366f1"],
body.sdp-redesigned a[style*="color:#6366f1"] {
  color: var(--sdp-preview-navy, #1F2D4A) !important;
}

/* --- Dark mode adjustments for harmonized buttons --- */
[data-theme="dark"] body.sdp-redesigned .btn-add,
[data-theme="dark"] body.sdp-redesigned .btn-success,
[data-theme="dark"] body.sdp-redesigned .btn-confirm,
[data-theme="dark"] body.sdp-redesigned .btn-submit,
[data-theme="dark"] body.sdp-redesigned .btn-save,
[data-theme="dark"] body.sdp-redesigned [class*="btn-primary"]:not(.btn-primary-vendas) {
  background: var(--color-navy-700, #36476B) !important;
  border-color: var(--color-navy-600, #445782) !important;
}

[data-theme="dark"] body.sdp-redesigned .btn-add:hover,
[data-theme="dark"] body.sdp-redesigned .btn-success:hover,
[data-theme="dark"] body.sdp-redesigned .btn-confirm:hover,
[data-theme="dark"] body.sdp-redesigned .btn-submit:hover,
[data-theme="dark"] body.sdp-redesigned .btn-save:hover,
[data-theme="dark"] body.sdp-redesigned [class*="btn-primary"]:not(.btn-primary-vendas):hover {
  background: var(--color-navy-600, #445782) !important;
}

[data-theme="dark"] body.sdp-redesigned .btn-secondary,
[data-theme="dark"] body.sdp-redesigned .btn-info,
[data-theme="dark"] body.sdp-redesigned .btn-export,
[data-theme="dark"] body.sdp-redesigned .btn-outline {
  border-color: var(--color-navy-100, #E8EDF4) !important;
  color: var(--color-navy-100, #E8EDF4) !important;
}

[data-theme="dark"] body.sdp-redesigned .btn-secondary:hover,
[data-theme="dark"] body.sdp-redesigned .btn-info:hover,
[data-theme="dark"] body.sdp-redesigned .btn-export:hover,
[data-theme="dark"] body.sdp-redesigned .btn-outline:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] body.sdp-redesigned [style*="background: #10b981"],
[data-theme="dark"] body.sdp-redesigned [style*="background:#10b981"],
[data-theme="dark"] body.sdp-redesigned [style*="background: #059669"],
[data-theme="dark"] body.sdp-redesigned [style*="background:#059669"],
[data-theme="dark"] body.sdp-redesigned [style*="background: #22c55e"],
[data-theme="dark"] body.sdp-redesigned [style*="background:#22c55e"],
[data-theme="dark"] body.sdp-redesigned [style*="background: #6366f1"],
[data-theme="dark"] body.sdp-redesigned [style*="background:#6366f1"],
[data-theme="dark"] body.sdp-redesigned [style*="background: #4f46e5"],
[data-theme="dark"] body.sdp-redesigned [style*="background:#4f46e5"],
[data-theme="dark"] body.sdp-redesigned [style*="background: #8b5cf6"],
[data-theme="dark"] body.sdp-redesigned [style*="background:#8b5cf6"],
[data-theme="dark"] body.sdp-redesigned [style*="background: #3b82f6"],
[data-theme="dark"] body.sdp-redesigned [style*="background:#3b82f6"] {
  background: var(--color-navy-700, #36476B) !important;
  border-color: var(--color-navy-600, #445782) !important;
}

/* --- Legacy navy→teal gradients → pure navy institutional --- */
body.sdp-redesigned .page-header-premium,
body.sdp-redesigned .module-title,
body.sdp-redesigned .reports-module-title {
  --accent-color: var(--sdp-preview-gold, #B5904A);
}

/* Override teal in legacy gradient headers */
body.sdp-redesigned [style*="#B5904A"],
body.sdp-redesigned [style*="#14b8a6"],
body.sdp-redesigned [style*="#C9A560"],
body.sdp-redesigned [style*="#0d9488"] {
  --teal-override: 1;
}

/* Stat card and module accent strips using teal → gold */
body.sdp-redesigned .stat-card::before,
body.sdp-redesigned .nd-stat-card::before {
  border-radius: 2px;
}

/* --- Form/filter container search buttons --- */
body.sdp-redesigned .search-btn,
body.sdp-redesigned .filter-btn-search,
body.sdp-redesigned [type="submit"],
body.sdp-redesigned button[onclick*="buscar"],
body.sdp-redesigned button[onclick*="pesquisar"],
body.sdp-redesigned button[onclick*="filtrar"],
body.sdp-redesigned button[onclick*="Buscar"],
body.sdp-redesigned button[onclick*="Pesquisar"],
body.sdp-redesigned button[onclick*="Filtrar"] {
  background: var(--sdp-preview-navy, #1F2D4A) !important;
  color: #FFFFFF !important;
  border-color: var(--sdp-preview-navy, #1F2D4A) !important;
}

body.sdp-redesigned .search-btn:hover,
body.sdp-redesigned .filter-btn-search:hover,
body.sdp-redesigned [type="submit"]:hover {
  background: var(--color-navy-800, #2A3A5C) !important;
}

/* --- Danger/destructive buttons stay red (semantic) --- */
body.sdp-redesigned .btn-danger,
body.sdp-redesigned .btn-delete,
body.sdp-redesigned .btn-remove,
body.sdp-redesigned .btn-excluir,
body.sdp-redesigned [style*="background: #ef4444"],
body.sdp-redesigned [style*="background:#ef4444"],
body.sdp-redesigned [style*="background: #dc2626"],
body.sdp-redesigned [style*="background:#dc2626"] {
  background: var(--color-status-danger, #DC2626) !important;
  border-color: var(--color-status-danger, #DC2626) !important;
  color: #FFFFFF !important;
}

body.sdp-redesigned .btn-danger:hover,
body.sdp-redesigned .btn-delete:hover,
body.sdp-redesigned .btn-remove:hover,
body.sdp-redesigned .btn-excluir:hover {
  background: #B91C1C !important;
  border-color: #B91C1C !important;
}

/* --- Legacy navy→teal gradient headers → pure navy institutional --- */
body.sdp-redesigned .profile-header,
body.sdp-redesigned .ficha-header,
body.sdp-redesigned .page-banner,
body.sdp-redesigned .header-gradient {
  background: linear-gradient(135deg, #16243C 0%, #1F2D4A 56%, #223455 100%) !important;
}

/* .btn-salvar and .btn-filter-primary (legacy action buttons with teal) */
body.sdp-redesigned .btn-salvar,
body.sdp-redesigned .btn-filter-primary,
body.sdp-redesigned .btn-filtrar {
  background: var(--sdp-preview-navy, #1F2D4A) !important;
  color: #FFFFFF !important;
  border-color: var(--sdp-preview-navy, #1F2D4A) !important;
}

body.sdp-redesigned .btn-salvar:hover,
body.sdp-redesigned .btn-filter-primary:hover,
body.sdp-redesigned .btn-filtrar:hover {
  background: var(--color-navy-800, #2A3A5C) !important;
}

/* Progress bars: teal/emerald → gold accent */
body.sdp-redesigned .progress-fill,
body.sdp-redesigned .progress-bar-fill {
  background: linear-gradient(90deg, var(--sdp-preview-gold, #B5904A), var(--color-gold-200, #EDD99A)) !important;
}

/* ============================================================
   26. Responsivo global + tipografia unificada + sidebar/perfil/tutoriais
   (todas as abas com body.sdp-redesigned)
   ============================================================ */

body.sdp-redesigned,
body.sdp-redesigned .main-content,
body.sdp-redesigned .content-area,
body.sdp-redesigned .tutoriais-header,
body.sdp-redesigned .tutoriais-title,
body.sdp-redesigned .profile-card-header h3,
body.sdp-redesigned .module-title,
body.sdp-redesigned .termos-content {
  font-family: var(--font-body, 'Inter'), system-ui, sans-serif !important;
}

/* Perfil — esconder emoji legado se ainda existir no HTML antigo */
body.sdp-redesigned .profile-card-header > .icon:not(.sdp-icon):not(.profile-icon),
body.sdp-redesigned .profile-card-header > span.icon {
  display: none !important;
  font-size: 0 !important;
  width: 0 !important;
  overflow: hidden !important;
}

body.sdp-redesigned .profile-icon {
  flex-shrink: 0;
}

body.sdp-redesigned .profile-container {
  width: 100%;
  max-width: 860px;
  box-sizing: border-box;
}

/* Tutoriais — header navy/gold (tutoriais.css legado usa roxo) */
body.sdp-redesigned .tutoriais-header {
  background: linear-gradient(135deg, #16243C 0%, #1F2D4A 56%, #223455 100%) !important;
  border: 1px solid rgba(181, 144, 74, 0.35) !important;
  border-radius: 16px !important;
  flex-wrap: wrap !important;
  gap: 1rem !important;
}

body.sdp-redesigned .tutoriais-title {
  color: #fff !important;
  font-weight: 700 !important;
}

body.sdp-redesigned .tutoriais-subtitle {
  color: rgba(255, 255, 255, 0.88) !important;
}

body.sdp-redesigned .tutoriais-stats {
  flex-wrap: wrap !important;
}

body.sdp-redesigned .accordion-header {
  flex-wrap: wrap !important;
  gap: 0.75rem !important;
}

body.sdp-redesigned .tutorial-grid,
body.sdp-redesigned .tutoriais-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)) !important;
  gap: 1rem !important;
}

body.sdp-redesigned .profile-grid,
body.sdp-redesigned .form-row,
body.sdp-redesigned .filters-grid,
body.sdp-redesigned .filter-grid,
body.sdp-redesigned .grid-2,
body.sdp-redesigned .grid-3,
body.sdp-redesigned .grid-4 {
  gap: var(--sdp-space-4, 1rem) !important;
}

@media (max-width: 768px) {
  body.sdp-redesigned .profile-grid,
  body.sdp-redesigned .form-row,
  body.sdp-redesigned .filters-grid,
  body.sdp-redesigned .filter-grid,
  body.sdp-redesigned .grid-2,
  body.sdp-redesigned .grid-3,
  body.sdp-redesigned .grid-4 {
    grid-template-columns: 1fr !important;
  }

  body.sdp-redesigned .tutoriais-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 1.25rem 1rem !important;
  }

  body.sdp-redesigned .tutoriais-stats {
    width: 100% !important;
  }

  body.sdp-redesigned .profile-header {
    padding: 1.5rem 1rem !important;
  }

  body.sdp-redesigned .profile-card-body {
    padding: 1rem !important;
  }

  body.sdp-redesigned .actions-row {
    flex-direction: column !important;
  }

  body.sdp-redesigned .actions-row .btn-save,
  body.sdp-redesigned .actions-row .btn-secondary,
  body.sdp-redesigned .actions-row button {
    width: 100% !important;
  }

  body.sdp-redesigned .sidebar-section {
    padding-bottom: 8px !important;
  }

  body.sdp-redesigned .sidebar-text {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    line-height: 1.3 !important;
  }
}

@media (max-width: 480px) {
  body.sdp-redesigned .main-content:not(.dashboard-premium),
  body.sdp-redesigned .main-content.dashboard-premium {
    width: calc(100% - 16px) !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  body.sdp-redesigned .accordion-header {
    padding: 0.875rem !important;
  }
}

body.sdp-redesigned .top-bar-left,
body.sdp-redesigned .top-bar-center,
body.sdp-redesigned .top-bar-right,
body.sdp-redesigned .topbar-left,
body.sdp-redesigned .topbar-center,
body.sdp-redesigned .topbar-right {
  min-width: 0;
}

/* Scroll horizontal em wrappers — NÃO usar display:block em <table> (quebra layout) */
body.sdp-redesigned .table-scroll,
body.sdp-redesigned .table-wrapper,
body.sdp-redesigned .table-responsive,
body.sdp-redesigned .nd-table-scroll,
body.sdp-redesigned .nd-table-wrap,
body.sdp-redesigned .scroll-x {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

/* ============================================================
   27. Tables, modals, forms, empty states + dark parity
   Tokens: --sdp-surface-border, --sdp-text-muted (design-system)
   ============================================================ */

body.sdp-redesigned {
  --sdp-surface-border: rgba(31, 45, 74, 0.12);
  --sdp-text-muted: var(--color-text-muted, #697386);
  --sdp-empty-bg: rgba(243, 230, 199, 0.22);
}

[data-theme="dark"] body.sdp-redesigned {
  --sdp-surface-border: rgba(226, 232, 240, 0.14);
  --sdp-text-muted: var(--color-text-muted, #A8B3C7);
  --sdp-empty-bg: rgba(181, 144, 74, 0.08);
}

body.sdp-redesigned .text-muted,
body.sdp-redesigned .field-info,
body.sdp-redesigned .module-subtitle,
body.sdp-redesigned .breadcrumb,
body.sdp-redesigned .breadcrumb span,
body.sdp-redesigned .form-hint,
body.sdp-redesigned .help-text {
  color: var(--sdp-text-muted) !important;
}

body.sdp-redesigned table thead th,
body.sdp-redesigned .data-table thead th,
body.sdp-redesigned .table-premium thead th {
  background: rgba(22, 36, 60, 0.04) !important;
  color: var(--sdp-preview-navy, #17243C) !important;
  border-bottom: 2px solid rgba(181, 144, 74, 0.35) !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em;
}

body.sdp-redesigned table td,
body.sdp-redesigned table th {
  border-color: var(--sdp-surface-border) !important;
}

body.sdp-redesigned table tbody tr:nth-child(even) {
  background: rgba(22, 36, 60, 0.02);
}

[data-theme="dark"] body.sdp-redesigned table thead th,
[data-theme="dark"] body.sdp-redesigned .data-table thead th {
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--sdp-preview-ink, #F8FAFC) !important;
  border-bottom-color: rgba(181, 144, 74, 0.45) !important;
}

[data-theme="dark"] body.sdp-redesigned table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.025);
}

body.sdp-redesigned .modal-content,
body.sdp-redesigned .modal-dialog,
body.sdp-redesigned .modal-box,
body.sdp-redesigned [class*="modal-panel"] {
  border: 1px solid var(--sdp-surface-border) !important;
  border-radius: 14px !important;
  box-shadow: var(--shadow-xl, 0 16px 36px rgba(31, 45, 74, 0.14)) !important;
}

body.sdp-redesigned .modal-header,
body.sdp-redesigned .modal-title {
  color: var(--sdp-preview-navy, #17243C) !important;
  border-bottom: 1px solid var(--sdp-surface-border) !important;
}

[data-theme="dark"] body.sdp-redesigned .modal-header,
[data-theme="dark"] body.sdp-redesigned .modal-title {
  color: var(--sdp-preview-ink, #F8FAFC) !important;
}

body.sdp-redesigned .modal-overlay,
body.sdp-redesigned .modal-backdrop {
  background: rgba(22, 36, 60, 0.48) !important;
}

[data-theme="dark"] body.sdp-redesigned .modal-overlay,
[data-theme="dark"] body.sdp-redesigned .modal-backdrop {
  background: rgba(0, 0, 0, 0.62) !important;
}

body.sdp-redesigned .empty-state,
body.sdp-redesigned .no-data,
body.sdp-redesigned .empty-message,
body.sdp-redesigned .state-empty {
  background: var(--sdp-empty-bg) !important;
  border: 1px dashed rgba(181, 144, 74, 0.45) !important;
  border-radius: 12px !important;
  color: var(--sdp-text-muted) !important;
  padding: 2rem 1.5rem !important;
  text-align: center !important;
}

body.sdp-redesigned .empty-state-icon,
body.sdp-redesigned .no-data-icon {
  color: var(--sdp-preview-gold, #B5904A) !important;
  opacity: 0.85;
}

body.sdp-redesigned .profile-field label,
body.sdp-redesigned .form-group label,
body.sdp-redesigned .filtro-group label {
  color: var(--sdp-preview-navy, #17243C) !important;
  font-weight: 600 !important;
}

[data-theme="dark"] body.sdp-redesigned .profile-field label,
[data-theme="dark"] body.sdp-redesigned .form-group label,
[data-theme="dark"] body.sdp-redesigned .filtro-group label {
  color: var(--sdp-preview-ink, #F8FAFC) !important;
}

body.sdp-redesigned input:not([type="checkbox"]):not([type="radio"]),
body.sdp-redesigned select,
body.sdp-redesigned textarea {
  background: var(--sdp-preview-panel, #FFFEFA) !important;
  border: 1px solid var(--sdp-surface-border) !important;
  color: var(--sdp-preview-ink) !important;
}

[data-theme="dark"] body.sdp-redesigned input:not([type="checkbox"]):not([type="radio"]),
[data-theme="dark"] body.sdp-redesigned select,
[data-theme="dark"] body.sdp-redesigned textarea {
  background: rgba(18, 29, 46, 0.92) !important;
  border-color: var(--sdp-surface-border) !important;
  color: var(--sdp-preview-ink) !important;
}

body.sdp-redesigned .termos-content,
body.sdp-redesigned .sdp-atualizacao-container,
body.sdp-redesigned #atualizacoes-sistema {
  color: var(--sdp-preview-ink) !important;
}

body.sdp-redesigned .termos-content h2,
body.sdp-redesigned .termos-content h3 {
  color: var(--sdp-preview-navy, #17243C) !important;
  border-bottom: 1px solid rgba(181, 144, 74, 0.25);
  padding-bottom: 0.35rem;
}

[data-theme="dark"] body.sdp-redesigned .termos-content h2,
[data-theme="dark"] body.sdp-redesigned .termos-content h3 {
  color: var(--sdp-preview-ink, #F8FAFC) !important;
}

/* ============================================================
   30. Topbar fixa — content-area compensa altura (evita corte / top negativo)
   ============================================================ */

body.sdp-redesigned .content-area {
  padding-top: var(--topbar-height, 64px) !important;
  height: calc(100vh - var(--topbar-height, 64px)) !important;
  max-height: calc(100vh - var(--topbar-height, 64px)) !important;
  box-sizing: border-box !important;
}

body.sdp-redesigned .main-content,
body.sdp-redesigned .main-content:not(.dashboard-premium),
body.sdp-redesigned .main-content.dashboard-premium {
  margin-top: 0 !important;
  animation: sdp-fade-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) both !important;
}

@media (max-width: 768px) {
  body.sdp-redesigned .content-area {
    padding-top: var(--topbar-height, 56px) !important;
    height: calc(100dvh - var(--topbar-height, 56px)) !important;
    max-height: calc(100dvh - var(--topbar-height, 56px)) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.sdp-redesigned .main-content {
    animation: none !important;
  }
}

/* ============================================================
   31. Toast global (.message) — alinhado ao navy/gold (substitui azul legado)
   ============================================================ */

@keyframes sdp-message-in {
  from {
    transform: translateX(calc(100% + 20px));
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes sdp-message-out {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(calc(100% + 20px));
    opacity: 0;
  }
}

body.sdp-redesigned .message {
  top: calc(var(--topbar-height, 64px) + 12px) !important;
  right: 16px !important;
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 12px !important;
  border-radius: 10px !important;
  font-family: var(--font-body, 'Inter'), system-ui, sans-serif !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
  max-width: min(360px, calc(100vw - 32px)) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow:
    0 1px 0 rgba(181, 144, 74, 0.12),
    0 12px 32px rgba(23, 36, 60, 0.22) !important;
  animation: sdp-message-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both !important;
  overflow: hidden;
}

body.sdp-redesigned .message::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--sdp-preview-gold, #B5904A), transparent);
  opacity: 0.85;
  pointer-events: none;
}

body.sdp-redesigned .message:hover {
  transform: none !important;
}

body.sdp-redesigned .message.message--dismiss {
  animation: sdp-message-out 0.32s ease forwards !important;
}

body.sdp-redesigned .message.info {
  background: linear-gradient(135deg, #16243C 0%, #1F2D4A 58%, #223455 100%) !important;
}

body.sdp-redesigned .message.success {
  background: linear-gradient(135deg, #1a3d32 0%, #1d5c45 58%, #1a4a3a 100%) !important;
  border-color: rgba(134, 239, 172, 0.25) !important;
}

body.sdp-redesigned .message.error {
  background: linear-gradient(135deg, #5c1a1a 0%, #7f1d1d 58%, #991b1b 100%) !important;
  border-color: rgba(252, 165, 165, 0.28) !important;
}

body.sdp-redesigned .message.loading {
  background: linear-gradient(135deg, #16243C 0%, #1F2D4A 100%) !important;
}

body.sdp-redesigned .message-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
}

body.sdp-redesigned .message-icon--spin svg {
  animation: sdp-message-spin 0.9s linear infinite;
}

@keyframes sdp-message-spin {
  to { transform: rotate(360deg); }
}

body.sdp-redesigned .message-text {
  flex: 1;
  min-width: 0;
}

body.sdp-redesigned .message-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

body.sdp-redesigned .message-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

body.sdp-redesigned .message .loading::before {
  display: none;
}

@media (max-width: 768px) {
  body.sdp-redesigned .message {
    top: calc(var(--topbar-height, 56px) + 8px) !important;
    right: 8px !important;
    left: 8px !important;
    max-width: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.sdp-redesigned .message {
    animation: none !important;
  }
  body.sdp-redesigned .message-icon--spin svg {
    animation: none !important;
  }
}

/* ============================================================
   32. Responsive completion — touch, safe-area, tablet, desktop
   Camada final (layout-init); vence design-system 36px @768.
   ============================================================ */

@media (max-width: 768px) {
  body.sdp-redesigned {
    --sdp-control-touch: 44px;
  }

  body.sdp-redesigned .sidebar-toggle-topbar,
  body.sdp-redesigned .topbar-menu-toggle,
  body.sdp-redesigned .user-profile-link,
  body.sdp-redesigned .btn-logout,
  body.sdp-redesigned .notif-bell-btn,
  body.sdp-redesigned .top-bar-right .btn-icon,
  body.sdp-redesigned .top-bar-right button:not(.btn-logout) {
    width: var(--sdp-control-touch) !important;
    min-width: var(--sdp-control-touch) !important;
    height: var(--sdp-control-touch) !important;
    min-height: var(--sdp-control-touch) !important;
  }

  body.sdp-redesigned .message-close {
    width: var(--sdp-control-touch);
    height: var(--sdp-control-touch);
    min-width: var(--sdp-control-touch);
    min-height: var(--sdp-control-touch);
  }

  body.sdp-redesigned .hub-card-arrow,
  body.sdp-redesigned .reports-hub-card .card-arrow {
    min-width: 44px;
    min-height: 44px;
  }

  body.sdp-redesigned .module-title,
  body.sdp-redesigned .reports-module-title {
    min-height: auto !important;
  }

  body.sdp-redesigned .table-actions .btn,
  body.sdp-redesigned .table-actions button,
  body.sdp-redesigned .list-actions .btn,
  body.sdp-redesigned .list-actions button,
  body.sdp-redesigned .nd-btn,
  body.sdp-redesigned .btn-action {
    min-height: 44px;
    min-width: 44px;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  body.sdp-redesigned .quick-stats,
  body.sdp-redesigned .reports-stats,
  body.sdp-redesigned .hub-cards,
  body.sdp-redesigned .hub-grid,
  body.sdp-redesigned .reports-hub-grid,
  body.sdp-redesigned .dp-bento-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@supports (padding: env(safe-area-inset-top)) {
  body.sdp-redesigned .top-bar {
    padding-top: env(safe-area-inset-top);
    padding-left: max(var(--space-3, 12px), env(safe-area-inset-left));
    padding-right: max(var(--space-3, 12px), env(safe-area-inset-right));
    height: calc(var(--topbar-height) + env(safe-area-inset-top));
  }

  body.sdp-redesigned .content-area {
    padding-top: calc(var(--topbar-height) + env(safe-area-inset-top)) !important;
    height: calc(100dvh - var(--topbar-height) - env(safe-area-inset-top)) !important;
    max-height: calc(100dvh - var(--topbar-height) - env(safe-area-inset-top)) !important;
  }

  @media (max-width: 768px) {
    body.sdp-redesigned .sidebar {
      top: calc(var(--topbar-height, 56px) + env(safe-area-inset-top)) !important;
      height: calc(100dvh - var(--topbar-height, 56px) - env(safe-area-inset-top)) !important;
    }
  }
}

@media (min-width: 1440px) {
  body.sdp-redesigned .content-area {
    width: calc(100% - var(--sdp-sidebar-width-expanded, 288px)) !important;
    max-width: calc(100% - var(--sdp-sidebar-width-expanded, 288px)) !important;
  }

  body.sdp-redesigned.sidebar-collapsed .content-area,
  body.sdp-redesigned[data-sidebar-state="collapsed"] .content-area,
  body.sdp-redesigned .main-layout:has(> .sidebar.collapsed) > .content-area {
    width: calc(100% - var(--sdp-sidebar-width-collapsed, 72px)) !important;
    max-width: calc(100% - var(--sdp-sidebar-width-collapsed, 72px)) !important;
  }
}

/* ============================================================
   33. Contraste dark/light — títulos, hubs, ficha, notificações
   (consolida fixes úteis do worktree REDESIGN-1 em sdp-visual-polish)
   ============================================================ */

body.sdp-redesigned .ficha-page-header h1,
body.sdp-redesigned .ficha-module-title h1,
body.sdp-redesigned .ficha-nota-header h1,
body.sdp-redesigned .filtros-card h2 {
  color: var(--color-navy-950, #16243C) !important;
  -webkit-text-fill-color: currentColor !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

/* Hub headers (gradiente navy): texto branco — não aplicar regra navy acima */
body.sdp-redesigned .module-title,
body.sdp-redesigned .module-title h1,
body.sdp-redesigned .reports-module-title,
body.sdp-redesigned .reports-module-title h1 {
  color: #ffffff !important;
  -webkit-text-fill-color: currentColor !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

body.sdp-redesigned .module-title svg,
body.sdp-redesigned .reports-module-title svg,
body.sdp-redesigned .reports-module-title .title-icon {
  color: #ffffff !important;
  stroke: currentColor !important;
}

body.sdp-redesigned .filtros-card h2 svg {
  color: var(--color-gold-500, #B5904A) !important;
  stroke: currentColor !important;
  fill: none !important;
}

[data-theme="dark"] body.sdp-redesigned .ficha-page-header h1,
[data-theme="dark"] body.sdp-redesigned .ficha-module-title h1,
[data-theme="dark"] body.sdp-redesigned .ficha-nota-header h1,
[data-theme="dark"] body.sdp-redesigned .filtros-card h2 {
  color: var(--color-text-inverse, #FAF8F2) !important;
  -webkit-text-fill-color: currentColor !important;
}

[data-theme="dark"] body.sdp-redesigned .module-title,
[data-theme="dark"] body.sdp-redesigned .module-title h1,
[data-theme="dark"] body.sdp-redesigned .reports-module-title,
[data-theme="dark"] body.sdp-redesigned .reports-module-title h1 {
  color: #ffffff !important;
  -webkit-text-fill-color: currentColor !important;
}

/* Cards/hubs: texto escuro em fundo claro (evita branco lavado no light) */
body.sdp-redesigned .hub-card h3,
body.sdp-redesigned .hub-card-title,
body.sdp-redesigned .reports-hub-card h3,
body.sdp-redesigned .reports-hub-card .card-title,
body.sdp-redesigned .hub-card p,
body.sdp-redesigned .reports-hub-card p {
  color: var(--color-navy-950, #16243C) !important;
}

body.sdp-redesigned .hub-card .card-subtitle,
body.sdp-redesigned .reports-hub-card .card-subtitle {
  color: var(--color-text-secondary, #4B5563) !important;
}

[data-theme="dark"] body.sdp-redesigned .hub-card h3,
[data-theme="dark"] body.sdp-redesigned .hub-card-title,
[data-theme="dark"] body.sdp-redesigned .reports-hub-card h3,
[data-theme="dark"] body.sdp-redesigned .reports-hub-card .card-title {
  color: var(--color-text-inverse, #FAF8F2) !important;
}

[data-theme="dark"] body.sdp-redesigned .hub-card .card-subtitle,
[data-theme="dark"] body.sdp-redesigned .reports-hub-card .card-subtitle {
  color: var(--color-text-muted, #A8B3C7) !important;
}

/* KPI / stat — legibilidade em dark */
[data-theme="dark"] body.sdp-redesigned .stat-card .stat-value,
[data-theme="dark"] body.sdp-redesigned .dp-card-value,
[data-theme="dark"] body.sdp-redesigned .nd-stat-value {
  color: var(--color-text-inverse, #FAF8F2) !important;
}

[data-theme="dark"] body.sdp-redesigned .stat-card .stat-label,
[data-theme="dark"] body.sdp-redesigned .dp-card-label,
[data-theme="dark"] body.sdp-redesigned .nd-stat-label {
  color: var(--color-text-muted, #A8B3C7) !important;
}

/* Topbar dark: school-name e ícones visíveis */
[data-theme="dark"] body.sdp-redesigned .top-bar .school-name {
  color: var(--color-text-inverse, #FAF8F2) !important;
}

[data-theme="dark"] body.sdp-redesigned .top-bar .btn-logout {
  color: var(--color-text-muted, #A8B3C7) !important;
  border-color: rgba(226, 232, 240, 0.2) !important;
}

body.sdp-redesigned .top-bar .notification-badge,
body.sdp-redesigned .top-bar .notif-badge {
  background: var(--color-gold-500, #B5904A) !important;
  color: var(--color-navy-950, #16243C) !important;
  box-shadow: 0 0 0 2px var(--color-navy-950, #16243C) !important;
}

[data-theme="dark"] body.sdp-redesigned .notif-item-marcarlida:hover {
  background: var(--color-gold-500, #B5904A) !important;
  color: var(--color-navy-950, #16243C) !important;
  border-color: var(--color-gold-500, #B5904A) !important;
}

/* Sidebar: ícones SVG sempre herdam cor do item (anti-teal legado) */
body.sdp-redesigned .sidebar .nav-item svg,
body.sdp-redesigned .sidebar .sidebar-subitem svg {
  stroke: currentColor !important;
  fill: none !important;
}

/* Light: evitar texto branco fora de headers navy */
body.sdp-redesigned .card:not(.hub-card):not(.reports-hub-card):not(.dp-card):not(.stat-card) h3,
body.sdp-redesigned .card:not(.hub-card):not(.reports-hub-card):not(.dp-card):not(.stat-card) h4,
body.sdp-redesigned .card:not(.hub-card):not(.reports-hub-card):not(.dp-card):not(.stat-card) p {
  color: inherit;
}

body.sdp-redesigned .card-body,
body.sdp-redesigned .filtros-card,
body.sdp-redesigned .filter-card {
  color: var(--color-text-primary, #111827) !important;
}

[data-theme="dark"] body.sdp-redesigned .card-body,
[data-theme="dark"] body.sdp-redesigned .filtros-card,
[data-theme="dark"] body.sdp-redesigned .filter-card {
  color: var(--color-text-inverse, #FAF8F2) !important;
}

/* ============================================================
   34. Ferramentas Escolares → Sistema (sidebar tail)
   Psicossocial, Biblioteca, Aniversariantes, legado #1D357F inline
   ============================================================ */

/* --- Atendimento Psicossocial (header próprio, sem module-title) --- */
body.sdp-redesigned .psico-header {
  background: linear-gradient(135deg, #16243C 0%, #1F2D4A 56%, #223455 100%) !important;
  border: 1px solid rgba(181, 144, 74, 0.35) !important;
  box-shadow: 0 18px 42px rgba(23, 36, 60, 0.18) !important;
  color: #ffffff !important;
}

body.sdp-redesigned .psico-header h1,
body.sdp-redesigned .psico-header p {
  color: #ffffff !important;
}

body.sdp-redesigned .psico-card {
  border-left-color: var(--sdp-preview-gold, #B5904A) !important;
  border-color: var(--sdp-surface-border) !important;
  box-shadow: 0 2px 10px rgba(22, 36, 60, 0.06) !important;
}

body.sdp-redesigned .psico-card.mes {
  border-left-color: var(--sdp-preview-gold, #B5904A) !important;
}

body.sdp-redesigned .psico-card.ano {
  border-left-color: var(--color-gold-300, #D4B76A) !important;
}

body.sdp-redesigned .psico-card.encam {
  border-left-color: var(--color-status-danger, #DC2626) !important;
}

body.sdp-redesigned .psico-contagem-item .qtd,
body.sdp-redesigned .psico-link,
body.sdp-redesigned .psico-breadcrumb a:hover,
body.sdp-redesigned .psico-tabela a {
  color: var(--sdp-preview-navy, #16243C) !important;
}

body.sdp-redesigned .psico-badge.psic {
  background: rgba(22, 36, 60, 0.08) !important;
  color: var(--sdp-preview-navy, #16243C) !important;
}

body.sdp-redesigned .psico-btn-pdf,
body.sdp-redesigned .psico-btn-add {
  border-color: rgba(22, 36, 60, 0.2) !important;
  color: var(--sdp-preview-navy, #16243C) !important;
}

body.sdp-redesigned .psico-btn-pdf:hover,
body.sdp-redesigned .psico-btn-add:hover {
  background: rgba(181, 144, 74, 0.12) !important;
  color: var(--sdp-preview-navy, #16243C) !important;
}

body.sdp-redesigned .psico-btn-pdf svg {
  stroke: var(--sdp-preview-navy, #16243C) !important;
}

body.sdp-redesigned .psico-btn[type="submit"],
body.sdp-redesigned .psico-btn.psico-btn-primary,
body.sdp-redesigned #btnSalvarDemanda,
body.sdp-redesigned #btnConfirmarAdd {
  background: var(--sdp-preview-navy, #16243C) !important;
  color: #ffffff !important;
  border-color: var(--sdp-preview-navy, #16243C) !important;
}

body.sdp-redesigned .psico-btn[type="submit"]:hover,
body.sdp-redesigned .psico-btn.psico-btn-primary:hover,
body.sdp-redesigned #btnSalvarDemanda:hover,
body.sdp-redesigned #btnConfirmarAdd:hover {
  background: var(--color-navy-800, #2A3A5C) !important;
}

body.sdp-redesigned .psico-dropdown-toggle:focus,
body.sdp-redesigned .psico-dropdown.aberto .psico-dropdown-toggle {
  border-color: var(--sdp-preview-gold, #B5904A) !important;
  box-shadow: 0 0 0 3px rgba(181, 144, 74, 0.22) !important;
}

body.sdp-redesigned .psico-dropdown-opcao input {
  accent-color: var(--sdp-preview-gold, #B5904A) !important;
}

body.sdp-redesigned .psico-check-option input {
  accent-color: var(--sdp-preview-gold, #B5904A) !important;
}

body.sdp-redesigned .psico-check-option input:checked + span {
  color: var(--sdp-preview-navy, #16243C) !important;
}

body.sdp-redesigned .psico-demanda-add {
  border-color: var(--sdp-preview-gold, #B5904A) !important;
  color: var(--sdp-preview-navy, #16243C) !important;
}

body.sdp-redesigned .psico-filtros,
body.sdp-redesigned .psico-tabela-wrap,
body.sdp-redesigned .psico-detalhe-card {
  border: 1px solid var(--sdp-surface-border) !important;
}

[data-theme="dark"] body.sdp-redesigned .psico-card,
[data-theme="dark"] body.sdp-redesigned .psico-filtros,
[data-theme="dark"] body.sdp-redesigned .psico-tabela-wrap,
[data-theme="dark"] body.sdp-redesigned .psico-detalhe-card {
  background: rgba(18, 29, 46, 0.92) !important;
}

[data-theme="dark"] body.sdp-redesigned .psico-contagem-item .qtd,
[data-theme="dark"] body.sdp-redesigned .psico-link,
[data-theme="dark"] body.sdp-redesigned .psico-tabela a {
  color: var(--color-text-inverse, #FAF8F2) !important;
}

/* --- Biblioteca Virtual (inline #1D357F em catalogo/emprestimo) --- */
body.sdp-redesigned .barcode-section {
  background: linear-gradient(135deg, rgba(22, 36, 60, 0.03) 0%, rgba(181, 144, 74, 0.1) 100%) !important;
  border-color: rgba(181, 144, 74, 0.45) !important;
}

body.sdp-redesigned .barcode-section-label {
  color: var(--sdp-preview-navy, #16243C) !important;
}

body.sdp-redesigned .barcode-input-wrapper input {
  border-color: rgba(22, 36, 60, 0.18) !important;
}

body.sdp-redesigned .barcode-input-wrapper input:focus {
  border-color: var(--sdp-preview-gold, #B5904A) !important;
  box-shadow: 0 0 0 3px rgba(181, 144, 74, 0.22) !important;
}

body.sdp-redesigned .btn-scan-activate {
  background: var(--sdp-preview-navy, #16243C) !important;
  color: #ffffff !important;
}

body.sdp-redesigned .btn-scan-activate:hover {
  background: var(--color-navy-800, #2A3A5C) !important;
}

body.sdp-redesigned .card-header .step-number {
  background: var(--sdp-preview-navy, #16243C) !important;
  color: #ffffff !important;
}

body.sdp-redesigned .search-input-wrapper input:focus {
  border-color: var(--sdp-preview-gold, #B5904A) !important;
  box-shadow: 0 0 0 3px rgba(181, 144, 74, 0.18) !important;
}

body.sdp-redesigned .btn-add {
  background: var(--sdp-preview-navy, #16243C) !important;
  color: #ffffff !important;
  border-color: var(--sdp-preview-navy, #16243C) !important;
}

body.sdp-redesigned .btn-add:hover {
  background: var(--color-navy-800, #2A3A5C) !important;
}

body.sdp-redesigned button[style*="background: #1D357F"],
body.sdp-redesigned button[style*="background:#1D357F"],
body.sdp-redesigned .btn-save[style*="background: #1D357F"],
body.sdp-redesigned .btn-save[style*="background:#1D357F"],
body.sdp-redesigned .btn-add[style*="background: #1D357F"],
body.sdp-redesigned .btn-add[style*="background:#1D357F"] {
  background: var(--sdp-preview-navy, #16243C) !important;
  background-image: none !important;
  color: #ffffff !important;
}

body.sdp-redesigned span[style*="color:#1D357F"],
body.sdp-redesigned span[style*="color: #1D357F"] {
  color: var(--sdp-preview-navy, #16243C) !important;
}

body.sdp-redesigned #colecaoProgressBar[style*="linear-gradient"] {
  background: linear-gradient(90deg, #16243C, #B5904A) !important;
}

/* --- Aniversariantes (KPI candy purple/blue → navy/gold) --- */
body.sdp-redesigned .stat-card.card-mes {
  border-left-color: var(--sdp-preview-gold, #B5904A) !important;
}

body.sdp-redesigned .stat-card.card-semana {
  border-left-color: var(--sdp-preview-navy, #16243C) !important;
}

body.sdp-redesigned .stat-icon.purple {
  background: linear-gradient(135deg, #16243C 0%, #1F2D4A 100%) !important;
}

body.sdp-redesigned .stat-icon.blue {
  background: linear-gradient(135deg, #B5904A 0%, #D4B76A 100%) !important;
}

body.sdp-redesigned .stat-icon.green {
  background: linear-gradient(135deg, #1F2D4A 0%, #36476B 100%) !important;
}

/* Paginação gerada em JS — botões touch-friendly */
body.sdp-redesigned #pagination button {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 14px !important;
  border-radius: 8px !important;
  border: 1px solid var(--sdp-surface-border) !important;
  background: var(--sdp-preview-panel, #fffefa) !important;
  color: var(--sdp-preview-navy, #16243C) !important;
  font-family: var(--font-body, 'Inter'), system-ui, sans-serif !important;
}

body.sdp-redesigned #pagination button[style*="background: #16243C"],
body.sdp-redesigned #pagination button[style*="background:#16243C"] {
  background: var(--sdp-preview-navy, #16243C) !important;
  color: #ffffff !important;
  border-color: var(--sdp-preview-navy, #16243C) !important;
}

[data-theme="dark"] body.sdp-redesigned #pagination button {
  background: rgba(18, 29, 46, 0.92) !important;
  color: var(--color-text-inverse, #FAF8F2) !important;
}

/* Meu perfil — header institucional (evita gradiente gold pesado no inline) */
body.sdp-redesigned .profile-header {
  background: linear-gradient(135deg, #16243C 0%, #1F2D4A 72%, rgba(181, 144, 74, 0.35) 100%) !important;
}

@media (max-width: 768px) {
  body.sdp-redesigned .psico-header {
    padding: 1.25rem 1rem !important;
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  body.sdp-redesigned .psico-header h1 {
    font-size: 1.35rem !important;
    flex-wrap: wrap;
  }

  body.sdp-redesigned .psico-dashboard {
    grid-template-columns: 1fr !important;
  }

  body.sdp-redesigned .psico-filtros {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================
   35. Alta prioridade QA — Medidas, Boletim interno, Admin PP,
   ferramentas standalone (migrar fotos / importar telefones)
   ============================================================ */

/* Medidas — registrar, bônus acadêmico (inline #1D357F) */
body.sdp-redesigned .whatsapp-popup-icon.default,
body.sdp-redesigned .sdp-anexo-icone.img,
body.sdp-redesigned .sdp-anexo-meta .badge-existente,
body.sdp-redesigned .bonus-stat-number,
body.sdp-redesigned .bonus-section-header h3,
body.sdp-redesigned .toast.info {
  color: var(--sdp-preview-navy, #16243C) !important;
}

body.sdp-redesigned .progress-fill,
body.sdp-redesigned .sdp-anexos-progress .bar-inner {
  background: var(--sdp-preview-navy, #16243C) !important;
}

body.sdp-redesigned .btn-primary,
body.sdp-redesigned .bonus-btn-primary,
body.sdp-redesigned button[style*="background: #1D357F"],
body.sdp-redesigned button[style*="background:#1D357F"],
body.sdp-redesigned button[style*="background: linear-gradient(135deg, #3b5a9e"],
body.sdp-redesigned button[style*="background:linear-gradient(135deg, #3b5a9e"] {
  background: var(--sdp-preview-navy, #16243C) !important;
  border-color: var(--sdp-preview-navy, #16243C) !important;
  color: #ffffff !important;
}

/* Boletim interno — badges e links gerados em JS */
body.sdp-redesigned .bi-badge,
body.sdp-redesigned .bi-status-pill,
body.sdp-redesigned a[style*="color:#1D357F"],
body.sdp-redesigned a[style*="color: #1D357F"] {
  color: var(--sdp-preview-navy, #16243C) !important;
}

body.sdp-redesigned .bi-header,
body.sdp-redesigned .bi-hero {
  background: linear-gradient(135deg, #16243C 0%, #1F2D4A 72%, rgba(181, 144, 74, 0.28) 100%) !important;
}

/* Admin Portal dos Pais — hubs e títulos */
body.sdp-redesigned .portal-pais-admin-header,
body.sdp-redesigned .pp-admin-hero {
  background: linear-gradient(135deg, #16243C 0%, #1F2D4A 100%) !important;
  color: #ffffff !important;
}

body.sdp-redesigned .portal-pais-admin-header h1,
body.sdp-redesigned .portal-pais-admin-header p,
body.sdp-redesigned .pp-admin-hero h1,
body.sdp-redesigned .pp-admin-hero p {
  color: #ffffff !important;
}

/* Ferramentas admin standalone (migrar fotos / importar telefones) */
body.sdp-redesigned.admin-tool-page,
body.sdp-redesigned.admin-tool-page .card h2,
body.sdp-redesigned.admin-tool-page .info-box .number,
body.sdp-redesigned.admin-tool-page .back-link {
  color: var(--sdp-preview-gold, #B5904A) !important;
}

body.sdp-redesigned.admin-tool-page {
  background: var(--sdp-surface-page, #F8F6F1) !important;
  color: var(--sdp-text, #16243C) !important;
  font-family: var(--sdp-font, 'Inter', system-ui, sans-serif) !important;
}

body.sdp-redesigned.admin-tool-page .card {
  background: var(--sdp-surface-card, #ffffff) !important;
  border: 1px solid rgba(22, 36, 60, 0.08) !important;
  color: var(--sdp-text, #16243C) !important;
}

body.sdp-redesigned.admin-tool-page .btn-success {
  background: var(--sdp-success, #059669) !important;
  color: #ffffff !important;
}

/* Atualizações — cards de versão */
body.sdp-redesigned .update-card .version-badge,
body.sdp-redesigned .changelog-tag {
  background: rgba(181, 144, 74, 0.15) !important;
  color: var(--sdp-preview-navy, #16243C) !important;
  border-color: rgba(181, 144, 74, 0.35) !important;
}
