/* =====================
   Base, Theme & Glass
   ===================== */
:root {
  /* New palette (from your target style) */
  --ink: #0e1318;
  --bg-1: #0f141a;
  --bg-2: #131a22;
  --text: #eaf1f6;
  --muted: #9fb0c1;

  --teal: #4aa8b5;
  --coral: #ff8c8c;
  --peach: #ffb0a3;
  --foam: #b9f3e0;

  --accent: var(--teal);
  --card: rgba(20, 26, 34, 0.6);
  --stroke: rgba(255, 255, 255, .12);
  --shadow: rgba(0, 0, 0, .45);

  /* Glass tuning */
  --glass-blur: 12px;
  --glass-sat: 140%;

  /* Keep your custom layout vars so JS/CSS continues to work */
  --radius: 16px;
  --base-size: 18px;
  --open-h: 120vh;

  /* Map old variable names to new theme for compatibility */
  --bg: var(--bg-2);
  --bg-soft: var(--bg-1);
  --eule-blue: var(--teal);

  --search-gap-top: 10px;
  /* keeps search & sidebar aligned */
  --layout-gap: 24px;
  --sidebar-w: 320px;
  --sidebar-collapsed-w: 52px;
  /* width when collapsed (shows just the toggle/label) */

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;

}

.light {
  --bg-1: #f6f8fb;
  --bg-2: #ffffff;
  --text: #0f141a;
  --muted: #546475;
  --card: rgba(255, 255, 255, .7);
  --stroke: rgba(0, 0, 0, .10);
  --shadow: rgba(17, 24, 39, .08);
  --accent: #2e7f8c;

  /* compatibility */
  --bg: var(--bg-2);
  --bg-soft: var(--bg-1);
}

/* Resets / base */
* {
  box-sizing: border-box;
}

/* Accessibility: Skip to main */
.skip-to-main {
  position: absolute;
  top: -100px;
  left: 0;
  z-index: 9999;
  padding: 10px 15px;
  background-color: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  border-radius: 0 0 8px 0;
  transition: top 0.2s ease-in-out;
}

.skip-to-main:focus {
  top: 0;
  outline: 3px solid #fff;
  outline-offset: -2px;
}

/* One scroller (html) + stable gutter; avoid double scrollbars */
html {
  height: 100%;
  scrollbar-gutter: stable;
}

body {
  min-height: 100%;
  overflow-y: auto;
  scroll-behavior: smooth;
}

/* Fallback only for browsers that don't support scrollbar-gutter */
@supports not (scrollbar-gutter: stable) {
  body {
    overflow-y: scroll;
  }

  /* reserve space without layout shift */
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--base-size);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-2);
  /* base behind the gradient layer */
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* Continuous fixed background (no seams) */
.bg {
  position: fixed;
  inset: -20vmax;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(120vmax 80vmax at 10% 10%, rgba(74, 168, 181, .18), transparent 60%),
    radial-gradient(90vmax 70vmax at 85% 15%, rgba(255, 140, 140, .16), transparent 60%),
    radial-gradient(90vmax 70vmax at 20% 90%, rgba(185, 243, 224, .12), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
  background-repeat: no-repeat;
  background-attachment: fixed;
  will-change: transform;
}

/* Glass utility */
.glass {
  background: var(--card);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  box-shadow: 0 10px 30px var(--shadow);
  position: relative;
  border-radius: var(--radius);
}

.glass:before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, .08) 70%);
  mix-blend-mode: overlay;
}

/* =====================
   Container & Header
   ===================== */
.container {
  width: 75%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* Top bar (use your existing markup) */
/* Make header a positioning context */
.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  /* center the brand line */
  gap: 16px;
  flex-wrap: wrap;
  padding: 0px 0 8px;
}

/* User Account Icon - Glass Style */
.user-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;

  /* Glass effect reusing vars */
  background: var(--card);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: 0 6px 16px var(--shadow);

  color: var(--accent);
  text-decoration: none;
  font-weight: bold;
  font-size: 18px;

  /* Position absolute to sit on same row as centered brand */
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;

  overflow: hidden;
}

.user-icon-btn:before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, .08) 70%);
  mix-blend-mode: overlay;
}

.user-icon-btn:hover {
  box-shadow: 0 8px 20px var(--shadow);
  color: var(--text);
  border-color: rgba(255, 255, 255, .25);
}

/* Brand centered across the row */
.brand {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 36px;
  font-weight: 100;
}

/* Base mobile hidden elements */
.mobile-menu-btn {
  display: none;
}

.mobile-backdrop {
  display: block;
  /* Logic handled by opacity/pointer-events in media query, or hide here */
  display: none;
}

@media (max-width: 1024px) {
  .mobile-backdrop {
    display: block;
  }
}

/* Toggle pinned to top-right of header */
.actions {
  position: absolute;
  top: 12px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 2;
}

/* (Optional) keep it clear on very small screens */
@media (max-width: 480px) {
  .actions {
    top: 8px;
    right: 10px;
  }
}

.logo-wrap {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.logo-obj {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-name {
  margin: 0;
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.1;
}

h1 {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 28px);
}

.sub {
  color: var(--muted);
  margin-top: 4px;
  font-size: 0.95em;
}

/* Theme switch (keep your minimal toggle) */
.switch {
  position: relative;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--stroke);
  display: flex;
  align-items: center;
  padding: 2px;
}

.switch .track {
  display: none;
}

/* not used with this look */
.thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  color: #0b1116;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  transition: transform 180ms;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch input:checked~.thumb {
  transform: translateX(16px);
}

/* =====================
   Utility Classes
   ===================== */
/* Flexbox utilities */
.flex-row {
  display: flex;
  align-items: center;
}

/* Spacing utilities */
.gap-xs {
  gap: 4px;
}

.gap-sm {
  gap: 8px;
}

.gap-md {
  gap: 10px;
}

.ml-auto {
  margin-left: auto;
}

/* Button variants */
.navbtn--icon-sm {
  padding: 4px;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.navbtn--compact {
  padding: 4px 10px;
  font-size: 12px;
  margin-left: 8px;
}

/* Container utilities */
.scroll-container {
  max-height: 382px;
  overflow-y: auto;
  flex: 0 0 382px;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE and Edge */
}

.scroll-container::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari, Opera */
}

.padding-0 {
  padding: 0 !important;
}

/* =====================
   Loading Skeletons
   ===================== */
.skeleton {
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0.04) 0%,
      rgba(255, 255, 255, 0.08) 50%,
      rgba(255, 255, 255, 0.04) 100%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

@keyframes skeleton-pulse {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.skeleton-card {
  height: 80px;
  margin: 12px 0;
}

.skeleton-text {
  height: 1em;
  margin: 8px 0;
  border-radius: 4px;
}

.skeleton-text--short {
  width: 60%;
}

.skeleton-text--long {
  width: 90%;
}

.skeleton-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}


/* =====================
   Navigation & Search
   ===================== */
nav.primary {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0 10px 0;
}

.navbtn {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 16px;
  font-weight: 600;
  box-shadow: 0 6px 18px var(--shadow);
  transition: transform .08s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}

.navbtn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .18);
}

.navbtn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.search {
  margin: var(--search-gap-top) 0 24px 0;
  display: flex;
  gap: 10px;
}

.search input {
  flex: 1;
  padding: 14px 16px;
  font-size: 1.05em;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  box-shadow: 0 6px 18px var(--shadow);
}

/* =====================
   Sections & Titles
   ===================== */
section {
  margin: 28px 0;
  padding: 0;
}

.section-title {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 900;
  color: var(--text);
}

/* =====================
   Workflow cards (glass)
   ===================== */
.wf-card {
  /* Apply glass look */
  background: var(--card);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  box-shadow: 0 10px 30px var(--shadow);
  position: relative;

  border-radius: var(--radius);
  margin: 12px 0;
  overflow: hidden;
  transition: box-shadow .2s ease, border-color .2s ease, background .2s ease;
}

.wf-card:before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, .08) 70%);
  mix-blend-mode: overlay;
}

.wf-card:hover {
  box-shadow: 0 14px 36px var(--shadow);
  border-color: rgba(255, 255, 255, .18);
}

.wf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  cursor: pointer;
  background: rgba(255, 255, 255, .04);
  border-bottom: 1px solid var(--stroke);
}

.wf-title {
  font-weight: 600;
  font-size: 0.9rem;
  flex: 1;
  text-align: center;
}

.wf-ind {
  color: var(--muted);
  font-size: .95em;
}

/* Expanding content (PDF) */
.wf-body {
  max-height: 0;
  transition: max-height .3s ease;
  background: var(--bg-1);
}

.wf-card.open .wf-body {
  overflow-y: auto;
  max-height: min(var(--open-h), 80vh);
}

.pdfwrap {
  height: var(--open-h);
}

.pdfwrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

/* Footer */
footer {
  color: var(--muted);
  margin-top: 26px;
  font-size: .95em;
  border-top: 1px solid var(--stroke);
  padding-top: 16px;
}

/* Responsive tweaks (mirroring target style) */
@media (max-width: 1024px) {
  .container {
    width: 85%;
  }
}

@media (max-width: 768px) {
  .topbar {
    justify-content: center;
    text-align: center;
  }

  .brand {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .container {
    width: 92%;
  }

  h1 {
    font-size: 22px;
  }
}

.nores {
  margin: 12px 0;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, .04);
  color: var(--muted);
  display: inline-block;
}

/* Grid: main content + sidebar. Sidebar column uses its own width so we can animate it */
.layout {
  display: grid;
  grid-template-columns: 1fr auto;
  /* main grows; sidebar width is set on .sidebar */
  gap: var(--layout-gap);
  align-items: start;
}

/* Main column */
.content {
  min-width: 0;
}

/* Sidebar column flush with right edge of the container (not floating) */
.sidebar {
  width: var(--sidebar-w);
  height: calc(100vh - 32px);
  /* Fill viewport minus top/bottom gaps */
  transition: width .25s ease;
  align-self: start;
  margin-top: var(--search-gap-top);
  /* aligns top with search */
  position: sticky;
  top: 16px;
  /* stick under header as you scroll */
  overflow: hidden;
  /* Clip content during transition */
  overflow-y: auto;
  /* Allow scrolling if content is long, though desktop sidebar usually fits */
}

/* Panel inside the sidebar */
/* Panel inside the sidebar */
.side-panel.glass {
  padding: 16px;
  border-radius: 16px;
  /* min-width removed to prevent button from being pushed out of view */
  display: flex;
  flex-direction: column;
}

.side-title {
  margin: 0 0 10px;
  font-size: 18px;
  color: var(--text);
}

/* Text-only links */
.side-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-link {
  display: block;
  padding: 2px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 16px;
  color: var(--accent);
  text-decoration: none;
  transition: color .15s ease, opacity .15s ease;
}

/* Toggle button (inside sidebar, top-right) */
.side-toggle {
  appearance: none;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  height: 36px;
  width: 36px;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 18px var(--shadow);
  transition: background .15s ease, transform .08s ease;

  /* Position absolute to track the Sidebar width */
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 20;
}

.layout.sidebar-collapsed .side-toggle {
  right: auto;
  left: 50%;
  transform: translateX(-50%);
  /* Use transform for cleaner centering than margin calc */
  margin-left: 0;
  /* Force it to stay on the left side when collapsed */
}

.side-toggle:hover {
  background: rgba(255, 255, 255, .1);
}

.side-toggle:active {
  transform: translateY(1px);
}

/* Optionally hide the toggle label text and use an icon-like character */
.side-toggle .lbl {
  font-size: 18px;
  line-height: 1;
}

/* Collapsed state (applied on the layout wrapper) */
.layout.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-w);
}

/* Hide panel contents when collapsed, keep only the toggle visible */
/* Animate text appearance/disappearance */
.side-title,
.side-links {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
  /* Prevent wrapping during width change */
  min-width: 220px;
  /* Ensure content retains shape/width while parent shrinks, allowing smooth clip */
}

/* Hide panel contents when collapsed */
/* Note: toggle stays visible because it tracks sidebar width via absolute pos */

/* Hide panel contents when collapsed */
/* Hide panel contents when collapsed */
.layout.sidebar-collapsed .side-title,
.layout.sidebar-collapsed .side-links,
.layout.sidebar-collapsed #calendar-container,
.page.sidebar-collapsed .side-title,
.page.sidebar-collapsed .side-links,
.page.sidebar-collapsed #calendar-container {
  opacity: 0;
  transform: translateX(-20px);
  pointer-events: none;
  /* Reverse animation must be explicit */
  transition: opacity 0.25s ease, transform 0.25s ease;
  /* position: absolute; removed to fix instant disappear */
}

.page.sidebar-collapsed #calendar-container {
  transition: opacity 0s, transform 0s;
}

/* Keep the glass box compact when collapsed */
.layout.sidebar-collapsed .side-panel.glass {
  padding: 8px;
  display: grid;
  justify-items: end;
}

/* Responsive: stack columns on tablets/phones and show full panel content */
@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }

  /* Sidebar: Flow layout (push content down) */
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    max-height: 0;
    overflow: hidden;
    background: #1e1e1e;
    margin-top: 0;
    opacity: 0;

    /* Reset transforms & fixed pos from previous step */
    top: auto;
    left: auto;
    bottom: auto;
    transform: none;
    box-shadow: none;
    z-index: 10;

    /* Animate Height & Opacity: Even Slower + Bounce */
    transition: max-height 1.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.8s ease;
    border-bottom: 1px solid var(--stroke);
    border-radius: 0 !important;
  }

  /* Ensure inner panel also has no radius on mobile */
  .sidebar .side-panel {
    border-radius: 0 !important;
  }

  /* Open state: expand height */
  .sidebar.mobile-open {
    max-height: 800px;
    /* Arbitrary large enough value */
    opacity: 1;
    transform: none;
  }

  /* Hide backdrop since we pushed content */
  .mobile-backdrop {
    display: none !important;
  }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 24px;
    height: 44px;
    width: 44px;
    cursor: pointer;
    /* Move button into flow or keep abs if topbar is relative */
    position: absolute;
    left: 0;
    top: 0;
    z-index: 10;
  }

  .layout.sidebar-collapsed .sidebar {
    width: 280px;
    /* Don't collapse on mobile, just hide/show */
  }

  /* Reset layout for mobile */
  .layout {
    grid-template-columns: 1fr;
  }

  .side-toggle {
    display: none;
  }

  /* Ensure content doesn't get pushed */
  .content {
    width: 100%;
  }

  /* Adjust topbar for btn */
  .topbar {
    justify-content: center;
    padding-left: 44px;
    /* Space for btn */
    min-height: 50px;
  }

  .brand {
    justify-content: center;
    font-size: 24px;
    /* Smaller brand on mobile */
  }

  .logo-wrap {
    width: 48px;
    height: 48px;
  }
}

/* ===== Left sidebar, full-bleed, collapsible (clean) ===== */
:root {
  --layout-gap: 24px;
  --sidebar-w: 257px;
  --sidebar-collapsed-w: 52px;
}

/* Grid: left sidebar + main content */
.page {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: var(--layout-gap);
  align-items: start;
  width: 100%;
  max-width: none;
  margin: 0;
  transition: grid-template-columns .2s ease;
}

.page.sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed-w) minmax(0, 1fr);
}

/* Center the content column within the right grid cell */
.page>.container {
  justify-self: center;
  width: min(75%, 1200px);
}

/* Left rail: attached to window edge, full height */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: var(--sidebar-w);
  margin: 0;
  transition: width .25s ease;
}

.page.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-w);
}

/* Sidebar panel visuals */
.side-panel.glass {
  height: 100%;
  padding: 16px;
  border-radius: 0 0 0 0;
  /* flush left edge */
  display: flex;
  flex-direction: column;
}

/* Calendar in Sidebar */
/* Calendar in Sidebar / Dashboard */
#calendar-container {
  width: 100%;
}

/* Ensure calendar content fits or scrolls */
.calendar-widget-container {
  /* Positioning: Relative inside card */
  position: relative;
  width: 100%;
  min-width: 0;
  /* Allow shrinking */

  /* Remove duplicate card styling since parent .card.glass already has it */
  background: transparent;
  backdrop-filter: none;
  border: none;
  box-shadow: none;
  box-shadow: none;
  padding: 20px !important;
  /* Internal padding */

  color: var(--text);
  font-size: 0.9rem;
}

@media (max-width: 1280px) {

  /* Hide specific position on smaller screens or move it */
  .calendar-widget-container {
    position: relative;
    top: 0;
    right: 0;
    width: 100%;
    margin-bottom: 20px;
    z-index: 1;
  }
}

/* Collapsed State */
.calendar-widget-container.collapsed .calendar-body {
  display: none;
}

.calendar-widget-container.collapsed #prevMonth,
.calendar-widget-container.collapsed #nextMonth {
  display: none;
}

.calendar-widget-container.collapsed {
  padding-bottom: 8px;
  /* Tighter spacing */
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
  background: transparent !important;
  border-bottom: none !important;
}




.cal-nav-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-weight: bold;
  /* Bigger buttons */
  padding: 6px 12px;
  font-size: 1.1rem;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.cal-nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

/* ... */

.cal-title {
  font-weight: 700;
  /* Bigger title */
  font-size: 1.3rem;
  color: var(--accent);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--muted);

  /* Separator Line */
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--stroke);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 2px;
  column-gap: 1px;
  /* Reduced to balance with aspect-ratio */
  margin-top: 0px;
  overflow: hidden;
}

.cal-day {
  aspect-ratio: 1.6;
  /* Wider than tall = compact vertical spacing */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
  font-size: 1.2rem !important;
  /* Increased for better visibility */
  position: relative;
}

.cal-day:not(.empty):hover {
  background: rgba(255, 255, 255, 0.05);
}

.cal-day.today {
  background: var(--accent);
  color: #fff !important;
  font-weight: bold;
}

.cal-day.selected {
  border: 2px solid var(--accent);
}

.cal-day.has-event::after {
  content: '';
  position: absolute;
  bottom: 3px;
  width: 4px;
  height: 4px;
  background: var(--coral);
  border-radius: 50%;
}

.calendar-summary {
  margin-top: 0px;
  padding-top: 6px;
  border-top: none !important;
  background: transparent !important;
  font-size: 0.75rem;
}

.summary-header {
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  font-size: 0.7rem;
  background: transparent !important;
}

.summary-content {
  line-height: 1.4;
  color: var(--text);
}

.time {
  color: var(--muted);
  font-size: 0.7em;
  margin-left: 0;
  display: block;
}

/* Hide content when collapsed (keep just the toggle) */
.page.sidebar-collapsed .side-title,
.page.sidebar-collapsed .side-links {
  display: none;
}

.page.sidebar-collapsed .side-panel.glass {
  padding: 8px;
  display: grid;
  justify-items: end;
}

/* Icon-only toggle (no box) */
.side-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: px;
  /* keeps a decent hit area */
  margin-left: auto;
  cursor: pointer;
  transition: transform .08s ease, color .15s ease, opacity .15s ease;
}

.side-toggle:hover {
  color: var(--accent);
}

.side-toggle:active {
  transform: scale(0.96);
}

/* Accessible focus ring */
.side-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
  /* just for the focus ring shape */
}

/* The “≡” icon */
.side-toggle .lbl {
  font-size: 20px;
  line-height: 1;
  font-weight: 600;
}

/* Text-only links (keep) */
.side-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-link {
  display: block;
  padding: 2px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 16px;
  color: var(--accent);
  text-decoration: none;
  transition: color .15s ease, opacity .15s ease;
}

.side-link:hover {
  text-decoration: underline;
}

.side-link:active {
  opacity: .85;
}

/* Responsive: stack; content full-width; rounded panel; hide toggle */
@media (max-width: 1024px) {
  .page {
    grid-template-columns: 1fr;
  }

  .page>.container {
    justify-self: stretch;
    width: 100%;
  }

  .sidebar {
    position: static;
    height: auto;
    width: 100%;
  }

  .side-panel.glass {
    border-radius: 16px;
  }

  .side-toggle {
    display: none;
  }
}

/* 1) Keep card background inside the border */
.wf-card {
  background-clip: padding-box;
}

/* 2) Pull the overlay in by 1px so it never hits the border */
.wf-card::before {
  inset: 1px;
  /* was: inset: 0 */
  border-radius: calc(var(--radius) - 1px);
  /* match the inset */
}

/* 3) Make sure a collapsed body can’t draw a divider */
.wf-body {
  overflow: hidden;
  border-top: 0 !important;
  /* in case an old rule adds one */
}

/* 4) Nudge GPU to avoid subpixel hairlines on some setups */
.wf-card,
.wf-card::before {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* =====================
   Comments – subtle, non-intrusive
   ===================== */

/* Container spacing */
.comment-item {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;

  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .06);
}

/* Email + timestamp */
.comment-meta {
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
  opacity: 0.85;
  margin-bottom: 4px;
}

/* Comment text */
.comment-text {
  font-size: 14px;
  line-height: 1.45;
  color: rgba(255, 255, 255, .88);
}

/* Make markdown inside comments quieter */
.comment-text p {
  margin: 0;
}

.comment-text code {
  font-size: 13px;
  background: rgba(0, 0, 0, .25);
  padding: 2px 4px;
  border-radius: 6px;
}

/* Actions: hidden unless hover */
.comment-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 4px;

  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}

.comment-item:hover .comment-actions {
  opacity: 1;
  pointer-events: auto;
}

/* Smaller buttons */
.navbtn.small {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 8px;
}

/* Softer danger button */
.navbtn.danger {
  color: rgba(255, 140, 140, .85);
  border-color: rgba(255, 140, 140, .25);
  background: transparent;
}

.navbtn.danger:hover {
  background: rgba(255, 140, 140, .12);
}

/* Make Quill actually show a writing area */
.quill-editor .ql-container {
  min-height: 140px;
  /* <- this is the key */
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
}

.quill-editor .ql-editor {
  min-height: 140px;
  /* <- also important */
  padding: 12px 14px;
}

/* Optional: match your dark UI better */
.quill-editor .ql-toolbar {
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

/* If you use CSS variables for dark/light */
.quill-editor .ql-toolbar,
.quill-editor .ql-container {
  border: 1px solid var(--input-border);
}

.quill-editor .ql-editor {
  background: var(--input-bg);
  color: var(--input-text);
}

/* Quill icons/labels can be hard to see in dark mode */
body.dark-mode .quill-editor .ql-stroke {
  stroke: var(--input-text);
}

body.dark-mode .quill-editor .ql-fill {
  fill: var(--input-text);
}

body.dark-mode .quill-editor .ql-picker {
  color: var(--input-text);
}

/* Quill needs height for the editable area */
.quill-editor .ql-container {
  border: none;
}

.quill-editor .ql-editor {
  min-height: 140px;
  padding: 12px;
}


/* Make toolbar readable in dark UI */
.quill-editor .ql-toolbar.ql-snow,
.quill-editor .ql-container.ql-snow {
  border-color: var(--stroke) !important;
}

.quill-editor .ql-toolbar.ql-snow .ql-stroke {
  stroke: var(--text) !important;
}

.quill-editor .ql-toolbar.ql-snow .ql-fill {
  fill: var(--text) !important;
}

.quill-editor .ql-toolbar.ql-snow .ql-picker {
  color: var(--text) !important;
}

/* =========================
   Inline workflow polishing
   ========================= */

/* 1) No gap between steps */
.wf-inline-root {
  padding: 0 !important;
}

.wf-inline-root .step-card {
  margin: 0 !important;
  border-radius: 0 !important;
}

/* add a subtle divider between steps instead of gaps */
.wf-inline-root .step-card+.step-card {
  border-top: 1px solid var(--stroke);
}

/* 2) Comment input + button on same row, smaller and less intrusive */
.wf-inline-root .comment-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.wf-inline-root .comment-input {
  flex: 1;
  height: 34px;
  padding: 8px 10px;
  margin: 0 !important;
  font-size: 13px;
  border-radius: 10px;
}

/* smaller "Lisa" button */
.wf-inline-root .comment-form .navbtn {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 10px;
  white-space: nowrap;
}

/* 3) Comment entry (input) more transparent / less visible */
.wf-inline-root .comment-input {
  background: rgba(255, 255, 255, .03) !important;
  border: 1px solid rgba(255, 255, 255, .08) !important;
}

.wf-inline-root .comment-input:focus {
  border-color: rgba(255, 255, 255, .18) !important;
}

/* 4) Make step card background more transparent */
.wf-inline-root .step-card.glass {
  background: rgba(255, 255, 255, .02) !important;
  box-shadow: none !important;
}

/* Optional: if you want them almost fully transparent, use this instead:
.wf-inline-root .step-card.glass {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  border-left: 0 !important;
  border-right: 0 !important;
}
*/
/* =====================
   Comment actions (reliable)
   ===================== */

.comment-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 4px;

  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}

/* Desktop hover */
.comment-item:hover .comment-actions {
  opacity: 1;
  pointer-events: auto;
}

/* Keyboard + click/tap focus */
.comment-item:focus-within .comment-actions,
.comment-item:active .comment-actions {
  opacity: 1;
  pointer-events: auto;
}

/* Devices where hover is unreliable (touch / hybrid laptops) */
@media (hover: none),
(pointer: coarse) {
  .comment-actions {
    opacity: 1;
    pointer-events: auto;
  }
}

/* =========================
   Workflow steps – unified styling (index inline + viewer page)
   ========================= */

/* Make viewer (#steps) behave like inline (.wf-inline-root) */
.wf-inline-root,
#steps {
  padding: 0 !important;
}

/* Step cards: remove gaps + same look */
.wf-inline-root .step-card,
#steps .step-card {
  margin: 0 !important;
  border-radius: 0 !important;
}

/* Divider between steps */
.wf-inline-root .step-card+.step-card,
#steps .step-card+.step-card {
  border-top: 1px solid var(--stroke);
}

/* Transparent-ish step background (same in both) */
.wf-inline-root .step-card.glass,
#steps .step-card.glass {
  background: rgba(255, 255, 255, .02) !important;
  box-shadow: none !important;
}

/* Comment form: same row, smaller */
.wf-inline-root .comment-form,
#steps .comment-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.wf-inline-root .comment-input,
#steps .comment-input {
  flex: 1;
  height: 34px;
  padding: 8px 10px;
  margin: 0 !important;
  font-size: 13px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .03) !important;
  border: 1px solid rgba(255, 255, 255, .08) !important;
}

.wf-inline-root .comment-form .navbtn,
#steps .comment-form .navbtn {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 10px;
  white-space: nowrap;
}

/* =========================
   Workflow steps – unified styling (index inline + viewer page)
   ========================= */

/* Make viewer (#steps) behave like inline (.wf-inline-root) */
.wf-inline-root,
#steps {
  padding: 0 !important;
}

/* Step cards: remove gaps + same look */
.wf-inline-root .step-card,
#steps .step-card {
  margin: 0 !important;
  border-radius: 0 !important;
}

/* Divider between steps */
.wf-inline-root .step-card+.step-card,
#steps .step-card+.step-card {
  border-top: 1px solid var(--stroke);
}

/* --- Starring & Collapsing Improvements --- */

/* Star Icon Wrapper */
.star-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--stroke);
  /* Default empty star color */
  transition: color 0.2s, transform 0.1s;
  padding: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.star-btn:hover {
  color: var(--muted);
  transform: scale(1.1);
}

.star-btn.active {
  color: #f1c40f;
  /* Gold color for starred */
}

/* Workflow Card Star Positioning */
.wf-head .star-btn {
  margin-right: 8px;
  /* Space between star and title */
  font-size: 1.4rem;
}

/* Step Header Styling for Collapse */
.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  padding-bottom: 8px;
  /* Give some breathing room */
}

.step-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.step-toggle-icon {
  font-size: 0.9rem;
  color: var(--muted);
  transition: transform 0.3s ease;
}

/* Rotate icon when collapsed (reverted to 180deg for clarity) */
.step-card.collapsed .step-toggle-icon {
  transform: rotate(-90deg);
}

/* Collapsible Body */
.step-body {
  transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
  overflow: hidden;
  max-height: 5000px;
  opacity: 1;
}

.step-card.collapsed .step-body {
  max-height: 0;
  opacity: 0;
  margin: 0 !important;
  padding: 0 !important;
}

/* Star in Step Header */
.step-header .star-btn {
  font-size: 1.3rem;
  margin-left: 10px;
}

/* Transparent-ish step background (same in both) */
.wf-inline-root .step-card.glass,
#steps .step-card.glass {
  background: #1e1e1e !important;
  /* Solid dark grey/black */
  box-shadow: none !important;
  color: #e0e0e0;
  /* Light text for better contrast */
}

/* Reduce text spacing & size */
.wf-body,
.step-body {
  line-height: 1.35;
  font-size: 15px;
  /* Increased to 15px (+1px from 14px) */
}

/* Force tighter spacing on text elements */
.step-body p,
.step-body li,
.step-body div:not(.comment-item):not(.step-header):not(.step-body) {
  margin-bottom: 8px !important;
}

.step-body ul,
.step-body ol {
  margin-bottom: 8px !important;
  padding-left: 20px;
}

/* Comment form: same row, smaller */

/* Comment form: same row, smaller */
.wf-inline-root .comment-form,
#steps .comment-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.wf-inline-root .comment-input,
#steps .comment-input {
  flex: 1;
  height: 34px;
  padding: 8px 10px;
  margin: 0 !important;
  font-size: 13px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .03) !important;
  border: 1px solid rgba(255, 255, 255, .08) !important;
}

.wf-inline-root .comment-form .navbtn,
#steps .comment-form .navbtn {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 10px;
  white-space: nowrap;
}

/* =====================
   Dashboard Grid Overhaul
   ===================== */
.dashboard-container {
  width: 90%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  min-height: 100vh;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(300px, auto);
  gap: 24px;
  margin-top: 24px;
}

/* Coin Spans */
.col-span-12 {
  grid-column: span 12;
}

.col-span-6 {
  grid-column: span 6;
}

.col-span-4 {
  grid-column: span 4;
}

.col-span-3 {
  grid-column: span 3;
}

.col-span-2 {
  grid-column: span 2;
}

/* Responsive adjustment: 1 column on mobile */
@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .col-span-12,
  .col-span-6,
  .col-span-4,
  .col-span-3,
  .col-span-2 {
    grid-column: span 1;
  }
}

/* Card Base Styles */
.card {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  /* Glass effect inherited if .glass class used */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  /* transform: translateY(-2px); removed per request */
  box-shadow: 0 14px 36px var(--shadow);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.5px;
}

.card-body {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

.padding-0 {
  padding: 0 !important;
}

/* Vertical Navigation Link Stack */
.vertical-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.navbtn-block {
  display: flex;
  align-items: center;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  border-radius: 12px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  text-decoration: none;
  justify-content: center;
  gap: 12px;
  position: relative;
  /* For pseudo-element overlay */
  overflow: hidden;
  /* Keep overlay inside */
}

.navbtn-block::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, .08) 70%);
  mix-blend-mode: overlay;
  z-index: 1;
}

/* Ensure text is above overlay */
.navbtn-block span,
.navbtn-block {
  z-index: 2;
}

.navbtn-block:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  text-decoration: none;
}

.navbtn-block:active {
  transform: translateX(2px);
}

/* Side links in card context */
/* Favorites Container Grid */
#fav-container {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: minmax(62px, auto) !important;
  /* CRITICAL: Prevent row shrinking */
  gap: 21px;
  align-items: start;
  align-content: start;

  /* CRITICAL: Override .card-body flex behavior */
  flex: 0 0 420px !important;

  /* Fixed height for exactly 5 rows - cutoff at card bottom */
  height: 420px !important;
  min-height: 420px !important;
  max-height: 420px !important;

  /* Allow scrolling but hide scrollbar */
  overflow-y: scroll !important;
  overflow-x: hidden !important;
  -ms-overflow-style: none;
  scrollbar-width: none;

  scroll-behavior: smooth;
  padding: 20px !important;
  /* Symmetric padding */
}

#fav-container::-webkit-scrollbar {
  display: none;
}

#fav-container .wf-card {
  margin: 0 !important;
}

/* Ensure nores message spans both */
#fav-container .nores {
  grid-column: span 2;
}

.card-body .side-link {
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.card-body .side-link:hover {
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

/* Old Content Sections below grid */
.content-sections {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--stroke);
}

/* Responsive */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .dashboard-container {
    width: 95%;
    padding: 12px;
  }
}

/* =====================
   iOS-Style Icon Buttons
   ===================== */
.icon-btn-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;

  /* Glassmorphism */
  background: var(--card);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  box-shadow: 0 8px 24px var(--shadow);

  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.icon-btn:before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, .08) 70%);
  mix-blend-mode: overlay;
}

.icon-btn .material-icons-outlined {
  font-size: 36px;
  color: var(--accent);
}

.icon-btn-label {
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
  color: var(--text);
  max-width: 100%;
  word-wrap: break-word;
}

.icon-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px var(--shadow);
  border-color: rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .08);
  text-decoration: none;
}

.icon-btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px var(--shadow);
}

.icon-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Inline Workflow Expansion */
.wf-body {
  display: none;
}

.wf-card.open .wf-body {
  display: block;
}

/* Fix for nested glass inputs (ensure they are clickable) */
.wf-edit-body input,
.wf-edit-body textarea,
.wf-edit-body select,
.wf-edit-body button {
  position: relative;
  z-index: 50;
  /* Ensure above any glass overflows */
  pointer-events: auto;
}

/* Centralized Input Styles (in case missing from page) */
.calc-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  box-shadow: 0 6px 18px var(--shadow);
  font-size: 16px;
  outline: none;
  font-family: var(--font-sans);
  transition: border-color .2s, box-shadow .2s;
}

.calc-input:focus {
  border-color: rgba(74, 168, 181, .6);
  box-shadow: 0 0 0 3px rgba(74, 168, 181, .18), 0 10px 26px var(--shadow);
}

textarea.calc-input {
  min-height: 100px;
  resize: vertical;
}

/* =====================
   Quill Editor Styling (WYSIWYG matches Output)
   ===================== */
.ql-container {
  font-family: var(--font-sans) !important;
  font-size: 15px !important;
}

.ql-editor {
  line-height: 1.35 !important;
  color: #e0e0e0 !important;
  /* Match .step-body color */
  padding: 12px 16px !important;
  /* Comfortable padding */
}

/* Match spacing from .step-body */
.ql-editor p,
.ql-editor ul,
.ql-editor ol,
.ql-editor li {
  margin-top: 0 !important;
  margin-bottom: 8px !important;
  line-height: 1.35 !important;
}

.ql-editor ul,
.ql-editor ol {
  padding-left: 20px !important;
}

/* Ensure step body matches exactly */
.step-body p,
.step-body li,
.step-body ul,
.step-body ol {
  margin-top: 0 !important;
  margin-bottom: 8px !important;
  line-height: 1.35 !important;
}

/* Headings: Tighter spacing (editor preference) */
.ql-editor h1,
.ql-editor h2,
.ql-editor h3,
.step-body h1,
.step-body h2,
.step-body h3 {
  margin-top: 12px !important;
  margin-bottom: 4px !important;
  line-height: 1.2 !important;
  font-weight: 700;
}

.ql-editor h1:first-child,
.step-body h1:first-child {
  margin-top: 0 !important;
}

/* Placeholder color */
.ql-editor.ql-blank::before {
  color: rgba(255, 255, 255, 0.4) !important;
  font-style: italic;
}


/* Line Height Dropdown Labels */
.ql-snow .ql-picker.ql-line-height .ql-picker-label::before,
.ql-snow .ql-picker.ql-line-height .ql-picker-item::before {
  content: "Rida";
}

.ql-snow .ql-picker.ql-line-height .ql-picker-label[data-value="1.0"]::before,
.ql-snow .ql-picker.ql-line-height .ql-picker-item[data-value="1.0"]::before {
  content: "1.0";
}

.ql-snow .ql-picker.ql-line-height .ql-picker-label[data-value="1.2"]::before,
.ql-snow .ql-picker.ql-line-height .ql-picker-item[data-value="1.2"]::before {
  content: "1.2";
}

.ql-snow .ql-picker.ql-line-height .ql-picker-label[data-value="1.35"]::before,
.ql-snow .ql-picker.ql-line-height .ql-picker-item[data-value="1.35"]::before {
  content: "1.35 (Vaikimisi)";
}

.ql-snow .ql-picker.ql-line-height .ql-picker-label[data-value="1.5"]::before,
.ql-snow .ql-picker.ql-line-height .ql-picker-item[data-value="1.5"]::before {
  content: "1.5";
}

.ql-snow .ql-picker.ql-line-height .ql-picker-label[data-value="1.6"]::before,
.ql-snow .ql-picker.ql-line-height .ql-picker-item[data-value="1.6"]::before {
  content: "1.6";
}

.ql-snow .ql-picker.ql-line-height .ql-picker-label[data-value="2.0"]::before,
.ql-snow .ql-picker.ql-line-height .ql-picker-item[data-value="2.0"]::before {
  content: "2.0";
}

.ql-snow .ql-picker.ql-line-height .ql-picker-label[data-value="3.0"]::before,
.ql-snow .ql-picker.ql-line-height .ql-picker-item[data-value="3.0"]::before {
  content: "3.0";
}

/* Set default width for the picker */
.ql-snow .ql-picker.ql-line-height {
  width: 98px !important;
}

/* Toolbar customization */
.ql-toolbar {
  border-color: var(--stroke) !important;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}

.ql-container.ql-snow {
  border-color: var(--stroke) !important;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  background: rgba(10, 14, 18, 0.6);
  /* Slightly darker bg for editor area */
}

/* =====================
   Calendar Widget Styles
   ===================== */
.calendar-widget-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--stroke);
}

.cal-title {
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  /* Prevent overflow */
}

.cal-nav-btn {
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--text);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.cal-nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
}

.calendar-body {
  padding: 12px;
  flex: 1;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 1fr;
  gap: 4px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text);
  position: relative;
}

.cal-day:hover:not(.empty) {
  background: rgba(255, 255, 255, 0.08);
}

.cal-day.today {
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.cal-day.selected {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border-color: transparent;
}

.cal-day.has-event::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--coral);
}

.cal-day.selected.has-event::after {
  background-color: #fff;
}

.cal-day.empty {
  cursor: default;
  pointer-events: none;
}

.calendar-summary {
  border-top: 1px solid var(--stroke);
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  min-height: 80px;
}

.summary-header {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.summary-content {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.4;
}

/* Hide scrollbars globally on cards and containers */
.card-body,
.vertical-nav {
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE and Edge */
}

.card-body::-webkit-scrollbar,
.vertical-nav::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari, Opera */
}

/* Greyed-out days from other months */
.cal-day.other-month {
  opacity: 0.3 !important;
  cursor: default !important;
  pointer-events: none;
}

.cal-day.other-month:hover {
  background: transparent !important;
}

/* Modal Overlay - Light Blur */
.modal-overlay {
  background: rgba(0, 0, 0, 0.1) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
}

/* Modal Overlay - Even Lighter Blur */
.modal-overlay {
  background: rgba(0, 0, 0, 0.02) !important;
  backdrop-filter: blur(2px) !important;
  -webkit-backdrop-filter: blur(2px) !important;
}

/* --- Global Scrollbar Styling (Appended) --- */
/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* WebKit (Chrome, Edge, Safari) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.3);
}
/* Flatpickr date picker - perfectly matching application dark theme */
.flatpickr-calendar {
  z-index: 2147483647 !important;
  background: #2d2d2d !important;
  border: 1px solid var(--stroke) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6) !important;
  color: var(--text) !important;
  border-radius: 12px !important;
}
.flatpickr-months, .flatpickr-innerContainer, .flatpickr-month, .flatpickr-days {
  background: transparent !important;
}
.flatpickr-weekdays, .flatpickr-weekdaycontainer {
  background: #2d2d2d !important;
}
.flatpickr-weekday {
  background: #2d2d2d !important;
  color: var(--text) !important;
}
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}
.flatpickr-day:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}
.flatpickr-current-month, .flatpickr-month {
  color: var(--text) !important;
  fill: var(--text) !important;
  font-weight: 600 !important;
}
.flatpickr-monthDropdown-months {
  background: #2d2d2d !important;
  color: var(--text) !important;
}
.flatpickr-day {
  color: var(--text) !important;
}
.flatpickr-time {
    background: #2d2d2d !important; /* Specific dark color */
    border-top: 1px solid var(--stroke) !important;
}
.flatpickr-time input {
    color: var(--text) !important;
}
.flatpickr-time .flatpickr-am-pm {
    color: var(--text) !important;
}
.flatpickr-time input:hover, .flatpickr-time .flatpickr-am-pm:hover, .flatpickr-time input:focus, .flatpickr-time .flatpickr-am-pm:focus {
    background: rgba(255, 255, 255, 0.05) !important;
}

