/* WhatsPedidos Tiendas — v2.5.0 */
:root {
	--wpt-primary: #12b76a;
	--wpt-primary-soft: #e8f5ed;
	--wpt-primary-dark: #05603a;
	--wpt-bg: #f4f3f1;
	--wpt-sidebar-bg: #ffffff;
	--wpt-text: #14203e;
	--wpt-card-bg: #ffffff;
	--wpt-border: #e2e8f0;
	--wpt-muted: #64748b;
	--wpt-white: #ffffff;
	--wpt-danger: #f04438;
	--wpt-radius: 24px;
	--wpt-radius-sm: 12px;
}

/* 
 * WPT DASHBOARD ENCAPSULATION
 * We use high specificity with .wpt-dashboard to ensure our styles win
 * without relying on 'all: initial' or excessive '!important'.
 */
.wpt-dashboard {
    display: flex; 
    width: 100vw;
    height: 100vh; 
    min-height: 100vh;
    max-height: 100vh;
    background: var(--wpt-bg); 
    position: fixed;
    inset: 0;
    z-index: 999999999;
    overflow: hidden;
    visibility: visible;
    opacity: 1;
    box-sizing: border-box;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    color: var(--wpt-text);
}


.wpt-dashboard *, .wpt-dashboard *::before, .wpt-dashboard *::after {
    box-sizing: border-box !important;
    font-family: inherit !important;
}

.wpt-dashboard svg {
    display: inline-block;
    vertical-align: middle;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}


.wpt-dashboard a {
    text-decoration: none !important;
    color: inherit !important;
}

.wpt-dashboard ul, .wpt-dashboard li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.wpt-dashboard h1, .wpt-dashboard h2, .wpt-dashboard h3, .wpt-dashboard h4, .wpt-dashboard h5, .wpt-dashboard h6 {
    margin: 0 !important;
    padding: 0 !important;
    font-weight: 800 !important;
}

.wpt-dashboard p {
    margin: 0 !important;
}

/* Layout Structure */
.wpt-sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 280px !important;
    min-width: 280px !important;
    background: var(--wpt-sidebar-bg) !important;
    border-right: 1px solid var(--wpt-border) !important;
    padding: 32px 20px !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    overflow-y: auto !important;
    flex-shrink: 0 !important;
    z-index: 1000 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.wpt-sidebar__brand {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 0 10px 40px !important;
}

.wpt-sidebar__logo {
    width: 32px !important;
    height: 32px !important;
    background: var(--wpt-primary) !important;
    color: white !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 800 !important;
}

.wpt-sidebar__logo svg { width: 20px !important; height: 20px !important; fill: currentColor !important; }
.wpt-sidebar__brand span { font-weight: 800 !important; font-size: 20px !important; color: var(--wpt-primary) !important; }

.wpt-sidebar__label {
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: var(--wpt-muted) !important;
    font-weight: 700 !important;
    margin: 0 10px 12px !important;
}

.wpt-sidebar__nav { display: flex !important; flex-direction: column !important; gap: 2px !important; }
.wpt-sidebar__nav a {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 10px 12px !important;
    color: var(--wpt-muted) !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    border-radius: var(--wpt-radius-sm) !important;
    transition: all 0.2s !important;
}

.wpt-sidebar__nav a .dashicons { font-size: 18px !important; width: 18px !important; height: 18px !important; display: flex !important; align-items: center !important; justify-content: center !important; }
.wpt-sidebar__nav a:hover { background: #f9fafb !important; color: var(--wpt-text) !important; }
.wpt-sidebar__nav a.is-active { background: var(--wpt-primary-soft) !important; color: var(--wpt-primary) !important; }
.wpt-sidebar__footer { margin-top: auto !important; padding-top: 20px !important; }
.wpt-sidebar__divider { height: 1px !important; background: var(--wpt-border) !important; margin: 20px 0 !important; }

/* Main Content Area */
.wpt-main { 
    flex: 1 !important; 
    margin-left: 280px !important;
    width: calc(100% - 280px) !important;
    padding: 48px 60px !important; 
    overflow-y: auto !important;
    height: 100vh !important;
    scroll-behavior: smooth !important;
    position: relative !important;
    z-index: 1 !important;
    background: var(--wpt-bg) !important;
}

.wpt-main__header { display: flex !important; justify-content: space-between !important; align-items: flex-start !important; margin-bottom: 40px !important; background: transparent !important; padding: 0 !important; border: none !important; }
.wpt-main__header-text h1 { font-size: 32px !important; }
.wpt-main__header-text p { color: var(--wpt-muted) !important; font-size: 16px !important; }

/* Cards & Stats */
.wpt-card {
    background: var(--wpt-card-bg) !important;
    border: 1px solid var(--wpt-border) !important;
    border-radius: var(--wpt-radius) !important;
    padding: 32px !important;
    margin-bottom: 32px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
}

.wpt-grid { display: grid !important; gap: 32px !important; }
.wpt-grid--4 { grid-template-columns: repeat(4, 1fr) !important; }
.wpt-grid--2 { grid-template-columns: repeat(2, 1fr) !important; }

/* Stat Cards (Super Admin) */
.wpt-stat-card {
    display: flex !important;
    flex-direction: column !important;
}

.wpt-stat-card__header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 24px !important;
}

.wpt-stat-card__label {
    text-transform: uppercase !important;
    font-size: 11px !important;
    letter-spacing: 0.1em !important;
    font-weight: 700 !important;
    color: #94a3b8 !important;
}

.wpt-stat-card__icon {
    color: var(--wpt-primary) !important;
    background: var(--wpt-primary-soft) !important;
    padding: 10px !important;
    border-radius: 12px !important;
}

.wpt-stat-card__icon .dashicons {
    font-size: 20px !important;
    width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.wpt-stat-card__value {
    font-size: 48px !important;
    font-weight: 800 !important;
    color: var(--wpt-text) !important;
    display: block !important;
    line-height: 1 !important;
    margin-bottom: 16px !important;
}

.wpt-stat-card__indicator {
    height: 4px !important;
    width: 32px !important;
    background: var(--wpt-primary) !important;
    border-radius: 2px !important;
    opacity: 0.2 !important;
}

/* Buttons */
.wpt-btn {
    display: inline-flex !important; 
    align-items: center !important; 
    justify-content: center !important; 
    gap: 10px !important;
    padding: 12px 24px !important; 
    border-radius: 16px !important; 
    font-weight: 700 !important;
    cursor: pointer !important; 
    transition: all 0.2s !important;
    font-size: 14px !important;
    border: none !important;
}

.wpt-btn--primary { background: var(--wpt-primary) !important; color: white !important; }
.wpt-btn--outline { background: transparent !important; color: var(--wpt-text) !important; border: 1px solid var(--wpt-border) !important; }
.wpt-btn--block { width: 100% !important; }
.wpt-btn:hover { transform: translateY(-2px) !important; box-shadow: 0 8px 20px rgba(0,0,0,0.1) !important; }

/* 
 * THEME ISOLATION
 * When active on a WhatsPedidos custom page, we hide theme elements
 * and ensure the body occupies the full viewport.
 */
body.wpt-custom-page {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: var(--wpt-bg) !important;
}

body.wpt-custom-page header:not(.wpt-exclude),
body.wpt-custom-page footer:not(.wpt-exclude),
body.wpt-custom-page .site-header,
body.wpt-custom-page .site-footer,
body.wpt-custom-page #header,
body.wpt-custom-page #footer,
body.wpt-custom-page .sidebar,
body.wpt-custom-page #sidebar,
body.wpt-custom-page .ast-header-break-point,
body.wpt-custom-page #wpadminbar {
    display: none !important;
}

.wpt-dashboard-page .ast-container,
.wpt-dashboard-page #primary,
.wpt-dashboard-page #content,
.wpt-dashboard-page .site-content {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}


/* Responsive */
@media (max-width: 1024px) {
    .wpt-sidebar { width: 80px !important; min-width: 80px !important; padding: 20px 10px !important; }
    .wpt-sidebar__brand span, .wpt-sidebar__label, .wpt-sidebar__nav a span:not(.dashicons) { display: none !important; }
    .wpt-sidebar__nav a { justify-content: center !important; }
    .wpt-main { margin-left: 80px !important; width: calc(100% - 80px) !important; padding: 30px 20px !important; }
    .wpt-grid--4 { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 600px) {
    .wpt-grid--4 { grid-template-columns: 1fr !important; }
}

