/*
 * The customer's account area.
 *
 * Only the dashboard had a sidebar: opening "Meus cartões NFC", the plan or
 * the account made the navigation disappear, and the user was left on a bare
 * `container` with no way back except the browser. Every /app screen shares a
 * shell now.
 *
 * It is the same information design as the back-office — pills for state,
 * drawers for row actions, real empty states — in the product's own light
 * skin rather than the operator's dark rail. The customer and the operator
 * should never wonder which side they are on.
 */

.acc {
    --acc-ground: #f7f7f5;
    --acc-surface: #ffffff;
    --acc-sunken: #f0f1ee;
    --acc-ink: #191c1a;
    --acc-ink-2: #5d6663;
    --acc-ink-3: #8b9491;
    --acc-line: rgba(25, 28, 26, .1);
    --acc-line-strong: rgba(25, 28, 26, .17);

    --acc-accent: var(--brand-primary, #2563eb);
    --acc-ok: #177a4c;
    --acc-ok-bg: #e4f4ec;
    --acc-warn: #96600f;
    --acc-warn-bg: #fbf0da;
    --acc-danger: #ab2e23;
    --acc-danger-bg: #fbe6e3;
    --acc-info: #1f5fa8;
    --acc-info-bg: #e4eefb;
    --acc-neutral: #5d6663;
    --acc-neutral-bg: #eaece9;
    --acc-busy: #574bc0;
    --acc-busy-bg: #eae8f9;

    --acc-radius: 14px;

    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    min-height: calc(100vh - 62px);
    background: var(--acc-ground);
    color: var(--acc-ink);
}

@media (max-width: 900px) { .acc { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------------- rail */
.acc-rail {
    background: var(--acc-surface);
    border-right: 1px solid var(--acc-line);
    padding: 18px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

@media (max-width: 900px) {
    .acc-rail {
        flex-direction: row;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid var(--acc-line);
        padding: 10px;
        scrollbar-width: none;
    }
    .acc-rail::-webkit-scrollbar { display: none; }
}

.acc-rail__link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 11px;
    border-radius: 10px;
    color: var(--acc-ink-2);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.acc-rail__link i { width: 17px; text-align: center; font-size: 14px; opacity: .75; }
.acc-rail__link:hover { background: var(--acc-sunken); color: var(--acc-ink); }

/* The current page is marked by a bar as well as a fill: colour alone is not
   a state everyone can read. */
.acc-rail__link--active {
    background: color-mix(in srgb, var(--acc-accent) 10%, transparent);
    color: var(--acc-accent);
    font-weight: 700;
    box-shadow: inset 3px 0 0 var(--acc-accent);
}

.acc-rail__link--active i { opacity: 1; }
.acc-rail__foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--acc-line); }
@media (max-width: 900px) { .acc-rail__foot { margin-top: 0; border-top: 0; padding-top: 0; } }

/* -------------------------------------------------------------- content */
.acc-main { padding: 26px 28px 64px; min-width: 0; }
@media (max-width: 620px) { .acc-main { padding: 18px 14px 48px; } }

.acc-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 22px;
}

.acc-head__title { margin: 0; font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.acc-head__sub { margin: 5px 0 0; font-size: 13.5px; color: var(--acc-ink-2); max-width: 62ch; }
.acc-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.acc-narrow { max-width: 620px; }

/* ----------------------------------------------------------------- card */
.acc-card {
    background: var(--acc-surface);
    border: 1px solid var(--acc-line);
    border-radius: var(--acc-radius);
    box-shadow: 0 1px 2px rgba(25, 28, 26, .04), 0 14px 30px -26px rgba(25, 28, 26, .5);
    overflow: hidden;
    margin-bottom: 18px;
}

.acc-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--acc-line);
}

.acc-card__title { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }

/* A card whose whole content is one sentence and one action needs no header
   rule across it: the divider was fencing off nothing. */
.acc-promo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.acc-promo > div:first-child { flex: 1 1 320px; min-width: 0; }
.acc-promo .acc-card__title { margin-bottom: 5px; }
.acc-card__body { padding: 18px; }
.acc-card__note { font-size: 13px; color: var(--acc-ink-2); margin: 0; }

/* ----------------------------------------------------- the card at a glance */
/* The user's own card is the product, so it leads the page instead of sitting
   in a fourth identical tile. */
.acc-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; }
@media (max-width: 720px) { .acc-hero { grid-template-columns: 1fr; } }

.acc-hero__id { display: flex; align-items: center; gap: 14px; min-width: 0; }

.acc-hero__avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
    background: var(--acc-accent);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    font-size: 20px;
}

.acc-hero__text { min-width: 0; }
.acc-hero__name { font-size: 17px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 3px; }
.acc-hero__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12.5px;
    color: var(--acc-ink-2);
    background: var(--acc-sunken);
    border-radius: 7px;
    padding: 4px 9px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.acc-hero__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------------------------------------------------------------- stats */
.acc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }

.acc-stat {
    background: var(--acc-surface);
    border: 1px solid var(--acc-line);
    border-radius: var(--acc-radius);
    padding: 15px 16px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.acc-stat__label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--acc-ink-3);
}

.acc-stat--state { gap: 7px; }
.acc-stat--state .acc-pill { align-self: flex-start; font-size: 13px; padding: 4px 12px; }

.acc-stat__value { font-size: 28px; font-weight: 700; line-height: 1.05; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.acc-stat__foot { font-size: 12.5px; color: var(--acc-ink-2); }

/* ----------------------------------------------------------------- pill */
.acc-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.acc-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.acc-pill--ok { background: var(--acc-ok-bg); color: var(--acc-ok); }
.acc-pill--warn { background: var(--acc-warn-bg); color: var(--acc-warn); }
.acc-pill--danger { background: var(--acc-danger-bg); color: var(--acc-danger); }
.acc-pill--info { background: var(--acc-info-bg); color: var(--acc-info); }
.acc-pill--neutral { background: var(--acc-neutral-bg); color: var(--acc-neutral); }
.acc-pill--busy { background: var(--acc-busy-bg); color: var(--acc-busy); }

/* --------------------------------------------------------------- buttons */
.acc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 15px;
    border: 1px solid var(--acc-line-strong);
    border-radius: 9px;
    background: var(--acc-surface);
    color: var(--acc-ink);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.acc-btn:hover { background: var(--acc-sunken); color: var(--acc-ink); }
.acc-btn:focus-visible { outline: 2px solid var(--acc-accent); outline-offset: 2px; }
.acc-btn--primary { background: var(--acc-accent); border-color: transparent; color: #fff; }
.acc-btn--primary:hover { background: var(--acc-accent); color: #fff; filter: brightness(1.08); }
.acc-btn--danger { color: var(--acc-danger); border-color: rgba(171, 46, 35, .35); }
.acc-btn--danger:hover { background: var(--acc-danger-bg); color: var(--acc-danger); }
.acc-btn--sm { height: 32px; padding: 0 11px; font-size: 13px; }
.acc-btn--lg { height: 46px; padding: 0 22px; font-size: 15px; }
.acc-btn--ghost { border-color: transparent; background: none; color: var(--acc-ink-2); }
.acc-btn--ghost:hover { background: var(--acc-sunken); color: var(--acc-ink); }

/* ---------------------------------------------------------------- table */
.acc-scroll { overflow: visible; }
@media (max-width: 900px) { .acc-scroll { overflow-x: auto; } }

.acc-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.acc-table th {
    background: var(--acc-sunken);
    text-align: left;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--acc-ink-3);
    padding: 9px 16px;
    white-space: nowrap;
    border-bottom: 1px solid var(--acc-line);
}

.acc-table td { padding: 12px 16px; border-bottom: 1px solid var(--acc-line); vertical-align: middle; }
.acc-table tbody tr:last-child td { border-bottom: 0; }
.acc-table tbody tr:hover td { background: rgba(25, 28, 26, .02); }
.acc-table .actions { text-align: right; white-space: nowrap; }
.acc-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: var(--acc-ink-2); }
.acc-muted { color: var(--acc-ink-3); }

/* ------------------------------------------------------------ row actions */
.acc-actions { position: relative; }
.acc-actions > summary { list-style: none; cursor: pointer; display: inline-flex; }
.acc-actions > summary::-webkit-details-marker { display: none; }

.acc-drawer {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 30;
    width: min(300px, 78vw);
    padding: 13px;
    background: var(--acc-surface);
    border: 1px solid var(--acc-line-strong);
    border-radius: 12px;
    box-shadow: 0 18px 40px -18px rgba(25, 28, 26, .55);
    text-align: left;
    white-space: normal;
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.acc-drawer__form { display: flex; flex-direction: column; gap: 7px; }
.acc-drawer__form + .acc-drawer__form { padding-top: 13px; border-top: 1px solid var(--acc-line); }
.acc-label { display: block; font-size: 12px; font-weight: 600; color: var(--acc-ink-2); }

.acc-input, .acc-select {
    width: 100%;
    height: 36px;
    padding: 0 11px;
    border: 1px solid var(--acc-line-strong);
    border-radius: 8px;
    background: var(--acc-surface);
    color: var(--acc-ink);
    font-size: 13.5px;
}

.acc-input:focus, .acc-select:focus { outline: 2px solid var(--acc-accent); outline-offset: 1px; border-color: transparent; }
.acc-check { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; line-height: 1.4; cursor: pointer; }
.acc-check input { margin-top: 3px; flex-shrink: 0; }

/* ----------------------------------------------------------- empty state */
.acc-empty { padding: 40px 24px; text-align: center; }
.acc-empty__icon { font-size: 26px; color: var(--acc-ink-3); margin-bottom: 10px; }
.acc-empty__title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.acc-empty p { color: var(--acc-ink-2); font-size: 13.5px; max-width: 44ch; margin: 0 auto 16px; }

/* ---------------------------------------------------------------- flash */
.acc-flash {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 13.5px;
    border: 1px solid transparent;
}

.acc-flash--success { background: var(--acc-ok-bg); color: var(--acc-ok); border-color: rgba(23, 122, 76, .22); }
.acc-flash--danger, .acc-flash--error { background: var(--acc-danger-bg); color: var(--acc-danger); border-color: rgba(171, 46, 35, .22); }
.acc-flash--warning { background: var(--acc-warn-bg); color: var(--acc-warn); border-color: rgba(150, 96, 15, .22); }
.acc-flash--info { background: var(--acc-info-bg); color: var(--acc-info); border-color: rgba(31, 95, 168, .22); }

/* ------------------------------------------------------------ price & form */
.acc-price { display: flex; align-items: baseline; gap: 9px; margin-bottom: 6px; }
.acc-price__value { font-size: 38px; font-weight: 700; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.acc-price__note { font-size: 13px; color: var(--acc-ink-2); }

.acc-list { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 8px; }
.acc-list li { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; color: var(--acc-ink-2); }
.acc-list i { color: var(--acc-ok); margin-top: 3px; }

.acc-form { display: flex; flex-direction: column; gap: 14px; }
.acc-form .acc-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.acc-form small { font-size: 12px; color: var(--acc-ink-3); }

/* The zone where an action cannot be undone is fenced off, not mixed in with
   the ordinary settings above it. */
.acc-danger-zone { border-color: rgba(171, 46, 35, .3); }
.acc-danger-zone .acc-card__head { background: var(--acc-danger-bg); border-bottom-color: rgba(171, 46, 35, .2); }
.acc-danger-zone .acc-card__title { color: var(--acc-danger); }

/* ------------------------------------------------------------- shop */
.acc-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; }
.acc-product {
    background: var(--acc-surface);
    border: 1px solid var(--acc-line);
    border-radius: var(--acc-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.acc-product__media { aspect-ratio: 4 / 3; background: var(--acc-ground, #f3f4f2); display: grid; place-items: center; overflow: hidden; }
.acc-product__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acc-product__placeholder { font-size: 42px; color: var(--acc-ink-3); }
.acc-product__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.acc-product__name { font-size: 16px; font-weight: 700; margin: 4px 0 0; }
.acc-product__desc { font-size: 13px; color: var(--acc-ink-2); margin: 0; }
.acc-product__price { font-size: 20px; font-weight: 700; margin: 4px 0 0; font-variant-numeric: tabular-nums; }
.acc-product__price small { font-size: 12px; font-weight: 400; color: var(--acc-ink-3); }
.acc-qty { display: grid; grid-template-columns: auto 80px; align-items: center; gap: 6px 10px; margin-top: 8px; font-size: 13px; }
.acc-qty small { grid-column: 1 / -1; font-size: 12px; color: var(--acc-ink-3); }
.acc-table--items .num, .acc-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.acc-table--items tfoot th { font-weight: 700; }

/* ---------------------------------------------------------- timeline */
.acc-timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.acc-timeline__step { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--acc-ink-3); position: relative; padding-top: 14px; }
.acc-timeline__dot { position: absolute; top: 0; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--acc-line); }
.acc-timeline__step::before { content: ''; position: absolute; top: 4px; left: 12px; right: -8px; height: 2px; background: var(--acc-line); }
.acc-timeline__step:last-child::before { display: none; }
.acc-timeline__step--done { color: var(--acc-ink); }
.acc-timeline__step--done .acc-timeline__dot { background: var(--acc-ok); }
.acc-timeline__label { font-weight: 600; }
.acc-timeline__at { font-size: 12px; color: var(--acc-ink-3); }
