/* ── Richer look: bold nav, ornaments, week strip, streamers, fuller light mode ── */

/* Bottom navigation: a dark gala bar with gold, in both modes, so it never melts into the page. */
.nav-inner {
  background: linear-gradient(165deg, rgba(43, 22, 78, .96), rgba(20, 10, 40, .97));
  border: 1px solid rgba(233, 196, 106, .45);
  box-shadow: 0 18px 40px rgba(20, 10, 40, .45), 0 0 0 4px rgba(233, 196, 106, .08), inset 0 1px 0 rgba(255, 240, 200, .18);
  overflow: hidden;
}
.nav-inner::before { content: ''; position: absolute; top: 0; left: 10%; right: 10%; height: 1.5px; background: linear-gradient(90deg, transparent, #fff0c4, transparent); background-size: 200% 100%; animation: sheen 5s linear infinite; opacity: .8; }
.nav-blob { background: var(--gold-grad); background-size: 220% 100%; animation: sheen 6s linear infinite; box-shadow: 0 6px 18px rgba(201, 161, 74, .45), inset 0 1px 0 rgba(255, 255, 255, .5); }
.nav a { color: rgba(245, 239, 230, .62); }
.nav a:not(.on):hover { color: #fff6dc; }
.nav a.on { color: #2a1505; font-weight: 700; }
.nav-badge { box-shadow: 0 0 0 2px #1f1038; }

/* Section titles get an art-deco ornament and a gold rule. */
.section-head { position: relative; padding-bottom: 10px; }
.section-head::after { content: ''; position: absolute; bottom: 0; right: 0; left: 0; height: 1px; background: linear-gradient(to left, color-mix(in srgb, var(--gold) 70%, transparent), transparent 75%); }
.section-head h2 { display: inline-flex; align-items: center; gap: 10px; }
.section-head h2::before { content: ''; width: 9px; height: 9px; flex: none; transform: rotate(45deg); background: var(--gold-grad); background-size: 220% 100%; box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent), 0 0 12px color-mix(in srgb, var(--gold) 50%, transparent); animation: sheen 6s linear infinite; }

/* Stats: dark gala medallions with a gold top accent. */
.stat { position: relative; overflow: hidden; }
.stat::before { content: ''; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; border-radius: 0 0 4px 4px; background: var(--gold-grad); background-size: 220% 100%; animation: sheen 6s linear infinite; }
.stat-ic { width: 40px; height: 40px; background: var(--gala); color: #f6dfa4; border: 1px solid rgba(233, 196, 106, .5); box-shadow: 0 6px 14px rgba(34, 18, 63, .25); }
.stat-ic .duo { width: 20px; height: 20px; }

/* Week strip */
.week { margin-top: 14px; padding: 14px 12px 12px; position: relative; overflow: hidden; }
.week::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 60px; background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 10%, transparent), transparent); pointer-events: none; }
.week-head { position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 4px 10px; flex-wrap: wrap; }
.week-head b { font-family: var(--serif); font-size: 1.15rem; }
.week-head small { color: var(--ink-2); font-size: .74rem; }
.week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.wd { min-width: 0; border: 1px solid var(--line); background: var(--surface-2); border-radius: 14px; padding: 7px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink); animation: pop .5s cubic-bezier(.2, 1.2, .4, 1) both; animation-delay: calc(var(--i) * 45ms); transition: transform .2s; }
.wd:hover { transform: translateY(-2px); }
.wd-name { font-size: .62rem; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.wd-num { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; line-height: 1.1; }
.wd-who { position: relative; height: 24px; display: grid; place-items: center; }
.wd-who em { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3); opacity: .35; }
.wd-who i { position: absolute; top: -4px; left: -8px; font-style: normal; font-size: .56rem; font-weight: 700; background: var(--rose); color: #fff; border-radius: 999px; padding: 0 4px; line-height: 14px; }
.wd.has { border-color: color-mix(in srgb, var(--gold) 60%, transparent); background: color-mix(in srgb, var(--gold) 10%, var(--surface)); box-shadow: 0 6px 14px color-mix(in srgb, var(--gold) 20%, transparent); }
.wd.now { background: var(--gala); color: #f6dfa4; border-color: rgba(233, 196, 106, .5); box-shadow: 0 10px 22px rgba(34, 18, 63, .35); }
.wd.now .wd-name { color: #f6dfa4; }
.wd.now .wd-who em { background: #f6dfa4; opacity: .7; }

/* Backdrop extras: art-deco fans, drifting streamers, shooting stars */
.deco { position: absolute; inset: 0; opacity: .1; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='28'><g fill='none' stroke='%23b8893a' stroke-width='1'><circle cx='28' cy='28' r='28'/><circle cx='28' cy='28' r='20'/><circle cx='28' cy='28' r='12'/><circle cx='0' cy='0' r='28'/><circle cx='0' cy='0' r='20'/><circle cx='0' cy='0' r='12'/><circle cx='56' cy='0' r='28'/><circle cx='56' cy='0' r='20'/><circle cx='56' cy='0' r='12'/></g></svg>"); -webkit-mask-image: radial-gradient(120% 70% at 50% 0%, #000 0%, transparent 70%); mask-image: radial-gradient(120% 70% at 50% 0%, #000 0%, transparent 70%); }
.st { position: absolute; top: -12%; left: var(--x); width: 16px; height: 40px; color: var(--c); opacity: .55; animation: drift var(--d) linear var(--dl) infinite; }
.st svg { width: 100%; height: 100%; display: block; }
@keyframes drift { from { transform: translate(0, 0) rotate(0); } 50% { transform: translate(30px, 60vh) rotate(calc(var(--r) / 2)); } to { transform: translate(-10px, 125vh) rotate(var(--r)); } }
.shoot { position: absolute; width: 130px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, rgba(255, 246, 220, 0), #fff6dc); opacity: 0; transform: rotate(-24deg); display: none; }
.shoot::after { content: ''; position: absolute; right: -2px; top: -2px; width: 6px; height: 6px; border-radius: 50%; background: #fff6dc; box-shadow: 0 0 10px 3px rgba(255, 233, 180, .9); }
.shoot.s1 { top: 14%; left: 8%; animation: shoot 9s ease-in 2s infinite; }
.shoot.s2 { top: 36%; left: 45%; animation: shoot 13s ease-in 7s infinite; }
@keyframes shoot { 0%, 88% { opacity: 0; transform: rotate(-24deg) translateX(0); } 90% { opacity: 1; } 100% { opacity: 0; transform: rotate(-24deg) translateX(260px); } }

/* Dark mode: stars that streak across, a fainter fan pattern */
:root[data-theme="dark"] .shoot { display: block; }
:root[data-theme="dark"] .deco { opacity: .06; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .shoot { display: block; }
  :root:not([data-theme="light"]) .deco { opacity: .06; }
}

/* Light mode: warmer, fuller, with visible ornaments */
:root:not([data-theme="dark"]) body { background: radial-gradient(120% 60% at 50% -10%, #fbe9d3 0%, transparent 60%), radial-gradient(90% 50% at 100% 100%, #f1def0 0%, transparent 60%), var(--bg); }
:root:not([data-theme="dark"]) .aurora.a1 { background: radial-gradient(circle, rgba(232, 160, 96, .7), transparent 62%); }
:root:not([data-theme="dark"]) .aurora.a2 { background: radial-gradient(circle, rgba(140, 90, 210, .5), transparent 62%); }
:root:not([data-theme="dark"]) .aurora.a3 { background: radial-gradient(circle, rgba(214, 69, 113, .38), transparent 62%); }
:root:not([data-theme="dark"]) .bk { background: radial-gradient(circle at 40% 40%, rgba(var(--c), .7), rgba(var(--c), .2) 55%, transparent 70%); }
:root:not([data-theme="dark"]) .sp { color: #b8893a; width: 15px; height: 15px; filter: drop-shadow(0 0 4px rgba(233, 196, 106, .8)); }
:root:not([data-theme="dark"]) .st { opacity: .7; }
:root:not([data-theme="dark"]) .card,
:root:not([data-theme="dark"]) .stat,
:root:not([data-theme="dark"]) .tl-card,
:root:not([data-theme="dark"]) .tl-date,
:root:not([data-theme="dark"]) .wm { background: linear-gradient(180deg, #fffdf8, #fff6ea); border-color: rgba(184, 137, 58, .2); box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 10px 28px rgba(140, 90, 40, .1); }
:root:not([data-theme="dark"]) .wm.cur, :root:not([data-theme="dark"]) .tl-row.hot .tl-date { background: var(--gala); }
:root:not([data-theme="dark"]) .wd { background: rgba(255, 255, 255, .7); }
:root:not([data-theme="dark"]) .wd.now { background: var(--gala); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body { background: var(--bg); }
  :root:not([data-theme="light"]) .aurora.a1 { background: radial-gradient(circle, rgba(244, 172, 120, .55), transparent 62%); }
  :root:not([data-theme="light"]) .aurora.a2 { background: radial-gradient(circle, rgba(150, 105, 220, .42), transparent 62%); }
  :root:not([data-theme="light"]) .aurora.a3 { background: radial-gradient(circle, rgba(222, 110, 150, .3), transparent 62%); }
  :root:not([data-theme="light"]) .bk { background: radial-gradient(circle at 40% 40%, rgba(var(--c), .55), rgba(var(--c), .12) 55%, transparent 70%); }
  :root:not([data-theme="light"]) .sp { color: #d8b260; width: 12px; height: 12px; filter: none; }
  :root:not([data-theme="light"]) .st { opacity: .55; }
  :root:not([data-theme="light"]) .card, :root:not([data-theme="light"]) .stat, :root:not([data-theme="light"]) .tl-card,
  :root:not([data-theme="light"]) .tl-date, :root:not([data-theme="light"]) .wm { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-sm); }
  :root:not([data-theme="light"]) .wm.cur, :root:not([data-theme="light"]) .tl-row.hot .tl-date, :root:not([data-theme="light"]) .wd.now { background: var(--gala); }
  :root:not([data-theme="light"]) .wd { background: var(--surface-2); }
}

/* Gala and hot items keep their own backgrounds in every mode */
.card.gala, .hero.gala, .adm-hero.gala, .profile.card { background: transparent; }
.profile.card { background: var(--surface); }
.tl-row.hot .tl-card { background: linear-gradient(var(--surface), var(--surface)) padding-box, conic-gradient(from var(--ang), #9c6f22, #fff0c4, #c9a14a, var(--line) 40%, var(--line) 60%, #c9a14a, #9c6f22) border-box; }

@media (max-width: 360px) {
  .week-days { gap: 3px; }
  .wd-num { font-size: 1.05rem; }
  .wd .av { --s: 20px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .st, .shoot { display: none !important; }
}

/* Nav must pop in dark mode too: a lighter plum bar with a gold halo, and a fade behind it. */
.nav::before { content: ''; position: absolute; inset: -24px 0 0 0; background: linear-gradient(to top, var(--bg) 35%, transparent); pointer-events: none; z-index: -1; }
:root[data-theme="dark"] .nav-inner { background: linear-gradient(165deg, #4d2c86 0%, #33195f 55%, #261247 100%); border-color: rgba(233, 196, 106, .6); box-shadow: 0 0 0 1px rgba(0, 0, 0, .4), 0 0 26px rgba(233, 196, 106, .22), 0 18px 40px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 240, 200, .25); }
:root[data-theme="dark"] .nav a:not(.on) { color: rgba(250, 240, 225, .78); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav-inner { background: linear-gradient(165deg, #4d2c86 0%, #33195f 55%, #261247 100%); border-color: rgba(233, 196, 106, .6); box-shadow: 0 0 0 1px rgba(0, 0, 0, .4), 0 0 26px rgba(233, 196, 106, .22), 0 18px 40px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 240, 200, .25); }
  :root:not([data-theme="light"]) .nav a:not(.on) { color: rgba(250, 240, 225, .78); }
}

/* Up next: on narrow screens the "in N days" pill moves under the name instead of crushing it */
.tl-card { flex-wrap: wrap; row-gap: 6px; }
.tl-card .row-main { flex: 1 1 96px; }
.tl-card .row-name { white-space: normal; overflow-wrap: anywhere; }
.tl-card .pill { margin-inline-start: auto; }

/* Active nav item: a deeper gold with no white peak, so the dark label always reads */
.nav-blob { background: linear-gradient(115deg, #a8782a 0%, #d9b05a 30%, #ecc977 50%, #d9b05a 70%, #a8782a 100%); background-size: 220% 100%; }
.nav .nav-inner a.on, .nav .nav-inner a.on:hover { color: #2a1240; text-shadow: 0 1px 0 rgba(255, 240, 200, .45); }
.nav a.on .duo .b { opacity: .38; }

/* Login card: every child stays inside the card and long lines wrap */
.login-card > * { max-width: 100%; }
.login-card .login-tag { overflow-wrap: anywhere; text-wrap: balance; }

/* Gold text on a light page: a deeper gold with no pale peak, so it never washes out */
:root:not([data-theme="dark"]) .gold-text { background-image: linear-gradient(115deg, #7a5410 0%, #b8892f 30%, #d4a84a 48%, #9c6f22 66%, #c9973a 82%, #7a5410 100%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gold-text { background-image: var(--gold-grad); } }
.gala .gold-text, .adm-hero .gold-text { background-image: var(--gold-grad); }

/* Calendar: each birthday cell also shows the first name, and grows to fit it */
.cal-day { aspect-ratio: auto; min-height: 3.3rem; padding-bottom: 4px; cursor: pointer; }
.cal-day.has { cursor: pointer; }
.cal-day.has:hover { transform: translateY(-2px); box-shadow: 0 8px 18px color-mix(in srgb, var(--gold) 22%, transparent); }
.cal-who { display: block; max-width: 100%; padding: 0 2px; font-size: .62rem; font-weight: 600; line-height: 1.2; color: var(--gold-deep); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:root[data-theme="dark"] .cal-who { color: #e9c46a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cal-who { color: #e9c46a; } }
.cal-day.today.has .cal-who { color: inherit; }
.cal-day .plus { top: calc(1.4rem + 8px); inset-inline-end: 1px; }

/* Smooth scrolling on phones: the nav bar is opaque, so a live blur behind it only cost frames.
   While the page scrolls, decorative animations pause so the phone spends every frame on the scroll. */
.nav-inner { backdrop-filter: none; -webkit-backdrop-filter: none; }
.backdrop.paused * { animation-play-state: paused; }

/* Admin tab bar (עובדים / יחידות / תזכורות / יומן): a gala bar like the bottom nav, so it stands out in both modes. */
.tabs {
  padding: 6px; margin: 4px 0 18px; border-radius: 24px;
  background: linear-gradient(165deg, rgba(43, 22, 78, .97), rgba(20, 10, 40, .98));
  border: 1.5px solid rgba(233, 196, 106, .55);
  box-shadow: 0 14px 32px rgba(20, 10, 40, .32), 0 0 0 4px rgba(233, 196, 106, .1), inset 0 1px 0 rgba(255, 240, 200, .2);
  overflow: hidden;
}
.tabs::before { content: ''; position: absolute; top: 0; left: 12%; right: 12%; height: 1.5px; background: linear-gradient(90deg, transparent, #fff0c4, transparent); opacity: .8; }
.tabs-blob { top: 6px; bottom: 6px; right: 6px; width: calc((100% - 12px) / var(--n)); border-radius: 18px; background: var(--gold-grad); background-size: 220% 100%; box-shadow: 0 6px 16px rgba(201, 161, 74, .45), inset 0 1px 0 rgba(255, 255, 255, .5); }
.tabs button { padding: 9px 2px 8px; font-size: .8rem; color: rgba(245, 239, 230, .7); }
.tabs button:not(.on):hover { color: #fff6dc; }
.tabs button.on { color: #2a1505; font-weight: 700; }
.tabs button .duo { width: 22px; height: 22px; transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.tabs button.on .duo { transform: scale(1.1); }
:root[data-theme="dark"] .tabs { background: linear-gradient(165deg, rgba(58, 32, 100, .97), rgba(30, 16, 56, .98)); box-shadow: 0 14px 32px rgba(0, 0, 0, .45), 0 0 22px rgba(233, 196, 106, .14); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tabs { background: linear-gradient(165deg, rgba(58, 32, 100, .97), rgba(30, 16, 56, .98)); box-shadow: 0 14px 32px rgba(0, 0, 0, .45), 0 0 22px rgba(233, 196, 106, .14); } }
/* Long lists: rows off screen are not drawn until they come near (cheaper scrolling with many people). */
.adm-row, .tcard, .tl-row { content-visibility: auto; contain-intrinsic-size: auto 84px; }
