/* Kite — festive look for the desktop apps and their websites (Grocery, Clinic, Kite Bill, Dining): text selection, a smooth menu collapse
   to symbols, a garland + corner drawing in the festival's colours (see /assets/js/kite-festival.js), dashboard card icons. */
input::selection, textarea::selection, [contenteditable]::selection { background: var(--accent, #0d9488); color: var(--on-accent, #fff); }

/* ---- menu collapse / expand: the names fade away and only the symbols stay (and come back) ---- */
/* Kite UI products (Grocery, Clinic) */
.side { transition: width .26s cubic-bezier(.4, 0, .2, 1), flex-basis .26s cubic-bezier(.4, 0, .2, 1), padding .26s ease !important; overflow-x: hidden !important; }
.side a > span:not(.ic):not(.nav-count):not(.lbl-s) { display: inline-block !important; white-space: normal; overflow: hidden; max-width: 16rem; opacity: 1; transition: opacity .16s ease, max-width .26s ease, margin .26s ease; }
.side a > .lbl-s { display: none !important; }
.side h6:not(.h6-tools) { height: auto; flex-shrink: 0; transition: color .16s ease, max-height .26s ease, margin .26s ease, padding .26s ease, border-color .26s ease; max-height: 3rem; overflow: hidden; border-top: 1px dashed transparent; white-space: nowrap; line-height: 1.3; }
.side h6.h6-tools > span { transition: opacity .16s ease, max-width .26s ease; display: inline-block; overflow: hidden; max-width: 12rem; white-space: nowrap; }
.side > a, .side > h6 { flex-shrink: 0; }
body.side-collapsed .side { width: 5rem !important; flex: 0 0 5rem !important; padding-left: .55rem !important; padding-right: .55rem !important; }
body.side-collapsed .side a { gap: 0 !important; justify-content: flex-start !important; flex-direction: row !important; position: relative; }
body.side-collapsed .side a > span:not(.ic):not(.nav-count):not(.lbl-s) { opacity: 0; max-width: 0; margin: 0; white-space: nowrap; }
body.side-collapsed .side a .nav-count { position: absolute; top: .12rem; right: .3rem; margin: 0; min-width: 1rem; height: 1rem; padding: 0 .25rem; border-radius: 999px; font-size: .58rem; line-height: 1; background: var(--accent); color: var(--on-accent, #fff); display: grid; place-items: center; }
body.side-collapsed .side a:hover::after { content: none !important; }
body.side-collapsed .side h6:not(.h6-tools) { color: transparent !important; height: auto !important; background: none !important; max-height: 0; padding-top: 0 !important; padding-bottom: 0 !important; margin: .55rem .6rem !important; border-top-color: var(--border-strong, #cbd5e1); font-size: .69rem !important; }
body.side-collapsed .side h6.h6-tools { justify-content: center; }
body.side-collapsed .side h6.h6-tools > span { opacity: 0; max-width: 0; }
.main, main.main, #main { transition: padding-left .26s ease; }
/* Kite Bill */
.mbb-nav-left > span:not(.mbb-nav-icon) { max-width: 14rem; opacity: 1; overflow: hidden; transition: opacity .16s ease, max-width .26s ease; }
.mbb-sidebar.is-collapsed .mbb-nav-left > span:not(.mbb-nav-icon) { display: inline-block !important; max-width: 0 !important; opacity: 0; white-space: nowrap; }
.mbb-section-label { max-height: 2.6rem; overflow: hidden; transition: opacity .16s ease, max-height .26s ease, margin .26s ease, padding .26s ease; }
.mbb-sidebar.is-collapsed .mbb-section-label { display: block !important; opacity: 0; max-height: 0; margin: 0 !important; padding: 0 !important; }
/* Kite Dining */
@media (min-width: 901px) {
  .pos-nav-item .nav-label span:not(.nav-icon) { max-width: 14rem; opacity: 1; overflow: hidden; transition: opacity .16s ease, max-width .26s ease; }
  body.pos-sidebar-mini .pos-nav-item .nav-label span:not(.nav-icon) { display: inline-block !important; max-width: 0; opacity: 0; white-space: nowrap; }
  .sidebar-section-title { max-height: 2.6rem; overflow: hidden; transition: opacity .16s ease, max-height .26s ease, margin .26s ease, padding .26s ease; }
  body.pos-sidebar-mini .sidebar-section-title { display: block !important; opacity: 0; max-height: 0; margin: 0 !important; padding: 0 !important; }
  .pos-sidebar { transition: width .26s cubic-bezier(.4, 0, .2, 1), padding .26s ease; }
}

/* ---- a design in every theme (Kite UI products): light = dot grid, grey = diagonals, dark = star dust ---- */
html body { background-attachment: fixed; }
html:has(.shell .side):not(.dark):not(.grey) body { background-image: radial-gradient(color-mix(in srgb, var(--fa, var(--accent)) 16%, transparent) 1px, transparent 1.3px), radial-gradient(60% 50% at 100% 0%, color-mix(in srgb, var(--fa, var(--accent)) 9%, transparent), transparent 70%); background-size: 20px 20px, auto; }
html.grey:not(.dark):has(.shell .side) body { background-image: repeating-linear-gradient(135deg, color-mix(in srgb, var(--fa, var(--accent)) 7%, transparent) 0 1px, transparent 1px 14px), radial-gradient(60% 50% at 0% 100%, color-mix(in srgb, var(--fa, var(--accent)) 10%, transparent), transparent 70%); }
html.dark:has(.shell .side) body { background-image: radial-gradient(1.2px 1.2px at 12% 18%, rgba(255,255,255,.55), transparent), radial-gradient(1px 1px at 68% 32%, rgba(255,255,255,.4), transparent), radial-gradient(1.4px 1.4px at 84% 74%, rgba(255,255,255,.5), transparent), radial-gradient(1px 1px at 30% 82%, rgba(255,255,255,.35), transparent), radial-gradient(60% 45% at 100% 0%, color-mix(in srgb, var(--fa, var(--accent)) 16%, transparent), transparent 70%), radial-gradient(50% 40% at 0% 100%, color-mix(in srgb, var(--fa, var(--accent)) 12%, transparent), transparent 70%); background-size: 320px 320px, 260px 260px, 380px 380px, 300px 300px, auto, auto; }
.hd { background-image: linear-gradient(90deg, color-mix(in srgb, var(--fa, var(--accent)) 7%, transparent), transparent 40%, color-mix(in srgb, var(--fb, var(--accent)) 5%, transparent)); }

/* ---- festival of the month: corner drawing, garland, greeting ---- */
#kiteFestArt { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
#kiteFestArt svg { position: absolute; right: -90px; bottom: -90px; width: 380px; height: 380px; opacity: .14; animation: kBgSpin 220s linear infinite; }
html.dark #kiteFestArt svg, body.dark #kiteFestArt svg { opacity: .22; }
@keyframes kBgSpin { to { transform: rotate(360deg); } }
.hd::after, .mbb-header::after, .pos-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: repeating-linear-gradient(90deg, var(--fa, var(--accent, #f59e0b)) 0 14px, var(--fb, var(--accent, #ec4899)) 14px 28px, var(--fc, var(--accent, #2dd4bf)) 28px 42px); opacity: .8; pointer-events: none; }
.kfest-chip { display: inline-flex; align-items: center; vertical-align: middle; margin-left: .7rem; padding: .18rem .7rem; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: 0; white-space: nowrap; color: #fff; background: linear-gradient(135deg, var(--fa, #f59e0b), var(--fb, #ec4899)); box-shadow: 0 2px 8px rgba(var(--fg1, 234,88,12), .35); text-shadow: 0 1px 2px rgba(0,0,0,.3); }
@media (max-width: 900px), print { #kiteFestArt { display: none; } }

/* ---- dashboard cards: a small icon before each name; line icons in place of text symbols ---- */
.kpi .l { display: flex; align-items: center; gap: .35rem; }
.kpi .l .kg { color: var(--accent, #0d9488); font-size: 1rem; }
.kpi.accent .l .kg { color: inherit; }
.ic.ic-svg.kg { display: inline-grid; place-items: center; vertical-align: -.14em; }
.ic.ic-svg.kg svg { width: 1.05em; height: 1.05em; }
#kiteSideTip { position: fixed; z-index: 2147483000; transform: translateY(-50%); background: var(--text, #0f172a); color: var(--surface, #fff); padding: .32rem .7rem; border-radius: 7px; font-size: .78rem; font-weight: 700; white-space: nowrap; pointer-events: none; opacity: 0; box-shadow: 0 6px 18px rgba(0, 0, 0, .22); transition: opacity .12s; }
#kiteSideTip.on { opacity: 1; }
.mbb-nav-icon.kg, .nav-icon.kg { display: inline-grid; place-items: center; }
.mbb-nav-icon.kg svg, .nav-icon.kg svg { width: 1.2em; height: 1.2em; }
/* simple one-page admins (Gym, Read Student, Social): the same garland under their header */
:where(body > header) { position: relative; }
body > header::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: repeating-linear-gradient(90deg, var(--fa, #f59e0b) 0 14px, var(--fb, #ec4899) 14px 28px, var(--fc, #2dd4bf) 28px 42px); opacity: .8; pointer-events: none; }
.sidebar-link { transition: background .15s, color .15s; }

/* festival: the symbol beside the title (no words), and the corner drawing stands still (a diya must not turn upside down) */
.kfest-chip { display: none !important; }
.kfest-mark { display: inline-flex; align-items: center; vertical-align: middle; margin-left: .55rem; line-height: 0; filter: drop-shadow(0 2px 4px rgba(0,0,0,.12)); }
.kfest-mark svg { width: 1.6em; height: 1.6em; }
#kiteFestArt svg { animation: none !important; right: -60px !important; bottom: -60px !important; width: 340px !important; height: 340px !important; opacity: .1 !important; }
html.dark #kiteFestArt svg, html.grey #kiteFestArt svg { opacity: .16 !important; }

/* No garland strip along the top in any app (the owner wants the top bar clean). The corner drawing stays, still. */
.hd::after, .mbb-header::after, .pos-header::after, body > header::after { content: none !important; display: none !important; }
