/* Qupio Hieroja – /varaushallinta */
:root { --a: #6B4EFF; --ink: #15172b; --muted: #646a80; --line: #e5e7ef; --soft: #f5f6fa; --ok: #166534; --okbg: #dcfce7; --err: #991b1b; --errbg: #fee2e2; --warn: #7a4b00; --warnbg: #fff4d6; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--soft); }
a { color: var(--a); }
h1 { font-size: 1.55rem; margin: 0 0 6px; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 0 0 10px; }
code { background: var(--soft); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.qh-muted { color: var(--muted); font-size: .92rem; margin: 0; }
.qh-nowrap { white-space: nowrap; }

/* Yläpalkki */
.qh-top { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 20; }
.qh-top__in { max-width: 1320px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.qh-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.qh-brand > span { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: linear-gradient(135deg, var(--a), color-mix(in srgb, var(--a) 55%, #22d3ee)); }
.qh-brand b { display: block; line-height: 1.15; }
.qh-brand small { display: block; font-weight: 500; font-size: .74rem; opacity: .65; }
.qh-nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.qh-nav a { color: rgba(255,255,255,.75); text-decoration: none; padding: 8px 12px; border-radius: 9px; font-weight: 600; font-size: .92rem; position: relative; }
.qh-nav a:hover, .qh-nav a[aria-current] { background: rgba(255,255,255,.12); color: #fff; }
.qh-nav em { font-style: normal; margin-left: 6px; background: #f59e0b; color: #111; border-radius: 999px; padding: 0 7px; font-size: .75rem; font-weight: 800; }
.qh-user { display: flex; gap: 14px; font-size: .88rem; }
.qh-user a { color: rgba(255,255,255,.75); }

.qh-main { max-width: 1320px; margin: 0 auto; padding: 24px 20px 40px; }
.qh-bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.qh-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qh-acts form { margin: 0; }
.qh-inline { display: inline; margin: 0; }
.qh-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin-bottom: 18px; }
.qh-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.qh-grid2 > .qh-card { margin-bottom: 0; }
.qh-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.qh-empty { padding: 30px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 16px; }
.qh-scroll { overflow-x: auto; }

.qh-alert { padding: 12px 16px; border-radius: 12px; margin: 0 0 16px; font-weight: 500; }
.qh-alert--ok { background: var(--okbg); color: var(--ok); }
.qh-alert--err { background: var(--errbg); color: var(--err); }
.qh-alert--warn { background: var(--warnbg); color: var(--warn); }

.qh-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 15px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.qh-btn:hover { border-color: var(--a); color: var(--a); }
.qh-btn--p { background: var(--a); border-color: var(--a); color: #fff; }
.qh-btn--p:hover { color: #fff; filter: brightness(1.07); }
.qh-btn--danger { color: #b42318; border-color: #f3c7c3; }
.qh-btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.qh-btn--s { padding: 5px 10px; font-size: .85rem; }
.qh-btn--block { width: 100%; justify-content: center; }

.qh-form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 12px; }
.qh-form label small { font-weight: 400; color: var(--muted); }
.qh-form input:not([type=checkbox]):not([type=color]), .qh-form select, .qh-form textarea, .qh-filter input, .qh-filter select, .qh-acts input[type=date], .qh-login input:not([type=checkbox]) {
    display: block; width: 100%; margin-top: 5px; padding: 9px 11px; border: 1px solid #ccd1dd; border-radius: 9px; font: inherit; font-weight: 400; background: #fff; color: var(--ink); }
.qh-acts input[type=date] { margin: 0; width: auto; }
.qh-form input[type=color] { display: block; margin-top: 5px; width: 64px; height: 38px; border: 1px solid #ccd1dd; border-radius: 9px; padding: 3px; }
.qh-form input:focus, .qh-form select:focus, .qh-form textarea:focus { outline: 2px solid color-mix(in srgb, var(--a) 30%, transparent); border-color: var(--a); }
.qh-check { display: flex !important; gap: 8px; align-items: center; font-weight: 500 !important; }
.qh-check input { width: 17px; height: 17px; accent-color: var(--a); margin: 0; }
.qh-fs { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 2px; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 0 18px; }
.qh-fs legend { font-weight: 700; font-size: .9rem; padding: 0 6px; }
.qh-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.qh-filter label { font-weight: 600; font-size: .85rem; flex: 1 1 140px; }

.qh-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.qh-table th { text-align: left; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.qh-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.qh-table tr:last-child td { border-bottom: 0; }

.qh-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #eef0f5; color: #4b5064; white-space: nowrap; }
.qh-badge--confirmed { background: #e8e4ff; color: #3f2fb3; }
.qh-badge--pending { background: var(--warnbg); color: var(--warn); }
.qh-badge--completed { background: var(--okbg); color: var(--ok); }
.qh-badge--cancelled, .qh-badge--no_show { background: var(--errbg); color: var(--err); }
.qh-dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 0; }
.qh-dl dt { color: var(--muted); }
.qh-dl dd { margin: 0; font-weight: 600; }

/* Viikko */
.qh-week { display: grid; grid-template-columns: repeat(7, 1fr) auto auto; gap: 8px; margin-bottom: 16px; align-items: stretch; }
.qh-week__d { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 12px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.qh-week__d small { text-transform: uppercase; color: var(--muted); font-weight: 700; font-size: .72rem; }
.qh-week__d span { font-size: .78rem; color: var(--muted); }
.qh-week__d.is-today { border-color: color-mix(in srgb, var(--a) 50%, #fff); }
.qh-week__d.is-on { background: var(--a); border-color: var(--a); color: #fff; }
.qh-week__d.is-on small, .qh-week__d.is-on span { color: rgba(255,255,255,.8); }
.qh-week__nav { align-self: center; font-size: .85rem; font-weight: 600; text-decoration: none; padding: 0 6px; }

/* Päivänäkymä */
.qh-cal { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: auto; }
.qh-cal__head, .qh-cal__body { display: grid; grid-template-columns: 58px repeat(var(--cols), minmax(170px, 1fr)); min-width: calc(58px + var(--cols) * 170px); }
.qh-cal__head { position: sticky; top: 0; z-index: 3; background: #fff; border-bottom: 1px solid var(--line); }
.qh-cal__staff { padding: 12px; font-weight: 700; display: flex; align-items: center; gap: 8px; border-left: 1px solid var(--line); }
.qh-cal__staff i { width: 10px; height: 10px; border-radius: 50%; }
.qh-cal__body { height: calc(var(--h) + 16px); padding-top: 8px; }
.qh-cal__axis { position: relative; }
.qh-cal__axis span { position: absolute; right: 8px; transform: translateY(-50%); font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.qh-cal__col { position: relative; border-left: 1px solid var(--line); background: repeating-linear-gradient(135deg, #f7f7fa, #f7f7fa 6px, #f2f3f7 6px, #f2f3f7 12px); }
.qh-cal__work { position: absolute; left: 0; right: 0; background: #fff; }
.qh-cal__line { position: absolute; left: 0; right: 0; border-top: 1px solid #eef0f4; }
.qh-cal__block { position: absolute; left: 4px; right: 4px; border-radius: 8px; background: repeating-linear-gradient(45deg, #fde8e8, #fde8e8 8px, #fbd5d5 8px, #fbd5d5 16px); color: #8a1c1c; font-size: .78rem; font-weight: 700; padding: 4px 8px; overflow: hidden; z-index: 1; }
.qh-cal__buf { position: absolute; left: 6px; right: 6px; background: repeating-linear-gradient(90deg, #eceef4, #eceef4 4px, transparent 4px, transparent 8px); border-radius: 0 0 6px 6px; z-index: 1; }
.qh-ev { --c: var(--a); position: absolute; left: 4px; right: 4px; z-index: 2; border-radius: 9px; padding: 5px 8px; overflow: hidden; text-decoration: none; color: var(--ink);
    background: color-mix(in srgb, var(--c) 14%, #fff); border-left: 4px solid var(--c); box-shadow: 0 1px 2px rgba(0,0,0,.05); transition: box-shadow .15s, transform .15s; }
.qh-ev:hover { box-shadow: 0 8px 18px -10px rgba(0,0,0,.35); transform: translateY(-1px); z-index: 4; }
.qh-ev b { display: block; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qh-ev span { display: block; font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qh-ev--pending { background: repeating-linear-gradient(135deg, #fff8e6, #fff8e6 8px, #fff1cc 8px, #fff1cc 16px); border-left-color: #f59e0b; }
.qh-ev--pending_payment { opacity: .6; border-left-style: dashed; }
.qh-ev--completed { opacity: .7; }
.qh-ev--no_show { opacity: .55; text-decoration: line-through; }
.qh-cal__now { position: absolute; left: 0; right: 0; border-top: 2px solid #ef4444; z-index: 5; }
.qh-cal__now::before { content: ""; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: #ef4444; }

/* Uusi varaus */
.qh-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; }
.qh-slot { padding: 8px 4px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.qh-slot:hover, .qh-slot.is-on { border-color: var(--a); background: var(--a); color: #fff; }

/* Tekijät */
.qh-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.qh-person { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; }
.qh-person.is-off { opacity: .55; }
.qh-person .qh-acts { margin-top: 10px; }
.qh-avatar { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.2rem; overflow: hidden; margin-bottom: 6px; }
.qh-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Aukioloajat */
.qh-hours { display: grid; gap: 6px; }
.qh-hours__h, .qh-hours__r { display: grid; grid-template-columns: 120px repeat(4, minmax(0, 1fr)) 70px; gap: 8px; align-items: center; }
.qh-hours__h span { font-size: .75rem; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.qh-hours__r input[type=time] { margin: 0 !important; }
.qh-hours__r .qh-check { margin: 0; justify-content: center; }

.qh-list { list-style: none; margin: 0; padding: 0; }
.qh-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.qh-checklist { list-style: none; margin: 0; padding: 0; }
.qh-checklist li { display: flex; gap: 10px; align-items: center; padding: 7px 0; }
.qh-checklist span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem; background: var(--warnbg); color: var(--warn); }
.qh-checklist .is-ok span { background: var(--okbg); color: var(--ok); }
.qh-guide details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.qh-guide details:last-child { border-bottom: 0; }
.qh-guide summary { font-weight: 700; cursor: pointer; }
.qh-guide p { margin: 10px 0 0; color: #3c4156; }
.qh-credit { text-align: center; font-size: .78rem; color: #9aa0b4; padding: 0 0 26px; }
.qh-credit a { color: inherit; }

/* Kirjautuminen */
.qh-login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: #f6f6fb; }
.qh-login__side { color: #fff; padding: 44px 52px; display: flex; flex-direction: column; justify-content: space-between;
    background: radial-gradient(800px 500px at 100% 0, color-mix(in srgb, var(--a) 55%, transparent), transparent 65%), radial-gradient(700px 600px at 0 100%, rgba(34,211,238,.25), transparent 60%), linear-gradient(160deg, #0f1124, #1a1d3d); }
.qh-login__brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.05rem; }
.qh-login__logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--a), color-mix(in srgb, var(--a) 50%, #22d3ee)); }
.qh-login__hero h1 { font-size: clamp(2rem, 3vw, 2.8rem); line-height: 1.12; margin: 0 0 14px; }
.qh-login__hero h1 span { background: linear-gradient(90deg, color-mix(in srgb, var(--a) 40%, #fff), #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.qh-login__hero p { color: rgba(255,255,255,.72); max-width: 420px; font-size: 1.05rem; }
.qh-login__foot { color: rgba(255,255,255,.45); font-size: .85rem; }
.qh-login__main { display: grid; place-items: center; padding: 30px 20px; }
.qh-login__card { width: min(400px, 100%); }
.qh-login__card h2 { font-size: 1.6rem; margin: 0 0 4px; }
.qh-login__card .qh-muted { margin-bottom: 22px; }
.qh-login__card label { display: block; font-weight: 600; margin-bottom: 14px; font-size: .92rem; }
.qh-login__card input:not([type=checkbox]) { height: 48px; border-radius: 12px; border-width: 1.5px; }
.qh-login__card .qh-btn--p { height: 50px; border-radius: 12px; font-size: 1rem; margin-top: 6px; }
.qh-login__lost { text-align: center; font-size: .9rem; }

@media (max-width: 900px) {
    .qh-grid2 { grid-template-columns: 1fr; }
    .qh-week { grid-template-columns: repeat(7, 1fr); }
    .qh-week__nav { display: none; }
    .qh-login { grid-template-columns: 1fr; }
    .qh-login__side { display: none; }
    .qh-hours__h { display: none; }
    .qh-hours__r { grid-template-columns: 1fr 1fr; padding: 8px 0; border-bottom: 1px solid var(--line); }
    .qh-hours__r b { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
    .qh-grid { grid-template-columns: 1fr; }
    .qh-main { padding: 16px 12px 30px; }
    .qh-week__d b { font-size: .8rem; }
    .qh-week__d span { display: none; }
}

/* Tiivis päivänäkymä + päivän varaukset (0.2.2) */
.qh-day { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.qh-day .qh-cal { margin: 0; }
.qh-cal__head .qh-cal__staff { padding: 9px 12px; }
.qh-ev { padding: 3px 8px; }
.qh-ev--short { display: flex; gap: 6px; align-items: center; }
.qh-ev--short b, .qh-ev--short span { display: inline; }
.qh-ev--short span::before { content: "· "; }
.qh-agenda { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; }
.qh-agenda h2 { display: flex; align-items: center; gap: 8px; font-size: 1rem; margin-bottom: 10px; }
.qh-agenda h2 span { background: var(--a); color: #fff; border-radius: 999px; padding: 0 9px; font-size: .78rem; }
.qh-agenda__i { display: flex; gap: 12px; padding: 10px 10px 10px 12px; margin: 0 -6px 4px; border-radius: 12px; text-decoration: none; color: var(--ink); border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 7%, #fff); }
.qh-agenda__i:hover { background: color-mix(in srgb, var(--c) 14%, #fff); }
.qh-agenda__i.is-past { opacity: .55; }
.qh-agenda__i time { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 44px; line-height: 1.2; }
.qh-agenda__i time small { display: block; font-weight: 500; color: var(--muted); font-size: .78rem; }
.qh-agenda__i > span { font-size: .86rem; color: var(--muted); line-height: 1.35; }
.qh-agenda__i b { display: block; color: var(--ink); font-size: .95rem; }
.qh-agenda__cx { margin-top: 10px; font-size: .82rem; }
@media (max-width: 1000px) { .qh-day { grid-template-columns: 1fr; } .qh-agenda { position: static; max-height: none; order: -1; } }

/* Värit ja ulkoasu (0.3.0) */
.qh-presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; }
.qh-preset { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; color: var(--ink); }
.qh-preset:hover { border-color: var(--a); }
.qh-preset i { width: 26px; height: 26px; border-radius: 50%; border: 2px solid; display: grid; place-items: center; }
.qh-preset b { width: 12px; height: 12px; border-radius: 50%; }
.qh-look { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; align-items: start; }
.qh-color { display: grid; grid-template-columns: minmax(0, 1fr) 46px 104px; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.qh-color > span b { display: block; font-size: .9rem; }
.qh-color > span small { display: block; color: var(--muted); font-size: .78rem; }
.qh-form .qh-color input[type=color] { width: 46px; height: 38px; margin: 0; padding: 2px; }
.qh-form .qh-color input[type=text] { margin: 0; font-family: ui-monospace, Consolas, monospace; text-transform: uppercase; }
.qh-color input:disabled { opacity: .45; }
.qh-form .qh-color__auto { grid-column: 2 / -1; margin: 0; font-size: .82rem; }
.qh-look__preview { position: sticky; top: 80px; background: repeating-conic-gradient(#f3f4f8 0% 25%, #fff 0% 50%) 50% / 18px 18px; border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.qh-look__preview > small { display: block; margin-bottom: 8px; }
.qh-look__preview .qhr-shell { padding: 18px; }
.qh-look__preview .qhr--plain .qhr-shell { padding: 0; }
.qh-look__preview .qhr-title { font-size: 1.3rem; }
.qh-prev__row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; align-items: start; }
.qh-prev__row .qhr-cal { padding: 10px; }
.qh-prev__row .qhr-slots__grid { grid-template-columns: 1fr; }
@media (max-width: 1000px) { .qh-look { grid-template-columns: 1fr; } .qh-look__preview { position: static; } }

/* Tekijän kuva (0.3.1) */
.qh-photo { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 14px; align-items: center; grid-column: 1 / -1; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; margin-bottom: 12px; }
.qh-photo .qh-avatar { grid-row: span 2; margin: 0; }
.qh-photo label { margin: 0; }
.qh-photo input[type=file] { display: block; margin-top: 6px; font: inherit; font-size: .88rem; }
