/*
Theme Name: Personal Finance Command Center
Theme URI: https://example.invalid/personal-finance-command-center
Author: Finance Command Center
Author URI: https://example.invalid
Description: A calm, data-focused application shell for the Personal Finance Command Center plugin. Provides the sidebar, navigation, header, light/dark modes and design tokens. Contains no financial logic and no secrets; every financial screen is rendered by the companion plugin after server-side authentication. Remains usable as a plain theme if the plugin is inactive.
Version: 1.0.0
Requires at least: 6.2
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pfcc-theme
Tags: custom-colors, accessibility-ready, one-column, blog, translation-ready
*/

/* Design tokens. `html:root` outranks the plugin's :root defaults regardless of load order. */
html:root {
  --pfcc-bg: #F6F7FB; --pfcc-surface: #FFFFFF; --pfcc-surface-2: #F9FAFB;
  --pfcc-text: #182230; --pfcc-text-2: #667085; --pfcc-border: #E4E7EC;
  --pfcc-accent: #5B5BD6; --pfcc-accent-ink: #FFFFFF; --pfcc-accent-weak: #EEEEFC;
  --pfcc-pos: #15803D; --pfcc-neg: #DC2626; --pfcc-warn: #D97706;
  --pfcc-font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --pfcc-sidebar-w: 268px; --pfcc-sidebar-w-collapsed: 76px; --pfcc-topbar-h: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  html:root:not([data-theme="light"]) { color-scheme: dark; --pfcc-bg: #0E1320; --pfcc-surface: #151B2B; --pfcc-surface-2: #1B2236; --pfcc-text: #E6EAF2; --pfcc-text-2: #9AA4B8; --pfcc-border: #2A3350; --pfcc-accent: #8B8BF0; --pfcc-accent-ink: #0E1320; --pfcc-accent-weak: #232A4A; --pfcc-pos: #4ADE80; --pfcc-neg: #F87171; --pfcc-warn: #FBBF24; }
}
html:root[data-theme="dark"] { color-scheme: dark; --pfcc-bg: #0E1320; --pfcc-surface: #151B2B; --pfcc-surface-2: #1B2236; --pfcc-text: #E6EAF2; --pfcc-text-2: #9AA4B8; --pfcc-border: #2A3350; --pfcc-accent: #8B8BF0; --pfcc-accent-ink: #0E1320; --pfcc-accent-weak: #232A4A; --pfcc-pos: #4ADE80; --pfcc-neg: #F87171; --pfcc-warn: #FBBF24; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body.pfcc-theme { margin: 0; background: var(--pfcc-bg); color: var(--pfcc-text); font-family: var(--pfcc-font); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
body.pfcc-theme a { color: var(--pfcc-accent); }
body.pfcc-theme :focus-visible { outline: 3px solid var(--pfcc-accent); outline-offset: 2px; border-radius: 6px; }
.screen-reader-text, .skip-link:not(:focus) { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; left: 12px; top: 12px; z-index: 100000; background: var(--pfcc-surface); color: var(--pfcc-text); padding: 10px 14px; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.2); }

/* ---- Application shell ---- */
.pfcc-shell { display: grid; grid-template-columns: var(--pfcc-sidebar-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .2s ease; }
.pfcc-collapsed .pfcc-shell { grid-template-columns: var(--pfcc-sidebar-w-collapsed) minmax(0, 1fr); }
.pfcc-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; background: var(--pfcc-surface); border-right: 1px solid var(--pfcc-border); padding: 16px 12px; z-index: 40; }
.pfcc-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; text-decoration: none; color: var(--pfcc-text) !important; font-weight: 700; letter-spacing: -.01em; }
.pfcc-brand__mark { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--pfcc-accent); color: var(--pfcc-accent-ink); display: grid; place-items: center; }
.pfcc-brand__name { display: block; line-height: 1.15; font-size: 15px; } .pfcc-brand__name small { display: block; font-weight: 500; color: var(--pfcc-text-2); font-size: 12px; }
.pfcc-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.pfcc-nav__link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--pfcc-text-2) !important; text-decoration: none; font-weight: 600; font-size: 14px; min-height: 44px; transition: background .15s, color .15s; }
.pfcc-nav__link svg { flex: none; }
.pfcc-nav__link:hover { background: var(--pfcc-surface-2); color: var(--pfcc-text) !important; }
.pfcc-nav__link[aria-current="page"] { background: var(--pfcc-accent-weak); color: var(--pfcc-accent) !important; }
.pfcc-nav__link[aria-current="page"]::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--pfcc-accent); }
.pfcc-sidebar__foot { border-top: 1px solid var(--pfcc-border); padding-top: 12px; margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.pfcc-sidebar__btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border-radius: 10px; border: 0; background: transparent; color: var(--pfcc-text-2); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; text-align: left; min-height: 44px; }
.pfcc-sidebar__btn:hover { background: var(--pfcc-surface-2); color: var(--pfcc-text); }
.pfcc-collapsed .pfcc-nav__label, .pfcc-collapsed .pfcc-brand__name, .pfcc-collapsed .pfcc-sidebar__btn span, .pfcc-collapsed .pfcc-nav__link::after { display: none; }
.pfcc-collapsed .pfcc-nav__link, .pfcc-collapsed .pfcc-sidebar__btn { justify-content: center; padding-inline: 0; }
.pfcc-collapsed .pfcc-brand { justify-content: center; padding-inline: 0; }
.pfcc-main { min-width: 0; display: flex; flex-direction: column; }
.pfcc-content { padding: 24px 32px 64px; width: 100%; max-width: 1440px; margin-inline: auto; outline: none; flex: 1; }
.pfcc-topbar { display: none; align-items: center; justify-content: space-between; gap: 8px; height: var(--pfcc-topbar-h); padding: 0 12px; background: var(--pfcc-surface); border-bottom: 1px solid var(--pfcc-border); position: sticky; top: 0; z-index: 30; }
.pfcc-topbar__title { font-weight: 700; display: flex; gap: 8px; align-items: center; }
.pfcc-topbar__btn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--pfcc-text); cursor: pointer; } .pfcc-topbar__btn:hover { background: var(--pfcc-surface-2); }
.pfcc-overlay { display: none; }
.pfcc-footer-note { padding: 16px 32px; color: var(--pfcc-text-2); font-size: 12.5px; border-top: 1px solid var(--pfcc-border); }

@media (max-width: 1023px) {
  .pfcc-shell, .pfcc-collapsed .pfcc-shell { grid-template-columns: minmax(0, 1fr); }
  .pfcc-sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0,0,0,.25); visibility: hidden; }
  .pfcc-nav-open .pfcc-sidebar { transform: none; visibility: visible; }
  .pfcc-nav-open .pfcc-overlay { display: block; position: fixed; inset: 0; background: rgba(16,24,40,.5); z-index: 35; }
  .pfcc-collapsed .pfcc-nav__label, .pfcc-collapsed .pfcc-brand__name, .pfcc-collapsed .pfcc-sidebar__btn span { display: revert; }
  .pfcc-collapsed .pfcc-nav__link, .pfcc-collapsed .pfcc-sidebar__btn { justify-content: flex-start; padding-inline: 12px; }
  .pfcc-topbar { display: flex; }
  .pfcc-content { padding: 16px 16px 48px; }
  .pfcc-footer-note { padding-inline: 16px; }
  .pfcc-sidebar__collapse { display: none; }
}
@media (prefers-reduced-motion: reduce) { .pfcc-shell, .pfcc-sidebar { transition: none; } }

/* ---- Plain (non-app) pages: login-gated landing, posts ---- */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; background: var(--pfcc-surface); border-bottom: 1px solid var(--pfcc-border); }
.site-title { font-weight: 700; margin: 0; font-size: 18px; } .site-title a { color: var(--pfcc-text); text-decoration: none; }
.site-nav ul { list-style: none; display: flex; gap: 16px; margin: 0; padding: 0; }
.site-main { max-width: 760px; margin: 40px auto; padding: 0 20px; }
.entry { background: var(--pfcc-surface); border: 1px solid var(--pfcc-border); border-radius: 14px; padding: 24px; margin-bottom: 20px; }
.entry-title { margin-top: 0; }
.pfcc-landing { text-align: center; padding: 56px 24px; }
.pfcc-landing .pfcc-brand__mark { margin: 0 auto 16px; width: 56px; height: 56px; border-radius: 16px; }
.pfcc-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 20px; border-radius: 10px; background: var(--pfcc-accent); color: var(--pfcc-accent-ink) !important; font-weight: 600; text-decoration: none; border: 0; cursor: pointer; }
.pfcc-button:hover { filter: brightness(.93); }
