/* ===== Lkhlas extras ===== */

/* Skeleton loading */
@keyframes lk-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.lk-skel, .lk-sk {
  border-radius: 14px;
  background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--surface-2) 55%, var(--surface)) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: lk-shimmer 1.4s linear infinite;
}
.lk-skeleton { display: grid; gap: 16px; }
.lk-skeleton .lk-sk-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.lk-sk.t1 { height: 34px; width: 38%; }
.lk-sk.t2 { height: 14px; width: 24%; margin-top: 10px; }
.lk-sk.btn { height: 46px; width: 160px; border-radius: 999px; }
.lk-sk-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.lk-sk.cell { height: 96px; border-radius: 22px; }
.lk-sk.panel { height: 220px; border-radius: 22px; }
.lk-skel-chart { height: 190px; }
.lk-skel-heat { height: 190px; }

/* Greeting */
.lk-greet { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.lk-greet svg { width: 18px; height: 18px; }
.lk-greet.day svg { color: #F2A93B; animation: lk-spin 18s linear infinite; }
.lk-greet.night svg { color: #A5B4FC; }
@keyframes lk-spin { to { transform: rotate(360deg); } }

/* Progress ring around the days badge */
.tag { overflow: visible; }
.lk-ring { position: absolute; inset: -3px; pointer-events: none; overflow: visible; }
.lk-ring rect { fill: none; stroke-width: 2.5; stroke-linecap: round; }
.lk-ring-track { stroke: color-mix(in srgb, currentColor 14%, transparent); }
.lk-ring-bar { transition: stroke-dashoffset 1s cubic-bezier(.2, .8, .2, 1); }

/* Monthly goal */
.lk-goal { display: grid; gap: 10px; }
.lk-goal.empty { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lk-goal.empty .muted { flex: 1; margin: 0; min-width: 180px; }
.lk-goal-top { display: flex; align-items: center; gap: 10px; }
.lk-goal-top h2 { margin: 0; flex: 1; }
.lk-goal-ico { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--orange, #FF5A1F) 15%, transparent); color: var(--orange, #FF5A1F); }
.lk-goal-ico svg { width: 20px; height: 20px; }
.lk-goal-pct { font-size: 26px; font-weight: 800; color: var(--orange, #FF5A1F); font-variant-numeric: tabular-nums; }
.lk-goal-track { height: 14px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.lk-goal-fill {
  height: 100%; width: var(--lk-w); border-radius: inherit;
  background: linear-gradient(90deg, #FF5A1F, #FF8A5B, #FF5A1F);
  background-size: 200% 100%;
  animation: lk-flow 3s linear infinite;
}
.lk-goal-fill.grow { animation: lk-fill 1.1s cubic-bezier(.2, .8, .2, 1) both, lk-flow 3s linear infinite; }
@keyframes lk-fill { from { width: 0; } to { width: var(--lk-w); } }
@keyframes lk-flow { from { background-position: 0 0; } to { background-position: -200% 0; } }
.lk-goal.done .lk-goal-track { box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange, #FF5A1F) 25%, transparent); }
.lk-goal-line { margin: 0; color: var(--ink-2); font-size: 14px; }
.lk-goal-line b { color: var(--ink); }
.lk-goal-form-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.lk-goal-form-row .field { flex: 0 1 220px; }

/* Chart + heatmap side by side */
.lk-duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.lk-duo > .panel { margin: 0; min-width: 0; }

/* Revenue chart */
.lk-bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; height: 200px; align-items: end; }
.lk-bar-col { display: grid; grid-template-rows: auto 1fr auto; height: 100%; text-align: center; gap: 6px; min-width: 0; }
.lk-bar-val { font-size: 12px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.lk-bar-slot { position: relative; display: flex; align-items: flex-end; justify-content: center; }
.lk-bar { width: min(44px, 100%); border-radius: 10px 10px 4px 4px; background: color-mix(in srgb, var(--ink) 22%, transparent); transform-origin: bottom; transition: filter .2s; }
.lk-bar-col.cur .lk-bar { background: linear-gradient(180deg, #FF8A5B, #FF5A1F); box-shadow: 0 8px 22px -8px rgba(255, 90, 31, .7); }
.lk-bar-col.cur .lk-bar-val { color: var(--orange, #FF5A1F); }
.lk-bar:hover { filter: brightness(1.15); }
.lk-bar.grow { animation: lk-grow .8s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--lk-i, 0) * 70ms); }
@keyframes lk-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.lk-bar-lbl { font-size: 12px; color: var(--ink-2); text-transform: capitalize; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Heatmap */
.lk-heat-scroll { overflow-x: auto; }
.lk-heat-grid { display: grid; grid-template-columns: 38px repeat(18, minmax(12px, 1fr)); gap: 3px; min-width: 330px; }
.lk-heat-day { font-size: 11px; color: var(--ink-2); align-self: center; white-space: nowrap; text-transform: capitalize; }
.lk-heat-cell { aspect-ratio: 1; border-radius: 4px; background: rgba(255, 90, 31, var(--lk-a)); transition: transform .15s; }
.lk-heat-cell.zero { background: var(--surface-2); }
.lk-heat-cell:hover { transform: scale(1.3); }
.lk-heat-hr { font-size: 10px; color: var(--ink-2); text-align: center; }
.lk-heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 10px; font-size: 11px; color: var(--ink-2); }
.lk-heat-legend i { width: 12px; height: 12px; border-radius: 3px; background: rgba(255, 90, 31, var(--lk-a)); }

/* Birthdays */
.lk-bday-ico { display: inline-grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 14px; background: color-mix(in srgb, var(--orange, #FF5A1F) 14%, transparent); color: var(--orange, #FF5A1F); }
.lk-bday-ico svg { width: 24px; height: 24px; }
.lk-bday.now .lk-bday-ico { animation: lk-wiggle 1.6s ease-in-out infinite; }
@keyframes lk-wiggle { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-10deg); } 80% { transform: rotate(10deg); } 90% { transform: rotate(-5deg); } }

/* Member visits this month */
.lk-streak { display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 0; padding: 4px 12px 4px 8px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); }
.lk-streak svg { width: 16px; height: 16px; }
.lk-streak.warm { background: color-mix(in srgb, #F2A93B 18%, transparent); color: #B45309; }
.lk-streak.hot { background: color-mix(in srgb, #FF5A1F 16%, transparent); color: #C2410C; }
.lk-streak.hot svg { animation: lk-flicker 1.2s ease-in-out infinite; }
@keyframes lk-flicker { 50% { transform: scale(1.18) rotate(-6deg); } }
:root[data-theme="dark"] .lk-streak.warm { color: #FBBF24; }
:root[data-theme="dark"] .lk-streak.hot { color: #FF8A5B; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lk-streak.warm { color: #FBBF24; }
  :root:not([data-theme="light"]) .lk-streak.hot { color: #FF8A5B; }
}

/* Check-in result: flash, pop, ripple, shake */
@keyframes lk-ci-in { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
@keyframes lk-ci-pop { 0% { transform: scale(.2); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
@keyframes lk-ci-shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-14px); } 40%, 80% { transform: translateX(14px); } }
@keyframes lk-ci-ripple { from { transform: scale(.3); opacity: .55; } to { transform: scale(2.6); opacity: 0; } }
.ci-result { animation: lk-ci-in .25s ease-out both; overflow: hidden; }
.ci-result .ci-mark { animation: lk-ci-pop .5s cubic-bezier(.34, 1.56, .64, 1) both; }
.ci-result.late .ci-mark, .ci-result.unknown .ci-mark { animation: lk-ci-pop .35s ease-out both, lk-ci-shake .45s .35s ease-in-out; }
.ci-result.ok::before, .ci-result.soon::before {
  content: ""; position: absolute; left: 50%; top: 45%; width: 60vmin; height: 60vmin; margin: -30vmin 0 0 -30vmin;
  border-radius: 50%; border: 6px solid currentColor; pointer-events: none;
  animation: lk-ci-ripple 1s ease-out both;
}

@media (prefers-reduced-motion: reduce) {
  .lk-skel, .lk-sk, .lk-goal-fill, .lk-bar.grow, .lk-greet svg, .lk-bday-ico, .lk-streak svg,
  .ci-result, .ci-result .ci-mark, .ci-result::before { animation: none !important; }
  .lk-ring-bar { transition: none; }
}

/* ===== Payments: revenue per day ===== */
.pay-chart { --pc-a: #FF5A1F; --pc-b: #4F63C9; }
:root[data-theme="dark"] .pay-chart { --pc-a: #EE5722; --pc-b: #6F82EE; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pay-chart { --pc-a: #EE5722; --pc-b: #6F82EE; } }
.pc-plot { position: relative; height: 210px; margin: 22px 0 30px; padding-left: 48px; }
.pc-grid { position: absolute; left: 48px; right: 0; border-top: 1px dashed var(--line); }
.pc-grid span { position: absolute; left: -48px; top: -8px; width: 42px; text-align: right; font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pc-bars { position: absolute; left: 48px; right: 0; top: 0; bottom: 0; display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 3px; align-items: end; border-bottom: 1px solid var(--line); }
.pc-col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; cursor: default; }
.pc-bar { width: 100%; max-width: 22px; border-radius: 4px 4px 0 0; background: var(--pc-a); transform-origin: bottom; animation: lk-grow .7s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 18ms); transition: filter .15s; }
.pc-col.zero .pc-bar { height: 0; }
.pc-col.today::before { content: ""; position: absolute; inset: 0 -1px; border-radius: 6px; background: color-mix(in srgb, var(--pc-a) 10%, transparent); }
.pc-col:hover .pc-bar, .pc-col:focus-visible .pc-bar { filter: brightness(1.12); }
.pc-col:focus-visible::after { content: ""; position: absolute; inset: -2px; border-radius: 6px; outline: 2px solid var(--pc-a); }
.pc-x { position: absolute; bottom: -22px; font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pc-tip {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translate(-50%, 4px); z-index: 5;
  display: grid; gap: 2px; min-width: max-content; padding: 8px 12px; border-radius: 12px;
  background: var(--ink); color: var(--surface); font-size: 12px; font-weight: 600; text-align: center;
  box-shadow: 0 12px 28px -12px rgba(0, 0, 0, .45); opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s;
}
.pc-tip b { font-weight: 700; text-transform: capitalize; opacity: .75; }
.pc-col { --tip-y: 0; }
.pc-col:hover .pc-tip, .pc-col:focus-visible .pc-tip { opacity: 1; transform: translate(-50%, 0); }
.pc-col:nth-child(-n+3) .pc-tip { left: 0; transform: translate(0, 4px); }
.pc-col:nth-child(-n+3):hover .pc-tip, .pc-col:nth-child(-n+3):focus-visible .pc-tip { transform: none; }
.pc-col:nth-last-child(-n+3) .pc-tip { left: auto; right: 0; transform: translate(0, 4px); }
.pc-col:nth-last-child(-n+3):hover .pc-tip, .pc-col:nth-last-child(-n+3):focus-visible .pc-tip { transform: none; }
.pc-split { border-top: 1px solid var(--line); padding-top: 16px; }
.pc-split-title { margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.pc-stack { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; }
.pc-seg { min-width: 4px; transform-origin: left; animation: lk-fill-x .8s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes lk-fill-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.pc-seg.cash, .pc-legend i.cash { background: var(--pc-b); }
.pc-seg.card, .pc-legend i.card { background: var(--pc-a); }
.pc-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 12px 0 0; padding: 0; font-size: 14px; }
.pc-legend li { display: flex; align-items: center; gap: 8px; }
.pc-legend i { width: 12px; height: 12px; border-radius: 3px; }
.pc-legend b { font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .pc-plot { height: 170px; } .pc-bars { gap: 1px; } .pc-x { font-size: 10px; } }
@media (prefers-reduced-motion: reduce) { .pc-bar, .pc-seg, .bil-meter i { animation: none !important; } }

/* ===== Billing: my subscription ===== */
.bil h3 { margin: 22px 0 10px; font-size: 16px; }
.bil-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bil-meter { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 14px; }
.bil-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #FF5A1F, #FF8A5B); animation: bil-grow .9s cubic-bezier(.2,.8,.2,1) both; }
@keyframes bil-grow { from { width: 0; } }
.bil-meter.low i { background: linear-gradient(90deg, #B91C1C, #F87171); }
.bil-left { margin: 6px 0 0; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.bil-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bil-plan {
  display: grid; gap: 2px; text-align: start; padding: 14px 16px; border-radius: 16px; cursor: pointer;
  border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: inherit;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.bil-plan span { font-weight: 600; font-size: 14px; color: var(--ink-2); }
.bil-plan em { font-style: normal; font-size: 11px; font-weight: 700; color: #141B34; background: #FF8A5B; padding: 2px 8px; border-radius: 999px; margin-inline-start: 4px; }
.bil-plan b { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bil-plan small { color: var(--ink-2); }
.bil-plan:hover { transform: translateY(-2px); }
.bil-plan.on { border-color: var(--orange, #FF5A1F); box-shadow: 0 10px 24px -14px rgba(255,90,31,.7); }
.bil-steps { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; color: var(--ink-2); font-size: 14px; }
.bil-account { margin-top: 14px; border: 1px dashed var(--line); border-radius: 16px; padding: 6px 14px; }
.bil-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.bil-row:last-child { border-bottom: 0; }
.bil-row .muted { min-width: 90px; font-size: 13px; }
.bil-row strong { flex: 1; min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.bil-paid { width: 100%; margin-top: 14px; }

/* ===== Invoice ===== */
.invoice { max-width: 820px; }
.inv-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 2px solid var(--orange, #FF5A1F); padding-bottom: 18px; }
.inv-top img { height: 52px; width: auto; }
.inv-meta { text-align: end; }
.inv-meta h2 { margin: 0 0 6px; font-size: 28px; }
.inv-meta p { margin: 2px 0; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 22px 0; }
.inv-parties p { margin: 2px 0; }
.inv-table { width: 100%; border-collapse: collapse; }
.inv-table th, .inv-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: start; }
.inv-table th:last-child, .inv-table td:last-child { text-align: end; white-space: nowrap; }
.inv-table thead th { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.inv-table td:nth-child(2), .inv-table td:nth-child(3) { white-space: nowrap; }
.inv-table tfoot td { font-weight: 800; font-size: 18px; border-bottom: 0; }
.inv-paid { margin: 18px 0 4px; font-weight: 700; color: var(--status-paid, #15803D); }
.inv-foot { font-size: 13px; }
@media (max-width: 600px) { .bil-plans, .inv-parties { grid-template-columns: 1fr; } }
@media print {
  .sidenav, .tabbar, .mobile-top, #sub-banner, #offline, .no-print, .toast, #ci-result { display: none !important; }
  body, .shell, .content, #view { background: #FFFFFF !important; color: #141B34 !important; padding: 0 !important; margin: 0 !important; }
  .invoice { border: 0 !important; box-shadow: none !important; max-width: none; color: #141B34; }
  .lk-enter { animation: none !important; }
  /* invoice always prints dark-on-white, even in dark mode */
  :root, :root[data-theme="dark"] { --ink: #141B34; --ink-2: #5B6272; --ink-muted: #5B6272; --line: #E3E6EE; --border: #E3E6EE; --surface: #FFFFFF; --surface-2: #F4F5F8; --orange: #FF5A1F; --status-paid: #15803D; color-scheme: light; }
  .invoice, .invoice * { color: #141B34 !important; background: transparent !important; }
  .invoice .muted, .inv-table thead th { color: #5B6272 !important; }
  .inv-paid, .inv-paid * { color: #15803D !important; }
  .inv-table th, .inv-table td { border-color: #E3E6EE !important; }
  .inv-top { border-bottom-color: #FF5A1F !important; }
  .invoice { -webkit-print-color-adjust: exact; print-color-adjust: exact; padding: 0 !important; }
  .content, #view { max-width: none !important; }
}
@page { margin: 14mm; }

/* Check-in: member already came in today */
.ci-again { margin-top: 10px; padding: 8px 16px; border-radius: 999px; background: rgba(20,27,52,.14); font-size: clamp(14px, 3.6vw, 18px); font-weight: 700; }
