/*!
 * Pure Fields — Dashboard v4 (Modern UI)
 * Scoped to body.toplevel_page_pure-fields
 */

/* ── WP ADMIN STRUCTURAL RESETS ─────────────────────────────────────────── */
.toplevel_page_pure-fields #wpcontent      { padding-left: 0 !important; overflow: visible !important; }
.toplevel_page_pure-fields #wpbody-content { padding: 0 !important; background: #f0f2f5 !important; overflow: visible !important; }
.toplevel_page_pure-fields #wpwrap,
.toplevel_page_pure-fields #wpbody         { overflow: visible !important; }

/* ── PAGE SHELL ──────────────────────────────────────────────────────────── */
.pfw-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #111827;
    background: #f0f2f5;
    min-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
}

/* ── DASHBOARD LAYOUT ────────────────────────────────────────────────────── */
.pfw-dashboard {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding: 24px 28px 32px;
    flex: 1;
    box-sizing: border-box;
}

/* ── MAIN COLUMN ─────────────────────────────────────────────────────────── */
.pfw-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── BANNER ──────────────────────────────────────────────────────────────── */
.pfw-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #162032 100%);
    border: none;
    border-radius: 14px;
    box-shadow: 0 4px 28px rgba(0,0,0,.18), 0 1px 4px rgba(0,0,0,.1);
    position: relative;
    overflow: hidden;
}

/* Decorative glow orbs */
.pfw-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 420px 300px at 5% 140%, rgba(99,102,241,.22) 0%, transparent 65%),
        radial-gradient(ellipse 300px 220px at 95% -40%, rgba(6,182,212,.14) 0%, transparent 60%);
    pointer-events: none;
}

/* Subtle dot-grid texture */
.pfw-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,.06) 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none;
}

.pfw-banner-brand,
.pfw-banner-chips { position: relative; z-index: 1; }

.pfw-banner-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.pfw-banner-brand img {
    width: 44px;
    height: 44px;
    filter: drop-shadow(0 0 14px rgba(99,102,241,.55));
    transition: transform .35s cubic-bezier(.34,1.56,.64,1);
}

.pfw-banner:hover .pfw-banner-brand img {
    transform: rotate(-8deg) scale(1.08);
}

.pfw-banner-name {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -.5px;
    background: linear-gradient(135deg, #ffffff 30%, #c7d2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.pfw-banner-sub {
    font-size: 12.5px;
    color: #94a3b8;
    margin-top: 6px;
    line-height: 1;
}

.pfw-banner-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.pfw-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 500;
    color: #94a3b8;
    padding: 5px 13px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 8px;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

.pfw-chip strong {
    font-size: 12.5px;
    font-weight: 700;
    color: #fff;
}

.pfw-chip--green {
    background: rgba(34,197,94,.1);
    border-color: rgba(34,197,94,.25);
    color: #4ade80;
}

/* ── SECTION HEAD ────────────────────────────────────────────────────────── */
.pfw-section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 0;
    border-bottom: none;
}

.pfw-section-head::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, #e5e7eb, transparent);
}

.pfw-eyebrow {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #9ca3af;
    white-space: nowrap;
}

/* ── OVERVIEW STATS ──────────────────────────────────────────────────────── */
.pfw-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.pfw-app a.pfw-stat,
.pfw-app a.pfw-stat:link,
.pfw-app a.pfw-stat:visited {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 20px 16px;
    background: #fff;
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 12px;
    text-decoration: none !important;
    color: inherit !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.03);
    transition: box-shadow .22s ease, transform .22s ease;
    position: relative;
    overflow: hidden;
}

/* Colored top accent bar */
.pfw-app a.pfw-stat::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 12px 12px 0 0;
    transition: height .22s ease;
}

.pfw-app a.pfw-stat.pfw-color-blue::before   { background: linear-gradient(90deg, #60a5fa, #2563eb); }
.pfw-app a.pfw-stat.pfw-color-purple::before { background: linear-gradient(90deg, #a78bfa, #7c3aed); }
.pfw-app a.pfw-stat.pfw-color-pink::before   { background: linear-gradient(90deg, #f472b6, #db2777); }
.pfw-app a.pfw-stat.pfw-color-teal::before   { background: linear-gradient(90deg, #2dd4bf, #0d9488); }
.pfw-app a.pfw-stat.pfw-color-orange::before { background: linear-gradient(90deg, #fb923c, #ea7010); }

.pfw-app a.pfw-stat:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.08), 0 16px 40px rgba(0,0,0,.05);
    transform: translateY(-4px);
    text-decoration: none !important;
}

.pfw-app a.pfw-stat:hover::before { height: 4px; }

.pfw-stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform .28s cubic-bezier(.34,1.56,.64,1);
}

.pfw-app a.pfw-stat:hover .pfw-stat-icon {
    transform: scale(1.12) rotate(-6deg);
}

.pfw-stat-icon .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #fff;
}

.pfw-stat-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.pfw-stat-count {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    color: #111827;
    letter-spacing: -1.5px;
}

.pfw-stat-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Stat icon gradients by color */
.pfw-color-blue   .pfw-stat-icon { background: linear-gradient(145deg, #60a5fa, #2563eb); }
.pfw-color-purple .pfw-stat-icon { background: linear-gradient(145deg, #c4b5fd, #7c3aed); }
.pfw-color-pink   .pfw-stat-icon { background: linear-gradient(145deg, #f9a8d4, #db2777); }
.pfw-color-teal   .pfw-stat-icon { background: linear-gradient(145deg, #5eead4, #0d9488); }
.pfw-color-orange .pfw-stat-icon { background: linear-gradient(145deg, #fdba74, #ea7010); }

/* ── TOOL GRID ───────────────────────────────────────────────────────────── */
.pfw-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

/* ── TOOL CARD ───────────────────────────────────────────────────────────── */
.pfw-app a.pfw-tool,
.pfw-app a.pfw-tool:link,
.pfw-app a.pfw-tool:visited {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 12px;
    text-decoration: none !important;
    color: inherit !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.03);
    overflow: hidden;
    transition: box-shadow .22s ease, transform .22s ease;
    position: relative;
}

.pfw-app a.pfw-tool:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.08), 0 16px 40px rgba(0,0,0,.05);
    transform: translateY(-4px);
    text-decoration: none !important;
    color: inherit !important;
}

/* Animated left accent bar */
.pfw-app a.pfw-tool::after {
    content: '';
    position: absolute;
    top: 14px; bottom: 14px; left: 0;
    width: 0;
    border-radius: 0 3px 3px 0;
    transition: width .2s ease;
}

.pfw-app a.pfw-tool:hover::after { width: 3px; }

.pfw-app a.pfw-tool.pfw-color-blue::after   { background: linear-gradient(180deg, #60a5fa, #2563eb); }
.pfw-app a.pfw-tool.pfw-color-purple::after { background: linear-gradient(180deg, #a78bfa, #7c3aed); }
.pfw-app a.pfw-tool.pfw-color-pink::after   { background: linear-gradient(180deg, #f472b6, #db2777); }
.pfw-app a.pfw-tool.pfw-color-teal::after   { background: linear-gradient(180deg, #2dd4bf, #0d9488); }
.pfw-app a.pfw-tool.pfw-color-orange::after { background: linear-gradient(180deg, #fb923c, #ea7010); }

/* Card header */
.pfw-tool-hd {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px 14px;
    border-bottom: 1px solid #f3f4f6;
}

/* Colored gradient icon */
.pfw-tool-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform .28s cubic-bezier(.34,1.56,.64,1);
}

.pfw-app a.pfw-tool:hover .pfw-tool-icon {
    transform: scale(1.12) rotate(-6deg);
}

.pfw-tool-icon .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #fff;
}

/* Tool icon gradients */
.pfw-color-blue   .pfw-tool-icon { background: linear-gradient(145deg, #60a5fa, #2563eb); }
.pfw-color-purple .pfw-tool-icon { background: linear-gradient(145deg, #c4b5fd, #7c3aed); }
.pfw-color-pink   .pfw-tool-icon { background: linear-gradient(145deg, #f9a8d4, #db2777); }
.pfw-color-teal   .pfw-tool-icon { background: linear-gradient(145deg, #5eead4, #0d9488); }
.pfw-color-orange .pfw-tool-icon { background: linear-gradient(145deg, #fdba74, #ea7010); }

.pfw-tool-name {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    flex: 1;
    line-height: 1.25;
    letter-spacing: -.25px;
}

/* Card body */
.pfw-tool-bd {
    padding: 12px 18px 8px;
    flex: 1;
}

.pfw-tool-desc {
    font-size: 12.5px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

/* Card footer */
.pfw-tool-ft {
    padding: 10px 18px 14px;
    border-top: 1px solid #f3f4f6;
}

.pfw-tool-open {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #d1d5db;
    transition: color .15s ease, gap .15s ease;
}

.pfw-app a.pfw-tool:hover .pfw-tool-open {
    color: var(--wp-admin-theme-color, #2563eb);
    gap: 8px;
}

/* ── WIDE CARD (Export / Import) ─────────────────────────────────────────── */
.pfw-app a.pfw-tool.pfw-tool--wide {
    grid-column: span 2;
    flex-direction: row;
    align-items: stretch;
}

.pfw-app a.pfw-tool.pfw-tool--wide .pfw-tool-hd {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    border-bottom: none;
    border-right: 1px solid #f3f4f6;
    padding: 20px 24px;
    min-width: 185px;
    gap: 10px;
}

.pfw-app a.pfw-tool.pfw-tool--wide .pfw-tool-bd {
    flex: 1;
    padding: 20px 24px;
    display: flex;
    align-items: center;
}

.pfw-app a.pfw-tool.pfw-tool--wide .pfw-tool-bd .pfw-tool-desc { margin: 0; }

.pfw-app a.pfw-tool.pfw-tool--wide .pfw-tool-ft {
    border-top: none;
    border-left: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    padding: 0 24px;
    white-space: nowrap;
}

/* ── SIDEBAR ─────────────────────────────────────────────────────────────── */
.pfw-sidebar {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── SIDEBAR CARD ────────────────────────────────────────────────────────── */
.pfw-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.03);
    overflow: hidden;
}

.pfw-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #f3f4f6;
    background: #fafafa;
}

/* Status pill */
.pfw-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .03em;
    padding: 3px 9px;
    border-radius: 20px;
}

.pfw-pill--green {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #15803d;
}

.pfw-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    animation: pfwPulse 2.4s ease-in-out infinite;
}

@keyframes pfwPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .3; }
}

/* ── META LIST ───────────────────────────────────────────────────────────── */
.pfw-meta {
    margin: 0;
    padding: 0 18px;
    display: flex;
    flex-direction: column;
}

.pfw-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 12.5px;
}

.pfw-meta-row:last-child { border-bottom: none; }

.pfw-meta-row dt { color: #6b7280; font-weight: 400; }
.pfw-meta-row dd { font-weight: 700; color: #111827; margin: 0; }

.pfw-meta-yes {
    display: flex !important;
    align-items: center;
    gap: 5px;
    color: #15803d !important;
    font-weight: 700 !important;
}

/* ── QUICK LINKS ─────────────────────────────────────────────────────────── */
.pfw-links {
    list-style: none;
    margin: 0;
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pfw-app a.pfw-link,
.pfw-app a.pfw-link:link,
.pfw-app a.pfw-link:visited {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #374151 !important;
    text-decoration: none !important;
    transition: background .12s, color .12s;
}

.pfw-app a.pfw-link:hover {
    background: #eff6ff;
    color: var(--wp-admin-theme-color, #2563eb) !important;
}

.pfw-app a.pfw-link .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
    color: #9ca3af;
    flex-shrink: 0;
    transition: color .12s;
}

.pfw-app a.pfw-link:hover .dashicons {
    color: var(--wp-admin-theme-color, #2563eb);
}

.pfw-link-ext {
    margin-left: auto;
    color: #d1d5db;
    flex-shrink: 0;
    transition: color .15s, transform .15s;
}

.pfw-app a.pfw-link:hover .pfw-link-ext {
    color: var(--wp-admin-theme-color, #2563eb);
    transform: translate(2px, -2px);
}
