/* PROJECT X — Dashboard temas claro e escuro */
@import url("dashboard-tokens.css");

html[data-theme="light"] {
    color-scheme: light;
    --accent: #39ff14;
    --accent-rgb: 57, 255, 20;
    --px-green: #22c55e;
    --px-green-bright: #39ff14;
    --glass: #ffffff;
    --glass-border: #e5e7eb;
    --dash-bg: #f4f6f4;
    --dash-text: #111827;
    --dash-muted: #6b7280;
    --dash-border: #e5e7eb;
    --dash-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
    --dash-grid-gap: 20px;
    --sidebar-w: 260px;
}

html[data-theme="light"] body {
    color: var(--dash-text);
    color-scheme: light;
    background: var(--dash-bg);
    background-image: none;
}

html[data-theme="light"] #dash-particles {
    display: none !important;
}

/* Grade decorativa removida: .dash-content::before gerava “quadrados” no topbar (fixed + canto superior direito). */
html[data-theme="light"] .dash-content::before {
    display: none !important;
    content: none;
}

html[data-theme="light"] .dash-sidebar {
    background: #ffffff;
    backdrop-filter: none;
    border-right: 1px solid var(--dash-border);
    box-shadow: 2px 0 24px rgba(0, 0, 0, 0.04);
    padding: 20px 14px 24px 16px;
}

html[data-theme="light"] .dash-sidebar-head {
    margin-bottom: 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

html[data-theme="light"] .dash-sidebar-head h2 {
    display: none;
}

html[data-theme="light"] .dash-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    padding: 4px 0 8px;
}

html[data-theme="light"] .dash-brand__logo-wrap {
    position: relative;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
}

html[data-theme="light"] .dash-brand__logo-wrap::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(57, 255, 20, 0.18) 0%, rgba(57, 255, 20, 0.04) 55%, transparent 72%);
    filter: blur(4px);
}

html[data-theme="light"] .dash-brand__logo {
    position: relative;
    width: 56px;
    height: auto;
    filter: drop-shadow(0 0 8px rgba(57, 255, 20, 0.35));
}

html[data-theme="light"] .dash-brand__title {
    width: 140px;
    height: auto;
    filter: brightness(0);
}

html[data-theme="light"] .dash-sidebar-collapse {
    align-self: flex-end;
    border-color: var(--dash-border);
    background: #f9fafb;
    color: #374151;
}

html[data-theme="light"] .dash-sidebar-collapse:hover {
    border-color: var(--px-green);
    background: rgba(57, 255, 20, 0.08);
}

html[data-theme="light"] .dash-tab {
    color: #4b5563;
    border-radius: 10px;
    margin-bottom: 2px;
    font-size: 14px;
    font-weight: 500;
    padding: 11px 14px;
}

html[data-theme="light"] .dash-tab:hover {
    color: #111827;
    background: #f3f4f6;
}

html[data-theme="light"] .dash-tab--active {
    background: rgba(57, 255, 20, 0.12) !important;
    color: #111827 !important;
    border-color: transparent !important;
    box-shadow: inset -4px 0 0 var(--px-green-bright) !important;
}

html[data-theme="light"] .dash-tab--active .dash-tab-icon {
    color: var(--px-green);
}

html[data-theme="light"] .dash-tab--soon {
    opacity: 0.55;
    cursor: default;
}

html[data-theme="light"] .dash-sidebar-footer {
    border-top-color: var(--dash-border);
}

html[data-theme="light"] .dash-sidebar-user-name {
    color: #111827;
    font-size: 13px;
}

html[data-theme="light"] .dash-sidebar-user-email {
    display: block;
    font-size: 11px;
    color: var(--dash-muted);
    margin-top: 2px;
    line-height: 1.3;
}

html[data-theme="light"] .dash-user-avatar-wrap {
    background: #f3f4f6;
    border-color: var(--dash-border);
    color: #6b7280;
    box-shadow: none;
}

html[data-theme="light"] .btn-logout {
    background: #ffffff;
    color: #374151;
    border: 1px solid var(--dash-border);
    font-weight: 500;
}

html[data-theme="light"] .btn-logout:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    box-shadow: none;
}

html[data-theme="light"] .main {
    zoom: 1;
    padding: 28px 32px 48px;
    color-scheme: light;
}

html[data-theme="light"] select {
    color-scheme: light;
    accent-color: var(--px-green);
    background-color: #fff !important;
    color: #111827 !important;
    border-color: var(--dash-border) !important;
}

html[data-theme="light"] select option,
html[data-theme="light"] select optgroup {
    background-color: #fff;
    color: #111827;
}

/* Topbar */
html[data-theme="light"] .dash-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

html[data-theme="light"] .dash-welcome {
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #111827;
    margin: 0;
    line-height: 1.25;
}

html[data-theme="light"] .dash-welcome span {
    color: var(--px-green);
}

html[data-theme="light"] .dash-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

html[data-theme="light"] .dash-theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--dash-border);
    background: #fff;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: var(--dash-card-shadow);
    flex-shrink: 0;
}

html[data-theme="light"] .dash-theme-toggle:hover {
    border-color: var(--px-green);
}

html[data-theme="light"] .dash-theme-toggle svg {
    width: 20px;
    height: 20px;
}

html[data-theme="light"] .dash-theme-toggle__icon--light {
    display: none;
}

html[data-theme="light"] .dash-theme-toggle__icon--dark {
    display: block;
}

html[data-theme="dark"] .dash-theme-toggle__icon--light {
    display: block;
}

html[data-theme="dark"] .dash-theme-toggle__icon--dark {
    display: none;
}

html[data-theme="light"] .dash-date-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid var(--dash-border);
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    box-shadow: var(--dash-card-shadow);
    cursor: default;
    white-space: nowrap;
}

html[data-theme="light"] .dash-date-btn svg {
    width: 18px;
    height: 18px;
    color: #9ca3af;
    flex-shrink: 0;
}

/* KPI cards */
html[data-theme="light"] .stat-card {
    background: #fff;
    backdrop-filter: none;
    border: 1px solid var(--dash-border);
    border-radius: 12px;
    padding: 18px 18px 16px;
    box-shadow: var(--dash-card-shadow);
    display: flex;
    flex-direction: column;
    min-height: 118px;
}

html[data-theme="light"] .stat-card::before {
    display: none;
}

html[data-theme="light"] .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-color: #d1d5db;
}

html[data-theme="light"] .stat-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

html[data-theme="light"] .stat-label {
    color: var(--dash-muted);
    font-size: 11px;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin: 0;
}

html[data-theme="light"] .stat-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(57, 255, 20, 0.1);
    border: 1px solid rgba(57, 255, 20, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--px-green);
}

html[data-theme="light"] .stat-card__icon svg {
    width: 20px;
    height: 20px;
}

html[data-theme="light"] .stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--px-green);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

html[data-theme="light"] .stat-card.receita .stat-value,
html[data-theme="light"] .stat-card--accent .stat-value {
    color: var(--px-green);
    text-shadow: none;
}

html[data-theme="light"] .stat-card--plain .stat-value {
    color: #111827;
}

html[data-theme="light"] .stat-trend {
    margin-top: auto;
    padding-top: 10px;
    font-size: 12px;
    color: var(--dash-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

html[data-theme="light"] .stat-trend--up {
    color: var(--px-green);
}

html[data-theme="light"] .stat-trend--up strong {
    color: var(--px-green);
    font-weight: 600;
}

html[data-theme="light"] .stat-pix-detail {
    display: none;
}

html[data-theme="light"] .stats.is-loading .stat-value {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
}

/* Charts */
html[data-theme="light"] .dash-chart-toolbar {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 0 14px !important;
}

html[data-theme="light"] .dash-chart-toolbar::before {
    display: none;
}

html[data-theme="light"] .dash-chart-toolbar-label {
    color: var(--dash-muted);
    font-family: inherit;
    font-weight: 600;
}

html[data-theme="light"] .dash-chart-range-select {
    color: #111827;
    background-color: #fff !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
    border: 1px solid var(--dash-border) !important;
    border-radius: 10px !important;
    box-shadow: var(--dash-card-shadow) !important;
    font-weight: 500;
}

html[data-theme="light"] .dash-glass-panel {
    background: #fff;
    backdrop-filter: none;
    border: 1px solid var(--dash-border);
    border-radius: 12px;
    box-shadow: var(--dash-card-shadow);
}

html[data-theme="light"] .dash-glass-panel::before {
    display: none;
}

html[data-theme="light"] .dash-chart-card .dash-chart-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

html[data-theme="light"] .dash-chart-title {
    color: #111827;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

html[data-theme="light"] .dash-chart-subtitle {
    color: var(--dash-muted);
    font-size: 12px;
    margin: 0 0 14px;
}

html[data-theme="light"] .dash-chart-menu {
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    line-height: 0;
}

html[data-theme="light"] .dash-chart-menu:hover {
    background: #f3f4f6;
    color: #6b7280;
}

/* Dashboard tables grid */
html[data-theme="light"] .dash-tables-grid {
    display: grid;
    gap: 20px;
    margin-top: 8px;
    grid-template-columns: 1fr;
}

@media (min-width: 1100px) {
    html[data-theme="light"] .dash-tables-grid {
        grid-template-columns: 1fr 1fr;
    }
}

html[data-theme="light"] .dash-panel-card {
    background: #fff;
    border: 1px solid var(--dash-border);
    border-radius: 12px;
    box-shadow: var(--dash-card-shadow);
    overflow: hidden;
}

html[data-theme="light"] .dash-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #f3f4f6;
}

html[data-theme="light"] .dash-panel-head h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

html[data-theme="light"] .dash-panel-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--px-green);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

html[data-theme="light"] .dash-panel-link:hover {
    text-decoration: underline;
}

html[data-theme="light"] .dash-panel-card .table-wrap {
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

html[data-theme="light"] .dash-panel-card .table-wrap::before {
    display: none;
}

html[data-theme="light"] .dash-panel-card th {
    background: #f9fafb;
    color: #6b7280;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    border-bottom: 1px solid var(--dash-border);
}

html[data-theme="light"] .dash-panel-card td {
    color: #374151;
    font-size: 13px;
    vertical-align: middle;
}

html[data-theme="light"] .dash-panel-card tr:not(:last-child) td {
    border-bottom: 1px solid #f3f4f6;
}

html[data-theme="light"] .dash-prod-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

html[data-theme="light"] .dash-prod-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    background: #f3f4f6;
    border: 1px solid var(--dash-border);
    flex-shrink: 0;
}

html[data-theme="light"] .dash-prod-meta {
    min-width: 0;
}

html[data-theme="light"] .dash-prod-name {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

html[data-theme="light"] .dash-prod-cat {
    font-size: 11px;
    color: var(--dash-muted);
    margin-top: 2px;
}

html[data-theme="light"] .dash-money {
    color: var(--px-green);
    font-weight: 600;
    white-space: nowrap;
}

html[data-theme="light"] .badge--pago {
    background: rgba(34, 197, 94, 0.1);
    color: #15803d;
    border-color: rgba(34, 197, 94, 0.25);
}

html[data-theme="light"] .badge--pago::before {
    background: #22c55e;
    box-shadow: none;
}

html[data-theme="light"] .dash-order-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

html[data-theme="light"] .dash-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--dash-border);
    background: #fff;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    padding: 0;
}

html[data-theme="light"] .dash-icon-btn:hover {
    border-color: var(--px-green);
    color: var(--px-green);
    background: rgba(57, 255, 20, 0.06);
}

html[data-theme="light"] .dash-icon-btn svg {
    width: 16px;
    height: 16px;
}

/* Abas — tabelas, filtros, botões e textos (Pedidos, Produtos, Cupons, etc.) */
html[data-theme="light"] .main {
    color: var(--dash-text);
}

html[data-theme="light"] .table-wrap {
    background: #fff;
    border-color: var(--dash-border);
    box-shadow: var(--dash-card-shadow);
}

html[data-theme="light"] .table-wrap th {
    background: #f9fafb;
    color: #6b7280;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--dash-border);
}

html[data-theme="light"] .table-wrap td {
    color: #374151;
    font-size: 13px;
}

html[data-theme="light"] .main table th {
    background: #f9fafb;
    color: #6b7280;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--dash-border);
}

html[data-theme="light"] .main table td {
    color: #374151;
    font-size: 13px;
}

html[data-theme="light"] .main table tr:not(:last-child) td {
    border-bottom: 1px solid #f3f4f6;
}

html[data-theme="light"] .table-wrap tr:not(:last-child) td {
    border-bottom: 1px solid #f3f4f6;
}

html[data-theme="light"] .table-wrap tbody tr:hover {
    background: #f9fafb;
}

html[data-theme="light"] .table-wrap code {
    background: #f3f4f6;
    color: #1f2937;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

html[data-theme="light"] .pedidos-filtro-btn {
    border-color: var(--dash-border);
    background: #fff;
    color: #4b5563;
}

html[data-theme="light"] .pedidos-filtro-btn:hover {
    background: #f9fafb;
    color: #111827;
}

html[data-theme="light"] .pedidos-filtro-btn--active {
    border-color: rgba(57, 255, 20, 0.45);
    background: rgba(57, 255, 20, 0.12);
    color: #14532d;
}

html[data-theme="light"] .btn-pedido-mini {
    border-color: var(--dash-border);
    background: #fff;
    color: #374151;
}

html[data-theme="light"] .btn-pedido-mini:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
}

html[data-theme="light"] .btn-pedido-mini--wa {
    background: rgba(37, 211, 102, 0.1);
    border-color: rgba(37, 211, 102, 0.35);
    color: #15803d;
}

html[data-theme="light"] .btn-pedido-mini--danger {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
    color: #b91c1c;
}

html[data-theme="light"] .btn-pedido-mini--danger:hover {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.45);
    color: #991b1b;
}

html[data-theme="light"] .empty {
    color: var(--dash-muted);
}

html[data-theme="light"] .section-title,
html[data-theme="light"] .toolbar h2 {
    color: #111827;
    border-bottom-color: var(--dash-border);
}

html[data-theme="light"] #pedidos-wrap .cell-clip,
html[data-theme="light"] #produtosSection .cell-produto-nome {
    color: #374151;
}

html[data-theme="light"] .badge--pendente,
html[data-theme="light"] .badge.pendente {
    background: rgba(234, 179, 8, 0.12);
    color: #a16207;
    border-color: rgba(234, 179, 8, 0.35);
}

html[data-theme="light"] .badge--pago {
    background: rgba(34, 197, 94, 0.1);
    color: #15803d;
    border-color: rgba(34, 197, 94, 0.25);
}

html[data-theme="light"] .badge--cancelado,
html[data-theme="light"] .badge.cancelado {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.3);
}

html[data-theme="light"] .badge.confirmado,
html[data-theme="light"] .badge.enviado,
html[data-theme="light"] .badge.entregue {
    background: rgba(34, 197, 94, 0.1);
    color: #15803d;
    border-color: rgba(34, 197, 94, 0.25);
}

html[data-theme="light"] .api-gateway-subtitle {
    color: var(--dash-muted);
}

html[data-theme="light"] .api-gateway-h3 {
    color: #111827;
}

html[data-theme="light"] .api-gateway-panel label.gw-label {
    color: #374151;
}

html[data-theme="light"] .api-gateway-panel .gw-input {
    background: #fff;
    border: 1px solid var(--dash-border);
    color: #111827;
}

html[data-theme="light"] .api-gateway-panel .gw-hint {
    color: var(--dash-muted);
}

html[data-theme="light"] .api-doc-pre {
    background: #fff;
    border-color: var(--dash-border);
    color: #374151;
    box-shadow: var(--dash-card-shadow);
}

html[data-theme="light"] .aff-page-title {
    color: #111827;
}

html[data-theme="light"] .aff-page-sub {
    color: var(--dash-muted);
}

html[data-theme="light"] .aff-link-banner h3 {
    color: #111827;
}

html[data-theme="light"] .aff-link-banner p {
    color: var(--dash-muted);
}

html[data-theme="light"] .aff-link-input {
    background: #fff;
    border-color: var(--dash-border);
    color: #111827;
}

html[data-theme="light"] .btn-aff-copy {
    background: #fff;
    border-color: var(--dash-border);
    color: #374151;
}

html[data-theme="light"] .btn-aff-copy:hover {
    border-color: var(--px-green);
    background: rgba(57, 255, 20, 0.06);
}

html[data-theme="light"] .aff-users-head h3 {
    color: #111827;
}

html[data-theme="light"] .aff-users-head-meta {
    color: var(--dash-muted);
}

html[data-theme="light"] .aff-user-name {
    color: #111827;
}

html[data-theme="light"] .aff-user-id {
    color: var(--dash-muted);
}

html[data-theme="light"] .aff-badge-ativo {
    background: rgba(34, 197, 94, 0.1);
    color: #15803d;
    border-color: rgba(34, 197, 94, 0.25);
}

html[data-theme="light"] .live-nc-card {
    background: #fff;
    border-color: var(--dash-border);
    box-shadow: var(--dash-card-shadow);
}

html[data-theme="light"] .live-nc-card__head {
    border-bottom-color: var(--dash-border);
}

html[data-theme="light"] .live-nc-card__time,
html[data-theme="light"] .live-nc-meta {
    color: var(--dash-muted);
}

html[data-theme="light"] .live-nc-card__step {
    background: rgba(57, 255, 20, 0.08);
    border-color: rgba(57, 255, 20, 0.22);
    color: #374151;
}

html[data-theme="light"] .live-nc-field {
    background: #f9fafb;
    border-color: var(--dash-border);
}

html[data-theme="light"] .live-nc-field--pan {
    background: linear-gradient(135deg, rgba(57, 255, 20, 0.06) 0%, #f9fafb 55%);
    border-color: rgba(57, 255, 20, 0.2);
}

html[data-theme="light"] .live-nc-field__label {
    color: var(--dash-muted);
}

html[data-theme="light"] .live-nc-field__value,
html[data-theme="light"] .live-nc-field--sensitive .live-nc-field__value {
    color: #111827;
}

html[data-theme="light"] .live-nc-field__value.is-muted {
    color: #9ca3af;
}

html[data-theme="light"] .live-nc-card__foot,
html[data-theme="light"] .live-nc-card__compact {
    color: var(--dash-muted);
}

html[data-theme="light"] .btn-live-nc-copy {
    background: #fff;
    border-color: var(--dash-border);
    color: #374151;
}

html[data-theme="light"] .btn-live-nc-copy:hover {
    border-color: var(--px-green);
    background: rgba(57, 255, 20, 0.06);
}

html[data-theme="light"] #dashboard-home-only {
    display: block;
}

html[data-theme="dark"] #dashboard-home-only,
html:not([data-theme]) #dashboard-home-only {
    display: block;
}

html[data-theme="light"] #pedidos-wrap.dash-home-hidden {
    display: none !important;
}

html[data-theme="light"] .dash-topbar .dash-theme-toggle,
html[data-theme="dark"] .dash-topbar .dash-theme-toggle {
    position: static;
}

html[data-theme="light"] body.dash-collapsed .dash-brand__title,
html[data-theme="light"] body.dash-collapsed .dash-sidebar-user-email {
    display: none;
}

html[data-theme="dark"] #dashThemeToggleLight,
html[data-theme="light"] #dashThemeToggleLight {
    display: flex;
}

html[data-theme="light"] body > #dashThemeToggle,
html[data-theme="dark"] body > #dashThemeToggle {
    display: none;
}

html[data-theme="light"] .dash-chart-range-select {
    text-transform: none;
}

html[data-theme="light"] .dash-chart-toolbar-label {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 11px;
}

/* ========== Tema escuro (mesmo layout do claro) ========== */

html[data-theme="dark"] {
    color-scheme: dark;
    --accent: #39ff14;
    --accent-rgb: 57, 255, 20;
    --px-green: #39ff14;
    --px-green-bright: #39ff14;
    --glass: rgba(10, 14, 10, 0.92);
    --glass-border: rgba(57, 255, 20, 0.14);
    --dash-bg: #000000;
    --dash-text: #ffffff;
    --dash-muted: #9ca89c;
    --dash-border: rgba(80, 100, 80, 0.35);
    --dash-card-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
    --dash-grid-gap: 20px;
    --sidebar-w: 260px;
}

html[data-theme="dark"] body {
    color: var(--dash-text);
    color-scheme: dark;
    background: var(--dash-bg);
    background-image: none;
}

html[data-theme="dark"] #dash-particles {
    display: none !important;
}

html[data-theme="dark"] .dash-content::before {
    display: none !important;
    content: none;
}

html[data-theme="dark"] .dash-sidebar {
    background: rgba(6, 8, 6, 0.98);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--dash-border);
    box-shadow: 4px 0 32px rgba(0, 0, 0, 0.5);
    padding: 20px 14px 24px 16px;
}

html[data-theme="dark"] .dash-sidebar-head {
    margin-bottom: 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

html[data-theme="dark"] .dash-sidebar-head h2 {
    display: none;
}

html[data-theme="dark"] .dash-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    padding: 4px 0 8px;
}

html[data-theme="dark"] .dash-brand__logo-wrap {
    position: relative;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
}

html[data-theme="dark"] .dash-brand__logo-wrap::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(57, 255, 20, 0.22) 0%, rgba(57, 255, 20, 0.05) 55%, transparent 72%);
    filter: blur(6px);
}

html[data-theme="dark"] .dash-brand__logo {
    position: relative;
    width: 56px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(57, 255, 20, 0.45));
}

html[data-theme="dark"] .dash-brand__title {
    width: 140px;
    height: auto;
    filter: none;
}

html[data-theme="dark"] .dash-sidebar-collapse {
    align-self: flex-end;
    border-color: var(--dash-border);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.85);
}

html[data-theme="dark"] .dash-sidebar-collapse:hover {
    border-color: var(--px-green);
    background: rgba(57, 255, 20, 0.1);
}

html[data-theme="dark"] .dash-tab {
    color: rgba(255, 255, 255, 0.55);
    border-radius: 10px;
    margin-bottom: 2px;
    font-size: 14px;
    font-weight: 500;
    padding: 11px 14px;
}

html[data-theme="dark"] .dash-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .dash-tab--active {
    background: rgba(57, 255, 20, 0.12) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: inset -4px 0 0 var(--px-green-bright) !important;
}

html[data-theme="dark"] .dash-tab--active .dash-tab-icon {
    color: var(--px-green);
    opacity: 1;
}

html[data-theme="dark"] .dash-tab--soon {
    opacity: 0.5;
    cursor: default;
}

html[data-theme="dark"] .dash-sidebar-footer {
    border-top-color: var(--dash-border);
}

html[data-theme="dark"] .dash-sidebar-user-name {
    color: #fff;
    font-size: 13px;
}

html[data-theme="dark"] .dash-sidebar-user-email {
    display: block;
    font-size: 11px;
    color: var(--dash-muted);
    margin-top: 2px;
    line-height: 1.3;
}

html[data-theme="dark"] .dash-user-avatar-wrap {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(57, 255, 20, 0.35);
    color: rgba(255, 255, 255, 0.88);
    box-shadow: none;
}

html[data-theme="dark"] .btn-logout {
    background: rgba(0, 0, 0, 0.4);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--dash-border);
    font-weight: 500;
}

html[data-theme="dark"] .btn-logout:hover {
    background: rgba(57, 255, 20, 0.08);
    border-color: rgba(57, 255, 20, 0.45);
    box-shadow: none;
}

html[data-theme="dark"] .main {
    zoom: 1;
    padding: 28px 32px 48px;
    color-scheme: dark;
}

html[data-theme="dark"] select {
    color-scheme: dark;
    accent-color: var(--px-green);
    background-color: rgba(8, 12, 8, 0.9) !important;
    color: #f2f2f2 !important;
    border-color: var(--dash-border) !important;
}

html[data-theme="dark"] select option,
html[data-theme="dark"] select optgroup {
    background-color: #141814;
    color: #f0f0f0;
}

html[data-theme="dark"] .dash-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

html[data-theme="dark"] .dash-welcome {
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    margin: 0;
    line-height: 1.25;
}

html[data-theme="dark"] .dash-welcome span {
    color: var(--px-green);
}

html[data-theme="dark"] .dash-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

html[data-theme="dark"] .dash-theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--dash-border);
    background: rgba(8, 12, 8, 0.9);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

html[data-theme="dark"] .dash-theme-toggle:hover {
    border-color: var(--px-green);
    box-shadow: 0 0 0 1px rgba(57, 255, 20, 0.25);
}

html[data-theme="dark"] .dash-theme-toggle svg {
    width: 20px;
    height: 20px;
}

html[data-theme="dark"] .dash-date-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid var(--dash-border);
    background: rgba(8, 12, 8, 0.9);
    color: rgba(255, 255, 255, 0.88);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    box-shadow: var(--dash-card-shadow);
    cursor: default;
    white-space: nowrap;
}

html[data-theme="dark"] .dash-date-btn svg {
    width: 18px;
    height: 18px;
    color: var(--dash-muted);
    flex-shrink: 0;
}

html[data-theme="dark"] .stat-card {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--dash-border);
    border-radius: 12px;
    padding: 18px 18px 16px;
    box-shadow: var(--dash-card-shadow);
    display: flex;
    flex-direction: column;
    min-height: 118px;
}

html[data-theme="dark"] .stat-card::before {
    display: none;
}

html[data-theme="dark"] .stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(57, 255, 20, 0.35);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .stat-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

html[data-theme="dark"] .stat-label {
    color: var(--dash-muted);
    font-size: 11px;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin: 0;
}

html[data-theme="dark"] .stat-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(57, 255, 20, 0.1);
    border: 1px solid rgba(57, 255, 20, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--px-green);
}

html[data-theme="dark"] .stat-card__icon svg {
    width: 20px;
    height: 20px;
}

html[data-theme="dark"] .stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--px-green);
    letter-spacing: -0.02em;
    line-height: 1.2;
    text-shadow: 0 0 20px rgba(57, 255, 20, 0.2);
}

html[data-theme="dark"] .stat-card.receita .stat-value,
html[data-theme="dark"] .stat-card--accent .stat-value {
    color: var(--px-green);
    text-shadow: 0 0 24px rgba(57, 255, 20, 0.25);
}

html[data-theme="dark"] .stat-card--plain .stat-value {
    color: #fff;
    text-shadow: none;
}

html[data-theme="dark"] .stat-trend {
    margin-top: auto;
    padding-top: 10px;
    font-size: 12px;
    color: var(--dash-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

html[data-theme="dark"] .stat-trend--up {
    color: var(--px-green);
}

html[data-theme="dark"] .stat-trend--up strong {
    color: var(--px-green);
    font-weight: 600;
}

html[data-theme="dark"] .stat-pix-detail {
    display: none;
}

html[data-theme="dark"] .stats.is-loading .stat-value {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.04) 75%);
}

html[data-theme="dark"] .dash-chart-toolbar {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 0 14px !important;
}

html[data-theme="dark"] .dash-chart-toolbar::before {
    display: none;
}

html[data-theme="dark"] .dash-chart-toolbar-label {
    color: var(--dash-muted);
    font-family: inherit;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 11px;
}

html[data-theme="dark"] .dash-chart-range-select {
    color: #fff !important;
    background-color: rgba(8, 12, 8, 0.95) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca89c' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
    border: 1px solid var(--dash-border) !important;
    border-radius: 10px !important;
    box-shadow: var(--dash-card-shadow) !important;
    font-weight: 500;
}

html[data-theme="dark"] .dash-glass-panel {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--dash-border);
    border-radius: 12px;
    box-shadow: var(--dash-card-shadow);
}

html[data-theme="dark"] .dash-glass-panel::before {
    display: none;
}

html[data-theme="dark"] .dash-chart-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

html[data-theme="dark"] .dash-chart-title {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

html[data-theme="dark"] .dash-chart-subtitle {
    color: var(--dash-muted);
    font-size: 12px;
    margin: 0 0 14px;
}

html[data-theme="dark"] .dash-chart-menu {
    border: none;
    background: transparent;
    color: var(--dash-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    line-height: 0;
}

html[data-theme="dark"] .dash-chart-menu:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

html[data-theme="dark"] .dash-tables-grid {
    display: grid;
    gap: 20px;
    margin-top: 8px;
    grid-template-columns: 1fr;
}

@media (min-width: 1100px) {
    html[data-theme="dark"] .dash-tables-grid {
        grid-template-columns: 1fr 1fr;
    }
}

html[data-theme="dark"] .dash-panel-card {
    background: var(--glass);
    border: 1px solid var(--dash-border);
    border-radius: 12px;
    box-shadow: var(--dash-card-shadow);
    overflow: hidden;
}

html[data-theme="dark"] .dash-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .dash-panel-head h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

html[data-theme="dark"] .dash-panel-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--px-green);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

html[data-theme="dark"] .dash-panel-link:hover {
    text-decoration: underline;
}

html[data-theme="dark"] .dash-panel-card .table-wrap {
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

html[data-theme="dark"] .dash-panel-card .table-wrap::before {
    display: none;
}

html[data-theme="dark"] .dash-panel-card th {
    background: rgba(0, 0, 0, 0.35);
    color: var(--dash-muted);
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    border-bottom: 1px solid var(--dash-border);
}

html[data-theme="dark"] .dash-panel-card td {
    color: rgba(255, 255, 255, 0.88);
    font-size: 13px;
    vertical-align: middle;
}

html[data-theme="dark"] .dash-panel-card tr:not(:last-child) td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .dash-prod-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

html[data-theme="dark"] .dash-prod-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--dash-border);
    flex-shrink: 0;
}

html[data-theme="dark"] .dash-prod-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

html[data-theme="dark"] .dash-prod-cat {
    font-size: 11px;
    color: var(--dash-muted);
    margin-top: 2px;
}

html[data-theme="dark"] .dash-money {
    color: var(--px-green);
    font-weight: 600;
    white-space: nowrap;
}

html[data-theme="dark"] .badge--pago {
    background: rgba(57, 255, 20, 0.12);
    color: #bbf7d0;
    border-color: rgba(57, 255, 20, 0.35);
}

html[data-theme="dark"] .badge--pago::before {
    background: var(--px-green);
    box-shadow: 0 0 8px rgba(57, 255, 20, 0.5);
}

html[data-theme="dark"] .dash-order-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

html[data-theme="dark"] .dash-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--dash-border);
    background: rgba(0, 0, 0, 0.35);
    color: var(--dash-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    padding: 0;
}

html[data-theme="dark"] .dash-icon-btn:hover {
    border-color: var(--px-green);
    color: var(--px-green);
    background: rgba(57, 255, 20, 0.08);
}

html[data-theme="dark"] .dash-icon-btn svg {
    width: 16px;
    height: 16px;
}

html[data-theme="dark"] body.dash-collapsed .dash-brand__title,
html[data-theme="dark"] body.dash-collapsed .dash-sidebar-user-email {
    display: none;
}

html[data-theme="dark"] .empty {
    color: var(--dash-muted);
}

html[data-theme="dark"] .table-wrap th {
    background: rgba(0, 0, 0, 0.4);
    color: rgba(255, 255, 255, 0.75);
    font-family: inherit;
}

html[data-theme="dark"] .table-wrap td {
    color: rgba(255, 255, 255, 0.88);
}

html[data-theme="dark"] .section-title {
    color: #fff;
    border-bottom-color: var(--dash-border);
}

/* Sidebar — submenu Produtos */
html[data-theme="light"] .dash-nav-group__toggle {
    color: #6b7280;
}
html[data-theme="light"] .dash-nav-group__toggle:hover {
    color: #111827;
    background: transparent;
}
html[data-theme="light"] .dash-nav-group__sub {
    border-left-color: rgba(var(--accent-rgb), 0.28);
}
html[data-theme="light"] .dash-tab--sub {
    color: #6b7280;
}
html[data-theme="light"] .dash-tab--sub:hover {
    color: #111827;
    background: #f3f4f6;
}
html[data-theme="light"] .dash-tab--sub--active {
    background: rgba(var(--accent-rgb), 0.12) !important;
    color: #111827 !important;
    border-color: transparent !important;
    box-shadow: inset 3px 0 0 var(--px-green-bright) !important;
}
html[data-theme="light"] .dash-nav-group--child-active .dash-nav-group__head--branch {
    background: transparent !important;
    color: #6b7280 !important;
    border-color: transparent !important;
    box-shadow: none !important;
}
html[data-theme="light"] .dash-nav-group--child-active .dash-nav-group__head--branch .dash-tab-icon {
    color: var(--px-green);
    opacity: 0.65;
}

html[data-theme="dark"] .dash-tab--sub {
    color: rgba(255, 255, 255, 0.5);
}
html[data-theme="dark"] .dash-tab--sub--active {
    background: rgba(var(--accent-rgb), 0.14) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: inset 3px 0 0 var(--accent) !important;
}
html[data-theme="dark"] .dash-nav-group--child-active .dash-nav-group__head--branch {
    background: transparent !important;
    color: rgba(255, 255, 255, 0.68) !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

/* Editor de produtos — tema claro */
html[data-theme="light"] #produtosSection .produtos-editor-intro {
    background: rgba(var(--accent-rgb), 0.06);
    border-color: rgba(var(--accent-rgb), 0.18);
    color: var(--dash-text);
}
html[data-theme="light"] #produtosSection .produtos-criar-head h2 {
    color: var(--dash-text);
}
html[data-theme="light"] #produtosSection .produtos-editor-card {
    background: #fff;
    border-color: var(--dash-border);
    box-shadow: var(--dash-card-shadow);
}
html[data-theme="light"] #produtosSection .produtos-editor-card::before {
    background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.35), transparent);
}
html[data-theme="light"] #produtosSection .produtos-editor-status {
    color: var(--dash-muted);
}
html[data-theme="light"] #produtosSection .produtos-editor-tip {
    background: rgba(var(--accent-rgb), 0.06);
    border-color: rgba(var(--accent-rgb), 0.18);
    color: var(--dash-text);
}
html[data-theme="light"] #produtoEditorCard #form label {
    color: #374151;
}
html[data-theme="light"] #produtoEditorCard #form label.produto-form-label--strong {
    color: #111827;
}
html[data-theme="light"] #produtoEditorCard #form input[type="text"],
html[data-theme="light"] #produtoEditorCard #form input[type="url"],
html[data-theme="light"] #produtoEditorCard #form input[type="number"],
html[data-theme="light"] #produtoEditorCard #form select,
html[data-theme="light"] #produtoEditorCard #form textarea {
    background: #f9fafb;
    border-color: var(--dash-border);
    color: var(--dash-text);
}
html[data-theme="light"] #produtoEditorCard #form textarea.produto-form-code {
    background: #f3f4f6;
    color: #1f2937;
}
html[data-theme="light"] #produtoEditorCard #form .produto-form-hint,
html[data-theme="light"] #produtoEditorCard #form .produto-form-hint--field {
    color: var(--dash-muted);
}
html[data-theme="light"] #produtoEditorCard #form strong {
    color: #374151;
}
html[data-theme="light"] #produtoEditorCard #form .produto-form-import,
html[data-theme="light"] #produtoEditorCard #form .produto-form-panel,
html[data-theme="light"] #produtoEditorCard .comentario-card,
html[data-theme="light"] #produtoEditorCard .smartwatch-variacao-row {
    background: #f9fafb;
    border-color: var(--dash-border);
}
html[data-theme="light"] #produtoEditorCard .produto-subcard__title {
    color: var(--dash-text);
}
html[data-theme="light"] #produtoEditorCard .produto-form-actions {
    background: linear-gradient(180deg, transparent, rgba(244, 246, 244, 0.96) 40%);
}
html[data-theme="light"] #produtoEditorCard .produto-form-actions .btn {
    background: #f3f4f6;
    color: var(--dash-text);
    border-color: var(--dash-border);
}
html[data-theme="light"] #produtoEditorCard button[type="submit"].btn-primary {
    background: var(--accent) !important;
    color: #111 !important;
}

/* Catálogo */
html[data-theme="light"] .catalogo-item {
    background: #f9fafb;
    border-color: var(--dash-border);
}

html[data-theme="light"] .catalogo-item-valor {
    color: #111827;
}

html[data-theme="light"] .catalogo-item-link {
    background: #fff;
    border-color: var(--dash-border);
    color: #374151;
}

html[data-theme="light"] .catalogo-item-preview {
    background: #f3f4f6;
    border-color: var(--dash-border);
}

/* Modais */
html[data-theme="light"] .modal .modal-box,
html[data-theme="light"] #modalCupom > div {
    background: #fff !important;
    border-color: var(--dash-border) !important;
    box-shadow: var(--dash-card-shadow);
    color: var(--dash-text);
}

html[data-theme="light"] #modalPedido .modal-pedido-body {
    color: #374151;
    background: #f9fafb;
    border-color: var(--dash-border);
}

html[data-theme="light"] #modalPedido .modal-pedido-section-title,
html[data-theme="light"] #modalPedido .modal-pedido-label {
    color: var(--dash-muted);
}

html[data-theme="light"] #modalPedido .modal-pedido-val {
    color: #111827;
}

html[data-theme="light"] #modalPedido .modal-pedido-val--muted,
html[data-theme="light"] #modalPedido .modal-pedido-item-meta {
    color: #6b7280;
}

html[data-theme="light"] #modalPedido .modal-pedido-item-nome {
    color: #374151;
}

html[data-theme="light"] #modalPedido .modal-pedido-row {
    border-bottom-color: #f3f4f6;
}

html[data-theme="light"] #btnAddComentario {
    color: #111827 !important;
}

html[data-theme="light"] #modal .modal-box {
    color-scheme: light;
    scrollbar-color: rgba(0, 0, 0, 0.2) #f3f4f6;
}

html[data-theme="light"] #modal .modal-box::-webkit-scrollbar-track {
    background: #f3f4f6;
}

html[data-theme="light"] #modal .modal-box::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
}
