/* =========================================================
   HOME DASHBOARD
========================================================= */

.home { display: grid; gap: 18px; }

/* ---------- greeting banner ---------- */
.greeting {
    position: relative; overflow: hidden; padding: 20px 20px 16px; border-radius: var(--radius-lg); color: #fff;
    background:
        radial-gradient(420px 220px at 105% -20%, rgba(var(--glow1-rgb), 0.55), transparent 65%),
        radial-gradient(360px 200px at -10% 120%, rgba(var(--glow2-rgb), 0.35), transparent 65%),
        linear-gradient(135deg, var(--hero1) 0%, var(--hero2) 55%, var(--hero3) 100%);
    box-shadow: 0 18px 40px rgba(var(--plum-rgb), 0.28);
}
.greeting::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.greeting-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.greeting-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.greeting-icon {
    width: 52px; height: 52px; flex: 0 0 52px; display: grid; place-items: center; border-radius: 18px; color: var(--hero-accent);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 0 26px rgba(255, 170, 120, 0.25);
}
.greeting-text h1 { font-family: var(--font-display); font-weight: 400; font-size: 23px; line-height: 1.15; }
.greeting-date { margin-top: 4px; font-size: 13.5px; color: rgba(255, 255, 255, 0.78); }
.greeting-clock { text-align: right; white-space: nowrap; line-height: 1; }
.clock-main { font-family: var(--font-display); font-size: 31px; letter-spacing: 0.01em; }
.clock-meta { display: block; margin-top: 5px; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; color: var(--hero-accent); }
.greeting-credit {
    display: flex; justify-content: flex-end; margin-top: 14px; padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.credit-text {
    font-family: var(--font-display); font-style: italic; font-size: 14px; letter-spacing: 0.04em; color: var(--hero-accent);
}

/* ---------- summary cards ---------- */
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat {
    position: relative; overflow: hidden; min-height: 132px; padding: 16px 16px 14px; border-radius: var(--radius); color: #fff;
    display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow);
}
.stat::before {
    content: ""; position: absolute; width: 130px; height: 130px; right: -44px; top: -52px; border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 255, 255, 0.26), transparent);
}
.stat-top { display: flex; align-items: center; gap: 10px; position: relative; }
.stat-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: rgba(255, 255, 255, 0.2); }
.stat-label { font-size: 11.5px; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.92; line-height: 1.25; }
.stat-value { margin-top: 12px; font-family: var(--font-display); font-size: 33px; line-height: 1; letter-spacing: -0.01em; }
.stat-note { margin-top: 6px; font-size: 12.5px; opacity: 0.86; }
.stat-earnings { background: linear-gradient(145deg, var(--s1a) 0%, var(--s1b) 100%); }
.stat-bookings { background: linear-gradient(145deg, var(--s2a) 0%, var(--s2b) 100%); }
.stat-completed { background: linear-gradient(145deg, var(--s3a) 0%, var(--s3b) 100%); }
.stat-action { background: linear-gradient(145deg, var(--s4a) 0%, var(--s4b) 100%); }
.stat-action.attention { animation: attention 2.6s ease-in-out infinite; }
@keyframes attention { 50% { box-shadow: 0 12px 34px rgba(236, 123, 48, 0.55); } }

/* ---------- panels ---------- */
.home-columns { display: grid; gap: 18px; }
.panel {
    position: relative; padding: 18px; border-radius: var(--radius-lg); background: rgba(var(--card-rgb), var(--glass));
    -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.35); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel-title { display: flex; align-items: center; gap: 10px; }
.panel-title h2 { font-family: var(--font-display); font-weight: 400; font-size: 21px; }
.panel-title .badge-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: var(--plum-2); background: var(--tint); }
.count-pill {
    min-width: 28px; height: 28px; padding: 0 9px; display: inline-grid; place-items: center; border-radius: 999px;
    font-size: 13px; font-weight: 750; color: #fff; background: linear-gradient(135deg, #ec7b30, #b03a1c);
}
.count-pill.zero { color: var(--success); background: var(--success-soft); }

/* ---------- next appointment ---------- */
.next-card {
    position: relative; padding: 18px; border-radius: var(--radius); background: linear-gradient(160deg, var(--card) 0%, var(--card-end) 100%);
    border: 1px solid rgba(var(--rose-rgb), 0.18);
}
.next-card::before {
    content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 4px; border-radius: 0 4px 4px 0;
    background: linear-gradient(180deg, var(--gold), var(--rose));
}
.next-card.soon { border-color: rgba(var(--rose-rgb), 0.55); }
.next-card.soon { box-shadow: 0 0 0 3px rgba(var(--rose-rgb), 0.12), 0 10px 34px rgba(var(--rose-rgb), 0.28); }
/* a smooth light travels around the border while the appointment is about to start.
   A real element turned with transform (works on every iPhone), cut into a thin ring with a mask. */
.next-card .soon-ring {
    position: absolute; inset: 0; padding: 3px; border-radius: inherit; pointer-events: none; z-index: 2; overflow: hidden;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
}
.next-card .soon-ring i {
    position: absolute; left: 50%; top: 50%; width: 240%; aspect-ratio: 1; margin: 0; display: block;
    background: conic-gradient(from 0deg, transparent 0deg, transparent 240deg, rgba(var(--rose-rgb), 0.35) 270deg, var(--btn-a) 320deg, #fff 346deg, transparent 360deg);
    transform: translate(-50%, -50%) rotate(0deg); animation: nbSpin 4.5s linear infinite; will-change: transform;
}
@keyframes nbSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .next-card .soon-ring i { animation: none; } }
@keyframes breathe { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

.next-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.next-time { font-family: var(--font-display); font-size: 34px; line-height: 1; color: var(--ink); }
.next-day { margin-top: 6px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.next-client { margin-top: 16px; font-family: var(--font-display); font-size: 22px; line-height: 1.2; }
.service-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.service-chip { padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--plum-2); background: var(--tint-2); }
.next-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line-strong); }
.next-total small { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.next-total strong { font-family: var(--font-display); font-size: 24px; font-weight: 400; }
.countdown {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
    font-size: 13px; font-weight: 700; color: var(--plum-2); background: var(--tint);
}
.next-card.soon .countdown { color: #fff; background: linear-gradient(135deg, var(--btn-a), var(--rose-deep)); }
.soon-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: breathe 1.6s ease-in-out infinite; }
.next-card .soon-label {
    display: none; margin-bottom: 12px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--rose-deep);
}
.next-card.soon .soon-label { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- appointment rows ---------- */
.appt-list { display: grid; gap: 10px; }
.appt-row {
    width: 100%; display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 12px; padding: 12px;
    text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
    transition: transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.25s;
}
.appt-row:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(var(--rose-rgb), 0.3); }
.appt-row:active { transform: scale(0.985); }
.appt-avatar {
    width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; font-weight: 750; font-size: 15px;
    color: var(--plum-2); background: linear-gradient(145deg, var(--tint-2), var(--tint));
}
.appt-main { min-width: 0; }
.appt-name { font-weight: 700; font-size: 15.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-services { margin-top: 2px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.appt-time { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 5px; }
.appt-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.appt-amount { font-family: var(--font-display); font-size: 17px; }
.appt-row .chevron { color: var(--gold); }

/* action required list: fixed height, scrolls inside */
.action-scroll {
    max-height: 330px; overflow-y: auto; margin: 0 -8px; padding: 2px 8px 4px; -webkit-overflow-scrolling: touch;
    scrollbar-width: thin; scrollbar-color: rgba(var(--rose-deep-rgb), 0.35) transparent;
}
.action-scroll::-webkit-scrollbar { width: 6px; }
.action-scroll::-webkit-scrollbar-thumb { border-radius: 6px; background: rgba(var(--rose-deep-rgb), 0.3); }
.action-scroll.has-more { -webkit-mask-image: linear-gradient(#000 calc(100% - 26px), transparent); mask-image: linear-gradient(#000 calc(100% - 26px), transparent); }
.action-panel .appt-row { border-color: rgba(236, 123, 48, 0.35); background: linear-gradient(160deg, var(--card), var(--warn-soft)); }
.overdue { font-size: 12px; font-weight: 750; color: var(--warn-ink); display: inline-flex; align-items: center; gap: 5px; }

/* upcoming groups */
.group + .group { margin-top: 18px; }
.group-title { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.group-count { padding: 2px 9px; border-radius: 999px; font-size: 11.5px; color: var(--plum-2); background: var(--tint); letter-spacing: 0.04em; }

/* empty + error states */
.empty { padding: 26px 10px; text-align: center; color: var(--muted); }
.empty .empty-icon { width: 58px; height: 58px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 19px; color: var(--success); background: var(--success-soft); }
.empty.neutral .empty-icon { color: var(--plum-2); background: var(--tint); }
.empty strong { display: block; font-family: var(--font-display); font-weight: 400; font-size: 19px; color: var(--ink); }
.empty p { margin-top: 4px; font-size: 14px; }
.home-error {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); color: var(--danger-ink);
    background: var(--danger-soft); font-weight: 600; font-size: 14px;
}
.home-error .btn { margin-left: auto; }

/* appointment details dialog */
.detail-grid { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.detail-row { display: grid; grid-template-columns: 118px 1fr; gap: 12px; padding: 12px 14px; font-size: 14.5px; }
.detail-row + .detail-row { border-top: 1px solid var(--line); }
.detail-row dt { font-size: 11.5px; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.detail-row dd { margin: 0; color: var(--ink); font-weight: 550; word-break: break-word; }
.detail-services { display: grid; gap: 6px; }
.detail-services li { display: flex; justify-content: space-between; gap: 10px; list-style: none; }
.detail-services { margin: 0; padding: 0; }
.detail-services span:last-child { color: var(--muted); white-space: nowrap; }
.detail-total dd { font-family: var(--font-display); font-size: 20px; }
.detail-actions { display: grid; gap: 10px; padding: 16px 0 6px; }
.detail-actions .row-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-danger-soft { color: var(--danger); background: var(--danger-soft); border-color: transparent; }

/* skeleton blocks */
.sk-banner { height: 150px; }
.sk-card { height: 132px; }
.sk-panel { height: 200px; }

@media (min-width: 760px) {
    .summary-grid { grid-template-columns: repeat(4, 1fr); }
    .home-columns { grid-template-columns: 1fr 1fr; align-items: stretch; }
    .greeting { padding: 24px 28px 18px; }
    .clock-main { font-size: 38px; }
    .greeting-text h1 { font-size: 28px; }
}
@media (max-width: 380px) {
    .greeting-text h1 { font-size: 20px; }
    .clock-main { font-size: 26px; }
    .stat-value { font-size: 29px; }
    .detail-row { grid-template-columns: 96px 1fr; }
}

/* details dialog: never wider than the screen */
.detail-actions, .detail-actions .row-two { min-width: 0; }
.detail-actions .btn { min-width: 0; padding-left: 12px; padding-right: 12px; white-space: nowrap; }
.detail-row dd { min-width: 0; }
.detail-services li { flex-direction: column; gap: 2px; }
.detail-services li span:first-child { font-weight: 600; }
.detail-services span:last-child { font-size: 13px; }

/* hero ornament: fine concentric arcs, a quiet luxury detail */
.greeting::before {
    content: ""; position: absolute; right: -70px; top: -90px; width: 260px; height: 260px; border-radius: 50%; pointer-events: none;
    background: repeating-radial-gradient(circle at center, transparent 0 14px, rgba(255, 255, 255, 0.07) 14px 15px);
}

/* the four numbers are buttons: tap to see who is behind each number */
button.stat { border: 0; width: 100%; text-align: left; font: inherit; cursor: pointer; transition: transform .22s var(--ease), box-shadow .22s; }
button.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
button.stat:active { transform: scale(0.98); }
button.stat:focus-visible { outline: 3px solid var(--card); outline-offset: 2px; }
.stat::after { content: ""; position: absolute; right: 12px; bottom: 12px; width: 8px; height: 8px; border-top: 2px solid rgba(255,255,255,.7); border-right: 2px solid rgba(255,255,255,.7); transform: rotate(45deg); }

/* popup lists */
.sl-body { display: grid; gap: 14px; }
.sl-total { padding: 16px 18px; border-radius: var(--radius); color: #fff; background: linear-gradient(145deg, var(--s1a), var(--s1b)); box-shadow: var(--shadow); }
.sl-total-label { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.sl-total strong { display: block; margin-top: 4px; font-family: var(--font-display); font-weight: 400; font-size: 38px; line-height: 1.1; }
.sl-split { display: flex; gap: 10px; margin-top: 12px; }
.sl-split span { flex: 1; display: grid; gap: 2px; padding: 9px 12px; border-radius: 12px; background: rgba(255,255,255,.16); font-size: 12.5px; }
.sl-split b { font-size: 16px; font-weight: 700; }
.sl-split .dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; }
.sl-split .dot.cash { background: #ffe29a; }
.sl-split .dot.interac { background: #9fe3ff; }
.sl-body .appt-list { max-height: 46vh; overflow-y: auto; padding: 2px; }

/* appointment rows on Home: a date tile on the left, status + source on the right (no price) */
.appt-row { grid-template-columns: 56px minmax(0, 1fr) auto; }
.appt-date {
    width: 56px; height: 60px; display: grid; grid-template-rows: auto 1fr; justify-items: center; align-items: center; overflow: hidden; border-radius: 16px;
    background: var(--card); box-shadow: inset 0 0 0 1.5px rgba(var(--rose-rgb), 0.35), 0 6px 14px rgba(var(--rose-rgb), 0.14);
}
.appt-date i { width: 100%; padding: 3px 0 2px; text-align: center; font-style: normal; font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #fff; background: linear-gradient(135deg, var(--btn-a), var(--rose-deep)); }
.appt-date b { font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 1; color: var(--ink); }
.appt-source { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.appt-side { align-items: flex-end; justify-content: center; gap: 6px; }
.appt-side .chip { white-space: nowrap; padding: 5px 10px; font-size: 11px; }
.appt-row .overdue { white-space: nowrap; }
.appt-row { gap: 12px; padding: 12px 12px 12px 10px; }

/* credit: tiny, in the top-right corner of the greeting box */
.greeting { padding-top: 26px; }
.credit-mini { position: absolute; top: 10px; right: 18px; z-index: 2; font-family: var(--font-display); font-style: italic; font-size: 10.5px; letter-spacing: .04em; color: var(--hero-accent); opacity: .8; white-space: nowrap; }

/* greeting: small label + the name, always tidy (never a 3-line wrap) */
.greeting:not(.fest) .greeting-text h1 { font-size: 26px; line-height: 1.08; }
.gt-hello { display: block; margin-bottom: 3px; font-family: var(--font-body, inherit); font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--hero-accent); }
.gt-name { display: block; font-family: var(--font-display); font-weight: 400; }
.greeting:not(.fest) .greeting-date { white-space: nowrap; }

/* running offers: only a quiet line of text, softly glowing, one offer at a time */
.home-offers { position: relative; z-index: 1; margin-top: 14px; padding-top: 11px; min-height: 52px; display: grid; justify-items: center; align-content: center; gap: 3px; border-top: 1px solid rgba(255, 255, 255, 0.14); text-align: center; pointer-events: none; user-select: none; }
.home-offers[hidden] { display: none; }
.ho-eyebrow { font-size: 9.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--hero-accent); opacity: .75; }
.ho-line { max-width: 100%; min-height: 20px; font-family: var(--font-display); font-size: 16px; letter-spacing: .02em; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .7s ease; }
.ho-line.on { opacity: 1; animation: hoGlow 2.6s ease-in-out 3; }
@keyframes hoGlow { 0%, 100% { text-shadow: 0 0 4px rgba(255,255,255,.10); } 50% { text-shadow: 0 0 14px rgba(255,255,255,.60), 0 0 28px rgba(var(--glow1-rgb), .45); } }
@media (prefers-reduced-motion: reduce) { .ho-line.on { animation: none; } }
.greeting::after { background-position: right 10px top 58px !important; background-size: 96px auto !important; opacity: .3; }

/* offers: one slim, quiet line at the very bottom (compact) */
.home-offers { margin-top: 8px; padding-top: 0; min-height: 22px; border-top: 0; display: flex; align-items: center; justify-content: center; gap: 10px; }
.ho-spark { flex: 0 0 auto; width: 6px; height: 6px; transform: rotate(45deg); background: var(--hero-accent); opacity: .8; border-radius: 1px; animation: hoGlow 2.6s ease-in-out infinite; box-shadow: 0 0 8px rgba(255,255,255,.4); }
.ho-line { min-height: 0; font-family: var(--font-body); font-size: 12.5px; font-weight: 600; letter-spacing: .06em; color: var(--hero-accent); }
.greeting { padding-bottom: 12px; }
