/* Shared workspace motion — clocks, checks, short rises. Not walls of text. */

:root {
    --qre-motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --qre-clock-green: #16a34a;
    --qre-clock-face: color-mix(in srgb, var(--color-surface, #fff) 88%, #e2e8f0);
    --qre-clock-ink: var(--color-text, #0f172a);
}

@media (prefers-reduced-motion: reduce) {
    .qre-clock-hands,
    .qre-clock-check,
    .qre-clock-dial,
    .qre-clock-digital,
    .qre-clock-stat,
    .qre-shift-dock,
    .app-page .app-main,
    .app-page .module-panel,
    .qre-setup-step {
        animation: none !important;
        transition: none !important;
    }
}

@keyframes qre-rise {
    from { opacity: 0; transform: translateY(12px) scale(0.985); }
    to { opacity: 1; transform: none; }
}

@keyframes qre-pop {
    0% { transform: scale(0.72); opacity: 0; }
    70% { transform: scale(1.06); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes qre-pulse-soft {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--qre-clock-green) 0%, transparent); }
    50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--qre-clock-green) 18%, transparent); }
}

.app-page .app-main,
.app-page .module-panel {
    animation: qre-rise 0.48s var(--qre-motion-ease) both;
}

.app-page .btn-primary,
.app-page .btn-add-row,
.qre-shift-btn {
    transition: transform 0.16s var(--qre-motion-ease), box-shadow 0.18s ease, background 0.18s ease;
}
.app-page .btn-primary:hover,
.qre-shift-btn.primary:hover,
.qre-shift-btn.accent:hover {
    transform: translateY(-1px);
}

/* ── Clock face ── */
.qre-clock-stage {
    display: grid;
    justify-items: center;
    gap: 14px;
}
.qre-clock-face {
    position: relative;
    width: min(42vw, 168px);
    height: min(42vw, 168px);
    border-radius: 50%;
    background: var(--qre-clock-face);
    box-shadow:
        inset 0 0 0 8px color-mix(in srgb, var(--qre-clock-ink) 8%, transparent),
        0 18px 40px rgba(15, 23, 42, 0.16);
    overflow: hidden;
    transition: background 0.55s var(--qre-motion-ease), box-shadow 0.55s ease;
}
.qre-clock-stage.is-in .qre-clock-face {
    background: var(--qre-clock-green);
    box-shadow: 0 16px 36px color-mix(in srgb, var(--qre-clock-green) 42%, transparent);
    animation: qre-pulse-soft 1.8s ease 0.4s 1;
}
.qre-clock-stage.is-out .qre-clock-face {
    background: color-mix(in srgb, var(--qre-clock-green) 78%, #0f172a);
}
.qre-clock-svg {
    width: 100%;
    height: 100%;
    display: block;
}
.qre-clock-ticks line {
    stroke: var(--qre-clock-ink);
    stroke-width: 2.2;
    stroke-linecap: round;
    opacity: 0.42;
}
.qre-clock-hour,
.qre-clock-minute,
.qre-clock-second {
    transform-origin: 60px 60px;
    stroke-linecap: round;
}
.qre-clock-hour { stroke: var(--qre-clock-ink); stroke-width: 5.2; }
.qre-clock-minute { stroke: var(--qre-clock-ink); stroke-width: 3.4; }
.qre-clock-second { stroke: #ef4444; stroke-width: 1.7; }
.qre-clock-hub { fill: var(--qre-clock-ink); }
.qre-clock-hands {
    transform-origin: 60px 60px;
    transition: opacity 0.42s ease, transform 0.55s var(--qre-motion-ease);
}
.qre-clock-caption {
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.72rem;
    color: var(--color-text-muted, #64748b);
}
.qre-clock-stage.is-in .qre-clock-caption,
.qre-clock-stage.is-out .qre-clock-caption {
    color: var(--qre-clock-green);
}
.qre-clock-stage.is-in .qre-clock-hands,
.qre-clock-stage.is-out .qre-clock-hands,
.qre-clock-stage.is-in .qre-clock-ticks,
.qre-clock-stage.is-out .qre-clock-ticks {
    opacity: 0;
    transform: scale(0.12);
}
.qre-clock-check {
    fill: none;
    stroke: #fff;
    stroke-width: 9;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 90;
    stroke-dashoffset: 90;
    opacity: 0;
    transition: stroke-dashoffset 0.7s var(--qre-motion-ease) 0.12s, opacity 0.2s ease;
}
.qre-clock-stage.is-in .qre-clock-check,
.qre-clock-stage.is-out .qre-clock-check {
    stroke-dashoffset: 0;
    opacity: 1;
}
.qre-clock-digital {
    position: absolute;
    left: 50%;
    bottom: 18%;
    transform: translateX(-50%);
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    font-size: clamp(0.72rem, 2.4vw, 0.92rem);
    letter-spacing: 0.04em;
    color: var(--qre-clock-ink);
    transition: opacity 0.28s ease, color 0.4s ease;
    pointer-events: none;
}
.qre-clock-stage.is-in .qre-clock-digital,
.qre-clock-stage.is-out .qre-clock-digital {
    color: #fff;
    bottom: 14%;
}

.qre-clock-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: min(100%, 360px);
}
.qre-clock-stat {
    border-radius: 14px;
    border: 1px solid var(--color-border, rgba(15, 23, 42, 0.12));
    background: var(--color-surface, #fff);
    padding: 8px 6px;
    text-align: center;
    opacity: 0.45;
    transform: translateY(6px);
    transition: opacity 0.35s ease, transform 0.4s var(--qre-motion-ease);
}
.qre-clock-stage.is-in .qre-clock-stat,
.qre-clock-stage.is-out .qre-clock-stat {
    opacity: 1;
    transform: none;
}
.qre-clock-stage.is-in .qre-clock-stat:nth-child(1) { transition-delay: 0.12s; }
.qre-clock-stage.is-in .qre-clock-stat:nth-child(2) { transition-delay: 0.2s; }
.qre-clock-stage.is-in .qre-clock-stat:nth-child(3) { transition-delay: 0.28s; }
.qre-clock-stat .num {
    display: block;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    font-size: 0.95rem;
}
.qre-clock-stat .lbl {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted, #64748b);
    margin-top: 2px;
}

/* ── Workspace dock ── */
.qre-shift-dock {
    position: fixed;
    top: max(10px, env(safe-area-inset-top));
    right: 16px;
    z-index: 2400;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 6px 12px 6px 6px;
    border: 1px solid color-mix(in srgb, var(--color-border, #cbd5e1) 70%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-surface, #fff) 88%, transparent);
    backdrop-filter: blur(14px) saturate(140%);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
    color: inherit;
    cursor: pointer;
    font: inherit;
    animation: qre-rise 0.5s var(--qre-motion-ease) both;
}
.qre-shift-dock.is-in {
    border-color: color-mix(in srgb, var(--qre-clock-green) 45%, transparent);
    background: color-mix(in srgb, var(--qre-clock-green) 12%, var(--color-surface, #fff));
}
.qre-shift-dock-mini {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
}
.qre-shift-dock-mini .qre-clock-face {
    width: 40px;
    height: 40px;
    box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--qre-clock-ink) 10%, transparent);
}
.qre-shift-dock-mini .qre-clock-digital { display: none; }
.qre-shift-dock-copy {
    display: grid;
    text-align: left;
    line-height: 1.15;
}
.qre-shift-dock-time {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    font-size: 0.92rem;
}
.qre-shift-dock-label {
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-muted, #64748b);
}
body.app-page > .qre-shift-dock,
body.starting-page > .qre-shift-dock {
    position: fixed;
    z-index: 2400;
}
body.operator-page .qre-shift-dock,
body.setup-page .qre-shift-dock,
body.index-page .qre-shift-dock { display: none; }

@media (max-width: 720px) {
    .qre-shift-dock { top: auto; bottom: calc(var(--qre-dock-fab-bottom, 14px) + 72px); right: 12px; }
}

/* ── Boss setup strip ── */
.qre-setup-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}
.qre-setup-step {
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 16px;
    background: var(--color-surface, #fff);
    padding: 12px 10px;
    text-align: center;
    cursor: pointer;
    display: grid;
    gap: 6px;
    justify-items: center;
    animation: qre-rise 0.5s var(--qre-motion-ease) both;
}
.qre-setup-step:nth-child(1) { animation-delay: 0.02s; }
.qre-setup-step:nth-child(2) { animation-delay: 0.08s; }
.qre-setup-step:nth-child(3) { animation-delay: 0.14s; }
.qre-setup-step:nth-child(4) { animation-delay: 0.2s; }
.qre-setup-step.active,
.qre-setup-step:focus-visible {
    border-color: color-mix(in srgb, var(--brand-primary, #2563eb) 55%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary, #2563eb) 18%, transparent);
}
.qre-setup-glyph {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    background: color-mix(in srgb, var(--brand-primary, #2563eb) 12%, var(--color-surface, #fff));
}
.qre-setup-step strong {
    font-size: 0.82rem;
}
.qre-setup-step span {
    font-size: 0.7rem;
    color: var(--color-text-muted, #64748b);
    line-height: 1.3;
}
@media (max-width: 900px) {
    .qre-setup-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.qre-pay-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.qre-pay-chip {
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 999px;
    background: var(--color-surface, #fff);
    font-weight: 800;
    font-size: 0.78rem;
    padding: 6px 10px;
    cursor: pointer;
}
.qre-pay-chip:hover { transform: translateY(-1px); }
.qre-pay-chip.is-on {
    border-color: color-mix(in srgb, var(--brand-primary, #2563eb) 55%, transparent);
    background: color-mix(in srgb, var(--brand-primary, #2563eb) 12%, var(--color-surface, #fff));
}

.hr-note.hr-note-quiet {
    font-size: 0.74rem;
    margin: 0;
}

.qre-manual-fold {
    border: 1px dashed var(--color-border, #e2e8f0);
    border-radius: 12px;
    padding: 8px 10px;
}
.qre-manual-fold summary {
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-text-muted, #64748b);
}

.app-page .hr-card,
.app-page .hr-day-detail,
.app-page .hr-list-row,
.app-page .order-card,
.app-page .item-card {
    animation: qre-rise 0.46s var(--qre-motion-ease) both;
}

@keyframes qre-crate-slide {
    0% { left: 12%; opacity: 1; transform: translateX(-50%) rotate(-4deg) scale(1); }
    45% { transform: translateX(-50%) rotate(8deg) scale(1.08); }
    100% { left: 88%; opacity: 1; transform: translateX(-50%) rotate(0deg) scale(1); }
}

.qre-move-stage {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 72px 1fr;
    align-items: center;
    gap: 8px;
    min-height: 118px;
    margin: 8px 0 12px;
}
.qre-move-bin {
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 16px;
    background: var(--color-surface, #fff);
    padding: 12px 10px;
    text-align: center;
    min-height: 96px;
    display: grid;
    align-content: center;
    gap: 4px;
}
.qre-move-bin strong { display: block; font-size: 0.82rem; }
.qre-move-bin .qre-move-qty {
    font-size: 1.35rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.qre-move-bin.is-to.is-landed {
    border-color: color-mix(in srgb, var(--qre-clock-green) 55%, transparent);
    background: color-mix(in srgb, var(--qre-clock-green) 12%, var(--color-surface, #fff));
}
.qre-move-arrow {
    text-align: center;
    font-size: 1.4rem;
    color: var(--brand-primary, #2563eb);
}
.qre-move-crate {
    position: absolute;
    top: 38%;
    left: 12%;
    width: 44px;
    height: 36px;
    margin-top: -18px;
    border-radius: 8px;
    background: #d97706;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.18);
    display: none;
    z-index: 2;
    transform: translateX(-50%);
}
.qre-move-crate::after {
    content: "";
    position: absolute;
    left: 6px;
    right: 6px;
    top: 7px;
    height: 8px;
    border-radius: 2px;
    background: color-mix(in srgb, #fff 35%, transparent);
}
.qre-move-stage.is-running .qre-move-crate {
    display: block;
    animation: qre-crate-slide 0.7s var(--qre-motion-ease) forwards;
}
.qre-move-stage.is-done .qre-move-bin.is-to {
    animation: qre-pop 0.45s var(--qre-motion-ease) both;
}
.qre-move-check {
    display: none;
    color: var(--qre-clock-green);
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.78rem;
    text-align: center;
}
.qre-move-stage.is-done .qre-move-check { display: block; }

.item-card.done {
    position: relative;
}
.item-card.done::after {
    content: "✓";
    position: absolute;
    right: 10px;
    top: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--qre-clock-green);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 0.95rem;
    font-weight: 800;
    animation: qre-pop 0.42s var(--qre-motion-ease) both;
}

.qre-track-stamp {
    animation: qre-pop 0.45s var(--qre-motion-ease) both;
    border-color: color-mix(in srgb, var(--qre-clock-green) 50%, transparent) !important;
    background: color-mix(in srgb, var(--qre-clock-green) 10%, var(--color-surface, #fff));
}

@media (prefers-reduced-motion: reduce) {
    .qre-move-crate,
    .qre-move-stage.is-done .qre-move-bin.is-to,
    .item-card.done::after,
    .qre-track-stamp {
        animation: none !important;
    }
    .qre-move-stage.is-running .qre-move-crate {
        display: block;
        left: 88%;
    }
}
