/*
 * Uttu Vuorot – suunnittelunäkymän tyylit.
 * Rekisteröidään Filamentin assetiksi (AppServiceProvider), joten erillistä
 * Tailwind-buildia ei tarvita. Värit seuraavat paneelin muuttujia (--primary-*, --gray-*).
 */
.uv-schedule { display: flex; flex-direction: column; gap: 1rem; }
.uv-muted { color: var(--gray-500); font-size: .8125rem; }
.uv-link { color: var(--primary-600); font-weight: 600; text-decoration: underline; }
.uv-icon { width: 1.1rem; height: 1.1rem; }
.uv-num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Värit kohteille ja työntekijöille */
.uv-c-sky { --c: #0284c7; --c-soft: #e0f2fe; }
.uv-c-orange { --c: #ea580c; --c-soft: #ffedd5; }
.uv-c-violet { --c: #7c3aed; --c-soft: #ede9fe; }
.uv-c-emerald { --c: #059669; --c-soft: #d1fae5; }
.uv-c-rose { --c: #e11d48; --c-soft: #ffe4e6; }
.uv-c-amber { --c: #d97706; --c-soft: #fef3c7; }
.uv-c-teal { --c: #0d9488; --c-soft: #ccfbf1; }
.uv-c-indigo { --c: #4f46e5; --c-soft: #e0e7ff; }
.uv-c-lime { --c: #65a30d; --c-soft: #ecfccb; }
.uv-c-slate { --c: #475569; --c-soft: #f1f5f9; }
.dark .uv-chip { --c-soft: color-mix(in oklab, var(--c) 18%, var(--gray-900)); }

/* Työkalurivi */
.uv-toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.uv-weeknav { display: inline-flex; border: 1px solid var(--gray-300); border-radius: .5rem; overflow: hidden; background: #fff; }
.dark .uv-weeknav { background: var(--gray-900); border-color: var(--gray-700); }
.uv-weeknav button { padding: .45rem .6rem; display: grid; place-items: center; }
.uv-weeknav button:hover { background: var(--gray-50); }
.dark .uv-weeknav button:hover { background: var(--gray-800); }
.uv-weeknav-label { font-weight: 600; font-size: .875rem; border-inline: 1px solid var(--gray-200); padding-inline: .9rem !important; }
.dark .uv-weeknav-label { border-color: var(--gray-700); }
.uv-select { border: 1px solid var(--gray-300); border-radius: .5rem; padding: .45rem 2rem .45rem .7rem; font-size: .875rem; background-color: #fff; }
.dark .uv-select { background-color: var(--gray-900); border-color: var(--gray-700); }
.uv-templates { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-left: auto; }
.uv-tpl { display: inline-flex; flex-direction: column; border: 1px dashed var(--gray-400); border-radius: .5rem; padding: .2rem .6rem; font-size: .75rem; line-height: 1.3; cursor: grab; background: #fff; user-select: none; }
.dark .uv-tpl { background: var(--gray-900); border-color: var(--gray-600); }
.uv-tpl span { color: var(--gray-500); font-variant-numeric: tabular-nums; }
.uv-tpl:hover { border-color: var(--primary-500); }

/* Tunnusluvut */
.uv-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .75rem; }
.uv-stat { display: flex; flex-direction: column; gap: .1rem; padding: .85rem 1rem; border-radius: .75rem; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .05); outline: 1px solid rgb(3 7 18 / .05); }
.dark .uv-stat { background: var(--gray-900); outline-color: rgb(255 255 255 / .1); }
.uv-stat-label { font-size: .75rem; font-weight: 500; color: var(--gray-500); }
.uv-stat-value { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.uv-stat-sub { font-size: .75rem; color: var(--gray-500); }
.uv-stat-alert .uv-stat-value { color: #dc2626; }

/* Taulukko */
.uv-board-wrap { overflow-x: auto; border-radius: .75rem; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .05); outline: 1px solid rgb(3 7 18 / .06); transition: opacity .15s; }
.dark .uv-board-wrap { background: var(--gray-900); outline-color: rgb(255 255 255 / .1); }
.uv-loading { opacity: .6; pointer-events: none; }
.uv-board { display: grid; grid-template-columns: minmax(13rem, 1.3fr) repeat(var(--uv-days, 7), minmax(7.5rem, 1fr)); min-width: 66rem; }
/* Jaksonäkymä: koko tasoittumisjakso (esim. 21 pv) – kapeammat sarakkeet, viikkorajat näkyviin */
.uv-board-period { grid-template-columns: minmax(8.5rem, 12rem) repeat(var(--uv-days, 21), minmax(2.6rem, 1fr)); min-width: calc(8.5rem + var(--uv-days, 21) * 2.6rem); }
.uv-board-period .uv-chip { font-size: .6875rem; padding: .2rem .3rem; border-left-width: 3px; }
/* Sirun teksti sarakkeen leveyden mukaan: kapeassa "19–09" / "P · lepo", leveässä koko teksti. */
.uv-board-period .uv-cell { container-type: inline-size; }
.uv-board-period .uv-wide { display: none; }
@container (min-width: 6.5rem) {
    .uv-board-period .uv-chip b .uv-wide { display: inline; }
    .uv-board-period .uv-chip b .uv-narrow { display: none; }
}
@container (min-width: 6.5rem) {
    .uv-board-period .uv-kind-line .uv-wide { display: inline; }
    .uv-board-period .uv-kind-line .uv-narrow { display: none; }
}
@container (max-width: 3.6rem) {
    .uv-board-period .uv-chip { font-size: .625rem; padding: .12rem .12rem .12rem .15rem; border-left-width: 2px; letter-spacing: -.02em; text-align: center; }
    .uv-board-period .uv-flag { top: -.3rem; right: -.2rem; width: .8rem; height: .8rem; font-size: .5rem; }
}
/* Pienellä näytöllä nimisarake kapeimmilleen, jotta koko jakso mahtuu ilman vieritystä. */
.uv-board-wrap { container-type: inline-size; }
@container (max-width: 80rem) {
    .uv-board-period { grid-template-columns: 8.5rem repeat(var(--uv-days, 21), minmax(2.6rem, 1fr)); }
}
.uv-board-period .uv-chip b, .uv-board-period .uv-chip small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uv-board-period .uv-chip small { display: none; }
.uv-board-period .uv-chip small.uv-kind-line { display: block; font-size: .625rem; line-height: 1.2; }
.uv-board-period .uv-head { padding: .45rem .3rem; }
.uv-board-period .uv-emp { padding: .5rem .5rem; }
.uv-board-period .uv-head span { font-size: .6875rem; }
.uv-board-period .uv-cell { padding: .2rem .15rem; }
/* Ei ylivuotoa: solujen ja otsikoiden sisältö pysyy omassa sarakkeessaan */
.uv-board > div { min-width: 0; }
.uv-head span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uv-who > div { min-width: 0; }
.uv-who b, .uv-who small { overflow: hidden; text-overflow: ellipsis; }
/* Lisiä maksavat päivät (pyhät, aatot) */
.uv-pay-badge { display: inline-block; font-style: normal; font-size: .625rem; font-weight: 700; line-height: 1; padding: .18rem .3rem; border-radius: .3rem;
    color: #92400e; background: #fef3c7; box-shadow: inset 0 0 0 1px #fcd34d; white-space: nowrap; vertical-align: middle; }
.dark .uv-pay-badge { color: #fde68a; background: rgb(245 158 11 / .18); box-shadow: inset 0 0 0 1px rgb(245 158 11 / .4); }
.uv-head { overflow: hidden; }
.uv-head .uv-pay-badge { margin-top: .2rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.uv-board-period .uv-head .uv-pay-badge { padding: .15rem .2rem; font-size: .5625rem; }
.uv-head.uv-payday { background: #fffbeb; box-shadow: inset 0 -2px 0 #f59e0b; }
.dark .uv-head.uv-payday { background: rgb(245 158 11 / .12); }
.uv-head.uv-payday span { color: #b45309; font-weight: 500; }
.dark .uv-head.uv-payday span { color: #fbbf24; }
.uv-legend .uv-pay-badge { margin-right: .15rem; }
/* Viikkoraja varjona (ei vie sarakkeen leveyttä, joten sirut mahtuvat) */
.uv-wk-start { box-shadow: inset 2px 0 0 var(--gray-300); }
.dark .uv-wk-start { box-shadow: inset 2px 0 0 var(--gray-600); }
.uv-head.uv-payday.uv-wk-start { box-shadow: inset 2px 0 0 var(--gray-300), inset 0 -2px 0 #f59e0b; }
.uv-segment { display: inline-flex; border: 1px solid var(--gray-300); border-radius: .5rem; overflow: hidden; background: #fff; }
.dark .uv-segment { background: var(--gray-900); border-color: var(--gray-700); }
.uv-segment button { padding: .4rem .75rem; font-size: .8125rem; color: var(--gray-700); }
.dark .uv-segment button { color: var(--gray-300); }
.uv-segment button + button { border-left: 1px solid var(--gray-300); }
.dark .uv-segment button + button { border-left-color: var(--gray-700); }
.uv-segment button.is-active { background: var(--primary-600); color: #fff; font-weight: 600; }
.uv-board > div { border-bottom: 1px solid var(--gray-200); border-right: 1px solid var(--gray-200); }
.dark .uv-board > div { border-color: var(--gray-800); }
.uv-board > div:nth-child(8n) { border-right: 0; }
.uv-head { padding: .55rem .7rem; font-size: .75rem; color: var(--gray-500); background: var(--gray-50); position: sticky; top: 0; z-index: 2; }
.dark .uv-head { background: var(--gray-800); }
.uv-head b { display: block; color: var(--gray-950); font-size: .8125rem; }
.dark .uv-head b { color: #fff; }
.uv-head.uv-today b { color: var(--primary-600); }
.uv-corner { display: flex; align-items: flex-end; font-weight: 600; }
.uv-emp { padding: .55rem .7rem; display: flex; flex-direction: column; gap: .4rem; position: sticky; left: 0; z-index: 1; background: #fff; }
.dark .uv-emp { background: var(--gray-900); }
.uv-open-emp { background: var(--gray-50); }
.dark .uv-open-emp { background: var(--gray-800); }
.uv-who { display: flex; gap: .55rem; align-items: center; min-width: 0; }
.uv-who b { display: block; font-size: .8125rem; font-weight: 600; white-space: nowrap; }
.uv-who small { display: block; font-size: .72rem; color: var(--gray-500); white-space: nowrap; }
.uv-avatar { width: 1.8rem; height: 1.8rem; border-radius: 999px; display: grid; place-items: center; font-size: .68rem; font-weight: 700; color: #fff; background: var(--c, var(--gray-500)); flex: none; }
.uv-avatar-open { background: var(--gray-400); }
.uv-hours { display: flex; align-items: center; gap: .45rem; font-size: .72rem; color: var(--gray-500); flex-wrap: wrap; }
.uv-period { flex-basis: 100%; font-size: .68rem; color: var(--gray-500); }
.uv-period-over { color: var(--danger-600); font-weight: 600; }
.uv-bar { flex: 1; height: .35rem; border-radius: 999px; background: var(--gray-100); overflow: hidden; min-width: 3rem; }
.dark .uv-bar { background: var(--gray-800); }
.uv-bar i { display: block; height: 100%; background: var(--primary-500); border-radius: 999px; }
.uv-bar i.uv-over { background: #dc2626; }
.uv-light { width: .6rem; height: .6rem; border-radius: 999px; flex: none; display: inline-block; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .15); }
.uv-light-green { background: #22c55e; }
.uv-light-yellow { background: #eab308; }
.uv-light-red { background: #ef4444; }

.uv-cell { min-height: 4.4rem; padding: .3rem; display: flex; flex-direction: column; gap: .25rem; position: relative; transition: background .1s; }
.uv-cell.uv-weekend { background: color-mix(in oklab, var(--gray-100) 55%, transparent); }
.dark .uv-cell.uv-weekend { background: color-mix(in oklab, var(--gray-800) 50%, transparent); }
.uv-cell.uv-payday { background: rgb(251 191 36 / .08); }
.dark .uv-cell.uv-payday { background: rgb(245 158 11 / .07); }
.uv-cell.uv-absent { background: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in oklab, var(--gray-200) 80%, transparent) 6px 12px); }
.dark .uv-cell.uv-absent { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--gray-800) 6px 12px); }
.uv-cell.uv-drop { outline: 2px dashed var(--primary-500); outline-offset: -3px; background: color-mix(in oklab, var(--primary-500) 8%, transparent); }
.uv-add { opacity: 0; border: 1px dashed var(--gray-300); border-radius: .375rem; color: var(--gray-500); font-size: .8rem; line-height: 1.2; padding: .1rem; }
.uv-cell:hover .uv-add, .uv-add:focus-visible { opacity: 1; }
.uv-abs { align-self: flex-start; font-size: .68rem; font-weight: 600; padding: .05rem .4rem; border-radius: .3rem; border: 1px solid var(--gray-300); background: #fff; color: var(--gray-700); }
.dark .uv-abs { background: var(--gray-900); color: var(--gray-200); border-color: var(--gray-600); }
.uv-abs-wish { border-style: dashed; }

.uv-chip { position: relative; text-align: left; width: 100%; padding: .25rem .45rem; border-radius: .4rem; border: 1px solid var(--c); border-left-width: 4px; background: var(--c-soft); color: var(--gray-950); font-size: .75rem; line-height: 1.25; cursor: grab; }
.dark .uv-chip { color: #fff; }
.uv-chip b { display: block; font-weight: 600; font-variant-numeric: tabular-nums; }
.uv-chip small { display: block; color: var(--gray-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Vuorotyypit: päivystys (työaikaa, mahdollisuus lepoon) ja varallaolo (ei työaikaa) */
.uv-kind-tag { font-weight: 500; font-size: .65rem; padding: 0 .3rem; border-radius: .25rem; background: rgb(0 0 0 / .08); margin-left: .15rem; }
.dark .uv-kind-tag { background: rgb(255 255 255 / .12); }
.uv-chip.uv-kind-standby { border-style: dashed; background: repeating-linear-gradient(135deg, var(--c-soft) 0 6px, transparent 6px 10px); }
.uv-chip.uv-kind-duty { background: linear-gradient(90deg, var(--c-soft), color-mix(in oklab, var(--c) 14%, transparent)); }
.dark .uv-chip small { color: var(--gray-300); }
.uv-chip.uv-draft { border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; }
.uv-chip.uv-deleting { opacity: .55; text-decoration: line-through; }
.uv-chip.uv-hl { box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary-500) 45%, transparent); }
.uv-chip:focus-visible { outline: 2px solid var(--primary-500); outline-offset: 1px; }
.uv-flag { position: absolute; top: .2rem; right: .25rem; width: 1rem; height: 1rem; border-radius: 999px; display: grid; place-items: center; font-size: .625rem; font-weight: 700; color: #fff; }

.uv-sev-error { background: #dc2626; }
.uv-sev-warning { background: #ca8a04; }
.uv-sev-info { background: #2563eb; }
.uv-sev-ok { background: #16a34a; }

.uv-cov { padding: .4rem .7rem; font-size: .72rem; font-weight: 600; background: var(--gray-50); display: flex; flex-direction: column; }
.dark .uv-cov { background: var(--gray-800); }
.uv-cov-label { justify-content: center; color: var(--gray-700); }
.dark .uv-cov-label { color: var(--gray-200); }
.uv-cov-bad { color: #dc2626; }
.uv-cov-ok { color: #16a34a; }
.uv-empty { grid-column: 1 / -1; padding: 2rem; text-align: center; color: var(--gray-500); }

.uv-legend { display: flex; flex-wrap: wrap; gap: 1.1rem; font-size: .75rem; color: var(--gray-500); align-items: center; }
.uv-legend i { display: inline-block; width: 1rem; height: .7rem; border-radius: .2rem; margin-right: .35rem; vertical-align: -1px; }
.uv-legend-draft { border: 1px dashed var(--gray-500); border-left: 3px solid var(--gray-500); }
.uv-legend-delete { background: var(--gray-200); opacity: .7; }
.uv-legend kbd { font-size: .7rem; padding: 0 .3rem; border: 1px solid var(--gray-300); border-radius: .25rem; }

/* Huomiot */
.uv-issues { display: flex; flex-direction: column; margin: -.25rem 0; }
.uv-issue { display: flex; gap: .6rem; text-align: left; width: 100%; padding: .55rem .25rem; border-bottom: 1px solid var(--gray-100); }
.dark .uv-issue { border-color: var(--gray-800); }
.uv-issues li:last-child .uv-issue { border-bottom: 0; }
.uv-issue:hover { background: var(--gray-50); }
.dark .uv-issue:hover { background: var(--gray-800); }
.uv-issue b { font-size: .8125rem; font-weight: 600; }
.uv-issue small { display: block; font-size: .75rem; color: var(--gray-500); }
.uv-issue-ico { width: 1.2rem; height: 1.2rem; border-radius: 999px; display: grid; place-items: center; font-size: .65rem; font-weight: 700; color: #fff; flex: none; margin-top: .1rem; }

/* Lomakkeen tarkistukset */
.uv-checks { display: flex; flex-direction: column; gap: .5rem; border: 1px solid var(--gray-200); border-radius: .75rem; padding: .75rem .9rem; background: var(--gray-50); font-size: .8125rem; }
.dark .uv-checks { background: var(--gray-800); border-color: var(--gray-700); }
.uv-checks-head { display: flex; justify-content: space-between; }
.uv-check-row { display: flex; gap: .5rem; align-items: flex-start; }

/* Julkaisuloki */
.uv-history { display: flex; flex-direction: column; gap: .75rem; }
.uv-history-row { display: flex; flex-direction: column; gap: .2rem; padding-bottom: .75rem; border-bottom: 1px solid var(--gray-200); }
.dark .uv-history-row { border-color: var(--gray-700); }
.uv-history-row small { display: block; }
.uv-history-reason p { margin-top: .25rem; font-size: .8125rem; }

/* Palkka-aineisto */
.uv-pay-table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.uv-pay-table th { text-align: right; font-weight: 600; font-size: .72rem; color: var(--gray-500); padding: .55rem .7rem; background: var(--gray-50); white-space: nowrap; border-bottom: 1px solid var(--gray-200); }
.uv-pay-table th:first-child, .uv-pay-table td:first-child { text-align: left; }
.uv-pay-table td { text-align: right; padding: .55rem .7rem; border-bottom: 1px solid var(--gray-100); font-variant-numeric: tabular-nums; white-space: nowrap; }
.uv-pay-table tfoot td { font-weight: 700; background: var(--gray-50); border-top: 1px solid var(--gray-300); }
.dark .uv-pay-table th, .dark .uv-pay-table tfoot td { background: var(--gray-800); border-color: var(--gray-700); }
.dark .uv-pay-table td { border-color: var(--gray-800); }
.uv-pay-table .uv-dim { color: var(--gray-400); }
.uv-csv { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .75rem; white-space: pre; overflow: auto; max-height: 16rem; padding: .75rem; border-radius: .5rem; background: var(--gray-50); border: 1px solid var(--gray-200); }
.dark .uv-csv { background: var(--gray-800); border-color: var(--gray-700); }

@media (prefers-reduced-motion: reduce) { .uv-board-wrap, .uv-cell { transition: none; } }

/* Mobiilisovelluksen jakelu */
.uv-app-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .uv-app-grid { grid-template-columns: 1fr; } }
.uv-app-link { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.uv-app-link code { font-size: .85rem; padding: .35rem .6rem; border-radius: .4rem; background: var(--gray-50); border: 1px solid var(--gray-200); word-break: break-all; }
.dark .uv-app-link code { background: var(--gray-800); border-color: var(--gray-700); }
.uv-app-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.uv-app-meta dt { font-size: .75rem; color: var(--gray-500); }
.uv-app-meta dd { font-weight: 600; font-variant-numeric: tabular-nums; }
.uv-app-qr { background: #fff; border-radius: .75rem; padding: .75rem; max-width: 15rem; margin: 0 auto; }
.uv-app-qr svg { width: 100%; height: auto; display: block; }
.uv-app-qr svg path, .uv-app-qr svg rect { fill: #111827; }

/* ------------------------------------------------------------------
 * Kirjautuminen: kaksi palstaa (tuote-esittely + lomake)
 * ------------------------------------------------------------------ */
.uv-auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: #fff; }
.dark .uv-auth { background: var(--gray-950); }

.uv-auth-brand {
    --ink: #e7f6f3; --ink-muted: #9cc9c2; --line: rgb(255 255 255 / .08);
    position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 2rem;
    padding: 2.5rem clamp(2rem, 5vw, 4.5rem); color: var(--ink);
    background-color: #0b3b38;
    /* hento viikkoruudukko taustalla */
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 100% 3.25rem, calc(100% / 7) 100%;
}
.uv-auth-brand::after { content: ""; position: absolute; inset: auto -20% -35% auto; width: 32rem; height: 32rem; border-radius: 999px; background: radial-gradient(closest-side, rgb(45 212 191 / .22), transparent); pointer-events: none; }
.uv-auth-brand > * { position: relative; z-index: 1; }
.uv-auth-brand-top { display: flex; align-items: center; gap: .65rem; font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.uv-auth-mark { width: 2.1rem; height: 2.1rem; border-radius: .5rem; box-shadow: 0 0 0 1px rgb(255 255 255 / .15); }
.uv-auth-pitch { max-width: 34rem; margin-top: auto; }
.uv-auth-pitch h1 { font-size: clamp(1.9rem, 3vw, 2.6rem); line-height: 1.12; font-weight: 700; letter-spacing: -.02em; text-wrap: balance; color: #fff; }
.uv-auth-pitch p { margin-top: .9rem; font-size: 1.02rem; line-height: 1.6; color: var(--ink-muted); max-width: 32rem; }

.uv-auth-preview { max-width: 30rem; border-radius: 1rem; padding: 1rem; background: rgb(255 255 255 / .96); color: #111827; box-shadow: 0 24px 60px -20px rgb(0 0 0 / .55); }
.uv-auth-preview-head { display: flex; justify-content: space-between; align-items: center; font-size: .78rem; font-weight: 600; color: #374151; margin-bottom: .6rem; }
.uv-auth-pill { font-size: .68rem; font-weight: 600; padding: .1rem .45rem; border-radius: .35rem; background: #fef3c7; color: #92400e; }
.uv-auth-preview-grid { display: grid; grid-template-columns: 4.6rem repeat(4, 1fr); gap: .35rem; align-items: center; }
.uv-auth-who { display: flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 600; }
.uv-auth-who i { width: 1.25rem; height: 1.25rem; border-radius: 999px; display: grid; place-items: center; font-size: .5rem; font-style: normal; color: #fff; }
.uv-auth-chip { position: relative; font-size: .7rem; font-weight: 600; font-variant-numeric: tabular-nums; padding: .3rem .4rem; border-radius: .35rem; background: #e0f2fe; border: 1px solid #0284c7; border-left-width: 3px; }
.uv-auth-chip-alt { background: #ffedd5; border-color: #ea580c; }
.uv-auth-chip-draft { border-style: dashed; border-left-style: solid; }
.uv-auth-chip-flag b { position: absolute; top: -.35rem; right: -.3rem; width: .95rem; height: .95rem; border-radius: 999px; background: #dc2626; color: #fff; font-size: .55rem; display: grid; place-items: center; }
.uv-auth-off { font-size: .66rem; font-weight: 600; text-align: center; padding: .3rem 0; border-radius: .35rem; color: #4b5563; background: repeating-linear-gradient(135deg, #f3f4f6 0 5px, #e5e7eb 5px 10px); }
.uv-auth-empty { min-height: 1.5rem; }
.uv-auth-preview-issue { display: flex; gap: .5rem; align-items: center; margin-top: .75rem; padding-top: .65rem; border-top: 1px solid #e5e7eb; font-size: .72rem; color: #374151; }
.uv-auth-preview-issue b { width: 1.05rem; height: 1.05rem; flex: none; border-radius: 999px; background: #dc2626; color: #fff; display: grid; place-items: center; font-size: .6rem; }
.uv-auth-preview-issue em { color: #6b7280; font-style: normal; }

.uv-auth-points { display: grid; gap: .55rem; max-width: 32rem; font-size: .9rem; color: var(--ink-muted); }
.uv-auth-points li { padding-left: 1.4rem; position: relative; }
.uv-auth-points li::before { content: ""; position: absolute; left: 0; top: .45rem; width: .55rem; height: .55rem; border-radius: 2px; background: #2dd4bf; }
.uv-auth-points strong { color: var(--ink); font-weight: 600; }
.uv-auth-brand-foot { margin-top: auto; display: flex; justify-content: space-between; gap: 1rem; font-size: .8rem; color: var(--ink-muted); }
.uv-auth-brand-foot a { color: #5eead4; font-weight: 600; }
.uv-auth-brand-foot a:hover { text-decoration: underline; }

.uv-auth-form { display: flex; flex-direction: column; justify-content: center; padding: 2.5rem clamp(1.25rem, 5vw, 4rem); outline: none; }
.uv-auth-form-inner { width: 100%; max-width: 24rem; margin: 0 auto; }
/* Filamentin yksinkertaisen sivun kortti ilman kehyksiä: lomake istuu suoraan palstaan */
.uv-auth .fi-simple-page { background: transparent; box-shadow: none; padding: 0; border: 0; }
.uv-auth .fi-simple-page-content { gap: 1.5rem; }
.uv-auth .fi-simple-header { align-items: flex-start; text-align: left; }
.uv-auth .fi-simple-header-heading { font-size: 1.6rem; letter-spacing: -.01em; }
.uv-auth .fi-simple-header .fi-logo { display: none; }

@media (max-width: 1023px) {
    .uv-auth { grid-template-columns: 1fr; }
    .uv-auth-brand { gap: 1rem; padding: 1.5rem 1.25rem; background-size: 100% 2.5rem, calc(100% / 7) 100%; }
    .uv-auth-pitch { margin-top: .5rem; }
    .uv-auth-pitch h1 { font-size: 1.5rem; }
    .uv-auth-pitch p, .uv-auth-preview, .uv-auth-points, .uv-auth-brand-foot { display: none; }
    .uv-auth-form { justify-content: flex-start; padding-top: 2rem; }
}
@media (prefers-reduced-motion: reduce) { .uv-auth * { transition: none !important; } }

/* Käyttäjät: avoimet kutsut */
.uv-invites { list-style: none; margin: 0; padding: 0; }
.uv-invites li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 0; border-top: 1px solid rgb(0 0 0 / .06); flex-wrap: wrap; }
.dark .uv-invites li { border-color: rgb(255 255 255 / .08); }
.uv-invites li:first-child { border-top: 0; }
.uv-invites-actions { display: flex; gap: 1rem; }

/* Muutosloki */
.uv-changes { width: 100%; border-collapse: collapse; font-size: .875rem; }
.uv-changes th, .uv-changes td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid rgb(0 0 0 / .06); vertical-align: top; }
.dark .uv-changes th, .dark .uv-changes td { border-color: rgb(255 255 255 / .08); }
.uv-changes th { font-weight: 600; color: var(--gray-500); }
.uv-shift-log { font-size: .8125rem; border-top: 1px solid rgb(0 0 0 / .06); padding-top: .5rem; }
.uv-shift-log summary { cursor: pointer; font-weight: 600; color: var(--gray-600); }
.dark .uv-shift-log summary { color: var(--gray-300); }
.uv-shift-log ol { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .4rem; }
.uv-rotation h4 { font-weight: 600; margin: 1rem 0 .3rem; }
.uv-rotation h4:first-child { margin-top: 0; }
.uv-ai-list { margin: 0 0 .75rem; padding-left: 1.1rem; display: grid; gap: .4rem; font-size: .875rem; list-style: disc; }
.uv-ai-fix { display: grid; gap: .75rem; font-size: .9rem; }
.uv-ai-fix p { margin: 0; }
.uv-ai-fix-box { border: 1px solid rgb(0 0 0 / .08); border-radius: .75rem; padding: .75rem .9rem; display: grid; gap: .35rem; }
.dark .uv-ai-fix-box { border-color: rgb(255 255 255 / .1); }
.uv-ai-warn { color: var(--warning-600); }
.uv-ai-ok { color: var(--success-600); }

/* Tekoälyavustaja */
.uv-chat { max-width: 52rem; display: grid; gap: .75rem; }
.uv-chat-empty { color: var(--gray-600); }
.dark .uv-chat-empty { color: var(--gray-300); }
.uv-chat-examples { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.uv-chat-examples button { border: 1px solid rgb(0 0 0 / .1); border-radius: 999px; padding: .4rem .8rem; font-size: .85rem; background: transparent; cursor: pointer; text-align: left; }
.dark .uv-chat-examples button { border-color: rgb(255 255 255 / .15); }
.uv-chat-examples button:hover { background: var(--primary-50); }
.dark .uv-chat-examples button:hover { background: rgb(255 255 255 / .05); }
.uv-msg { padding: .7rem .95rem; border-radius: 1rem; font-size: .9rem; line-height: 1.55; max-width: 85%; }
.uv-msg p { margin: 0 0 .5rem; } .uv-msg p:last-child { margin: 0; }
.uv-msg ul, .uv-msg ol { margin: .25rem 0 .5rem 1.2rem; list-style: disc; }
.uv-msg-user { justify-self: end; background: var(--primary-600); color: #fff; border-bottom-right-radius: .3rem; }
.uv-msg-ai { justify-self: start; background: #fff; border: 1px solid rgb(0 0 0 / .07); border-bottom-left-radius: .3rem; }
.dark .uv-msg-ai { background: rgb(255 255 255 / .05); border-color: rgb(255 255 255 / .1); }
.uv-typing { color: var(--gray-500); font-style: italic; }
.uv-chat-error { color: var(--danger-600); font-size: .875rem; }
.uv-chat-form { display: flex; gap: .5rem; align-items: flex-end; }
.uv-chat-form textarea { flex: 1; border-radius: .75rem; border: 1px solid rgb(0 0 0 / .12); padding: .6rem .8rem; font: inherit; resize: vertical; background: #fff; }
.dark .uv-chat-form textarea { background: rgb(255 255 255 / .05); border-color: rgb(255 255 255 / .15); color: inherit; }
.uv-chat-foot { display: flex; justify-content: space-between; gap: 1rem; font-size: .75rem; }
/* Avustajan esikatselukortit */
.uv-action-card { border: 1px solid rgb(0 0 0 / .1); border-left: 3px solid var(--warning-500); border-radius: .75rem; padding: .75rem .95rem; background: #fff; font-size: .875rem; display: grid; gap: .5rem; }
.dark .uv-action-card { background: rgb(255 255 255 / .04); border-color: rgb(255 255 255 / .12); }
.uv-action-card.is-done { border-left-color: var(--success-500); }
.uv-action-card.is-dismissed { border-left-color: var(--gray-400); opacity: .65; }
.uv-action-card.is-failed { border-left-color: var(--danger-500); }
.uv-action-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.uv-action-head b { flex: 1; min-width: 0; }
.uv-action-rows { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .9rem; margin: 0; }
.uv-action-rows dt { color: var(--gray-500); }
.uv-action-rows dd { margin: 0; overflow-wrap: anywhere; }
.uv-action-check { display: inline-flex; gap: .45rem; align-items: center; cursor: pointer; }
.uv-action-buttons { display: flex; gap: .5rem; flex-wrap: wrap; }
.uv-action-secret { white-space: pre-wrap; font-size: .8125rem; padding: .6rem .75rem; border-radius: .5rem; background: var(--gray-100); margin: 0; }
.dark .uv-action-secret { background: rgb(255 255 255 / .06); }


/* Sivukohtaiset ohjeet (?-painike otsikkorivillä, App\Filament\PageHelp) */
.uv-help-trigger { display: flex; align-items: center; }
.uv-help { font-size: .875rem; line-height: 1.6; color: var(--gray-700); }
.dark .uv-help { color: var(--gray-300); }
.uv-help > * + * { margin-top: .75rem; }
.uv-help h3 { font-weight: 600; font-size: .9375rem; color: var(--gray-950); margin-top: 1.5rem; }
.dark .uv-help h3 { color: #fff; }
.uv-help ul { list-style: disc; padding-left: 1.25rem; }
.uv-help ol { list-style: decimal; padding-left: 1.25rem; }
.uv-help li + li { margin-top: .375rem; }
.uv-help b { font-weight: 600; color: var(--gray-950); }
.dark .uv-help b { color: #fff; }
.uv-help-steps li::marker { font-weight: 600; color: var(--primary-600); }
.uv-help-tip { padding: .75rem 1rem; border-radius: .5rem; border-left: 3px solid var(--primary-500); background: var(--primary-50); }
.dark .uv-help-tip { background: color-mix(in oklab, var(--primary-500) 12%, var(--gray-900)); }
.uv-help-table { width: 100%; border-collapse: collapse; }
.uv-help-table th { text-align: left; font-weight: 600; color: var(--gray-950); padding: .5rem .75rem .5rem 0; border-bottom: 1px solid var(--gray-200); }
.uv-help-table td { padding: .5rem .75rem .5rem 0; vertical-align: top; border-bottom: 1px solid var(--gray-100); }
.uv-help-table td:first-child { width: 35%; }
.dark .uv-help-table th { color: #fff; border-color: var(--gray-700); }
.dark .uv-help-table td { border-color: var(--gray-800); }

/* Avustajan chat-kupla (Messenger-tyyli) */
.uv-messenger { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 40; }
.uv-messenger-bubble { width: 3.5rem; height: 3.5rem; border-radius: 999px; display: grid; place-items: center; background: var(--primary-600); color: #fff;
    box-shadow: 0 8px 24px rgb(0 0 0 / .25); position: relative; transition: transform .15s ease, background .15s ease; }
.uv-messenger-bubble:hover { transform: scale(1.06); background: var(--primary-500); }
.uv-messenger-bubble:focus-visible { outline: 3px solid var(--primary-300); outline-offset: 3px; }
.uv-messenger-bubble-icon { width: 1.75rem; height: 1.75rem; }
.uv-messenger-dot { position: absolute; top: .15rem; right: .15rem; width: .85rem; height: .85rem; border-radius: 999px; background: var(--danger-500); border: 2px solid #fff; }
.uv-messenger-window { width: 24rem; height: min(40rem, calc(100vh - 2.5rem)); display: flex; flex-direction: column; border-radius: 1rem; overflow: hidden;
    background: #fff; box-shadow: 0 16px 48px rgb(0 0 0 / .28); border: 1px solid rgb(0 0 0 / .08); }
.dark .uv-messenger-window { background: var(--gray-900); border-color: rgb(255 255 255 / .1); }
.uv-messenger-head { display: flex; align-items: center; gap: .6rem; padding: .7rem .75rem .7rem .9rem; border-bottom: 1px solid rgb(0 0 0 / .07); }
.dark .uv-messenger-head { border-color: rgb(255 255 255 / .08); }
.uv-messenger-avatar { width: 2.25rem; height: 2.25rem; border-radius: 999px; display: grid; place-items: center; flex: none; color: #fff;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700)); }
.uv-messenger-title { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.uv-messenger-title b { font-size: .9375rem; color: var(--gray-950); }
.dark .uv-messenger-title b { color: #fff; }
.uv-messenger-title span { font-size: .75rem; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uv-messenger-body { flex: 1; overflow-y: auto; padding: .9rem; display: flex; flex-direction: column; gap: .5rem; overscroll-behavior: contain; font-size: .875rem; }
.uv-messenger-empty { color: var(--gray-600); line-height: 1.5; display: grid; gap: .6rem; }
.dark .uv-messenger-empty { color: var(--gray-300); }
.uv-messenger-chips { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; }
.uv-messenger-chips button { text-align: left; font-size: .8125rem; padding: .45rem .75rem; border-radius: 1rem; border: 1px solid var(--primary-200); color: var(--primary-700); background: var(--primary-50); }
.uv-messenger-chips button:hover { border-color: var(--primary-400); }
.dark .uv-messenger-chips button { background: rgb(255 255 255 / .04); border-color: rgb(255 255 255 / .14); color: var(--primary-300); }
.uv-bubble { max-width: 85%; padding: .55rem .85rem; border-radius: 1.1rem; line-height: 1.5; overflow-wrap: anywhere; }
.uv-bubble p { margin: 0 0 .4rem; } .uv-bubble p:last-child { margin: 0; }
.uv-bubble ul, .uv-bubble ol { margin: .2rem 0 .4rem 1.1rem; list-style: disc; }
.uv-bubble-me { align-self: flex-end; background: var(--primary-600); color: #fff; border-bottom-right-radius: .3rem; }
.uv-bubble-ai { align-self: flex-start; background: var(--gray-100); color: var(--gray-900); border-bottom-left-radius: .3rem; }
.dark .uv-bubble-ai { background: rgb(255 255 255 / .08); color: var(--gray-100); }
.uv-messenger-note { align-self: center; font-size: .75rem; color: var(--gray-500); text-align: center; margin: .1rem 0; }
.uv-messenger-body .uv-action-card { align-self: stretch; }
.uv-messenger-all { align-self: flex-start; }
.uv-messenger-typing { display: flex; gap: .25rem; align-items: center; padding: .7rem .85rem; }
.uv-action-card .fi-link { justify-self: start; }
.uv-messenger-typing span { width: .4rem; height: .4rem; border-radius: 999px; background: var(--gray-400); animation: uv-typing 1s infinite ease-in-out; }
.uv-messenger-typing span:nth-child(2) { animation-delay: .15s; } .uv-messenger-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes uv-typing { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .uv-messenger-typing span { animation: none; } .uv-messenger-bubble { transition: none; } }
.uv-messenger-form { display: flex; align-items: flex-end; gap: .4rem; padding: .6rem .6rem .3rem .9rem; border-top: 1px solid rgb(0 0 0 / .07); }
.dark .uv-messenger-form { border-color: rgb(255 255 255 / .08); }
.uv-messenger-form textarea { flex: 1; resize: none; border: 0; border-radius: 1.1rem; padding: .55rem .85rem; font: inherit; font-size: .875rem; line-height: 1.4;
    background: var(--gray-100); color: inherit; max-height: 140px; }
.uv-messenger-form textarea:focus { outline: 2px solid var(--primary-500); outline-offset: 0; }
.dark .uv-messenger-form textarea { background: rgb(255 255 255 / .08); }
.uv-messenger-foot { font-size: .6875rem; color: var(--gray-500); padding: 0 .9rem .55rem; margin: 0; }
@media (max-width: 640px) {
    .uv-messenger { right: 1rem; bottom: 1rem; }
    .uv-messenger-window { position: fixed; inset: 0; width: auto; height: 100dvh; border-radius: 0; border: 0; }
}
@media print { .uv-messenger { display: none !important; } }

/* Tekoälysuunnittelun edistyminen: pieni keskitetty tilailmoitus (tyhjätilan tyyliin) */
.uv-ai-overlay { position: fixed; inset: 0; z-index: 35; display: grid; place-items: center; padding: 1rem;
    background: rgb(255 255 255 / .45); animation: uv-ai-fade .15s ease-out; }
.dark .uv-ai-overlay { background: rgb(0 0 0 / .35); }
.uv-ai-box { width: 19rem; max-width: 100%; padding: 1.5rem 1.5rem 1rem; border-radius: .75rem; background: #fff;
    box-shadow: 0 0 0 1px rgb(3 7 18 / .05), 0 10px 30px -8px rgb(3 7 18 / .15);
    display: flex; flex-direction: column; align-items: center; text-align: center; animation: uv-ai-pop .2s ease-out; }
.dark .uv-ai-box { background: var(--gray-900); box-shadow: 0 0 0 1px rgb(255 255 255 / .1), 0 10px 30px -8px rgb(0 0 0 / .5); }
.uv-ai-icon { position: relative; width: 2.5rem; height: 2.5rem; margin-bottom: .9rem; border-radius: 999px; display: grid; place-items: center;
    background: var(--gray-100); color: var(--gray-500); }
.dark .uv-ai-icon { background: var(--gray-800); color: var(--gray-400); }
.uv-ai-icon svg { width: 1.25rem; height: 1.25rem; }
.uv-ai-icon::after { content: ''; position: absolute; inset: -3px; border-radius: 999px; border: 2px solid transparent;
    border-top-color: var(--primary-500); animation: uv-ai-spin .9s linear infinite; }
.uv-ai-title { margin: 0; font-size: .875rem; font-weight: 600; color: var(--gray-950); }
.dark .uv-ai-title { color: #fff; }
.uv-ai-desc { margin: .25rem 0 0; font-size: .8125rem; line-height: 1.45; color: var(--gray-500); }
.dark .uv-ai-desc { color: var(--gray-400); }
.uv-ai-elapsed { font-variant-numeric: tabular-nums; }
.uv-ai-cancel { margin-top: .75rem; font-size: .8125rem; font-weight: 500; color: var(--gray-500); padding: .2rem .55rem; border-radius: .375rem; }
.uv-ai-cancel:hover { background: var(--gray-100); color: var(--gray-900); }
.dark .uv-ai-cancel:hover { background: rgb(255 255 255 / .06); color: #fff; }
@keyframes uv-ai-spin { to { transform: rotate(360deg); } }
@keyframes uv-ai-pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@keyframes uv-ai-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .uv-ai-overlay, .uv-ai-box { animation: none; }
    .uv-ai-icon::after { animation-duration: 2.5s; }
}

/* Tekoälyn ehdotus vuorokarttana */
.uv-rv { display: grid; gap: .85rem; }
.uv-rv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; font-size: .8125rem; color: var(--gray-500); }
.uv-rv-count b { color: var(--gray-950); font-weight: 600; }
.dark .uv-rv-count b { color: #fff; }
.uv-rv-legend { display: flex; flex-wrap: wrap; gap: .85rem; }
.uv-rv-legend > span { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; }
.uv-rv-tools { margin-left: auto; display: flex; gap: .25rem; }
.uv-rv-tools button { font-weight: 500; color: var(--primary-600); padding: .2rem .5rem; border-radius: .375rem; }
.uv-rv-tools button:hover { background: var(--gray-100); }
.dark .uv-rv-tools button { color: var(--primary-400); }
.dark .uv-rv-tools button:hover { background: rgb(255 255 255 / .06); }

.uv-rv-scroll { overflow: auto; max-height: min(60vh, 34rem); border-radius: .75rem; box-shadow: 0 0 0 1px rgb(3 7 18 / .08); }
.dark .uv-rv-scroll { box-shadow: 0 0 0 1px rgb(255 255 255 / .1); }
.uv-rv-grid { display: grid; grid-template-columns: 10rem repeat(var(--uv-days), minmax(2.6rem, 1fr)) 6.5rem; width: 100%; min-width: calc(16.5rem + var(--uv-days) * 2.6rem); font-size: .75rem; }
.uv-rv-grid > * { border-bottom: 1px solid rgb(3 7 18 / .06); }
.dark .uv-rv-grid > * { border-color: rgb(255 255 255 / .06); }
.uv-rv-head { position: sticky; top: 0; z-index: 2; background: var(--gray-50); display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
    padding: .3rem .15rem .4rem; line-height: 1.15; color: var(--gray-500); }
.dark .uv-rv-head { background: var(--gray-800); color: var(--gray-400); }
.uv-rv-head b { font-weight: 600; color: var(--gray-700); }
.dark .uv-rv-head b { color: var(--gray-200); }
.uv-rv-head span { font-size: .6875rem; }
.uv-rv-head .uv-rv-wk { min-height: .85rem; font-size: .625rem; font-weight: 600; color: var(--primary-600); text-transform: uppercase; letter-spacing: .03em; }
.uv-rv-head.uv-rv-name, .uv-rv-head.uv-rv-sum { align-items: flex-start; font-weight: 500; padding-left: .75rem; }
.uv-rv-head.uv-rv-name { left: 0; z-index: 3; }
.uv-rv-name { position: sticky; left: 0; z-index: 1; background: #fff; display: flex; align-items: center; gap: .5rem; padding: .4rem .75rem; min-width: 0;
    box-shadow: 1px 0 0 rgb(3 7 18 / .06); }
.dark .uv-rv-name { background: var(--gray-900); box-shadow: 1px 0 0 rgb(255 255 255 / .08); }
.uv-rv-avatar { --c: var(--gray-400); flex: none; width: 1.6rem; height: 1.6rem; border-radius: 999px; display: grid; place-items: center; font-size: .625rem; font-weight: 600;
    color: var(--c); background: color-mix(in oklab, var(--c) 14%, transparent); }
.uv-rv-who { font-size: .8125rem; font-weight: 500; color: var(--gray-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dark .uv-rv-who { color: var(--gray-100); }
.uv-rv-cell { display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: .3rem; padding: .4rem .2rem; min-height: 2.6rem; min-width: 0; }
.uv-rv-head.is-weekend, .uv-rv-cell.is-weekend { background-color: color-mix(in oklab, var(--gray-100) 55%, transparent); }
.dark .uv-rv-head.is-weekend, .dark .uv-rv-cell.is-weekend { background-color: rgb(255 255 255 / .025); }
.uv-rv-head.is-wk, .uv-rv-cell.is-wk { box-shadow: inset 1px 0 0 rgb(3 7 18 / .12); }
.dark .uv-rv-head.is-wk, .dark .uv-rv-cell.is-wk { box-shadow: inset 1px 0 0 rgb(255 255 255 / .12); }
.uv-rv-sum { display: flex; flex-direction: column; justify-content: center; gap: .3rem; padding: .3rem .75rem; box-shadow: inset 1px 0 0 rgb(3 7 18 / .06); }
.uv-rv-hours { white-space: nowrap; color: var(--gray-500); font-variant-numeric: tabular-nums; }
.uv-rv-hours b { font-weight: 600; color: var(--gray-900); }
.dark .uv-rv-hours b { color: #fff; }
.uv-rv-hours.is-over b { color: var(--warning-600); }
.uv-rv-hours.is-over + .uv-rv-meter i { background: var(--warning-500); }
.uv-rv-meter { height: .25rem; border-radius: 999px; background: var(--gray-100); overflow: hidden; }
.dark .uv-rv-meter { background: rgb(255 255 255 / .08); }
.uv-rv-meter i { display: block; height: 100%; border-radius: inherit; background: var(--primary-500); transition: width .2s; }
.uv-rv-muted { color: var(--gray-400); }

.uv-rv-chip { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .15rem; padding: .2rem .25rem; border-radius: .375rem;
    font-size: .6875rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer;
    color: var(--primary-800); background: var(--primary-100); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--primary-600) 25%, transparent);
    transition: opacity .15s, background .15s, color .15s; }
.uv-rv-chip:hover { box-shadow: inset 0 0 0 1.5px var(--primary-600); }
.dark .uv-rv-chip { color: var(--primary-100); background: color-mix(in oklab, var(--primary-500) 28%, transparent); }
.uv-rv-chip.is-night { color: #fff; background: #3b3f73; box-shadow: none; }
.dark .uv-rv-chip.is-night { background: #4c5196; }
.uv-rv-chip.is-standby { background: repeating-linear-gradient(135deg, var(--primary-100) 0 4px, transparent 4px 7px); }
.uv-rv-chip.is-warn { box-shadow: inset 0 0 0 2px var(--warning-500); }
.uv-rv-chip.is-error { box-shadow: inset 0 0 0 2px var(--danger-500); }
.uv-rv-chip.is-off { color: var(--gray-400); background: transparent; box-shadow: inset 0 0 0 1px var(--gray-300); text-decoration: line-through; }
.dark .uv-rv-chip.is-off { color: var(--gray-500); box-shadow: inset 0 0 0 1px var(--gray-600); }
.uv-rv-chip.is-sample { width: 1.1rem; height: .75rem; padding: 0; cursor: default; }
.uv-rv-chip.is-sample.is-warn { background: var(--primary-100); }
.uv-rv-flag { flex: none; display: inline-grid; place-items: center; width: .85rem; height: .85rem; border-radius: 999px; font-size: .5625rem; font-weight: 700; line-height: 1;
    color: #fff; background: var(--warning-500); }
.uv-rv-chip .uv-rv-flag { position: absolute; top: -.35rem; right: -.3rem; width: .8rem; height: .8rem; box-shadow: 0 0 0 1.5px #fff; }
.dark .uv-rv-chip .uv-rv-flag { box-shadow: 0 0 0 1.5px var(--gray-900); }
.uv-rv-chip.is-error .uv-rv-flag, .uv-rv-issues li.is-error .uv-rv-flag { background: var(--danger-500); }

.uv-rv-issues { border-radius: .75rem; padding: .7rem .9rem; background: color-mix(in oklab, var(--warning-500) 8%, transparent); }
.uv-rv-issues-title { margin: 0 0 .4rem; font-size: .8125rem; font-weight: 600; color: var(--gray-900); }
.dark .uv-rv-issues-title { color: #fff; }
.uv-rv-issues ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .3rem; font-size: .8125rem; color: var(--gray-700); }
.dark .uv-rv-issues ul { color: var(--gray-300); }
.uv-rv-issues li { display: flex; align-items: baseline; gap: .45rem; }
.uv-rv-issues li .uv-rv-flag { transform: translateY(.1rem); }
.uv-rv-note { margin: 0; font-size: .75rem; color: var(--gray-500); }

/* Vuorotaulukon pikavalikko (hiiren oikea painike) */
.uv-ctx { position: fixed; z-index: 40; min-width: 15rem; max-width: 21rem; padding: .3rem; border-radius: .6rem; background: #fff; font-size: .8125rem;
    box-shadow: 0 0 0 1px rgb(3 7 18 / .07), 0 12px 32px -8px rgb(3 7 18 / .22); }
.dark .uv-ctx { background: var(--gray-900); box-shadow: 0 0 0 1px rgb(255 255 255 / .1), 0 12px 32px -8px rgb(0 0 0 / .6); }
.uv-ctx-group { display: grid; }
.uv-ctx-title { margin: 0; padding: .35rem .6rem .3rem; font-size: .75rem; font-weight: 600; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uv-ctx button[role=menuitem] { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .42rem .6rem; border-radius: .4rem; text-align: left; color: var(--gray-800); }
.dark .uv-ctx button[role=menuitem] { color: var(--gray-200); }
.uv-ctx button[role=menuitem] b { font-weight: 600; }
.uv-ctx button[role=menuitem] svg { width: 1rem; height: 1rem; flex: none; color: var(--gray-400); }
.uv-ctx button[role=menuitem]:hover:not(:disabled), .uv-ctx button[role=menuitem]:focus-visible { background: var(--gray-100); outline: none; }
.dark .uv-ctx button[role=menuitem]:hover:not(:disabled), .dark .uv-ctx button[role=menuitem]:focus-visible { background: rgb(255 255 255 / .06); }
.uv-ctx button[role=menuitem]:disabled { opacity: .45; cursor: default; }
.uv-ctx-foot { margin-top: .25rem; padding: .45rem .6rem .3rem; border-top: 1px solid rgb(3 7 18 / .06); font-size: .75rem; color: var(--gray-500); }
.dark .uv-ctx-foot { border-color: rgb(255 255 255 / .08); }
.uv-ctx-foot b { color: var(--gray-700); font-weight: 600; }
.dark .uv-ctx-foot b { color: var(--gray-200); }
.uv-ctx-foot button { margin-left: .25rem; color: var(--primary-600); font-weight: 500; }
.uv-ctx-foot button:hover { text-decoration: underline; }

/* Huutomerkin ponnahdusikkuna (vuoron huomiot) */
.uv-flag[data-issues] { cursor: help; }
.uv-tip { position: fixed; z-index: 45; width: 20rem; max-width: calc(100vw - 1rem); padding: .7rem .8rem .6rem; border-radius: .7rem; background: #fff; pointer-events: none;
    box-shadow: 0 0 0 1px rgb(3 7 18 / .07), 0 14px 34px -10px rgb(3 7 18 / .28); font-size: .8125rem; animation: uv-ai-fade .12s ease-out; }
.dark .uv-tip { background: var(--gray-900); box-shadow: 0 0 0 1px rgb(255 255 255 / .1), 0 14px 34px -10px rgb(0 0 0 / .6); }
.uv-tip-head { margin: 0 0 .5rem; font-size: .75rem; font-weight: 600; color: var(--gray-500); }
.uv-tip ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .55rem; }
.uv-tip li { display: flex; gap: .55rem; align-items: flex-start; }
.uv-tip li b { display: block; font-weight: 600; color: var(--gray-950); line-height: 1.3; }
.dark .uv-tip li b { color: #fff; }
.uv-tip li small { display: block; margin-top: .1rem; font-size: .75rem; line-height: 1.4; color: var(--gray-600); }
.dark .uv-tip li small { color: var(--gray-300); }
.uv-tip-foot { margin: .6rem 0 0; padding-top: .45rem; border-top: 1px solid rgb(3 7 18 / .06); font-size: .6875rem; color: var(--gray-400); }
.dark .uv-tip-foot { border-color: rgb(255 255 255 / .08); }

/* Työntekijän kalenterisyöte */
.uv-cal { display: grid; gap: .9rem; font-size: .875rem; color: var(--gray-700); }
.dark .uv-cal { color: var(--gray-300); }
.uv-cal p { margin: 0; }
.uv-cal-top { display: flex; gap: 1rem; align-items: flex-start; }
.uv-cal-qr { flex: none; width: 8.5rem; height: 8.5rem; padding: .35rem; border-radius: .6rem; background: #fff; box-shadow: 0 0 0 1px rgb(3 7 18 / .1); }
.uv-cal-qr svg { width: 100%; height: 100%; display: block; }
.uv-cal-text { display: grid; gap: .5rem; }
.uv-cal-muted { font-size: .8125rem; color: var(--gray-500); }
.uv-cal-label { font-size: .8125rem; font-weight: 500; color: var(--gray-950); }
.dark .uv-cal-label { color: #fff; }
.uv-cal-url { display: flex; border-radius: .5rem; box-shadow: 0 0 0 1px rgb(3 7 18 / .12); overflow: hidden; margin-top: -.5rem; }
.dark .uv-cal-url { box-shadow: 0 0 0 1px rgb(255 255 255 / .15); }
.uv-cal-url input { flex: 1; min-width: 0; border: 0; padding: .5rem .7rem; font-size: .8125rem; font-family: ui-monospace, monospace; background: var(--gray-50); color: var(--gray-700); }
.dark .uv-cal-url input { background: rgb(255 255 255 / .04); color: var(--gray-200); }
.uv-cal-url button { flex: none; padding: 0 .9rem; font-size: .8125rem; font-weight: 600; color: var(--primary-600); border-left: 1px solid rgb(3 7 18 / .1); }
.uv-cal-url button:hover { background: var(--gray-50); }
.uv-cal-how { margin: 0; padding-left: 1.1rem; list-style: disc; display: grid; gap: .3rem; }
.uv-cal a { color: var(--primary-600); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 30rem) { .uv-cal-top { flex-direction: column; align-items: center; } }
