/* =============================================================
   CommercePilot
   Light mode — all colours scoped & hardcoded under .cp-dashboard
   No card hover lift animation. KPI value: 16px / weight 500.
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Root colours scoped to the wrapper — theme-proof ───────── */
.cp-dashboard {
    /* Layout */
    display: block;
    padding: 28px;
    /* Force white/light regardless of WordPress theme */
    background-color: #d5d9e2 !important;
    color: #111827 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif !important;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
    /* Appearance setting — overridden per-site via an inline <style> in dashboard.php */
    --cp-accent: #1d4ed8;
    --cp-accent-rgb: 29,78,216;
}

/* Hard reset on every child — kills theme colour bleed */
.cp-dashboard *,
.cp-dashboard *::before,
.cp-dashboard *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Force all text dark */
.cp-dashboard p,
.cp-dashboard span,
.cp-dashboard div,
.cp-dashboard li,
.cp-dashboard td,
.cp-dashboard th,
.cp-dashboard label {
    color: inherit;
}

/* ── Header ──────────────────────────────────────────────────── */
.cp-dashboard .cp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding: 18px 22px;
    background-color: #ffffff !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.cp-dashboard .cp-header__brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cp-dashboard .cp-logo {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
}

.cp-dashboard .cp-header__title {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    letter-spacing: -0.3px;
    line-height: 1.2;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    box-shadow: none !important;
}

.cp-dashboard .cp-header__sub {
    font-size: 12px !important;
    color: #64748b !important;
    font-weight: 400 !important;
    margin-top: 2px;
}

.cp-dashboard .cp-header__controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Date range ──────────────────────────────────────────────── */
.cp-dashboard .cp-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #f7f9fc !important;
    padding: 6px 12px;
}

.cp-dashboard .cp-label {
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #64748b !important;
    white-space: nowrap;
}

.cp-dashboard .cp-date-sep {
    color: #94a3b8 !important;
    font-size: 12px;
}

.cp-dashboard .cp-input {
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: #111827 !important;
    font-family: 'JetBrains Mono', ui-monospace, monospace !important;
    font-size: 12px !important;
    cursor: pointer;
    padding: 2px 4px;
}
.cp-dashboard .cp-input:hover {
    background-color: #edf0f5 !important;
}
.cp-dashboard .cp-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.5;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.cp-dashboard .cp-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 7px 14px;
    cursor: pointer;
    border: none;
    text-decoration: none !important;
    white-space: nowrap;
    line-height: 1.2;
    transition: background-color 0.15s, color 0.15s;
}

.cp-dashboard .cp-btn--primary {
    background-color: var(--cp-accent, #1d4ed8) !important;
    color: #ffffff !important;
}
.cp-dashboard .cp-btn--primary:hover {
    background-color: #1e40af !important;
    color: #ffffff !important;
}

.cp-dashboard .cp-btn--export {
    background-color: #ecfdf5 !important;
    color: #065f46 !important;
}
.cp-dashboard .cp-btn--export:hover {
    background-color: #d1fae5 !important;
    color: #065f46 !important;
}

/* ── KPI grid ────────────────────────────────────────────────── */
.cp-dashboard .cp-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

/* ── Base card — NO hover lift ───────────────────────────────── */
.cp-dashboard .cp-card {
    background-color: #ffffff !important;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    color: #111827 !important;
    /* No transform, no transition — hover animation removed */
}

/* ── KPI card layout ─────────────────────────────────────────── */
.cp-dashboard .cp-card--kpi {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    position: relative;
}

/* Status dot, top-left corner — replaces the old left-border accent */
.cp-dashboard .cp-card--kpi::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #1d4ed8;
}

/* Dot colour per card */
.cp-dashboard .cp-card--accent-green::before  { background-color: #059669; }
.cp-dashboard .cp-card--accent-blue::before   { background-color: var(--cp-accent, #1d4ed8); }
.cp-dashboard .cp-card--accent-purple::before { background-color: #7c3aed; }
.cp-dashboard .cp-card--accent-orange::before { background-color: #d97706; }
.cp-dashboard .cp-card--accent-teal::before   { background-color: #0891b2; }
.cp-dashboard .cp-card--accent-rose::before   { background-color: #e11d48; }

/* Icon bubble */
.cp-dashboard .cp-card__icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cp-dashboard .cp-card__icon svg {
    width: 17px;
    height: 17px;
}

/* Per-accent icon colours */
.cp-dashboard .cp-card--accent-green  .cp-card__icon { background-color: #ecfdf5; color: #059669 !important; }
.cp-dashboard .cp-card--accent-blue   .cp-card__icon { background-color: #eff6ff; color: var(--cp-accent, #1d4ed8) !important; }
.cp-dashboard .cp-card--accent-purple .cp-card__icon { background-color: #f5f3ff; color: #7c3aed !important; }
.cp-dashboard .cp-card--accent-orange .cp-card__icon { background-color: #fffbeb; color: #d97706 !important; }
.cp-dashboard .cp-card--accent-teal   .cp-card__icon { background-color: #ecfeff; color: #0891b2 !important; }
.cp-dashboard .cp-card--accent-rose   .cp-card__icon { background-color: #fff1f2; color: #e11d48 !important; }

.cp-dashboard .cp-card__content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.cp-dashboard .cp-card__label {
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b !important;
    white-space: nowrap;
}

/* ── KPI VALUE — 16px, weight 500, NOT bold, fits in card ────── */
.cp-dashboard .cp-card__value {
    font-size: 16px !important;
    font-weight: 500 !important;
    color: #111827 !important;
    font-family: 'JetBrains Mono', ui-monospace, monospace !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.2px;
    line-height: 1.3;
}

.cp-dashboard .cp-card__sub {
    font-size: 11px !important;
    color: #94a3b8 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Card header ─────────────────────────────────────────────── */
.cp-dashboard .cp-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.cp-dashboard .cp-card__title {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #111827 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
}

.cp-dashboard .cp-badge {
    font-size: 10px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background-color: #eff6ff !important;
    color: #1d4ed8 !important;
    border: 1px solid #bfdbfe;
    padding: 2px 8px;
    border-radius: 100px;
}

/* ── Two-column chart grid ───────────────────────────────────── */
.cp-dashboard .cp-charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.cp-dashboard .cp-card--chart {
    padding: 18px;
}

.cp-dashboard .cp-chart-wrap {
    position: relative;
    height: 220px;
}
.cp-dashboard .cp-chart-wrap--sm {
    height: 200px;
}

/* ── Two-column table grid ───────────────────────────────────── */
.cp-dashboard .cp-tables-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.cp-dashboard .cp-card--table { padding: 18px; }
.cp-dashboard .cp-card--full  { grid-column: 1 / -1; }

.cp-dashboard .cp-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cp-dashboard .cp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: #111827;
}

.cp-dashboard .cp-table th {
    text-align: left;
    padding: 8px 12px;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #64748b !important;
    background-color: #f7f9fc !important;
    white-space: nowrap;
}

.cp-dashboard .cp-table td {
    padding: 10px 12px;
    color: #111827 !important;
    background-color: transparent !important;
    vertical-align: middle;
}

.cp-dashboard .cp-table tbody tr:nth-child(even) td {
    background-color: #f7f9fc !important;
}

.cp-dashboard .cp-table tbody tr:hover td {
    background-color: #eff6ff !important;
}

.cp-dashboard .cp-table a {
    color: #1d4ed8 !important;
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 500;
}
.cp-dashboard .cp-table a:hover {
    text-decoration: underline;
    color: #1e40af !important;
}

.cp-dashboard .cp-table__empty {
    text-align: center !important;
    padding: 28px 12px !important;
    color: #94a3b8 !important;
    font-style: italic;
}

/* ── Status pills ────────────────────────────────────────────── */
.cp-dashboard .cp-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: capitalize;
    border: 1px solid transparent;
    line-height: 1.5;
}
.cp-dashboard .cp-status--completed       { background-color: #ecfdf5 !important; color: #065f46 !important; border-color: #6ee7b7; }
.cp-dashboard .cp-status--processing      { background-color: #eff6ff !important; color: #1e40af !important; border-color: #93c5fd; }
.cp-dashboard .cp-status--on-hold         { background-color: #fffbeb !important; color: #92400e !important; border-color: #fcd34d; }
.cp-dashboard .cp-status--pending,
.cp-dashboard .cp-status--pending-payment { background-color: #f5f3ff !important; color: #5b21b6 !important; border-color: #c4b5fd; }
.cp-dashboard .cp-status--cancelled       { background-color: #f8fafc !important; color: #64748b !important; border-color: #dde3ed; }
.cp-dashboard .cp-status--refunded        { background-color: #fff1f2 !important; color: #9f1239 !important; border-color: #fda4af; }

/* ── Section wrapper ─────────────────────────────────────────── */
.cp-dashboard .cp-section {
    margin-bottom: 20px;
}

/* ── Customer stats large numbers ────────────────────────────── */
.cp-dashboard .cp-stats-row {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    padding: 12px 0 4px;
}

.cp-dashboard .cp-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cp-dashboard .cp-stat__num {
    font-size: 36px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    font-family: 'JetBrains Mono', monospace !important;
    letter-spacing: -2px;
    line-height: 1;
}

.cp-dashboard .cp-stat__lbl {
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #64748b !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ── Loading spinner overlay ─────────────────────────────────── */
.cp-dashboard .cp-loading {
    position: fixed;
    inset: 0;
    background-color: rgba(240,242,247,0.80) !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    z-index: 99999;
    backdrop-filter: blur(3px);
}

.cp-dashboard .cp-loading p {
    font-size: 13px !important;
    color: #64748b !important;
    font-weight: 500;
}

.cp-dashboard .cp-loading__spinner {
    width: 34px;
    height: 34px;
    border: 3px solid #dde3ed;
    border-top-color: var(--cp-accent, #1d4ed8);
    border-radius: 50%;
    animation: cp-spin 0.65s linear infinite;
}

@keyframes cp-spin { to { transform: rotate(360deg); } }

/* ── Access denied ───────────────────────────────────────────── */
.cp-dashboard .cp-access-denied {
    padding: 36px;
    text-align: center;
    color: #9f1239 !important;
    font-weight: 600;
    font-size: 15px;
    background-color: #fff1f2 !important;
}

/* ── Footer ──────────────────────────────────────────────────── */
.cp-dashboard .cp-footer {
    margin-top: 28px;
    padding-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.cp-dashboard .cp-footer__text {
    font-size: 11px !important;
    color: #94a3b8 !important;
}
.cp-dashboard .cp-footer__text a {
    color: #1d4ed8 !important;
    text-decoration: none;
}
.cp-dashboard .cp-footer__text a:hover {
    text-decoration: underline;
}

.cp-dashboard .cp-version-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background-color: #eff6ff !important;
    color: #1d4ed8 !important;
    border: 1px solid #bfdbfe;
    padding: 3px 9px;
    border-radius: 100px;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .cp-dashboard .cp-charts-grid { grid-template-columns: 1fr; }
    .cp-dashboard .cp-tables-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .cp-dashboard                       { padding: 14px; }
    .cp-dashboard .cp-header            { flex-direction: column; align-items: flex-start; }
    .cp-dashboard .cp-header__controls  { width: 100%; }
    .cp-dashboard .cp-date-range        { flex-wrap: wrap; width: 100%; }
    .cp-dashboard .cp-kpi-grid          { grid-template-columns: repeat(2, 1fr); }
    .cp-dashboard .cp-card__value       { font-size: 14px !important; }
}

@media (max-width: 480px) {
    .cp-dashboard .cp-kpi-grid  { grid-template-columns: 1fr; }
    .cp-dashboard .cp-stats-row { gap: 24px; }
    .cp-dashboard .cp-stat__num { font-size: 28px !important; }
}

/* ============================================================
   SIDEBAR LAYOUT — added v1.3.0
   ============================================================ */

/* Override: outer wrapper becomes flex row */
.cp-dashboard {
    padding: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    min-height: 100vh;
    align-items: stretch;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.cp-dashboard .cp-sidebar {
    width: 220px;
    min-width: 220px;
    background-color: #1e2535 !important;
    display: flex;
    flex-direction: column;
    padding: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    flex-shrink: 0;
}

.cp-dashboard .cp-sidebar__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 18px 20px;
}

.cp-dashboard .cp-sidebar__brand {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    letter-spacing: -0.3px;
}

/* SVG presentation attributes don't reliably resolve var() — use classes instead. */
.cp-dashboard .cp-logo-accent-fill   { fill: var(--cp-accent, #1d4ed8) !important; }
.cp-dashboard .cp-logo-accent-stroke { stroke: var(--cp-accent, #1d4ed8) !important; }
.cp-dashboard .cp-sidebar__logo-img  { width: 28px; height: 28px; object-fit: contain; }

.cp-dashboard .cp-sidebar__nav {
    flex: 1;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cp-dashboard .cp-sidebar__section-label {
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.3) !important;
    padding: 10px 10px 4px;
    display: block;
}

.cp-dashboard .cp-nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    color: rgba(255,255,255,0.65) !important;
    text-decoration: none !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    transition: background-color 0.12s, color 0.12s;
    cursor: pointer;
}

.cp-dashboard .cp-nav-item:hover {
    background-color: rgba(255,255,255,0.07) !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

.cp-dashboard .cp-nav-item--active {
    background-color: var(--cp-accent, #1d4ed8) !important;
    color: #ffffff !important;
}

.cp-dashboard .cp-sidebar__footer {
    padding: 18px;
}
.cp-dashboard .cp-sidebar__footer .cp-nav-item {
    margin: -6px -8px 10px;
}

.cp-dashboard .cp-sidebar__site-name {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: rgba(255,255,255,0.75) !important;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cp-dashboard .cp-sidebar__footer-meta {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cp-dashboard .cp-sidebar__user {
    font-size: 11px !important;
    color: rgba(255,255,255,0.45) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.cp-dashboard .cp-sidebar__footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
}

.cp-dashboard .cp-sidebar__version {
    font-size: 10px !important;
    color: rgba(255,255,255,0.25) !important;
    font-family: 'JetBrains Mono', monospace !important;
}

.cp-dashboard .cp-sidebar__logout {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px !important;
    font-weight: 500 !important;
    color: rgba(255,255,255,0.45) !important;
    text-decoration: none !important;
}
.cp-dashboard .cp-sidebar__logout:hover {
    color: #ffffff !important;
    text-decoration: none !important;
}

/* ── Main content area ───────────────────────────────────────── */
.cp-dashboard .cp-main {
    flex: 1;
    min-width: 0;
    background-color: #d5d9e2 !important;
    overflow-y: auto;
}

/* ── Panels ──────────────────────────────────────────────────── */
.cp-dashboard .cp-panel {
    padding: 24px;
    min-height: 100vh;
}

.cp-dashboard .cp-panel--hidden {
    display: none !important;
}

/* ── Top bar (replaces old header) ──────────────────────────── */
.cp-dashboard .cp-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 22px;
    padding: 16px 20px;
    background-color: #ffffff !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.cp-dashboard .cp-topbar__title { display: flex; flex-direction: column; gap: 2px; }
.cp-dashboard .cp-topbar__controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── Products table specifics ────────────────────────────────── */
.cp-dashboard .cp-table--products .cp-product-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    display: block;
}

.cp-dashboard .cp-table--products td { vertical-align: middle; }

.cp-dashboard .cp-product-name-link {
    color: #111827 !important;
    font-weight: 600;
    text-decoration: none;
    font-family: inherit !important;
    font-size: 13px !important;
}
.cp-dashboard .cp-product-name-link:hover { color: #1d4ed8 !important; text-decoration: underline; }

.cp-dashboard .cp-product-type-badge {
    display: inline-block;
    font-size: 10px;
    padding: 1px 6px;
    background-color: #d5d9e2;
    color: #64748b !important;
    font-weight: 500;
    margin-top: 3px;
}

/* Product status pills */
.cp-dashboard .cp-prod-status { display: inline-block; padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 600; border: 1px solid transparent; }
.cp-dashboard .cp-prod-status--publish { background-color: #ecfdf5; color: #065f46 !important; border-color: #6ee7b7; }
.cp-dashboard .cp-prod-status--draft   { background-color: #f8fafc; color: #64748b !important; border-color: #dde3ed; }
.cp-dashboard .cp-prod-status--pending { background-color: #fffbeb; color: #92400e !important; border-color: #fcd34d; }
.cp-dashboard .cp-prod-status--private { background-color: #f5f3ff; color: #5b21b6 !important; border-color: #c4b5fd; }

/* ── New Product form layout ─────────────────────────────────── */
.cp-dashboard .cp-topbar--compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 12px;
    margin-bottom: 12px;
}
.cp-dashboard .cp-topbar__actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.cp-dashboard .cp-product-compact-card {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cp-dashboard .cp-product-compact-body {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 16px;
    align-items: start;
}

.cp-dashboard .cp-product-compact-left {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cp-dashboard .cp-product-compact-right {
    display: flex;
    flex-direction: column;
}

.cp-dashboard .cp-product-compact-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-top: 10px;
    padding: 8px 10px;
    background: #f7f9fc;
}

.cp-dashboard .cp-attributes-list { display: flex; flex-direction: column; gap: 8px; }
.cp-dashboard .cp-attribute-row { display: flex; gap: 8px; align-items: center; }
.cp-dashboard .cp-attribute-row .fp-attr-name { flex: 1; }
.cp-dashboard .cp-attribute-row .fp-attr-values { flex: 2; }

.cp-dashboard .cp-variations-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.cp-dashboard .cp-variation-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f7f9fc;
}
.cp-dashboard .cp-variation-row__label { flex: 1.4; font-size: 12px; font-weight: 600; color: #374151; }
.cp-dashboard .cp-variation-row .cp-form-input { flex: 1; }

.cp-dashboard .cp-badge--plugin-hint {
    font-size: 10px !important;
    color: #92400e !important;
    background: #fef3c7;
    padding: 1px 5px;
    margin-left: 2px;
    font-weight: 600;
}

.cp-dashboard .cp-form-group--grow2 { flex: 2; }

.cp-dashboard .cp-form-card {
    padding: 18px 20px;
}

/* ── Compact textarea variant ────────────────────────────────── */
.cp-dashboard .cp-form-textarea--compact {
    resize: none;
    font-size: 12px !important;
}

/* ── Description / Short Description editors (wp_editor / TinyMCE) ──────── */
.cp-dashboard .cp-form-row--editors { align-items: flex-start; }
.cp-dashboard .wp-editor-container {
    border: 1px solid #dde3ed !important;
    background-color: #ffffff;
}
.cp-dashboard .wp-editor-tabs { background-color: #f7f9fc; }
.cp-dashboard .wp-editor-tabs .wp-switch-editor {
    font-size: 11px !important;
    font-family: 'Inter', sans-serif;
    border: none !important;
    background: transparent;
    color: #64748b;
}
.cp-dashboard .wp-editor-tabs .wp-switch-editor.switch-tmce { color: #111827; }
.cp-dashboard .mce-toolbar-grp,
.cp-dashboard .quicktags-toolbar {
    background-color: #f7f9fc !important;
    border-bottom: 1px solid #dde3ed !important;
}
.cp-dashboard .wp-editor-area { font-family: 'Inter', sans-serif; font-size: 13px; }

/* ── Form inputs ─────────────────────────────────────────────── */
.cp-dashboard .cp-form-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: #111827 !important;
    background-color: #f7f9fc !important;
    outline: none;
    transition: background-color 0.15s, box-shadow 0.15s;
}
.cp-dashboard .cp-form-input:focus {
    background-color: #eff6ff !important;
    box-shadow: 0 0 0 3px rgba(var(--cp-accent-rgb, 29,78,216), 0.1);
}
.cp-dashboard .cp-form-input--lg {
    font-size: 16px !important;
    font-weight: 600 !important;
    padding: 10px 14px;
}

.cp-dashboard .cp-form-textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: #111827 !important;
    background-color: #f7f9fc !important;
    outline: none;
    resize: vertical;
    transition: background-color 0.15s, box-shadow 0.15s;
    line-height: 1.6;
}
.cp-dashboard .cp-form-textarea:focus {
    background-color: #eff6ff !important;
    box-shadow: 0 0 0 3px rgba(var(--cp-accent-rgb, 29,78,216), 0.1);
}

.cp-dashboard .cp-form-select {
    width: 100%;
    padding: 8px 32px 8px 12px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: #111827 !important;
    background-color: #f7f9fc !important;
    outline: none;
    cursor: pointer;
    /* Native <select> chrome paints its own rounded skin regardless of
       border-radius:0 unless the OS widget theme is disabled. */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px 6px;
}
.cp-dashboard .cp-form-select:focus { background-color: #eff6ff !important; box-shadow: 0 0 0 3px rgba(var(--cp-accent-rgb, 29,78,216), 0.1); }

.cp-dashboard .cp-form-label {
    display: block;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #374151 !important;
    margin-bottom: 6px;
}

.cp-dashboard .cp-form-hint {
    font-size: 11px !important;
    color: #9aa3bb !important;
    margin-left: 4px;
}

.cp-dashboard .cp-form-group { display: flex; flex-direction: column; flex: 1; }

.cp-dashboard .cp-form-row {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
}
.cp-dashboard .cp-form-row--checks { flex-wrap: wrap; gap: 16px; margin-bottom: 14px; }
.cp-dashboard .cp-form-row--nomargin { margin-bottom: 0; }
.cp-dashboard .cp-form-row:last-child { margin-bottom: 0; }

/* ── Checkbox ────────────────────────────────────────────────── */
.cp-dashboard .cp-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px !important;
    color: #111827 !important;
    font-weight: 500;
    user-select: none;
}
.cp-dashboard .cp-checkbox-label--block { display: flex; }
.cp-dashboard .cp-checkbox { display: none; }
.cp-dashboard .cp-checkbox-box {
    width: 16px;
    height: 16px;
    min-width: 16px;
    background-color: #dde3ed;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.12s;
}
.cp-dashboard .cp-checkbox:checked + .cp-checkbox-box {
    background-color: #1d4ed8;
}
.cp-dashboard .cp-checkbox:checked + .cp-checkbox-box::after {
    content: '';
    width: 8px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translateY(-1px);
    display: block;
}

/* ── Buttons extras ──────────────────────────────────────────── */
.cp-dashboard .cp-btn--full { width: 100%; justify-content: center; }
.cp-dashboard .cp-btn--ghost {
    background-color: #f7f9fc !important;
    color: #374151 !important;
}
.cp-dashboard .cp-btn--ghost:hover {
    background-color: #edf0f5 !important;
    color: #111827 !important;
}

/* ── Image picker ────────────────────────────────────────────── */
.cp-dashboard .cp-image-picker__placeholder {
    background-color: #f7f9fc;
    padding: 28px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #94a3b8 !important;
    font-size: 12px !important;
    cursor: pointer;
    transition: background-color 0.15s;
}
.cp-dashboard .cp-image-picker__placeholder--sm {
    padding: 14px 10px;
    gap: 4px;
    font-size: 11px !important;
}
.cp-dashboard .cp-image-picker__placeholder:hover { background-color: #eff6ff; }

/* ── Categories checklist ────────────────────────────────────── */
.cp-dashboard .cp-categories-checklist {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 4px;
}
.cp-dashboard .cp-categories-checklist--compact {
    max-height: 130px;
    gap: 3px;
}
.cp-dashboard .cp-categories-checklist--compact .cp-checkbox-label {
    font-size: 12px !important;
    padding: 3px 4px;
}
.cp-dashboard .cp-categories-checklist .cp-checkbox-label {
    padding: 5px 4px;
}
.cp-dashboard .cp-categories-checklist .cp-checkbox-label:hover { background-color: #f7f9fc; }

.cp-dashboard .cp-add-category-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}
.cp-dashboard .cp-add-category-row .cp-form-input {
    flex: 1;
    padding: 6px 10px;
    font-size: 12px;
}
.cp-dashboard .cp-add-category-row .cp-btn {
    font-size: 11px;
    padding: 6px 12px;
    white-space: nowrap;
}

/* ── Badge variants ──────────────────────────────────────────── */
.cp-dashboard .cp-badge--plugin { background-color: #fef3c7 !important; color: #92400e !important; border-color: #fcd34d; }
.cp-dashboard .cp-badge--info   { background-color: #ecfeff !important; color: #0e7490 !important; border-color: #67e8f9; }

/* ── Alert messages ──────────────────────────────────────────── */
.cp-dashboard .cp-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
}
.cp-dashboard .cp-alert--success { background-color: #ecfdf5 !important; color: #065f46 !important; }
.cp-dashboard .cp-alert--error   { background-color: #fff1f2 !important; color: #9f1239 !important; }
.cp-dashboard .cp-alert__link    { margin-left: auto; color: inherit !important; font-weight: 700; text-decoration: underline; white-space: nowrap; }

/* ── Inline loading ──────────────────────────────────────────── */
.cp-dashboard .cp-inline-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px;
    color: #64748b !important;
    font-size: 13px;
}
.cp-dashboard .cp-inline-loading .cp-loading__spinner {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .cp-dashboard .cp-product-form-grid { grid-template-columns: 1fr; }
    .cp-dashboard .cp-product-form-side { order: -1; }
    .cp-dashboard .cp-product-compact-body { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .cp-dashboard { flex-direction: column !important; }
    .cp-dashboard .cp-sidebar {
        width: 100% !important;
        min-width: 0 !important;
        height: auto;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 10px;
    }
    .cp-dashboard .cp-sidebar__logo { padding: 8px 10px; border-bottom: none; }
    .cp-dashboard .cp-sidebar__nav  { flex-direction: row; flex-wrap: wrap; padding: 0 6px 8px; gap: 4px; flex: none; width: 100%; }
    .cp-dashboard .cp-sidebar__section-label { display: none; }
    .cp-dashboard .cp-sidebar__footer { display: none; }
    .cp-dashboard .cp-panel { padding: 14px; }
    .cp-dashboard .cp-form-row { flex-direction: column; }
    .cp-dashboard .cp-kpi-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 480px) {
    .cp-dashboard .cp-kpi-grid { grid-template-columns: 1fr; }
}

/* ── Inline row editing ───────────────────────────────────────── */
.cp-dashboard .cp-product-row td { vertical-align: middle; }
.cp-dashboard .cp-product-row.cp-row--editing { background: #f8faff; }
.cp-dashboard .cp-row--saved { animation: cp-row-flash 1.2s ease; }
@keyframes cp-row-flash {
    0%,100% { background: transparent; }
    30%      { background: #dcfce7; }
}
.cp-dashboard .cp-inline-input { min-width: 90px; width: 100%; font-size: 12px; padding: 4px 8px; height: 30px; }
.cp-dashboard .cp-col-sku .cp-inline-input { max-width: 100px; }
.cp-dashboard .cp-col-price .cp-inline-input { max-width: 80px; }
.cp-dashboard .cp-col-status .cp-form-select.cp-inline-input { font-size: 12px; padding: 4px 6px; height: 30px; }

/* action buttons */
.cp-dashboard .cp-col-actions { width: 72px; white-space: nowrap; }
.cp-dashboard .cp-row-actions { display: flex; gap: 4px; align-items: center; }
.cp-dashboard .cp-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px;
    background: #f7f9fc; cursor: pointer; color: #64748b; transition: all .15s;
}
.cp-dashboard .cp-icon-btn:hover { color: #1e293b; background: #edf0f5; }
.cp-dashboard .cp-icon-btn--save  { color: #16a34a; background: #f0fdf4; }
.cp-dashboard .cp-icon-btn--save:hover { background: #dcfce7; }
.cp-dashboard .cp-icon-btn--cancel { color: #dc2626; background: #fff7f7; }
.cp-dashboard .cp-icon-btn--cancel:hover { background: #fee2e2; }

/* ── Edit product modal ───────────────────────────────────────── */
.cp-dashboard .cp-modal-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(15,23,42,.45);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
body.cp-modal-open { overflow: hidden; }

.cp-dashboard .cp-modal {
    background: #fff; width: 100%; max-width: 860px;
    max-height: 92vh; overflow-y: auto; box-shadow: 0 24px 64px rgba(0,0,0,.22);
    display: flex; flex-direction: column;
}
.cp-dashboard .cp-modal__header {
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 20px 24px 14px; gap: 12px; flex-shrink: 0;
}
.cp-dashboard .cp-modal__title { font-size: 16px; font-weight: 700; color: #0f172a; margin: 0 0 2px; }
.cp-dashboard .cp-modal__sub { font-size: 12px; color: #64748b; margin: 0; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-dashboard .cp-modal__header-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.cp-dashboard .cp-btn--sm { font-size: 11px; padding: 5px 10px; }
.cp-dashboard .cp-modal__close {
    width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
    background: #f7f9fc; cursor: pointer; color: #64748b;
}
.cp-dashboard .cp-modal__close:hover { background: #edf0f5; color: #0f172a; }
.cp-dashboard .cp-modal__loader { padding: 32px 24px; }
.cp-dashboard #cp-modal-body,
.cp-dashboard #cp-user-modal-body { padding: 20px 24px; flex: 1; }
.cp-dashboard .cp-modal__footer {
    padding: 14px 24px; background: #f7f9fc;
    display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0;
}

/* modal body grid */
.cp-dashboard .cp-modal-body-grid {
    display: grid; grid-template-columns: 1fr 200px; gap: 18px; margin-top: 14px;
}
.cp-dashboard .cp-modal-body-left { display: flex; flex-direction: column; gap: 0; }
.cp-dashboard .cp-modal-body-right { display: flex; flex-direction: column; gap: 0; }

.cp-dashboard .cp-categories-checklist--modal {
    max-height: 160px; overflow-y: auto;
    background: #f7f9fc;
    padding: 8px 10px; display: flex; flex-direction: column; gap: 4px;
}

/* ============================================================
   SETTINGS — added v1.6.0
   ============================================================ */
.cp-dashboard .cp-settings-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background-color: #f7f9fc;
    margin-bottom: 16px;
}
.cp-dashboard .cp-settings-tab {
    padding: 8px 14px;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #64748b;
    cursor: pointer;
    background: none;
    border: none;
    font-family: 'Inter', sans-serif;
}
.cp-dashboard .cp-settings-tab--active {
    background-color: #ffffff;
    color: #111827;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.cp-dashboard .cp-settings-tab-content--hidden { display: none; }

.cp-dashboard .cp-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.cp-dashboard .cp-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}

/* Toggle switch — pill/circle shapes are the documented exception to the flat design system. */
.cp-dashboard .cp-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}
.cp-dashboard .cp-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.cp-dashboard .cp-switch__track {
    position: absolute;
    inset: 0;
    background-color: #dde3ed;
    border-radius: 100px;
    transition: background-color .15s;
}
.cp-dashboard .cp-switch input:checked + .cp-switch__track {
    background-color: var(--cp-accent, #1d4ed8);
}
.cp-dashboard .cp-switch__thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: transform .15s;
    box-shadow: 0 1px 2px rgba(0,0,0,.15);
    pointer-events: none;
}
.cp-dashboard .cp-switch input:checked ~ .cp-switch__thumb {
    transform: translateX(16px);
}

@media (max-width: 640px) {
    .cp-dashboard .cp-modal-body-grid { grid-template-columns: 1fr; }
    .cp-dashboard .cp-settings-tabs { flex-wrap: wrap; }
}
