/* ══════════════════════════════════════════════════════════ */
/* Sofia sidebar — calm sage room (#2830)                    */
/* Loaded after opgaver-blod-bolge.css                       */
/* ══════════════════════════════════════════════════════════ */

/* ── Shell: warm cream / gold / sage canvas (#3011) ── */
.sofia-sidebar-shell {
  position: relative;
  background-color: #FBF8F2;
  background-image:
    radial-gradient(120% 80% at 80% 95%, rgba(245, 206, 130, 0.14) 0%, rgba(245, 206, 130, 0) 55%),
    radial-gradient(at 25% 12%, rgba(110, 138, 126, 0.08) 0%, rgba(0, 0, 0, 0) 50%),
    linear-gradient(180deg, rgba(255, 254, 251, 0.6) 0%, rgba(251, 248, 242, 0) 40%);
  overflow: hidden;
  box-shadow: rgba(110, 138, 126, 0.10) 1px 0 0 0 inset;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
}

.sofia-sidebar-shell > *:not(.calm-sidebar-flower) {
  position: relative;
  z-index: 1;
}

/* ── Footer flower: static, decorative daisy behind shell content (#3011) ── */
.sofia-sidebar-shell .calm-sidebar-flower {
  position: absolute;
  right: 18px;
  bottom: 14px;
  width: 56px;
  height: auto;
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
  animation: none;
  transition: none;
}

.sofia-sidebar-shell .calm-sidebar-flower svg {
  display: block;
  width: 56px;
  height: auto;
}

/* ── Toggle: 26x26 icon-only control ── */
#sofia-fold-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #A89C8F;
  padding: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 160ms ease, color 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

/* Invisible hit-area extension to 44x44 */
#sofia-fold-toggle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}

#sofia-fold-toggle:hover {
  background: rgba(110,138,126,0.10);
  color: #4A7A68;
}

#sofia-fold-toggle:active {
  background: rgba(110,138,126,0.14);
}

#sofia-fold-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #F2F5EF, 0 0 0 4px rgba(110,138,126,0.45);
}

#sofia-fold-toggle .calm-fold-icon {
  width: 14px;
  height: 14px;
  transition: transform 160ms ease;
  display: block;
}

/* ── Collapsed state: reconcile with base folded rules ── */
.sofia-sidebar-folded #sofia-fold-toggle {
  position: relative;
  top: auto;
  right: auto;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(110,138,126,0.08);
  color: #4A7A68;
  border: none;
  box-shadow: none;
  pointer-events: auto;
  margin: 0;
}

.sofia-sidebar-folded #sofia-fold-toggle:hover {
  background: rgba(110,138,126,0.16);
}

.sofia-sidebar-folded #sofia-fold-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #F2F5EF, 0 0 0 4px rgba(110,138,126,0.45);
}

#sofia-fold-toggle[calm-fold-collapsed] .calm-fold-icon {
  transform: rotate(180deg);
}

/* ── Section title: approved contract ── */
.sofia-section-title {
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  line-height: 1.2;
  color: #9A8E82;
  margin: 4px 32px 12px 2px;
  padding: 0;
}

/* ── Cards: sage hairline + layered shadow ── */
.sofia-reminder,
#sofia-reminder {
  border: 1px solid rgba(110,138,126,0.14);
  box-shadow:
    0 1px 2px rgba(110,138,126,0.06),
    0 4px 12px rgba(110,138,126,0.04);
}

.sofia-quick-actions-card {
  border: 1px solid rgba(110,138,126,0.14);
  box-shadow:
    0 1px 2px rgba(110,138,126,0.06),
    0 4px 12px rgba(110,138,126,0.04);
  border-radius: var(--radius-card);
}

/* ── Dark mode ──
   The sidebar shell follows the canonical dark surface defined in
   opgaver-blod-bolge.css ([data-theme="dark"] .sofia-sidebar-shell -> #241F1B)
   via a background shorthand, so the warm light canvas (#FBF8F2 + gold/sage
   wash) and the decorative flower never leak into dark mode as a light island
   (#2933, #3011). */

[data-theme="dark"] #sofia-fold-toggle {
  color: #A89C8F;
}

[data-theme="dark"] #sofia-fold-toggle:hover {
  background: rgba(110,138,126,0.10);
  color: #4A7A68;
}

[data-theme="dark"] .sofia-sidebar-folded #sofia-fold-toggle {
  background: rgba(110,138,126,0.08);
  color: #4A7A68;
  border: none;
}

[data-theme="dark"] .sofia-sidebar-folded .sofia-sidebar-shell {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

[data-theme="dark"] .sofia-reminder,
[data-theme="dark"] #sofia-reminder {
  border: 1px solid rgba(110,138,126,0.14);
  box-shadow:
    0 1px 2px rgba(110,138,126,0.06),
    0 4px 12px rgba(110,138,126,0.04);
}

[data-theme="dark"] .sofia-quick-actions-card {
  border: 1px solid rgba(110,138,126,0.14);
  box-shadow:
    0 1px 2px rgba(110,138,126,0.06),
    0 4px 12px rgba(110,138,126,0.04);
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  #sofia-fold-toggle,
  #sofia-fold-toggle .calm-fold-icon {
    transition: none !important;
  }
  .sofia-sidebar-shell .calm-sidebar-flower {
    animation: none;
    transition: none;
  }
}
