@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    color-scheme: dark;

    /* type */
    --font-ui: 'Manrope', ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: 'Space Grotesk', 'Manrope', ui-sans-serif, system-ui, sans-serif;

    /* base */
    --bg: #050912;
    --bg-2: #0a1222;
    --ink: #04070f;

    /* surfaces */
    --panel: rgba(15, 23, 42, 0.6);
    --panel-2: rgba(20, 30, 54, 0.72);
    --glass-line: rgba(120, 170, 255, 0.14);
    --glass-line-strong: rgba(120, 170, 255, 0.34);

    /* text */
    --text: #eef4ff;
    --text-dim: #c4d2ec;
    --muted: #92a6c8;
    --faint: #7587a8;

    /* blue-led accents */
    --blue: #3b82f6;
    --blue-bright: #5b9dff;
    --blue-deep: #1e40af;
    --indigo: #4f6bff;
    --sky: #38bdf8;
    --cyan: #22d3ee;
    --mint: #5eead4;

    --holo: linear-gradient(120deg, #1e40af 0%, #3b82f6 45%, #38bdf8 100%);
    --holo-soft: linear-gradient(120deg, rgba(59, 130, 246, 0.24), rgba(56, 189, 248, 0.16));

    --radius: 20px;
    --radius-sm: 13px;
    --shadow: 0 24px 60px -22px rgba(0, 0, 0, 0.82);
    --glow: 0 0 40px -8px rgba(59, 130, 246, 0.6);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 0.94rem;
    line-height: 1.5;
    letter-spacing: -0.006em;
    background-color: var(--bg);
    background-image:
        radial-gradient(820px 620px at 6% -10%, rgba(59, 130, 246, 0.22), transparent 60%),
        radial-gradient(760px 600px at 102% 2%, rgba(56, 189, 248, 0.16), transparent 58%),
        radial-gradient(900px 760px at 80% 112%, rgba(79, 107, 255, 0.14), transparent 62%),
        linear-gradient(180deg, var(--bg-2), var(--bg));
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    content: "";
    background-image:
        linear-gradient(rgba(140, 180, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(140, 180, 255, 0.03) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: radial-gradient(120% 110% at 50% 0%, rgba(0, 0, 0, 0.7), transparent 80%);
}

button, input, select, textarea { font: inherit; }

button {
    min-height: 44px;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 700;
    padding: 0 18px;
    transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

button:hover { filter: brightness(1.07); }
button:active { transform: translateY(1px); }

h1, h2, h3, p { margin: 0; }

h1, h2, h3, .brand-lockup strong, .metric-card strong, .spotlight-value, .num {
    font-family: var(--font-display);
    letter-spacing: -0.022em;
    font-variant-numeric: tabular-nums;
}

/* tabular figures keep currency + metrics aligned */
.spotlight-value, .metric-card strong, .number-cell, .bar-value, .sales-stat strong,
.insight-list strong, .plan-editor-number, .product-plan-row b, .amount-input input,
.percent-input input, .plan-price-input input, #pixInput, #cbInput {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "ss01" 1;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
.cselect-trigger:focus-visible {
    outline: 3px solid rgba(56, 189, 248, 0.76);
    outline-offset: 3px;
    box-shadow: 0 0 0 5px rgba(56, 189, 248, 0.16);
}

h1 { font-size: 1.95rem; line-height: 1.08; font-weight: 600; }
h2 { font-size: 1.06rem; font-weight: 600; }

svg { display: block; }

/* ===================== shell ===================== */

.dashboard-app {
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 26px;
    height: 100vh;
    padding: 26px 18px;
    border-right: 1px solid var(--glass-line);
    background: linear-gradient(180deg, rgba(12, 19, 36, 0.88), rgba(6, 10, 20, 0.72));
    backdrop-filter: blur(20px);
}

.brand-lockup {
    display: grid;
    align-items: start;
    gap: 8px;
    padding: 0 6px;
}

.brand-logo {
    display: block;
    width: min(172px, 100%);
    height: auto;
    filter: drop-shadow(0 14px 24px rgba(56, 189, 248, 0.12));
}

.brand-lockup > span {
    display: block;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-lockup strong, .brand-lockup span { display: block; }
.brand-lockup strong { font-size: 1.02rem; font-weight: 600; }
.brand-lockup div span { margin-top: 1px; color: var(--muted); font-size: 0.74rem; font-weight: 500; }

.side-nav { display: grid; gap: 4px; }

.side-nav a {
    display: grid;
    grid-template-columns: 22px 1fr;
    align-items: center;
    gap: 13px;
    min-height: 52px;
    border-radius: 13px;
    color: var(--text-dim);
    padding: 8px 14px;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease;
}

.side-nav a:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }

.side-nav a.active {
    background: var(--holo-soft);
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--glass-line-strong);
}

.nav-ic { width: 19px; height: 19px; color: var(--faint); transition: color 0.18s ease; }
.side-nav a:hover .nav-ic { color: var(--blue-bright); }
.side-nav a.active .nav-ic { color: var(--sky); filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.6)); }

.side-nav strong, .side-nav small { display: block; }
.side-nav strong { font-size: 0.9rem; font-weight: 600; }
.side-nav small { margin-top: 2px; color: var(--muted); font-size: 0.73rem; }

.sidebar-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding: 14px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.035);
    box-shadow: inset 0 0 0 1px var(--glass-line);
}

.sidebar-status strong, .sidebar-status span { display: block; }
.sidebar-status strong { font-size: 0.84rem; font-weight: 600; }
.sidebar-status div span { margin-top: 2px; color: var(--muted); font-size: 0.74rem; }

.live-dot {
    position: relative;
    display: inline-block;
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 999px;
    background: var(--mint);
    box-shadow: 0 0 12px 1px rgba(94, 234, 212, 0.8);
}

.live-dot::after {
    position: absolute;
    inset: -5px;
    content: "";
    border-radius: 999px;
    border: 1px solid rgba(94, 234, 212, 0.5);
    animation: ping 2.2s ease-out infinite;
}

@keyframes ping {
    0% { transform: scale(0.6); opacity: 0.9; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* ===================== main ===================== */

.dashboard-shell {
    width: min(1340px, calc(100% - 48px));
    margin: 0 auto;
    padding: 26px 0 56px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 18px;
}

.header-copy { display: grid; gap: 6px; flex: 0 0 auto; }
.header-copy > p:not(.breadcrumb) { display: none; }

.breadcrumb, .eyebrow, .panel-kicker {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: var(--holo);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--blue-bright);
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    margin-left: auto;
}

.icon-btn {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    padding: 0;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.045);
    box-shadow: inset 0 0 0 1px var(--glass-line);
    color: var(--text-dim);
}

.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { color: var(--text); }

.notification-wrap {
    position: relative;
}

.notification-btn {
    position: relative;
}

.notification-btn.has-unread {
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--glass-line-strong), 0 0 28px -18px rgba(56, 189, 248, 0.9);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    display: grid;
    min-width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 999px;
    background: var(--sky);
    color: #04101f;
    font-size: 0.68rem;
    font-weight: 800;
    box-shadow: 0 0 16px -2px rgba(56, 189, 248, 0.9);
    padding: 0 6px;
}

.notification-badge[hidden] { display: none; }

.notification-pop {
    position: absolute;
    top: 56px;
    right: 0;
    z-index: 45;
    width: min(360px, calc(100vw - 32px));
    overflow: hidden;
    border-radius: 18px;
    background: rgba(13, 20, 38, 0.97);
    box-shadow: var(--shadow), inset 0 0 0 1px var(--glass-line-strong);
    backdrop-filter: blur(22px);
}

.notification-pop[hidden] { display: none; }

.notification-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--glass-line);
    padding: 14px 16px;
}

.notification-head strong {
    font-family: var(--font-display);
    font-size: 0.98rem;
    font-weight: 600;
}

.notification-head span {
    color: var(--sky);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.notification-list {
    display: grid;
    max-height: 340px;
    overflow-y: auto;
}

.notification-item {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.notification-item:last-child { border-bottom: 0; }

.notification-icon {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.12);
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.25);
    color: var(--sky);
}

.notification-icon svg { width: 18px; height: 18px; }

.notification-copy {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.notification-copy strong {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 700;
}

.notification-copy span {
    min-width: 0;
    overflow: hidden;
    color: var(--text-dim);
    font-size: 0.83rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-copy small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
}

.notification-empty {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.45;
    padding: 18px 16px;
}

.toast-host {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 70;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}

.sale-toast {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 12px;
    align-items: center;
    border-radius: 18px;
    background: rgba(13, 20, 38, 0.96);
    box-shadow: var(--shadow), inset 0 0 0 1px var(--glass-line-strong);
    backdrop-filter: blur(22px);
    padding: 13px 15px;
    animation: toastIn 0.22s ease-out;
}

.sale-toast.is-leaving {
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.sale-toast-copy strong,
.sale-toast-copy > span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sale-toast-copy strong {
    color: var(--text);
    font-size: 0.9rem;
}

.sale-toast-copy > span {
    margin-top: 2px;
    color: var(--text-dim);
    font-size: 0.82rem;
    font-weight: 600;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* settings dropdown (holds export + logout) */
.settings-menu { position: relative; }
.settings-menu summary { list-style: none; cursor: pointer; }
.settings-menu summary::-webkit-details-marker { display: none; }
.settings-menu[open] .icon-btn { color: var(--text); box-shadow: inset 0 0 0 1px var(--glass-line-strong); }

.menu-pop {
    position: absolute;
    top: 54px;
    right: 0;
    z-index: 30;
    width: 252px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(13, 20, 38, 0.96);
    box-shadow: var(--shadow), inset 0 0 0 1px var(--glass-line-strong);
    backdrop-filter: blur(22px);
}

.menu-pop p {
    margin: 2px 4px 10px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.menu-pop button, .menu-pop a {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    border-radius: 11px;
    background: transparent;
    color: var(--text-dim);
    font-size: 0.88rem;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    padding: 0 12px;
}

.menu-pop button:hover, .menu-pop a:hover { background: rgba(120, 170, 255, 0.12); color: var(--text); filter: none; }
.menu-pop svg { width: 17px; height: 17px; flex: 0 0 17px; color: var(--blue-bright); }
.menu-pop .menu-sep { height: 1px; margin: 8px 4px; background: var(--glass-line); }

/* glass surface base */
.spotlight, .control-panel, .metric-card, .panel, .export-panel, .access-panel {
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow), inset 0 0 0 1px var(--glass-line);
    backdrop-filter: blur(22px);
}

/* ===================== spotlight (featured revenue) ===================== */

.spotlight {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    overflow: hidden;
    min-height: 198px;
    padding: 28px 30px;
}

.spotlight-copy { display: grid; gap: 14px; position: relative; z-index: 2; }
.spotlight-value { font-size: 3.15rem; line-height: 1; font-weight: 500; letter-spacing: -0.035em; color: var(--text); }

.spotlight-stats { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 4px; }
.spotlight-stats > div { display: grid; gap: 3px; }
.spotlight-stats span { color: var(--muted); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.spotlight-stats strong {
    max-width: 220px;
    overflow: hidden;
    color: var(--text);
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.spotlight-stats strong#heroTopOffer { color: var(--sky); }
.spotlight-stats strong#heroTopPlatform { color: var(--blue-bright); }

/* holographic orb */
.orb-wrap {
    position: relative;
    flex: 0 0 auto;
    width: 200px;
    height: 200px;
    display: grid;
    place-items: center;
}

.orb {
    width: 142px;
    height: 142px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 34% 28%, #d6e9ff 0%, #6aa8ff 26%, #2563eb 55%, #16308f 78%, #0a1a52 100%);
    box-shadow:
        0 0 70px -6px rgba(59, 130, 246, 0.75),
        inset -16px -18px 48px rgba(3, 9, 28, 0.7),
        inset 14px 16px 40px rgba(214, 233, 255, 0.45);
    animation: orbFloat 6s ease-in-out infinite;
}

.orb-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(120, 180, 255, 0.32);
}
.orb-ring.r2 { inset: 18px; border-color: rgba(120, 180, 255, 0.2); }
.orb-ring.r3 {
    inset: -14px;
    border-color: rgba(56, 189, 248, 0.28);
    border-style: dashed;
    animation: spin 26s linear infinite;
}

@keyframes orbFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-9px); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spotlight::after {
    position: absolute;
    top: -40%;
    right: 4%;
    width: 320px;
    height: 320px;
    content: "";
    border-radius: 999px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2), transparent 68%);
    filter: blur(10px);
    pointer-events: none;
}

/* ===================== control / filter panel ===================== */

.control-panel { padding: 16px 18px; position: relative; z-index: 30; }

.dashboard-filter-panel {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
}

.dashboard-filter-copy { display: grid; max-width: 420px; gap: 5px; }
.dashboard-filter-copy > div { display: grid; gap: 5px; }
.dashboard-filter-copy > span { color: var(--muted); font-size: 0.78rem; line-height: 1.45; }
.dashboard-filter-fields {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr) auto;
    width: min(840px, 100%);
    align-items: end;
    gap: 10px;
}
.dashboard-filter-fields label > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
}
.dashboard-filter-fields label > span svg { width: 14px; height: 14px; color: var(--blue-bright); }
.dashboard-filter-clear { min-height: 44px; }

.section-heading, .panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.section-heading { margin-bottom: 16px; }
.section-heading > div, .panel-heading > div { display: grid; gap: 5px; }

.section-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.sales-period-slot {
    display: flex;
    align-items: center;
}

.ghost-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.045);
    box-shadow: inset 0 0 0 1px var(--glass-line);
    color: var(--text-dim);
}
.ghost-button:hover { color: var(--text); }
.ghost-button svg { width: 16px; height: 16px; color: var(--blue-bright); }

.filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 0.8fr)) repeat(2, minmax(150px, 1fr)) minmax(150px, 0.95fr);
    gap: 12px;
    align-items: end;
}

label { display: grid; gap: 7px; }

.filters label span, .export-grid label span, .access-form label span, .config-grid label > span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.filters label > span, .config-grid label > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.filters label > span svg, .config-grid label > span svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    color: var(--blue-bright);
}

.field-with-icon {
    position: relative;
}

.field-with-icon svg {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 17px;
    height: 17px;
    transform: translateY(-50%);
    color: var(--blue-bright);
    pointer-events: none;
}

.field-with-icon input {
    padding-left: 42px;
}

input, select, textarea {
    width: 100%;
    border: 0;
    border-radius: var(--radius-sm);
    background: rgba(8, 13, 26, 0.7);
    box-shadow: inset 0 0 0 1px var(--glass-line);
    color: var(--text);
    padding: 0 13px;
    transition: box-shadow 0.15s ease;
}

input, select { height: 44px; }

textarea {
    min-height: 96px;
    resize: vertical;
    line-height: 1.5;
    padding-top: 11px;
    padding-bottom: 11px;
}

input::placeholder, textarea::placeholder { color: var(--faint); }

input:focus, select:focus, textarea:focus {
    outline: none;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.9), 0 0 0 4px rgba(59, 130, 246, 0.18);
}

/* ===================== metric grid ===================== */

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.metric-card {
    position: relative;
    overflow: hidden;
    min-height: 132px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.metric-card::before {
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    content: "";
    background: var(--holo);
    opacity: 0.9;
}

.metric-card::after {
    position: absolute;
    top: -50%;
    right: -28%;
    width: 200px;
    height: 200px;
    content: "";
    border-radius: 999px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2), transparent 70%);
    filter: blur(8px);
    pointer-events: none;
}

.metric-card[data-tone="cyan"]::after { background: radial-gradient(circle, rgba(56, 189, 248, 0.2), transparent 70%); }
.metric-card[data-tone="amber"]::after { background: radial-gradient(circle, rgba(79, 107, 255, 0.22), transparent 70%); }
.metric-card[data-tone="violet"]::after { background: radial-gradient(circle, rgba(34, 211, 238, 0.18), transparent 70%); }
.metric-card[data-tone="mint"]::after { background: radial-gradient(circle, rgba(94, 234, 212, 0.2), transparent 70%); }
.metric-card[data-tone="mint"]::before { background: linear-gradient(90deg, var(--mint), var(--cyan)); }

.metric-card > span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.metric-card strong {
    display: block;
    margin-top: auto;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 1.85rem;
    font-weight: 600;
    line-height: 1.05;
}

.metric-card small { display: block; margin-top: 6px; color: var(--faint); font-size: 0.76rem; }

/* ===================== analytics grid ===================== */

.analytics-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(290px, 0.82fr);
    gap: 16px;
}

.panel { min-width: 0; padding: 20px; }

.panel-heading { margin-bottom: 18px; }
.panel-heading span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-align: right;
}

.trend-panel { min-height: 320px; }

/* daily chart -> columns */
.trend-panel .bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 232px;
    padding-top: 10px;
}

.trend-panel .bar-row {
    display: flex;
    flex: 1 1 0;
    flex-direction: column-reverse;
    align-items: center;
    gap: 10px;
    height: 100%;
    min-width: 0;
}

.trend-panel .bar-label {
    flex: 0 0 auto;
    max-width: 100%;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trend-panel .bar-track {
    display: flex;
    flex: 1;
    width: 100%;
    align-items: flex-end;
    justify-content: center;
    height: auto;
    background: transparent;
    box-shadow: none;
}

.trend-panel .bar-fill {
    width: 100%;
    max-width: 38px;
    min-height: 4px;
    border-radius: 8px 8px 4px 4px;
    background: linear-gradient(180deg, var(--sky), var(--blue) 55%, var(--blue-deep));
    box-shadow: 0 0 24px -4px rgba(59, 130, 246, 0.8);
    transition: filter 0.15s ease;
}

.trend-panel .bar-row:hover .bar-fill { filter: brightness(1.18); }
.trend-panel .bar-value { display: none; }

/* horizontal bars (offer / platform) */
.bar-chart { display: grid; gap: 13px; }

.bar-row {
    display: grid;
    grid-template-columns: minmax(96px, 130px) 1fr minmax(76px, auto);
    align-items: center;
    gap: 12px;
}

.bar-label, .bar-value { min-width: 0; font-size: 0.84rem; }
.bar-label { overflow: hidden; color: var(--text-dim); text-overflow: ellipsis; white-space: nowrap; }
.bar-value {
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}

.bar-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 0 1px var(--glass-line);
}

.bar-fill {
    height: 100%;
    min-width: 4px;
    border-radius: inherit;
    background: var(--holo);
    box-shadow: 0 0 18px -3px rgba(59, 130, 246, 0.8);
}

.bar-row:nth-child(2n) .bar-fill { background: linear-gradient(90deg, var(--sky), var(--cyan)); }
.bar-row:nth-child(3n) .bar-fill { background: linear-gradient(90deg, var(--indigo), var(--blue-bright)); }
.bar-row:nth-child(4n) .bar-fill { background: linear-gradient(90deg, var(--cyan), var(--mint)); }

.compact .bar-row { grid-template-columns: minmax(96px, 1fr) 1.1fr minmax(56px, auto); }

/* offer + platform panels span half each, below the trend+insight row */
.analytics-grid > .panel:nth-child(3),
.analytics-grid > .panel:nth-child(4) { grid-column: span 1; }

/* insight panel */
.insight-list { display: grid; gap: 11px; }

.insight-list div {
    display: grid;
    gap: 5px;
    min-width: 0;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.035);
    box-shadow: inset 0 0 0 1px var(--glass-line);
    padding: 13px 14px;
}

.insight-list span { color: var(--muted); font-size: 0.74rem; font-weight: 600; }
.insight-list strong {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 1.02rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===================== export panel ===================== */

.export-panel { padding: 18px 20px; }
.export-count { color: var(--muted); font-size: 0.8rem; font-weight: 600; }

.export-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(140px, auto) minmax(140px, auto) minmax(160px, auto);
    gap: 12px;
    align-items: end;
}

.export-custom { display: none; }
.export-custom.is-visible { display: grid; }

.secondary-button, .button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: var(--radius-sm);
    background: var(--holo);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    padding: 0 18px;
    box-shadow: 0 10px 30px -12px rgba(59, 130, 246, 0.85);
}

.secondary-button svg { width: 17px; height: 17px; }
.secondary-button:disabled { cursor: wait; filter: saturate(0.55); opacity: 0.72; }

/* ===================== table ===================== */

.table-wrap { width: 100%; overflow-x: auto; }

table { width: 100%; min-width: 880px; border-collapse: collapse; }

th, td { padding: 13px 9px; text-align: left; vertical-align: middle; }

th {
    border-bottom: 1px solid var(--glass-line);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.045);
    color: var(--text-dim);
    font-size: 0.9rem;
}

tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: rgba(59, 130, 246, 0.08); }

.number-cell {
    color: var(--sky);
    font-family: var(--font-display);
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}

.cell-user { display: flex; align-items: center; gap: 11px; }
.avatar-sm {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 10px;
    background: var(--holo-soft);
    box-shadow: inset 0 0 0 1px var(--glass-line-strong);
    color: var(--blue-bright);
    font-family: var(--font-display);
    font-size: 0.74rem;
    font-weight: 600;
}
.cell-user span { overflow: hidden; color: var(--text); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 999px;
    background: rgba(120, 170, 255, 0.1);
    box-shadow: inset 0 0 0 1px var(--glass-line);
    padding: 5px 11px 5px 9px;
    font-size: 0.8rem;
    font-weight: 600;
}
.chip i { width: 7px; height: 7px; border-radius: 999px; background: var(--blue-bright); }

.empty-state { padding: 26px 10px; color: var(--muted); text-align: center; }

/* ===================== access / login ===================== */

.access-body { display: grid; place-items: center; }

.access-shell {
    display: grid;
    width: 100%;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.access-panel {
    position: relative;
    width: min(440px, 100%);
    overflow: hidden;
    padding: 34px;
}

.access-panel::after {
    position: absolute;
    top: -120px;
    right: -120px;
    width: 280px;
    height: 280px;
    content: "";
    border-radius: 999px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.28), transparent 68%);
    filter: blur(10px);
    pointer-events: none;
}

.access-brand { margin-bottom: 26px; }
.access-panel h1 { margin-top: 14px; font-size: 1.7rem; }
.access-copy { margin-top: 12px; color: var(--muted); line-height: 1.55; }

.login-error {
    margin-top: 16px;
    border-radius: var(--radius-sm);
    background: rgba(255, 93, 93, 0.1);
    box-shadow: inset 0 0 0 1px rgba(255, 93, 93, 0.28);
    color: #ffb8b8;
    font-size: 0.9rem;
    padding: 11px 14px;
}

.access-form { display: grid; gap: 14px; margin-top: 26px; position: relative; z-index: 2; }

.access-form button {
    margin-top: 6px;
    background: var(--holo);
    color: #fff;
    box-shadow: 0 12px 34px -12px rgba(59, 130, 246, 0.9);
}

/* ===================== responsive ===================== */

@media (max-width: 1120px) {
    .dashboard-app { grid-template-columns: minmax(0, 1fr); }

    .sidebar {
        position: static;
        min-width: 0;
        height: auto;
        flex-direction: row;
        align-items: center;
        gap: 16px;
        padding: 14px 18px;
    }

    .side-nav { display: flex; min-width: 0; max-width: 100%; flex: 1; gap: 8px; overflow-x: auto; }
    .side-nav a { min-width: 180px; }
    .sidebar-status { margin-top: 0; }

    .filters, .analytics-grid, .export-grid { grid-template-columns: 1fr 1fr; }
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .search-field, .trend-panel { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
    .topbar { flex-wrap: wrap; }
    .spotlight { flex-direction: column-reverse; align-items: flex-start; }
    .orb-wrap { width: 140px; height: 140px; }
    .orb { width: 110px; height: 110px; }
}

@media (max-width: 720px) {
    h1 { font-size: 1.6rem; }
    .spotlight-value { font-size: 2.4rem; }

    .dashboard-shell { min-width: 0; width: min(100% - 24px, 1340px); padding-top: 20px; }

    .section-heading, .panel-heading, .sidebar {
        align-items: stretch;
        flex-direction: column;
    }

    .filters, .metric-grid, .analytics-grid, .export-grid { grid-template-columns: 1fr; }
    .sidebar { width: 100%; overflow: visible; }
    .sidebar-status { display: none; }
    .side-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        overflow: visible;
    }
    .side-nav a { min-width: 0; }

    .trend-panel .bar-chart { gap: 5px; }
    .bar-row, .compact .bar-row { grid-template-columns: minmax(90px, 1fr) minmax(80px, 1fr); }
    .bar-track { grid-column: 1 / -1; grid-row: 2; }
    .trend-panel .bar-row { grid-template-columns: none; }
}

/* ===================== view switching (tabs) ===================== */

.view { display: none; flex-direction: column; gap: 18px; }
.view.is-active { display: flex; }

/* ===================== range bar (date presets) ===================== */

.range-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow), inset 0 0 0 1px var(--glass-line);
    backdrop-filter: blur(22px);
}

.range-bar.is-hidden { display: none; }

.range-presets { display: flex; flex-wrap: wrap; gap: 8px; }

.range-pill {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.045);
    box-shadow: inset 0 0 0 1px var(--glass-line);
    color: var(--text-dim);
    font-size: 0.84rem;
    font-weight: 600;
}

.range-pill:hover { color: var(--text); }

.range-pill.active {
    background: var(--holo-soft);
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--glass-line-strong);
}

.range-custom { display: none; gap: 10px; margin-left: auto; }
.range-custom.is-visible { display: flex; flex-wrap: wrap; }
.range-custom label { gap: 5px; }
.range-custom input { height: 40px; max-width: 168px; }

/* ===================== eye toggle (hide values) ===================== */

.icon-btn .eye-off { display: none; }
.icon-btn[aria-pressed="false"] .eye-on { display: none; }
.icon-btn[aria-pressed="false"] .eye-off { display: block; }
.icon-btn[aria-pressed="false"] { color: var(--sky); box-shadow: inset 0 0 0 1px var(--glass-line-strong); }

.is-masked { letter-spacing: 0.08em; color: var(--muted); }

/* ===================== combo chart (faturamento x receita) ===================== */

.chart-legend { display: flex; gap: 16px; }
.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-dim);
    font-size: 0.78rem;
    font-weight: 600;
}
.chart-legend i { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 11px; }

.combo-chart {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 232px;
    padding-top: 10px;
}

.combo-col {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 0;
    height: 100%;
}

.combo-bars {
    display: flex;
    flex: 1;
    width: 100%;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
}

.combo-bar {
    width: 100%;
    max-width: 16px;
    min-height: 4px;
    border-radius: 6px 6px 3px 3px;
    transition: filter 0.15s ease;
}

.combo-bar.gross {
    background: linear-gradient(180deg, var(--sky), var(--blue) 55%, var(--blue-deep));
    box-shadow: 0 0 20px -6px rgba(59, 130, 246, 0.75);
}

.combo-bar.net {
    background: linear-gradient(180deg, var(--mint), var(--cyan) 60%, #0e7490);
    box-shadow: 0 0 18px -7px rgba(94, 234, 212, 0.7);
}

.combo-col:hover .combo-bar { filter: brightness(1.16); }

.combo-label {
    flex: 0 0 auto;
    max-width: 100%;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===================== toolbar + date range picker ===================== */

.toolbar { display: flex; align-items: center; gap: 12px; }
.toolbar.is-hidden { display: none; }

.date-filter { position: relative; }

.date-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 14px 0 16px;
    border-radius: 13px;
    background: rgba(10, 16, 30, 0.7);
    box-shadow: inset 0 0 0 1px var(--glass-line);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
}
.date-trigger > svg { width: 18px; height: 18px; color: var(--blue-bright); }
.date-trigger .chev { width: 15px; height: 15px; color: var(--muted); margin-left: 2px; transition: transform 0.18s ease; }
.date-trigger:hover { color: var(--text); filter: none; box-shadow: inset 0 0 0 1px var(--glass-line-strong); }
.date-filter.is-open .date-trigger { box-shadow: inset 0 0 0 1px var(--glass-line-strong); }
.date-filter.is-open .chev { transform: rotate(180deg); }

.date-pop {
    position: absolute;
    top: 54px;
    left: 0;
    z-index: 60;
    border-radius: 18px;
    background: rgba(13, 20, 38, 0.97);
    box-shadow: var(--shadow), inset 0 0 0 1px var(--glass-line-strong);
    backdrop-filter: blur(22px);
    padding: 14px;
}
.date-pop[hidden] { display: none; }

.section-actions .date-pop {
    right: 0;
    left: auto;
}

.date-pop-inner { display: flex; gap: 14px; }

.preset-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 172px;
    border-right: 1px solid var(--glass-line);
    padding-right: 14px;
}
.preset-col button {
    justify-content: flex-start;
    min-height: 40px;
    border-radius: 11px;
    background: transparent;
    color: var(--text-dim);
    font-size: 0.86rem;
    font-weight: 600;
    text-align: left;
    padding: 0 12px;
}
.preset-col button:hover { background: rgba(120, 170, 255, 0.1); color: var(--text); filter: none; }
.preset-col button.active {
    background: var(--holo-soft);
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--glass-line-strong);
}

.cal-col { width: 286px; display: flex; flex-direction: column; gap: 10px; }

.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head strong {
    font-family: var(--font-display);
    font-size: 0.94rem;
    font-weight: 600;
    text-transform: capitalize;
}
.cal-nav {
    display: grid;
    width: 34px;
    height: 34px;
    min-height: 34px;
    place-items: center;
    padding: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.045);
    box-shadow: inset 0 0 0 1px var(--glass-line);
    color: var(--text-dim);
}
.cal-nav:hover { color: var(--text); filter: none; }
.cal-nav svg { width: 16px; height: 16px; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-dow {
    display: grid;
    place-items: center;
    height: 30px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.cal-cell {
    height: 36px;
    min-height: 0;
    padding: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-dim);
    font-size: 0.84rem;
    font-weight: 600;
}
.cal-cell.empty { background: transparent; box-shadow: none; cursor: default; }
.cal-cell:not(.empty):hover { background: rgba(120, 170, 255, 0.14); color: var(--text); filter: none; }
.cal-cell.in-range { border-radius: 0; background: rgba(59, 130, 246, 0.18); color: var(--text); }
.cal-cell.is-start, .cal-cell.is-end, .cal-cell.is-single {
    background: var(--holo);
    color: #fff;
    box-shadow: 0 0 16px -4px rgba(59, 130, 246, 0.85);
}
.cal-cell.is-start { border-radius: 9px 0 0 9px; }
.cal-cell.is-end { border-radius: 0 9px 9px 0; }
.cal-cell.is-single { border-radius: 9px; }
.cal-cell.is-today:not(.is-start):not(.is-end):not(.is-single) { box-shadow: inset 0 0 0 1px var(--glass-line-strong); }

.cal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid var(--glass-line);
    padding-top: 10px;
}
.cal-foot span { color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.cal-apply { min-height: 38px; padding: 0 18px; border-radius: 11px; background: var(--holo); color: #fff; font-size: 0.84rem; }

/* sales table head: summary stats (left) + csv export (right), one line */
.table-head-actions {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}
.sales-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
    margin-right: auto;
}
.sales-stat {
    display: grid;
    gap: 2px;
    align-content: center;
    min-height: 44px;
    padding: 5px 13px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 0 0 1px var(--glass-line);
}
.sales-stat small {
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.sales-stat strong {
    color: var(--text);
    font-family: var(--font-display);
    font-size: 0.96rem;
    font-weight: 600;
    white-space: nowrap;
}
.sales-stat.is-gross { background: rgba(120, 170, 255, 0.08); }
.sales-stat.is-gross strong { color: var(--blue-bright); }
.sales-stat.is-net { background: rgba(94, 234, 212, 0.08); box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.18); }
.sales-stat.is-net strong { color: var(--mint); }
.export-mini {
    display: inline-flex;
    align-items: center;
    align-self: stretch;
    gap: 6px;
    min-height: 44px;
    padding: 5px 13px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.045);
    box-shadow: inset 0 0 0 1px var(--glass-line);
    color: var(--text-dim);
    font-size: 0.76rem;
    font-weight: 600;
}
.export-mini:hover { color: var(--text); filter: none; }
.export-mini svg { width: 14px; height: 14px; }

@media (max-width: 600px) {
    .table-head-actions { width: 100%; flex-wrap: wrap; }
    .sales-summary { width: 100%; }
    .date-pop-inner { flex-direction: column; }
    .preset-col {
        width: auto;
        border-right: 0;
        border-bottom: 1px solid var(--glass-line);
        padding-right: 0;
        padding-bottom: 10px;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .preset-col button { min-height: 36px; }
    .cal-col { width: min(86vw, 286px); }
}

/* ===================== sales filters / config ===================== */

.filters-sales { grid-template-columns: minmax(140px, 0.82fr) minmax(180px, 1.35fr) repeat(4, minmax(110px, 1fr)); }
.sales-search-field { min-width: 0; }
/* limpar ancorado no canto superior direito do painel (desktop/tablet) */
#clearFilters { position: absolute; top: 16px; right: 18px; }

/* período field embedded in the sales filter grid */
.period-field { min-width: 0; }
.period-field .sales-period-slot,
.period-field .date-filter { width: 100%; }
.period-field .date-trigger {
    width: 100%;
    min-height: 44px;
    justify-content: flex-start;
    padding: 0 13px;
}
.period-field .date-trigger .chev { margin-left: auto; }
.period-field .date-trigger #dateLabel {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.panel-heading-hint { color: var(--muted); font-size: 0.78rem; font-weight: 500; text-align: right; max-width: 260px; }

.config-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
}
.config-fields { display: grid; gap: 10px; }

.setting-row {
    display: flex;
    align-items: center;
    gap: 14px;
    border-radius: var(--radius-sm);
    background: rgba(120, 170, 255, 0.05);
    box-shadow: inset 0 0 0 1px var(--glass-line);
    padding: 13px 15px;
}
.setting-row-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 12px;
    background: var(--holo-soft);
    box-shadow: inset 0 0 0 1px var(--glass-line-strong);
    color: var(--blue-bright);
}
.setting-row-icon svg { width: 19px; height: 19px; }
.setting-row-copy { display: grid; gap: 3px; min-width: 0; flex: 1; }
.setting-row-copy strong { color: var(--text); font-size: 0.92rem; font-weight: 600; }
.setting-row-copy span { color: var(--muted); font-size: 0.78rem; line-height: 1.45; }
.setting-row-control { flex: 0 0 150px; width: 150px; }
.setting-row-readonly { color: var(--text-dim); }

.receita-sim {
    display: grid;
    gap: 12px;
    border-radius: var(--radius-sm);
    background:
        radial-gradient(260px 180px at 100% 0%, rgba(56, 189, 248, 0.12), transparent 70%),
        rgba(8, 13, 26, 0.55);
    box-shadow: inset 0 0 0 1px var(--glass-line-strong);
    padding: 18px;
}
.receita-sim h3 { color: var(--text); font-size: 1.05rem; font-weight: 600; }
.receita-sim h3 strong { color: var(--sky); font-weight: 600; }
.sim-list { display: grid; gap: 2px; margin: 2px 0 0; padding: 0; list-style: none; }
.sim-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.sim-list li span { color: var(--text-dim); font-size: 0.85rem; }
.sim-list li span i { color: var(--muted); font-style: normal; }
.sim-list li b {
    font-family: var(--font-display);
    font-variant-numeric: tabular-nums;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
}
.sim-list li b.is-minus { color: #ff9d9d; }
.sim-total { border-bottom: 0 !important; margin-top: 2px; }
.sim-total span { color: var(--text) !important; font-weight: 600; }
.sim-total b { color: var(--mint) !important; font-size: 1.05rem !important; }
.sim-margin {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-radius: 12px;
    background: rgba(94, 234, 212, 0.08);
    box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.2);
    padding: 11px 14px;
}
.sim-margin span { color: var(--text-dim); font-size: 0.82rem; font-weight: 600; }
.sim-margin strong { color: var(--mint); font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: 1.1rem; font-weight: 600; }
.sim-foot { color: var(--muted); font-size: 0.76rem; line-height: 1.5; }
.sim-foot strong { color: var(--text-dim); }

@media (max-width: 900px) {
    .config-split { grid-template-columns: 1fr; }
    .panel-heading-hint { text-align: left; max-width: none; }
}

@media (max-width: 560px) {
    .setting-row { flex-wrap: wrap; }
    .setting-row-icon { width: 38px; height: 38px; flex-basis: 38px; }
    .setting-row-control { flex-basis: 100%; width: 100%; }
}

.percent-input {
    position: relative;
}

.percent-input input {
    padding-right: 42px;
}

.percent-input span {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    color: var(--sky);
    font-size: 0.9rem;
    font-weight: 800;
    pointer-events: none;
}

.config-note {
    margin-top: 18px;
    border-radius: var(--radius-sm);
    background: rgba(120, 170, 255, 0.06);
    box-shadow: inset 0 0 0 1px var(--glass-line);
    color: var(--text-dim);
    font-size: 0.88rem;
    line-height: 1.6;
    padding: 14px 16px;
}

.config-note strong { color: var(--text); }

.settings-save-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    background: rgba(94, 234, 212, 0.08);
    box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.18);
    color: var(--mint);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 0 10px;
    text-transform: uppercase;
}

.settings-save-status[data-state="saving"],
.settings-save-status[data-state="pending"] {
    background: rgba(56, 189, 248, 0.08);
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.22);
    color: var(--sky);
}

.settings-save-status[data-state="error"] {
    background: rgba(255, 93, 93, 0.1);
    box-shadow: inset 0 0 0 1px rgba(255, 93, 93, 0.28);
    color: #ffb8b8;
}

.config-actions {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.config-actions form { margin: 0; }

.config-action-link { min-width: 190px; }

/* ===================== products ===================== */

.product-toolbar .secondary-button,
.product-form-actions .secondary-button {
    gap: 8px;
    border: 0;
}

.product-toolbar-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.product-search { width: min(520px, 100%); }
.product-search > span,
.product-fields label > span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 600;
}

.product-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.product-summary span {
    border-radius: 999px;
    background: rgba(120, 170, 255, 0.08);
    box-shadow: inset 0 0 0 1px var(--glass-line);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 8px 12px;
}

.product-summary strong { color: var(--sky); }

.product-help {
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.55;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
}

.product-grid .product-empty { grid-column: 1 / -1; color: var(--muted); text-align: center; padding: 18px; }

.catalog-meta { margin: 2px 2px 10px; text-align: right; }
.catalog-meta .catalog-counts { background: none; box-shadow: none; padding: 0; }

.product-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 14px;
}

.product-card.is-unmapped { box-shadow: var(--shadow), inset 0 0 0 1px rgba(56, 189, 248, 0.18); }

.product-card-thumb {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 11px;
    background: rgba(120, 170, 255, 0.06);
    box-shadow: inset 0 0 0 1px var(--glass-line);
}
.product-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card-thumb img[src*="balyon-logo"] { object-fit: contain; padding: 9px; opacity: 0.8; }

.product-card-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 0.98rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-edit { flex: 0 0 auto; min-height: 38px; padding: 0 13px; font-size: 0.8rem; }

.product-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    overflow-y: auto;
    align-items: flex-start;
    justify-content: center;
    padding: 24px;
}

.product-modal[hidden] { display: none; }

.product-modal-backdrop {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 0;
    background: rgba(2, 6, 16, 0.78);
    backdrop-filter: blur(9px);
    cursor: default;
    padding: 0;
}

.product-dialog {
    position: relative;
    z-index: 1;
    width: min(900px, 100%);
    border-radius: 22px;
    background: rgba(13, 20, 38, 0.98);
    box-shadow: 0 34px 90px -24px rgba(0, 0, 0, 0.95), inset 0 0 0 1px var(--glass-line-strong);
    margin: auto 0;
    padding: 20px;
}

.product-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.product-dialog-title,
.plan-editor-title,
.plan-editor-label {
    display: flex;
    align-items: center;
    gap: 10px;
}
.product-dialog-title > div,
.plan-editor-title > div { display: grid; gap: 4px; }

.dialog-icon,
.plan-row-icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border-radius: 12px;
    background: var(--holo-soft);
    box-shadow: inset 0 0 0 1px var(--glass-line-strong);
    color: var(--blue-bright);
}
.dialog-icon svg { width: 19px; height: 19px; }
.dialog-icon-small { width: 34px; height: 34px; flex-basis: 34px; border-radius: 10px; }
.dialog-icon-small svg { width: 16px; height: 16px; }

.product-dialog-close {
    display: grid;
    width: 40px;
    height: 40px;
    min-height: 40px;
    place-items: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.045);
    box-shadow: inset 0 0 0 1px var(--glass-line);
    color: var(--muted);
    padding: 0;
}

.product-dialog-close svg { width: 18px; height: 18px; }

.product-form-layout {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 18px;
}

.product-image-editor { display: flex; flex-direction: column; gap: 10px; }

.product-image-preview {
    display: grid;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.25), rgba(8, 13, 26, 0.9));
    box-shadow: inset 0 0 0 1px var(--glass-line);
}

.product-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.product-image-preview img[src*="balyon-logo"] { object-fit: contain; padding: 26px; }

.image-upload-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.045);
    box-shadow: inset 0 0 0 1px var(--glass-line);
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
}

.image-upload-button:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--glass-line-strong); }
.image-upload-button svg { width: 16px; height: 16px; color: var(--blue-bright); }
#productImage { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.product-image-editor small,
.product-fields small { color: var(--faint); font-size: 0.7rem; line-height: 1.45; }

.product-fields { display: grid; align-content: start; gap: 12px; }
.product-fields label { gap: 7px; }
.product-fields textarea { min-height: 64px; }

.plan-editor-section {
    margin-top: 18px;
    border-top: 1px solid var(--glass-line);
    padding-top: 15px;
}

.plan-editor-heading,
.plan-editor-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.plan-editor-heading .ghost-button { min-height: 40px; font-size: 0.8rem; }
.plan-editor-list { display: grid; gap: 10px; margin-top: 12px; }

.plan-editor-row {
    border-radius: 14px;
    background: rgba(120, 170, 255, 0.045);
    box-shadow: inset 0 0 0 1px var(--glass-line);
    padding: 12px;
}

.plan-editor-row-head { margin-bottom: 10px; }
.plan-editor-number { color: var(--text); font-family: var(--font-display); font-size: 0.9rem; }
.plan-row-icon { width: 28px; height: 28px; flex-basis: 28px; border-radius: 8px; }
.plan-row-icon svg { width: 14px; height: 14px; }
.plan-remove {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 0.72rem;
    padding: 0 8px;
}
.plan-remove:hover { background: rgba(255, 93, 93, 0.08); color: #ffb8b8; }
.plan-remove svg { width: 14px; height: 14px; }

.plan-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px minmax(0, 1fr);
    gap: 10px 12px;
    align-items: start;
}
.plan-field-name { grid-column: 1; grid-row: 1; }
.plan-field-price { grid-column: 2; grid-row: 1; }
.plan-field-platform { grid-column: 3; grid-row: 1; }
.plan-field-webhook { grid-column: 1 / -1; grid-row: 2; }

.plan-editor-grid label { gap: 7px; }
.plan-editor-grid label > span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 600;
}
.plan-editor-grid textarea { min-height: 58px; }
.plan-editor-grid .plan-field-webhook small { margin-top: 1px; color: var(--faint); font-size: 0.68rem; }
.plan-price-input { position: relative; }
.plan-price-input > span {
    position: absolute;
    top: 50%;
    left: 13px;
    z-index: 1;
    transform: translateY(-50%);
    color: var(--sky);
    font-size: 0.78rem;
    font-weight: 800;
    pointer-events: none;
}
.plan-price-input input { padding-left: 38px; }
.plan-editor-empty {
    border-radius: 13px;
    background: rgba(120, 170, 255, 0.035);
    color: var(--muted);
    font-size: 0.82rem;
    text-align: center;
    padding: 18px;
}

.product-form-error {
    margin-top: 16px;
    border-radius: 12px;
    background: rgba(255, 93, 93, 0.1);
    box-shadow: inset 0 0 0 1px rgba(255, 93, 93, 0.28);
    color: #ffb8b8;
    font-size: 0.84rem;
    padding: 11px 13px;
}

.product-form-error[hidden] { display: none; }

.product-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
    border-top: 1px solid var(--glass-line);
    padding-top: 15px;
}

.form-primary-actions { display: flex; justify-content: flex-end; gap: 10px; margin-left: auto; }
.danger-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--radius-sm);
    background: rgba(255, 93, 93, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 93, 93, 0.22);
    color: #ffb8b8;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0 14px;
}
.danger-button:hover { background: rgba(255, 93, 93, 0.14); color: #ffe0e0; }
.danger-button[hidden] { display: none; }
.danger-button:disabled { cursor: wait; opacity: 0.58; }
.danger-button svg { width: 16px; height: 16px; }
.danger-button-solid { background: linear-gradient(135deg, #ef4444, #be123c); box-shadow: 0 10px 28px -12px rgba(239, 68, 68, 0.9); color: #fff; }
.danger-button-solid:hover { color: #fff; filter: brightness(1.08); }

.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 160;
    display: grid;
    place-items: center;
    padding: 20px;
}
.confirm-modal[hidden] { display: none; }
.confirm-modal-backdrop {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 0;
    background: rgba(2, 6, 16, 0.78);
    backdrop-filter: blur(8px);
    cursor: default;
    padding: 0;
}
.confirm-dialog {
    position: relative;
    z-index: 1;
    width: min(420px, 100%);
    border-radius: 20px;
    background: rgba(13, 20, 38, 0.99);
    box-shadow: 0 34px 90px -24px rgba(0, 0, 0, 0.95), inset 0 0 0 1px var(--glass-line-strong);
    text-align: center;
    padding: 24px;
}
.confirm-icon {
    display: grid;
    width: 48px;
    height: 48px;
    margin: 0 auto 14px;
    place-items: center;
    border-radius: 14px;
    background: rgba(255, 93, 93, 0.1);
    box-shadow: inset 0 0 0 1px rgba(255, 93, 93, 0.24);
    color: #ff9d9d;
}
.confirm-icon svg { width: 21px; height: 21px; }
.confirm-dialog h2 { font-size: 1.2rem; }
.confirm-dialog p { margin-top: 9px; color: var(--muted); font-size: 0.87rem; line-height: 1.55; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.confirm-actions button { width: 100%; }

.product-modal-open { overflow: hidden; }

/* sales: tap-to-open detail sheet (mobile) */
.td-sub { display: none; }

.sale-sheet-dialog {
    position: relative;
    width: min(460px, 100%);
    text-align: left;
    padding: 22px 20px 20px;
}
.sale-sheet-grip { display: none; }
.sale-sheet-x { position: absolute; top: 13px; right: 13px; }
.sale-sheet-head { display: flex; align-items: center; gap: 13px; padding-right: 34px; }
.sale-sheet-avatar { width: 46px; height: 46px; flex: 0 0 46px; font-size: 0.9rem; }
.sale-sheet-id { display: grid; gap: 2px; min-width: 0; }
.sale-sheet-id strong { display: block; overflow: hidden; color: var(--text); font-size: 1.06rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.sale-sheet-id span { color: var(--muted); font-size: 0.82rem; font-variant-numeric: tabular-nums; }

.sale-sheet-amounts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.sale-amount {
    display: grid;
    gap: 4px;
    border-radius: var(--radius-sm);
    background: rgba(120, 170, 255, 0.06);
    box-shadow: inset 0 0 0 1px var(--glass-line);
    padding: 13px 14px;
}
.sale-amount span { color: var(--muted); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.sale-amount b { color: var(--sky); font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: 1.18rem; font-weight: 600; }
.sale-amount.is-net { background: rgba(94, 234, 212, 0.08); box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.2); }
.sale-amount.is-net b { color: var(--mint); }

.sale-sheet-rows { display: grid; margin: 16px 0 0; }
.sale-sheet-rows > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.sale-sheet-rows > div:last-child { border-bottom: 0; }
.sale-sheet-rows dt { color: var(--muted); font-size: 0.84rem; }
.sale-sheet-rows dd { margin: 0; color: var(--text); font-size: 0.9rem; font-weight: 600; text-align: right; }
.sale-sheet-close-btn { width: 100%; margin-top: 16px; justify-content: center; }

@media (max-width: 720px) {
    .sale-sheet { align-items: flex-end; padding: 0; }
    .sale-sheet-dialog {
        width: 100%;
        border-radius: 24px 24px 0 0;
        padding: 14px 18px calc(20px + env(safe-area-inset-bottom));
        animation: mobileSheetUp 0.22s ease;
    }
    .sale-sheet-grip { display: block; width: 40px; height: 4px; margin: 0 auto 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); }
    .sale-sheet-x { display: none; }
}

.spotlight-net {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    color: var(--mint);
    font-size: 0.92rem;
    font-weight: 600;
}
.spotlight-net span { color: var(--muted); font-weight: 600; }

@media (max-width: 1120px) {
    .filters-sales { grid-template-columns: 1fr 1fr; }
    .dashboard-filter-panel { align-items: stretch; flex-direction: column; }
    .dashboard-filter-fields { width: 100%; }
    .sales-search-field { grid-column: 1 / -1; }
    .range-custom { margin-left: 0; }
}

@media (max-width: 720px) {
    .filters-sales, .config-grid { grid-template-columns: 1fr; }
    .section-actions {
        justify-content: flex-start;
        width: 100%;
    }
    .sales-period-slot,
    .sales-period-slot .date-filter,
    .sales-period-slot .date-trigger {
        width: 100%;
    }
    .sales-period-slot .date-trigger { justify-content: space-between; }
    .section-actions .ghost-button { width: 100%; }
    .section-actions .date-pop {
        right: auto;
        left: 0;
    }
    .product-toolbar-row { align-items: stretch; flex-direction: column; }
    .product-summary { justify-content: flex-start; }
    .product-form-layout { grid-template-columns: 1fr; }
    .plan-editor-heading { align-items: stretch; flex-direction: column; }
    .plan-editor-heading .ghost-button { width: 100%; }
    .plan-editor-grid { grid-template-columns: 1fr; }
    .plan-field-name,
    .plan-field-webhook,
    .plan-field-platform,
    .plan-field-price { grid-column: auto; grid-row: auto; }
    .product-image-editor { width: min(260px, 100%); margin: 0 auto; }
    .product-dialog { padding: 18px; }
    .product-modal { align-items: start; padding: 12px; }
    .dashboard-filter-fields { grid-template-columns: 1fr; }
    .dashboard-filter-clear { width: 100%; }
    .product-form-actions { align-items: stretch; flex-direction: column-reverse; }
    .form-primary-actions { width: 100%; margin-left: 0; }
    .form-primary-actions button { flex: 1; }
    .product-form-actions button { width: 100%; }
    .config-actions,
    .config-actions form,
    .config-actions button,
    .config-action-link { width: 100%; }
}

/* ===================== custom select dropdown ===================== */
.cselect { position: relative; width: 100%; }
.cselect > select {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.cselect-trigger {
    display: flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    gap: 10px;
    padding: 0 13px;
    border-radius: var(--radius-sm);
    background: rgba(8, 13, 26, 0.7);
    box-shadow: inset 0 0 0 1px var(--glass-line);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: left;
}
.cselect-trigger:hover { filter: none; box-shadow: inset 0 0 0 1px var(--glass-line-strong); }
.cselect.is-open .cselect-trigger {
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.9), 0 0 0 4px rgba(59, 130, 246, 0.18);
}
.cselect-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cselect-label.is-placeholder { color: var(--faint); }
.cselect-chev {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    color: var(--muted);
    transition: transform 0.18s ease;
}
.cselect.is-open .cselect-chev { transform: rotate(180deg); }
.cselect-pop {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 60;
    max-height: 286px;
    overflow-y: auto;
    padding: 6px;
    border-radius: 14px;
    background: rgba(13, 20, 38, 0.98);
    box-shadow: var(--shadow), inset 0 0 0 1px var(--glass-line-strong);
    backdrop-filter: blur(22px);
}
.cselect-pop[hidden] { display: none; }
.cselect-option {
    display: flex;
    width: 100%;
    min-height: 40px;
    align-items: center;
    gap: 9px;
    padding: 0 11px;
    border-radius: 10px;
    background: transparent;
    color: var(--text-dim);
    font-size: 0.86rem;
    font-weight: 600;
    text-align: left;
}
.cselect-option > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cselect-option:hover { background: rgba(120, 170, 255, 0.1); color: var(--text); filter: none; }
.cselect-option.is-selected {
    background: var(--holo-soft);
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--glass-line-strong);
}
.cselect-option .check { width: 16px; height: 16px; flex: 0 0 16px; color: var(--sky); opacity: 0; }
.cselect-option.is-selected .check { opacity: 1; }
.cselect-empty { padding: 14px 12px; color: var(--muted); font-size: 0.82rem; text-align: center; }

/* ===================== editable amount field (R$ prefix) ===================== */
.amount-input { position: relative; }
.amount-input > span {
    position: absolute;
    top: 50%;
    left: 13px;
    transform: translateY(-50%);
    color: var(--sky);
    font-size: 0.82rem;
    font-weight: 800;
    pointer-events: none;
}
.amount-input input { padding-left: 40px; }

/* ===================== product card actions (edit + delete) ===================== */
.product-card-actions { display: flex; align-items: center; gap: 8px; }
.icon-trash {
    display: grid;
    width: 38px;
    height: 38px;
    min-height: 38px;
    flex: 0 0 38px;
    place-items: center;
    padding: 0;
    border-radius: 11px;
    background: rgba(255, 93, 93, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 93, 93, 0.2);
    color: #ff9d9d;
}
.icon-trash:hover { background: rgba(255, 93, 93, 0.16); color: #ffd0d0; filter: none; }
.icon-trash svg { width: 16px; height: 16px; }

/* ===================== product catalog header ===================== */
.catalog-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.catalog-title { flex: 0 0 auto; display: grid; gap: 4px; }
.catalog-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.catalog-counts {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 999px;
    background: rgba(120, 170, 255, 0.08);
    box-shadow: inset 0 0 0 1px var(--glass-line);
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 600;
    padding: 5px 11px;
}
.catalog-counts b { color: var(--sky); font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.catalog-counts i { width: 4px; height: 4px; border-radius: 999px; background: var(--faint); }
.catalog-search { flex: 1 1 320px; min-width: 220px; }
.catalog-search .field-with-icon input { height: 48px; }
.catalog-bar .product-add-button {
    flex: 0 0 auto;
    min-height: 48px;
    border-radius: 13px;
    padding: 0 18px;
    white-space: nowrap;
}
.catalog-hint {
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.5;
}
.catalog-hint strong { color: var(--text-dim); }

@media (max-width: 720px) {
    .catalog-bar { gap: 12px 10px; align-items: center; }
    .catalog-title { order: 1; flex: 1 1 auto; width: auto; min-width: 0; }
    .catalog-search { flex-basis: 100%; order: 3; min-width: 0; }
    .catalog-bar .product-add-button {
        order: 2;
        margin-left: auto;
        min-height: 42px;
        padding: 0 16px;
        font-size: 0.84rem;
    }
    .catalog-bar .product-add-button svg { width: 15px; height: 15px; }
    .catalog-hint { margin-top: 6px; }
}

.product-catalog-head {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(0, 470px);
    align-items: center;
    gap: 10px 16px;
    margin-bottom: 0;
}

.product-heading-copy {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.product-heading-desc {
    grid-column: 1 / -1;
    max-width: 760px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.product-catalog-head > .product-heading-actions {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.product-catalog-head > .product-heading-actions .product-search {
    flex: 0 1 280px;
    width: 100%;
    min-width: 210px;
    max-width: 280px;
}

.product-catalog-head > .product-heading-actions .product-search label { margin: 0; }

.product-catalog-head > .product-heading-actions .product-add-button {
    flex: 0 0 auto;
    min-height: 38px;
    border-radius: 11px;
    padding: 0 13px;
    font-size: 0.82rem;
    white-space: nowrap;
}

.product-catalog-head > .product-heading-actions .product-add-button svg {
    width: 15px;
    height: 15px;
}

.product-catalog-head > .product-summary {
    display: flex;
    grid-column: 1 / -1;
    justify-content: flex-end;
}

@media (max-width: 900px) {
    .product-catalog-head {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .product-catalog-head > .product-heading-actions {
        justify-content: flex-start;
    }

    .product-catalog-head > .product-heading-actions .product-search {
        max-width: none;
    }

    .product-catalog-head > .product-summary {
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    .product-catalog-head > .product-heading-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .product-catalog-head > .product-heading-actions .product-search {
        min-width: 0;
    }
}

@media (max-width: 420px) {
    .product-catalog-head > .product-heading-actions {
        grid-template-columns: 1fr;
    }

    .product-catalog-head > .product-heading-actions .product-add-button {
        justify-content: center;
        width: 100%;
    }
}

/* ===================== platform name mapping (config) ===================== */
.platform-map-list { display: grid; gap: 10px; margin-top: 14px; }

.platform-map-row {
    cursor: default;
}

.platform-edit-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.76rem;
}

.platform-edit-button svg {
    width: 14px;
    height: 14px;
}

.platform-map-preview {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
    gap: 10px 12px;
}

.platform-map-preview > div {
    display: grid;
    gap: 4px;
    min-width: 0;
    border-radius: 12px;
    background: rgba(8, 13, 26, 0.38);
    box-shadow: inset 0 0 0 1px var(--glass-line);
    padding: 10px 12px;
}

.platform-map-preview span,
.platform-fields label > span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 600;
}

.platform-map-preview strong {
    overflow: hidden;
    color: var(--text-dim);
    font-size: 0.84rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.platform-dialog {
    width: min(720px, 100%);
}

.platform-fields {
    gap: 14px;
}

.platform-fields textarea {
    min-height: 96px;
}

/* platforms tab: card grid */
.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.platform-grid .platform-empty {
    grid-column: 1 / -1;
    color: var(--muted);
    text-align: center;
}
.platform-card {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    overflow: hidden;
    padding: 0;
}
.platform-card-media {
    display: grid;
    place-items: center;
    padding: 14px;
    background: linear-gradient(150deg, rgba(30, 64, 175, 0.28), rgba(8, 13, 26, 0.9));
    border-right: 1px solid var(--glass-line);
}
.platform-card-media img {
    width: 100%;
    height: 100%;
    max-height: 64px;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));
}
.platform-card-media.is-empty { background: var(--holo-soft); }
.platform-card-initials {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--blue-bright);
    letter-spacing: 0.02em;
}
.platform-card-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    padding: 15px 16px;
}
.platform-card-copy { display: grid; gap: 7px; min-width: 0; }
.platform-card-copy h3 {
    overflow: hidden;
    color: var(--text);
    font-size: 1.06rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.platform-card-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.platform-card-chip {
    max-width: 100%;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(120, 170, 255, 0.1);
    box-shadow: inset 0 0 0 1px var(--glass-line);
    color: var(--text-dim);
    font-size: 0.74rem;
    font-weight: 600;
    padding: 4px 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.platform-card-chip.is-empty { color: var(--faint); background: transparent; }
.platform-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    border-top: 1px solid var(--glass-line);
    padding-top: 12px;
}
.platform-card-foot > span { color: var(--muted); font-size: 0.76rem; font-weight: 600; }

/* platform modal: logo editor */
.platform-form-layout {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 18px;
}
.platform-logo-editor { display: flex; flex-direction: column; gap: 10px; }
.platform-logo-preview {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.25), rgba(8, 13, 26, 0.9));
    box-shadow: inset 0 0 0 1px var(--glass-line);
}
.platform-logo-preview img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.platform-logo-placeholder { width: 38px; height: 38px; color: var(--faint); }
.platform-logo-preview[data-empty="0"] .platform-logo-placeholder { display: none; }
#platformLogo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.platform-logo-remove {
    min-height: 38px;
    border-radius: 11px;
    background: rgba(255, 93, 93, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 93, 93, 0.2);
    color: #ffb8b8;
    font-size: 0.78rem;
    font-weight: 700;
}
.platform-logo-remove[hidden] { display: none; }
.platform-logo-remove:hover { background: rgba(255, 93, 93, 0.14); color: #ffe0e0; }
.platform-logo-editor small { color: var(--faint); font-size: 0.7rem; line-height: 1.45; }

/* settings: account + hosting actions */
.account-actions { display: grid; gap: 12px; }
.account-action {
    display: flex;
    align-items: center;
    gap: 14px;
    border-radius: var(--radius-sm);
    background: rgba(120, 170, 255, 0.05);
    box-shadow: inset 0 0 0 1px var(--glass-line);
    padding: 14px 16px;
}
.account-action-icon {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border-radius: 13px;
    background: var(--holo-soft);
    box-shadow: inset 0 0 0 1px var(--glass-line-strong);
    color: var(--blue-bright);
}
.account-action-icon.is-danger {
    background: rgba(255, 93, 93, 0.1);
    box-shadow: inset 0 0 0 1px rgba(255, 93, 93, 0.22);
    color: #ff9d9d;
}
.account-action-icon svg { width: 20px; height: 20px; }
.account-action-copy { display: grid; gap: 3px; min-width: 0; flex: 1; }
.account-action-copy strong { color: var(--text); font-size: 0.94rem; font-weight: 600; }
.account-action-copy span { color: var(--muted); font-size: 0.8rem; line-height: 1.45; }
.account-action-button { flex: 0 0 auto; margin: 0; }
.account-action-button .ghost-button,
a.account-action-button { white-space: nowrap; }
.account-action-icon.is-live {
    background: rgba(94, 234, 212, 0.1);
    box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.24);
    color: var(--mint);
}
.account-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: rgba(94, 234, 212, 0.08);
    box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.2);
    color: var(--mint);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 8px 14px;
}

/* ===================== settings: profile ===================== */
.profile-head {
    display: flex;
    align-items: center;
    gap: 16px;
    border-radius: var(--radius-sm);
    background: var(--holo-soft);
    box-shadow: inset 0 0 0 1px var(--glass-line-strong);
    padding: 16px;
    margin-bottom: 14px;
}
.profile-avatar {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    border-radius: 18px;
    background: var(--holo);
    box-shadow: var(--glow);
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
}
.profile-head-copy { display: grid; gap: 3px; min-width: 0; }
.profile-head-copy strong { color: var(--text); font-size: 1.04rem; font-weight: 600; }
.profile-head-copy span { color: var(--muted); font-size: 0.82rem; }
.profile-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.profile-fields label > span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
@media (max-width: 560px) { .profile-fields { grid-template-columns: 1fr; } }

/* ===================== settings: toggle switch ===================== */
.switch { position: relative; flex: 0 0 auto; display: inline-flex; cursor: pointer; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch-track {
    position: relative;
    width: 46px;
    height: 27px;
    border-radius: 999px;
    background: rgba(8, 13, 26, 0.85);
    box-shadow: inset 0 0 0 1px var(--glass-line);
    transition: background 0.18s ease, box-shadow 0.18s ease;
}
.switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: var(--text-dim);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
    transition: transform 0.18s ease, background 0.18s ease;
}
.switch input:checked + .switch-track {
    background: var(--holo);
    box-shadow: inset 0 0 0 1px var(--glass-line-strong);
}
.switch input:checked + .switch-track::after { transform: translateX(19px); background: #fff; }
.switch input:focus-visible + .switch-track { box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.9), 0 0 0 4px rgba(59, 130, 246, 0.18); }

/* ===================== settings: segmented (theme) ===================== */
.setting-row-control--auto { flex: 0 0 auto; width: auto; }
.segmented {
    display: inline-flex;
    gap: 4px;
    border-radius: 999px;
    background: rgba(8, 13, 26, 0.7);
    box-shadow: inset 0 0 0 1px var(--glass-line);
    padding: 4px;
}
.segmented label { position: relative; margin: 0; display: inline-flex; }
.segmented input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.segmented span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.segmented span svg { width: 15px; height: 15px; }
.segmented input:checked + span {
    color: var(--text);
    background: var(--holo-soft);
    box-shadow: inset 0 0 0 1px var(--glass-line-strong);
}

/* ===================== settings: webhook endpoint ===================== */
.endpoint-field {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: var(--radius-sm);
    background: rgba(8, 13, 26, 0.7);
    box-shadow: inset 0 0 0 1px var(--glass-line);
    padding: 8px 8px 8px 14px;
}
.endpoint-field code {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-display);
    font-size: 0.82rem;
    letter-spacing: 0.01em;
    color: var(--text-dim);
}
.endpoint-field .ghost-button { flex: 0 0 auto; min-height: 38px; }
@media (max-width: 560px) {
    .endpoint-field { flex-wrap: wrap; }
    .endpoint-field .ghost-button { width: 100%; justify-content: center; }
}

@media (max-width: 720px) {
    .platform-map-preview {
        grid-template-columns: 1fr;
    }
    .platform-grid { grid-template-columns: 1fr; gap: 10px; }
    .platform-card { grid-template-columns: 76px minmax(0, 1fr); border-radius: 16px; }
    .platform-card-media { padding: 10px; }
    .platform-card-media img { max-height: 52px; }
    .platform-card-body { gap: 10px; padding: 12px 13px; }
    .platform-card-copy h3 { font-size: 0.98rem; }
    .platform-card-foot { align-items: stretch; flex-direction: column; gap: 8px; padding-top: 10px; }
    .platform-edit-button { justify-content: center; width: 100%; }
    .platform-form-layout { grid-template-columns: 1fr; }
    .platform-logo-editor { width: min(240px, 100%); margin: 0 auto; }
    .account-action { flex-wrap: wrap; }
    .account-action-copy { flex: 1 1 140px; }
    .account-action-button { width: 100%; }
    .account-action-button .ghost-button,
    a.account-action-button { justify-content: center; width: 100%; }
}

.mobile-menu-btn,
.mobile-top-logo,
.mobile-nav-backdrop { display: none; }

@keyframes sheetFade {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes mobileSheetUp {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 720px) {
    body.app-body {
        min-height: 100dvh;
        background-color: #05080f;
        background-image:
            radial-gradient(560px 420px at 8% -6%, rgba(59, 130, 246, 0.18), transparent 60%),
            radial-gradient(520px 420px at 104% 2%, rgba(34, 211, 238, 0.12), transparent 58%),
            linear-gradient(180deg, #070c16, #05080f);
    }

    body.app-body::before { opacity: 0.34; }
    body.nav-lock { overflow: hidden; }

    .dashboard-app {
        display: block;
        min-height: 100dvh;
    }

    .dashboard-shell {
        width: 100%;
        gap: 14px;
        padding: 0 14px 34px;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 70;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 11px 10px;
        margin: 0 -14px;
        padding: 12px 14px 13px;
        border-bottom: 1px solid rgba(120, 170, 255, 0.12);
        background:
            linear-gradient(180deg, rgba(7, 12, 22, 0.96), rgba(7, 12, 22, 0.86)),
            radial-gradient(440px 220px at 18% -30%, rgba(56, 189, 248, 0.14), transparent 68%);
        backdrop-filter: blur(18px);
    }

    .mobile-menu-btn {
        display: grid;
        order: 1;
        width: 44px;
        height: 44px;
        flex: 0 0 44px;
        border-radius: 14px;
    }

    .mobile-top-logo {
        display: block;
        order: 2;
        width: auto;
        max-width: 118px;
        height: 23px;
        filter: drop-shadow(0 4px 12px rgba(34, 211, 238, 0.25));
    }

    .top-actions {
        order: 3;
        gap: 8px;
        margin-left: auto;
    }

    .icon-btn {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .header-copy {
        order: 4;
        flex: 0 0 100%;
        min-width: 0;
        gap: 3px;
        padding-top: 1px;
    }

    .breadcrumb {
        font-size: 0.62rem;
        letter-spacing: 0.14em;
    }

    h1 {
        overflow: hidden;
        font-size: 1.42rem;
        line-height: 1.06;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 90;
        width: min(294px, 86vw);
        height: 100dvh;
        gap: 22px;
        align-items: stretch;
        padding: 26px 16px;
        border-right: 1px solid rgba(120, 170, 255, 0.14);
        background: linear-gradient(180deg, rgba(14, 22, 38, 0.99), rgba(8, 12, 22, 0.98));
        box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9), inset -1px 0 0 rgba(120, 170, 255, 0.14);
        transform: translateX(-105%);
        transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    .dashboard-app.nav-open .sidebar { transform: translateX(0); }

    .mobile-nav-backdrop {
        position: fixed;
        inset: 0;
        z-index: 80;
        width: 100%;
        min-height: 0;
        padding: 0;
        border-radius: 0;
        background: rgba(2, 6, 16, 0.66);
        backdrop-filter: blur(4px);
        cursor: default;
    }

    .dashboard-app.nav-open .mobile-nav-backdrop { display: block; }

    .brand-lockup {
        gap: 10px;
        padding: 0 4px;
    }

    .brand-logo { width: 118px; }

    .side-nav {
        display: grid;
        grid-template-columns: 1fr;
        gap: 5px;
        width: 100%;
        overflow: visible;
    }

    .side-nav a {
        grid-template-columns: 36px minmax(0, 1fr);
        min-height: 56px;
        min-width: 0;
        border-radius: 15px;
        padding: 9px 12px;
    }

    .nav-ic {
        width: 20px;
        height: 20px;
        justify-self: center;
    }

    .sidebar-status { display: flex; }

    .view { gap: 14px; }

    .spotlight,
    .control-panel,
    .metric-card,
    .panel,
    .export-panel,
    .access-panel {
        border-radius: 22px;
        background: rgba(14, 22, 38, 0.92);
        box-shadow: inset 0 0 0 1px rgba(120, 170, 255, 0.12), 0 22px 42px -30px rgba(0, 0, 0, 0.9);
    }

    .control-panel { padding: 15px; backdrop-filter: none; -webkit-backdrop-filter: none; }

    .dashboard-filter-panel {
        display: block;
        overflow: visible;
        margin: 0;
        padding: 16px;
        border-radius: 22px;
        background: rgba(14, 22, 38, 0.92);
        box-shadow: inset 0 0 0 1px rgba(120, 170, 255, 0.12), 0 22px 42px -30px rgba(0, 0, 0, 0.9);
        backdrop-filter: none;
    }

    .dashboard-filter-copy { display: none; }

    /* período + limpar na linha de cima; produto e plataforma dividem a de baixo */
    .dashboard-filter-fields {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        grid-template-areas:
            "per per per per clr clr"
            "prd prd prd plt plt plt";
        gap: 14px 10px;
        width: 100%;
    }
    .dashboard-filter-fields .period-field { grid-area: per; }
    .dashboard-filter-fields > label:nth-of-type(2) { grid-area: prd; }
    .dashboard-filter-fields > label:nth-of-type(3) { grid-area: plt; }

    .dashboard-filter-fields label {
        display: grid;
        gap: 8px;
        width: auto;
        min-width: 0;
    }

    .dashboard-filter-fields label > span {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        color: var(--muted);
        font-size: 0.74rem;
        font-weight: 600;
    }
    .dashboard-filter-fields label > span svg { width: 14px; height: 14px; color: var(--blue-bright); }

    .dashboard-filter-fields .period-field,
    .dashboard-filter-fields .sales-period-slot,
    .dashboard-filter-fields .date-filter,
    .dashboard-filter-fields .cselect {
        width: auto;
    }

    .dashboard-filter-fields .date-trigger,
    .dashboard-filter-fields .cselect-trigger {
        width: 100%;
        min-width: 0;
        min-height: 48px;
        height: auto;
        border-radius: 14px;
        background: rgba(8, 13, 26, 0.7);
        box-shadow: inset 0 0 0 1px rgba(120, 170, 255, 0.12);
        color: var(--text);
        font-size: 0.92rem;
        font-weight: 700;
        padding: 0 14px;
        justify-content: space-between;
        white-space: nowrap;
    }

    .dashboard-filter-fields .date-trigger > svg,
    .dashboard-filter-fields .cselect-chev { width: 16px; height: 16px; }

    /* limpar como botão sólido, alinhado à base do seletor de período */
    .dashboard-filter-clear {
        grid-area: clr;
        align-self: end;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        min-width: 0;
        min-height: 48px;
        height: 48px;
        padding: 0 12px;
        border-radius: 14px;
        background: rgba(8, 13, 26, 0.7);
        box-shadow: inset 0 0 0 1px rgba(120, 170, 255, 0.12);
        color: var(--text);
        font-size: 0.92rem;
        font-weight: 700;
    }
    .dashboard-filter-clear svg { width: 17px; height: 17px; color: var(--blue-bright); }

    .spotlight {
        min-height: 0;
        align-items: flex-start;
        padding: 22px;
        border-radius: 24px;
        background: linear-gradient(150deg, rgba(30, 64, 175, 0.34), rgba(13, 20, 38, 0.76));
    }

    .spotlight::after {
        top: -62px;
        right: -52px;
        width: 210px;
        height: 210px;
        background: radial-gradient(circle, rgba(34, 211, 238, 0.32), transparent 66%);
    }

    .spotlight-copy {
        width: 100%;
        gap: 10px;
    }

    .spotlight-value {
        font-size: 2.45rem;
        line-height: 1;
        overflow-wrap: anywhere;
    }

    .spotlight-net {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        width: fit-content;
        max-width: 100%;
        border-radius: 12px;
        background: rgba(94, 234, 212, 0.1);
        box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.22);
        padding: 7px 12px;
        font-size: 0.78rem;
    }

    .spotlight-net strong {
        color: var(--mint);
        white-space: nowrap;
    }

    .spotlight-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
        gap: 14px 18px;
        margin-top: 8px;
    }

    .spotlight-stats > div:last-child { grid-column: 1 / -1; }
    .spotlight-stats span { font-size: 0.62rem; }
    .spotlight-stats strong { max-width: 100%; font-size: 0.86rem; }
    .orb-wrap { display: none; }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .metric-card {
        min-height: 108px;
        padding: 16px;
        border-radius: 20px;
    }

    .metric-card > span { font-size: 0.74rem; }
    .metric-card strong { font-size: 1.55rem; }
    .metric-card small { font-size: 0.7rem; }

    .analytics-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .panel { padding: 17px 16px; }

    .panel-heading {
        gap: 10px;
        margin-bottom: 14px;
    }

    .panel-heading h2 {
        font-size: 0.98rem;
        line-height: 1.2;
    }

    .chart-legend { gap: 10px; }
    .chart-legend span { font-size: 0.7rem; }

    .combo-chart,
    .trend-panel .bar-chart {
        height: 150px;
        gap: 8px;
    }

    .combo-bar { max-width: 13px; }
    .combo-label { font-size: 0.62rem; }
    .bar-chart { gap: 14px; }

    .bar-row,
    .compact .bar-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 7px 10px;
    }

    .bar-track {
        grid-column: 1 / -1;
        grid-row: 2;
        height: 9px;
    }

    .bar-label,
    .bar-value { font-size: 0.82rem; }

    .insight-list {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .insight-list div { padding: 12px; }
    .insight-list span { font-size: 0.68rem; }
    .insight-list strong { font-size: 0.92rem; }

    .section-heading,
    .panel-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .section-actions,
    .table-head-actions {
        width: 100%;
        justify-content: flex-start;
    }

    /* filtros de vendas: período + limpar em cima; busca; produto/plano; plataforma/ordenar */
    .filters-sales {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        grid-template-areas:
            "per per per per clr clr"
            "src src src src src src"
            "prd prd prd pln pln pln"
            "plt plt plt ord ord ord";
        gap: 14px 10px;
    }

    .filters-sales label {
        display: grid;
        gap: 8px;
        min-width: 0;
    }

    .filters-sales .period-field { grid-area: per; }
    .filters-sales .sales-search-field { grid-area: src; }
    .filters-sales label:has(#offerFilter) { grid-area: prd; }
    .filters-sales label:has(#planFilter) { grid-area: pln; }
    .filters-sales label:has(#platformFilter) { grid-area: plt; }
    .filters-sales label:has(#sortSelect) { grid-area: ord; }

    .filters-sales label > span {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.01em;
    }
    .filters-sales label > span svg { width: 14px; height: 14px; color: var(--blue-bright); }

    .filters-sales .date-trigger,
    .filters-sales .cselect-trigger,
    .filters-sales input {
        min-height: 48px;
        border-radius: 14px;
        background: rgba(8, 13, 26, 0.7);
    }

    .filters-sales .field-with-icon input { width: 100%; }

    /* limpar como botão sólido alinhado à base do seletor de período */
    #clearFilters {
        position: static;
        grid-area: clr;
        align-self: end;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        min-height: 48px;
        height: 48px;
        padding: 0 12px;
        border-radius: 14px;
        background: rgba(8, 13, 26, 0.7);
        box-shadow: inset 0 0 0 1px rgba(120, 170, 255, 0.12);
        color: var(--text);
        font-size: 0.92rem;
        font-weight: 700;
    }
    #clearFilters svg { width: 17px; height: 17px; color: var(--blue-bright); }
    .clear-suffix { display: none; }

    /* card de vendas recebidas: resumo 2x2 cheio + exportar só ícone no canto */
    #view-vendas .panel { position: relative; }
    #view-vendas .panel .settings-save-status { display: none; }
    #view-vendas .table-head-actions { display: block; width: 100%; }

    .sales-summary {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
        gap: 8px;
        overflow: visible;
    }

    .sales-stat {
        flex: initial;
        min-width: 0;
        border-radius: 13px;
    }

    /* exportar: somente o ícone, ancorado no canto superior direito do card */
    #view-vendas .export-mini {
        position: absolute;
        top: 16px;
        right: 16px;
        grid-column: auto;
        justify-self: auto;
        width: 46px;
        height: 46px;
        min-height: 46px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.045);
        box-shadow: inset 0 0 0 1px var(--glass-line);
        color: var(--blue-bright);
        font-size: 0;
    }
    #view-vendas .export-mini svg { width: 19px; height: 19px; color: var(--blue-bright); }
    #view-vendas .export-mini .export-label,
    #view-vendas .export-mini .csv-suffix { display: none; }
    .table-wrap { overflow: visible; }

    table {
        min-width: 0;
        border-collapse: separate;
    }

    table,
    thead,
    tbody,
    tr,
    td {
        display: block;
        width: 100%;
    }

    thead { display: none; }

    tbody {
        display: grid;
        gap: 10px;
    }

    tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        column-gap: 12px;
        row-gap: 5px;
        border-radius: 16px;
        background: #0e1626;
        box-shadow: inset 0 0 0 1px rgba(120, 170, 255, 0.12);
        padding: 12px 14px;
        cursor: pointer;
    }

    tbody tr:hover,
    tbody tr:focus-visible { background: #122036; outline: none; }

    td {
        display: flex;
        align-items: center;
        min-width: 0;
        border-bottom: 0;
        color: var(--text-dim);
        font-size: 0.82rem;
        padding: 0;
        text-align: left;
    }

    td::before { display: none; }

    td:nth-child(3),
    td:nth-child(5),
    td:nth-child(6) { display: none; }

    td:nth-child(2) { grid-column: 1; grid-row: 1; }

    td:nth-child(7) {
        grid-column: 2;
        grid-row: 1;
        justify-content: flex-end;
        color: var(--mint);
        font-family: var(--font-display);
        font-variant-numeric: tabular-nums;
        font-size: 0.98rem;
        font-weight: 600;
    }

    td:nth-child(4) {
        display: block;
        grid-column: 1;
        grid-row: 2;
        overflow: hidden;
        color: var(--muted);
        font-size: 0.78rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    td:nth-child(1) {
        grid-column: 2;
        grid-row: 2;
        justify-content: flex-end;
        color: var(--faint);
        font-size: 0.72rem;
        white-space: nowrap;
    }

    .td-sub {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin-left: 6px;
        color: var(--text-dim);
    }
    .td-sub::before { content: ""; width: 3px; height: 3px; border-radius: 999px; background: var(--faint); }
    .td-sub i { display: none; }

    .cell-user { min-width: 0; gap: 10px; }
    .cell-user .avatar-sm { width: 38px; height: 38px; flex: 0 0 38px; }
    .cell-user span:last-child {
        overflow: hidden;
        color: var(--text);
        font-weight: 600;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #settingsSaveStatus { display: none; }

    .product-catalog-head { gap: 12px; }

    .product-catalog-head > .product-heading-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        width: 100%;
    }

    .product-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .product-card {
        gap: 12px;
        padding: 10px 12px;
        border-radius: 16px;
    }

    .product-card-thumb {
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
    }

    .product-card-name { font-size: 0.94rem; }

    .product-edit {
        flex: 0 0 auto;
        padding: 0 12px;
    }

    /* período e selects abrem como bottom-sheet colado na base do celular */
    .date-pop,
    .cselect.is-open .cselect-pop {
        position: fixed;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 200;
        width: 100%;
        max-height: min(82dvh, 640px);
        overflow-y: auto;
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -22px 60px rgba(0, 0, 0, 0.6);
        animation: mobileSheetUp 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    }

    /* fundo escurecido atrás do bottom-sheet */
    .date-filter.is-open::before,
    .cselect.is-open::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 150;
        background: rgba(4, 8, 18, 0.6);
        -webkit-backdrop-filter: blur(2px);
        backdrop-filter: blur(2px);
        animation: sheetFade 0.28s ease;
    }

    .date-pop { padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); }
    .date-pop-inner { flex-direction: column; }

    .preset-col {
        width: auto;
        flex-flow: row wrap;
        border-right: 0;
        border-bottom: 1px solid rgba(120, 170, 255, 0.14);
        padding-right: 0;
        padding-bottom: 10px;
    }

    .preset-col button {
        min-height: 36px;
        flex: 1 1 calc(50% - 4px);
    }

    .cal-col { width: 100%; }
    .cselect-pop { padding: 8px 8px calc(10px + env(safe-area-inset-bottom)); }

    .cselect-option {
        min-height: 46px;
        border-radius: 13px;
    }

    .notification-pop {
        position: fixed;
        top: 78px;
        right: 12px;
        left: 12px;
        width: auto;
        border-radius: 18px;
    }

    .product-modal { padding: 12px; }

    .product-dialog {
        border-radius: 22px;
        padding: 18px;
    }

    .product-form-layout,
    .plan-editor-grid,
    .config-grid {
        grid-template-columns: 1fr;
    }

    .access-shell { padding: 16px; }

    .access-panel {
        border-radius: 24px;
        padding: 26px 20px;
    }
}

@media (max-width: 420px) {
    .dashboard-shell { padding-right: 12px; padding-left: 12px; }
    .topbar { margin-right: -12px; margin-left: -12px; padding-right: 12px; padding-left: 12px; }
    .spotlight { padding: 20px; }
    .spotlight-value { font-size: 2.16rem; }
    .metric-card { padding: 14px; }
    .metric-card strong { font-size: 1.36rem; }
    .insight-list { grid-template-columns: 1fr; }
    .product-catalog-head > .product-heading-actions { grid-template-columns: 1fr; }
}

/* ===================== desktop polish (pointer devices) ===================== */
@media (hover: hover) and (min-width: 721px) {
    .metric-card,
    .product-card,
    .platform-card {
        transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s ease;
    }
    .metric-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow), inset 0 0 0 1px var(--glass-line-strong), 0 18px 44px -26px rgba(56, 189, 248, 0.65);
    }
    .product-card:hover,
    .platform-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow), inset 0 0 0 1px var(--glass-line-strong);
    }
    .side-nav a { transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease; }
    .side-nav a:hover { transform: translateX(2px); }
}

/* product card edit button: arrow only shown on mobile */
.product-edit .pe-arrow { display: none; }

/* ============================================================
   MOBILE VISUAL REFINEMENTS (≤720px) — overrides
   1) Vendas: client cards like the reference
   2) Side drawer: tighter + higher
   3) Edit-product modal: full bottom sheet
   4) Product list: arrow icon, no "Editar" label
   ============================================================ */
@media (max-width: 720px) {

    /* ---------- 1) VENDAS CLIENT CARDS ---------- */
    #view-vendas tbody { gap: 11px; }

    #view-vendas tbody tr {
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        column-gap: 13px;
        row-gap: 2px;
        padding: 13px 15px;
        border-radius: 18px;
        background: #0c1422;
        box-shadow: inset 0 0 0 1px rgba(120, 170, 255, 0.13);
    }
    #view-vendas tbody tr:hover,
    #view-vendas tbody tr:focus-visible { background: #111b2e; }

    /* hoist avatar + name out of their cells into the row grid */
    #view-vendas td:nth-child(2),
    #view-vendas .cell-user { display: contents; }

    #view-vendas .cell-user .avatar-sm {
        grid-column: 1;
        grid-row: 1 / span 2;
        align-self: center;
        width: 46px;
        height: 46px;
        flex: 0 0 46px;
        border-radius: 13px;
        background: linear-gradient(150deg, rgba(59, 130, 246, 0.62), rgba(34, 211, 238, 0.3));
        box-shadow: inset 0 0 0 1px rgba(120, 170, 255, 0.45);
        color: #eaf2ff;
        font-size: 0.82rem;
        font-weight: 700;
    }

    /* client name */
    #view-vendas .cell-user span:last-child {
        grid-column: 2;
        grid-row: 1;
        align-self: end;
        overflow: hidden;
        color: var(--text);
        font-size: 0.98rem;
        font-weight: 700;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* product · platform line (colored, leading dot) */
    #view-vendas td:nth-child(4) {
        display: flex;
        grid-column: 2;
        grid-row: 2;
        align-self: start;
        align-items: center;
        gap: 6px;
        min-width: 0;
        overflow: hidden;
        color: var(--blue-bright);
        font-size: 0.79rem;
        font-weight: 600;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    #view-vendas td:nth-child(4)::before {
        content: "";
        flex: 0 0 7px;
        width: 7px;
        height: 7px;
        border-radius: 999px;
        background: var(--blue-bright);
        box-shadow: 0 0 8px rgba(91, 157, 255, 0.65);
    }
    #view-vendas td:nth-child(4) .td-sub {
        margin-left: 0;
        color: var(--blue-bright);
        opacity: 0.82;
    }

    /* value (top-right, colored) */
    #view-vendas td:nth-child(7) {
        grid-column: 3;
        grid-row: 1;
        align-self: end;
        justify-content: flex-end;
        color: var(--blue-bright);
        font-size: 1rem;
        font-weight: 700;
    }

    /* date (bottom-right, muted) */
    #view-vendas td:nth-child(1) {
        grid-column: 3;
        grid-row: 2;
        align-self: start;
        justify-content: flex-end;
        color: var(--faint);
        font-size: 0.72rem;
        white-space: nowrap;
    }

    /* ---------- 2) SIDE DRAWER: tighter + higher ---------- */
    .sidebar {
        justify-content: flex-start;
        gap: 12px;
        padding: 14px 13px;
    }
    .brand-lockup { gap: 4px; padding: 0 4px; }
    /* keep nav packed at the top instead of stretching to fill the height */
    .side-nav {
        flex: 0 0 auto;
        align-self: stretch;
        align-content: start;
        gap: 4px;
    }
    .side-nav a {
        min-height: 48px;
        padding: 7px 12px;
        border-radius: 14px;
    }
    .side-nav small { margin-top: 1px; }

    /* ---------- 3) EDIT-PRODUCT MODAL: FULL BOTTOM SHEET ---------- */
    .product-modal {
        align-items: flex-end;
        justify-content: center;
        overflow: hidden;
        padding: 0;
    }
    .product-dialog {
        width: 100%;
        max-width: 100%;
        max-height: 94dvh;
        overflow-y: auto;
        margin: 0;
        border-radius: 24px 24px 0 0;
        padding: 12px 18px calc(20px + env(safe-area-inset-bottom));
        animation: mobileSheetUp 0.26s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .product-dialog::before {
        content: "";
        display: block;
        width: 40px;
        height: 4px;
        margin: 0 auto 14px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.2);
    }

    /* upload as one big outlined button, no preview square */
    .product-image-editor {
        width: 100%;
        margin: 0;
        gap: 8px;
    }
    .product-image-preview { display: none; }
    .image-upload-button {
        width: 100%;
        min-height: 62px;
        border-radius: 16px;
        background: rgba(56, 189, 248, 0.06);
        box-shadow: inset 0 0 0 1.5px rgba(120, 170, 255, 0.22);
        color: var(--blue-bright);
        font-size: 0.92rem;
    }
    .image-upload-button svg { width: 19px; height: 19px; }
    .product-image-editor small { text-align: center; }

    /* planos heading stays on one row */
    .plan-editor-heading {
        flex-direction: row;
        align-items: center;
    }
    .plan-editor-heading .ghost-button { width: auto; }

    /* actions: Excluir on top (full width), then Cancelar + Salvar */
    .product-form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .form-primary-actions {
        display: flex;
        width: 100%;
        margin-left: 0;
        gap: 10px;
    }
    .form-primary-actions .ghost-button { flex: 0 0 auto; width: auto; padding: 0 22px; }
    .form-primary-actions .secondary-button { flex: 1; width: auto; }
    .product-form-actions .danger-button { width: 100%; }

    /* ---------- 4) PRODUCT LIST: arrow icon, no label ---------- */
    .product-card {
        gap: 14px;
        padding: 13px 14px;
        border-radius: 18px;
    }
    .product-card-thumb {
        flex: 0 0 48px;
        width: 48px;
        height: 48px;
        border-radius: 13px;
    }
    .product-card-name { font-size: 1.02rem; }
    .product-edit {
        flex: 0 0 46px;
        width: 46px;
        height: 46px;
        min-height: 46px;
        padding: 0;
        display: grid;
        place-items: center;
        border-radius: 14px;
        background: rgba(56, 189, 248, 0.06);
        box-shadow: inset 0 0 0 1px rgba(120, 170, 255, 0.2);
    }
    .product-edit .pe-pencil,
    .product-edit .pe-label { display: none; }
    .product-edit .pe-arrow {
        display: block;
        width: 18px;
        height: 18px;
        color: var(--blue-bright);
    }

    /* ---------- 5) EDIT-PRODUCT: webhook field same size as name field ---------- */
    #productWebhookNames {
        min-height: 46px;
        height: 46px;
    }

    /* ---------- 6) PLANOS: only "Planos", drop the kicker above ---------- */
    .plan-editor-title .panel-kicker { display: none; }
    #planEditorTitle {
        font-size: 0;
        line-height: 0;
    }
    #planEditorTitle::after {
        content: "Planos";
        font-family: var(--font-display);
        font-size: 1.04rem;
        line-height: 1.2;
        font-weight: 600;
        color: var(--text);
        letter-spacing: -0.022em;
    }

    /* ---------- 7) CONFIGURAÇÕES: drop helper subtitles + currency row ---------- */
    #view-config .panel-heading-hint { display: none; }
    #view-config .setting-row:has(.setting-row-readonly) { display: none; }

    /* ---------- 8) PLATFORM MODAL: match product layout on mobile ---------- */
    /* logo upload as one big outlined button, no preview square (same as product) */
    .platform-logo-editor {
        width: 100%;
        margin: 0;
        gap: 8px;
    }
    .platform-logo-preview { display: none; }
    .platform-logo-editor small { text-align: center; }

    /* webhook field same size as the "Nome exibido no painel" input */
    #platformWebhookNames {
        min-height: 46px;
        height: 46px;
    }
}

/* ===== Estados de autenticação (Cloudflare Pages) ===== */
body.app-loading .access-shell,
body.app-loading .dashboard-app { display: none; }
body.access-body .dashboard-app { display: none; }
body.app-body .access-shell { display: none; }
