﻿/* =========================
   DASHBOARD LAYOUT
   ========================= */

.dashboard {
    width: 100%;
    max-width: 1200px;
    margin: 0;
    padding: 16px;
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 0;
    align-items: start;
}

.preview--doc {
    width: 100%;
    height: 420px;
    border: 0;
}

/* Panels */
.panel {
    background: rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 16px;
    min-width: 0;
}

.panel--left {
    justify-self: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

/* Generic rows / stacks */
.stack {
    display: grid;
    gap: 10px;
}

.row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

    .row > * {
        min-width: 0;
        max-width: 100%;
    }

/* =========================
   DASH CARD (RIGHT PANEL)
   ========================= */

.dash-card {
    background: var(--color-white);
    width: 100%;
    padding: 6px 15px 15px;
    border-radius: 15px;
    box-shadow: var(--rk-shadow-card);
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}

.dash-card__row {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .dash-card__row .icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 20px;
        height: 20px;
        line-height: 0;
    }

        .dash-card__row .icon svg {
            display: block;
            width: 18px;
            height: 18px;
        }

.lastSaleSubTitle {
    font-weight: bold;
}

/* (legacy card styling you still use elsewhere) */
.leftSideCard {
    background: var(--color-white);
    padding: 15px;
    border-radius: 15px;
    box-shadow: var(--rk-shadow-card);
}

/* =========================
   UPLOAD / PREVIEW
   ========================= */

.preview {
    max-width: 100%;
    margin-top: 1rem;
    border-radius: 12px;
}

.items {
    margin-top: 1rem;
}

.totals {
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.placeholder-box {
    height: 240px;
    border-radius: 12px;
    border: 1px dashed rgba(255,255,255,0.25);
}

.file-name {
    margin-top: 6px;
    font-size: 0.95rem;
    opacity: 0.8;
    text-align: center;
    word-break: break-all;
}

.upload-out {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 22px;
}

    .upload-out[hidden] {
        display: none;
    }

    .upload-out.is-error .status-text {
        opacity: 1;
        font-weight: 600;
    }

/* =========================
   Fancy Doc Toggle (Option 1 + 3)
   - Pill = ONLY translate (GPU smooth)
   - Separate glow layer does the “alive” blob pulse
   - Background gets subtle aurora shift on toggle
   - Shine sweep stays, but runs on the pill (cheap)
   ========================= */

/* wrapper */
.doc-toggle {
    --pad: 4px;
    --w: calc(50% - var(--pad));
    --h: calc(100% - (var(--pad) * 2));

    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: var(--pad);
    border-radius: 999px;
    overflow: hidden;
    isolation: isolate;

    /* premium glass */
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 10px 30px rgba(0,0,0,.10), inset 0 1px 0 rgba(255,255,255,.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    /* aurora baseline */
    --auroraX: 0%;
}

/* ambient lights + subtle aurora */
.doc-toggle::before,
.doc-toggle::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
}

/* Soft ambient lights (your original, kept) */
.doc-toggle::before {
    z-index: 0;
    background:
        radial-gradient(120px 80px at 25% 30%, rgba(255,255,255,.22), transparent 60%),
        radial-gradient(140px 90px at 75% 70%, rgba(255,255,255,.12), transparent 65%);
    opacity: .7;
}

/* Aurora wash that “shifts mood” on toggle (Option 3) */
.doc-toggle::after {
    z-index: 1;
    opacity: .55;
    background:
        radial-gradient(140px 90px at var(--auroraX) 35%, rgba(255,255,255,.18), transparent 65%),
        radial-gradient(220px 140px at calc(var(--auroraX) + 10%) 85%, rgba(255,255,255,.10), transparent 70%),
        linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,0), rgba(255,255,255,.04));
    transform: translate3d(0,0,0);
    transition: opacity .35s ease, filter .35s ease;
    filter: saturate(1.05);
}

/* state changes: move aurora anchor */
.doc-toggle:not(.is-invoice) { --auroraX: 20%; }
.doc-toggle.is-invoice       
{ 
    --auroraX: 80%; 
    margin-bottom: 15px;

}

/* buttons */
.doc-toggle__btn {
    position: relative;
    z-index: 5;
    border: 0;
    background: transparent;

    display: flex;
    align-items: center;
    justify-content: center;
    padding: .62rem .9rem;
    border-radius: 999px;

    cursor: pointer;
    font-weight: 750;
    letter-spacing: .2px;
    line-height: 1;
    margin: 0;

    opacity: .75;
    transform: translate3d(0,0,0);
    transition:
        opacity .18s ease,
        transform .22s cubic-bezier(.2,.9,.2,1),
        filter .22s ease;
}

.doc-toggle__btn:hover {
    opacity: 1;
    transform: translate3d(0,-1px,0);
}

.doc-toggle__btn:active {
    transform: translate3d(0,0,0) scale(.985);
}

.doc-toggle__btn.is-active {
    opacity: 1;
    filter: saturate(1.05);
}

.doc-toggle__btn.is-disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

/* =========================
   Layer A: pill (moves only)
   ========================= */

.doc-toggle__pill {
    position: absolute;
    z-index: 3;
    top: var(--pad);
    left: var(--pad);
    width: var(--w);
    height: var(--h);
    border-radius: 999px;

    background: rgba(255,255,255,0.92);
    box-shadow: 0 12px 28px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.7);

    transform: translate3d(0,0,0);
    will-change: transform;
    transition: transform .52s cubic-bezier(.16, 1.22, .22, 1);
}

/* ring */
.doc-toggle__pill::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,.65);
    opacity: .75;
}

/* shine sweep (Option 3) */
.doc-toggle__pill::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;

    background: linear-gradient(
        120deg,
        transparent 0%,
        rgba(255,255,255,0) 35%,
        rgba(255,255,255,.55) 50%,
        rgba(255,255,255,0) 65%,
        transparent 100%
    );

    transform: translate3d(-140%,0,0) skewX(-20deg);
    opacity: 0;
}

/* invoice position */
.doc-toggle.is-invoice .doc-toggle__pill {
    transform: translate3d(100%,0,0);
}

/* shine trigger on toggle */
.doc-toggle:not(.is-invoice) .doc-toggle__pill::after,
.doc-toggle.is-invoice .doc-toggle__pill::after {
    animation: pillShine .65s ease-out;
}

/* =========================
   Layer B: glow blob (Option 1)
   - separate layer for “alive” feel
   - pill stays cheap: translate only
   ========================= */

.doc-toggle__pillGlow {
    position: absolute;
    z-index: 2;
    top: var(--pad);
    left: var(--pad);
    width: var(--w);
    height: var(--h);
    border-radius: 999px;

    /* glow + soft core */
    background:
        radial-gradient(120% 90% at 30% 35%, rgba(255,255,255,.55), rgba(255,255,255,0) 60%),
        radial-gradient(140% 100% at 70% 70%, rgba(255,255,255,.30), rgba(255,255,255,0) 65%);

    opacity: .0; /* off when idle */
    transform: translate3d(0,0,0);
    will-change: transform, opacity;
    filter: blur(10px);
}

/* move glow with the pill */
.doc-toggle.is-invoice .doc-toggle__pillGlow {
    transform: translate3d(100%,0,0);
}

/* pulse the glow on toggle (blob feel) */
.doc-toggle:not(.is-invoice) .doc-toggle__pillGlow,
.doc-toggle.is-invoice .doc-toggle__pillGlow {
    animation: glowPop .55s cubic-bezier(.16, 1.22, .22, 1);
}

/* optional: a tiny trailing sparkle */
.doc-toggle__pillGlow::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(10px 10px at 25% 35%, rgba(255,255,255,.8), transparent 60%);
    opacity: 0;
}

.doc-toggle:not(.is-invoice) .doc-toggle__pillGlow::after,
.doc-toggle.is-invoice .doc-toggle__pillGlow::after {
    animation: sparkle .55s ease-out;
}

/* =========================
   Keyframes
   ========================= */

@keyframes pillShine {
    0%   { transform: translate3d(-140%,0,0) skewX(-20deg); opacity: 0; }
    20%  { opacity: .55; }
    100% { transform: translate3d(140%,0,0) skewX(-20deg);  opacity: 0; }
}

/* glow blob pulse (no scale on pill itself) */
@keyframes glowPop {
    0%   { opacity: 0;  filter: blur(14px); transform: translate3d(var(--tx, 0),0,0) scale(0.98); }
    35%  { opacity: .9; filter: blur(10px); transform: translate3d(var(--tx, 0),0,0) scale(1.06, .96); }
    70%  { opacity: .55;filter: blur(11px); transform: translate3d(var(--tx, 0),0,0) scale(.99, 1.02); }
    100% { opacity: 0;  filter: blur(14px); transform: translate3d(var(--tx, 0),0,0) scale(1); }
}

@keyframes sparkle {
    0%   { opacity: 0; transform: translate3d(-6px,0,0) scale(.9); }
    35%  { opacity: .65; }
    100% { opacity: 0; transform: translate3d(10px,0,0) scale(1.05); }
}

/* Provide tx for glowPop (so it pulses at the right side) */
.doc-toggle:not(.is-invoice) 
{
    --tx: 0%;
    margin-bottom: 15px;

}
.doc-toggle.is-invoice       { --tx: 100%; }

/* accessibility: reduce motion */
@media (prefers-reduced-motion: reduce) {
    .doc-toggle::after,
    .doc-toggle__btn,
    .doc-toggle__pill {
        transition: none !important;
        animation: none !important;
    }
    .doc-toggle__pill::after,
    .doc-toggle__pillGlow,
    .doc-toggle__pillGlow::after {
        animation: none !important;
        opacity: 0 !important;
    }
}

.companyPick {
    display: grid;
    gap: 12px;
}

.companyPick__text {
    opacity: .9;
    line-height: 1.35;
}

.companyPick__list {
    display: grid;
    gap: 10px;
}

.companyPick__card {
    border: 0;
    cursor: pointer;
    text-align: left;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    box-shadow: 0 10px 24px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

    .companyPick__card:hover {
        transform: translate3d(0,-1px,0);
        background: rgba(255,255,255,0.10);
        border-color: rgba(255,255,255,0.20);
    }

    .companyPick__card:active {
        transform: translate3d(0,0,0) scale(.99);
    }

.companyPick__name {
    font-weight: 750;
    letter-spacing: .2px;
}

.companyPick__sub {
    margin-top: 4px;
    opacity: .8;
    font-size: .92rem troubled;
}

.companyPick__actions {
    display: flex;
    justify-content: flex-end;
}



/* =========================
   OVERFLOW SAFETY
   ========================= */

.dashboard,
.dashboard * {
    box-sizing: border-box;
        margin-top: 2px;
}

    .dashboard > * {
        min-width: 0;
    }

.dash-card {
    width: auto;
}

/* =========================
   MOBILE / RESPONSIVE
   ========================= */

@media (max-width: 900px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
}
