/*
Theme Name: Capital Fort
Theme URI: https://capitalfort.in/
Author: Capital Fort
Author URI: https://capitalfort.in/
Description: A dedicated full-width Capital Fort application theme with a scalable left navigation, clean content canvas, responsive layouts and first-class compatibility with Capital Fort tools and plugins.
Version: 2.2.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.0
Text Domain: capital-fort
*/

:root {
    --cf-navy-950: #0A111A;
    --cf-navy-900: #0A111A;
    --cf-navy-850: #0E1621;
    --cf-navy-800: #172331;
    --cf-gold: #D0A732;
    --cf-gold-strong: #E0B63E;
    --cf-gold-soft: rgba(208,167,50,.12);
    --cf-ink: #DDE6F0;
    --cf-muted: #8FA0B3;
    --cf-line: #1D2A38;
    --cf-line-strong: #2A394A;
    --cf-canvas: #0A111A;
    --cf-panel: #0E1621;
    --cf-sidebar: 252px;
    --cf-sidebar-collapsed: 76px;
    --cf-topbar: 64px;
    --cf-radius: 16px;
    --cf-content-pad: 28px;
    --cf-shadow: 0 14px 40px rgba(0,0,0,.20);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--cf-ink);
    background: var(--cf-canvas);
    font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
::selection { background: rgba(201, 162, 39, .24); }

/* App shell */
.cf-app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--cf-sidebar) minmax(0, 1fr);
    background: var(--cf-canvas);
    transition: grid-template-columns .22s ease;
}
body.cf-nav-collapsed .cf-app { grid-template-columns: var(--cf-sidebar-collapsed) minmax(0, 1fr); }
.cf-stage { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.cf-drawer-backdrop { display: none; }

/* Sidebar */
.cf-sidebar {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #DDE6F0;
    background: #0A111A;
    border-right: 1px solid rgba(255,255,255,.06);
    box-shadow: 12px 0 34px rgba(7,17,31,.12);
}
#wpadminbar { display: none !important; }
body.admin-bar .cf-sidebar { top: 0; height: 100vh; }

.cf-brand-row {
    height: var(--cf-topbar);
    flex: 0 0 var(--cf-topbar);
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 11px 9px 12px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.cf-brand {
    min-width: 0;
    flex: 1;
    height: 48px;
    display: flex;
    align-items: center;
    padding: 4px 7px;
    overflow: hidden;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 9px;
    box-shadow: none;
}
.cf-brand img, .cf-brand .custom-logo {
    display: block;
    width: 100%;
    max-width: 218px;
    height: 40px;
    object-fit: contain;
    object-position: left center;
}
.cf-nav-collapse {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 9px;
    color: #a8b5c7;
    background: rgba(255,255,255,.04);
    cursor: pointer;
    transition: .18s ease;
}
.cf-nav-collapse:hover { color: #fff; border-color: rgba(201,162,39,.38); background: rgba(201,162,39,.09); }
.cf-nav-collapse svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.cf-sidebar-body {
    flex: 1;
    min-height: 0;
    padding: 14px 10px 16px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.13) transparent;
}
.cf-sidebar-menu, .cf-sidebar-menu ul { list-style: none; margin: 0; padding: 0; }
.cf-sidebar-nav li { position: relative; margin: 3px 0; }
.cf-sidebar-nav li > a,
.cf-login-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #AEBCCB;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .005em;
    transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease;
}
.cf-sidebar-nav li > a:hover,
.cf-login-link:hover {
    color: #fff;
    background: rgba(255,255,255,.055);
    transform: translateX(2px);
}
.cf-sidebar-nav .current-menu-item > a,
.cf-sidebar-nav .current_page_item > a,
.cf-sidebar-nav .cf-menu-item.is-current > a {
    color: #FFF4D0;
    border-color: rgba(208,167,50,.26);
    background: linear-gradient(90deg, rgba(208,167,50,.18), rgba(208,167,50,.05));
    box-shadow: inset 3px 0 0 var(--cf-gold);
}
.cf-nav-icon {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    display: inline-grid;
    place-items: center;
    color: #8297b0;
}
.cf-nav-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cf-sidebar-nav li > a:hover .cf-nav-icon,
.cf-sidebar-nav .current-menu-item > a .cf-nav-icon,
.cf-sidebar-nav .current_page_item > a .cf-nav-icon,
.cf-sidebar-nav .cf-menu-item.is-current > a .cf-nav-icon { color: #D0A732; }
.cf-nav-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cf-sidebar-nav .menu-item-has-children > a { padding-right: 39px; }
.cf-submenu-toggle {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #71839b;
    cursor: pointer;
}
.cf-submenu-toggle:hover { color: #fff; background: rgba(255,255,255,.05); }
.cf-submenu-toggle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .18s ease; }
.cf-sidebar-nav .sub-menu { display: none; margin: 4px 0 7px 15px; padding-left: 11px; border-left: 1px solid rgba(255,255,255,.10); }
.cf-sidebar-nav .is-submenu-open > .sub-menu { display: block; }
.cf-sidebar-nav .is-submenu-open > .cf-submenu-toggle svg { transform: rotate(90deg); }
.cf-sidebar-nav .sub-menu a { min-height: 38px; padding-block: 7px; font-size: 12px; }

/* Account block */
.cf-account-zone {
    flex: 0 0 auto;
    padding: 10px;
    border-top: 1px solid rgba(255,255,255,.08);
    background: #0E1621;
}
.cf-profile-link {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 7px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    color: #c8d3df;
    background: rgba(255,255,255,.035);
    font-size: 12px;
    font-weight: 600;
    transition: .16s ease;
}
.cf-profile-link:hover,
.cf-profile-link.is-current { color: #FFF4D0; border-color: rgba(201,162,39,.32); background: rgba(201,162,39,.09); }
.cf-profile-link .cf-nav-icon { color: #d9b142; }
.cf-profile-arrow { margin-left: auto; color: #71839a; font-size: 17px; }
.cf-user-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cf-user-card { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 5px 4px; }
.cf-user-avatar {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    overflow: hidden;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.16);
    box-shadow: 0 0 0 3px rgba(201,162,39,.06);
}
.cf-user-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cf-user-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.28; }
.cf-user-copy strong { color: #f6f8fb; font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-user-copy small { margin-top: 2px; color: #73859d; font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-logout-link {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 9px;
    color: #778ba4;
    background: rgba(255,255,255,.025);
    transition: .16s ease;
}
.cf-logout-link:hover { color: #ff9098; border-color: rgba(255,92,105,.28); background: rgba(255,92,105,.07); }
.cf-logout-link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Collapsed sidebar */
body.cf-nav-collapsed .cf-brand-row { justify-content: center; padding-inline: 10px; }
body.cf-nav-collapsed .cf-brand { display: none; }
body.cf-nav-collapsed .cf-nav-collapse { transform: rotate(180deg); }
body.cf-nav-collapsed .cf-sidebar-body { padding-inline: 10px; }
body.cf-nav-collapsed .cf-nav-text,
body.cf-nav-collapsed .cf-user-copy,
body.cf-nav-collapsed .cf-profile-arrow { display: none; }
body.cf-nav-collapsed .cf-sidebar-nav li > a,
body.cf-nav-collapsed .cf-login-link,
body.cf-nav-collapsed .cf-profile-link { justify-content: center; padding-inline: 8px; }
body.cf-nav-collapsed .cf-sidebar-nav .menu-item-has-children > a { padding-right: 8px; }
body.cf-nav-collapsed .cf-submenu-toggle,
body.cf-nav-collapsed .cf-sidebar-nav .sub-menu { display: none !important; }
body.cf-nav-collapsed .cf-user-row { flex-direction: column; }
body.cf-nav-collapsed .cf-user-card { justify-content: center; padding-inline: 0; }

/* Topbar */
.cf-topbar {
    position: sticky;
    top: 0;
    z-index: 700;
    height: var(--cf-topbar);
    flex: 0 0 var(--cf-topbar);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 clamp(18px, 2.2vw, 34px);
    background: #0E1621;
    border-bottom: 1px solid #1D2A38;
    box-shadow: 0 4px 16px rgba(16,38,71,.025);
    backdrop-filter: blur(12px);
}
.admin-bar .cf-topbar { top: 32px; }
.cf-topbar-left { min-width: 0; display: flex; align-items: center; gap: 12px; }
.cf-mobile-toggle { display: none; }
.cf-mobile-brand { display: none; }
.cf-page-context { min-width: 0; display: flex; align-items: center; gap: 10px; }
.cf-page-context h1 {
    margin: 0;
    color: #DDE6F0;
    font-size: clamp(17px, 1.35vw, 21px);
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -.018em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cf-topbar-right { display: flex; align-items: center; gap: 10px; }
.cf-topbar-date { color: #8FA0B3; font-size: 11px; font-weight: 500; white-space: nowrap; }
.cf-add-trade {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border: 1px solid #b48f1d;
    border-radius: 10px;
    color: #10284d;
    background: linear-gradient(180deg, #f0c84a, #d9ad29);
    box-shadow: 0 6px 16px rgba(208,167,50,.18);
    font-size: 12px;
    font-weight: 700;
    transition: .16s ease;
}
.cf-add-trade:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(201,162,39,.25); }
.cf-add-trade svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.cf-top-login { color: var(--cf-navy-900); font-size: 12px; font-weight: 700; }

/* Main canvas - intentionally not containerized */
.cf-main {
    flex: 1 0 auto;
    width: 100%;
    min-width: 0;
    padding: var(--cf-content-pad) var(--cf-content-pad) calc(var(--cf-content-pad) + 6px);
}
.cf-content {
    width: 100%;
    max-width: none;
    margin: 0;
}
.cf-content > :first-child { margin-top: 0; }
.cf-content > :last-child { margin-bottom: 0; }

/* Generic surfaces */
.cf-surface,
.entry-content > .wp-block-group.has-background,
.cf-article-card {
    background: var(--cf-panel);
    border: 1px solid var(--cf-line);
    border-radius: var(--cf-radius);
    box-shadow: var(--cf-shadow);
}
.entry-content { color: #B8C5D2; }
.entry-content h1, .entry-content h2, .entry-content h3, .entry-content h4 { color: #DDE6F0; line-height: 1.2; }
.entry-content a { color: #0d5bd7; }
.entry-content a:hover { text-decoration: underline; }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { border-bottom: 1px solid var(--cf-line); padding: 10px 12px; text-align: left; }
.entry-content input, .entry-content select, .entry-content textarea {
    border: 1px solid var(--cf-line-strong);
    border-radius: 10px;
    background: #0E1621;
    color: #DDE6F0;
}

/* Empty front page */
.cf-home-hero {
    min-height: 158px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 26px;
    padding: clamp(22px, 2.4vw, 34px);
    border: 1px solid #e4e8ef;
    border-radius: 18px;
    background:
        radial-gradient(circle at 86% 14%, rgba(201,162,39,.16), transparent 22%),
        linear-gradient(135deg, #ffffff 0%, #fbfcff 62%, #f7f9fd 100%);
    box-shadow: 0 14px 38px rgba(10,31,68,.06);
}
.cf-home-hero small { display: block; margin-bottom: 7px; color: #a27b10; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.cf-home-hero h2 { margin: 0; color: #13213a; font-size: clamp(25px, 2.2vw, 35px); font-weight: 650; letter-spacing: -.03em; }
.cf-home-hero p { max-width: 660px; margin: 9px 0 0; color: #6e798a; font-size: 13px; }
.cf-home-hero-actions { flex: 0 0 auto; display: flex; gap: 9px; }
.cf-primary-btn, .cf-secondary-btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}
.cf-primary-btn { color: #fff; background: var(--cf-navy-900); box-shadow: 0 8px 18px rgba(10,31,68,.13); }
.cf-primary-btn:hover { background: #12315f; }
.cf-secondary-btn { color: #6e5510; background: var(--cf-gold-soft); border: 1px solid #efdfaa; }
.cf-secondary-btn:hover { background: #fff1c4; }

.cf-quick-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}
.cf-quick-action {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 16px;
    border: 1px solid var(--cf-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(10,31,68,.04);
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.cf-quick-action:hover { transform: translateY(-2px); border-color: #d2d9e4; box-shadow: 0 12px 30px rgba(10,31,68,.07); }
.cf-quick-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #b18814;
    background: #fff7df;
    border: 1px solid #f0e1ad;
}
.cf-quick-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.cf-quick-copy { min-width: 0; display: flex; flex-direction: column; }
.cf-quick-copy strong { color: #1a263b; font-size: 13px; }
.cf-quick-copy small { margin-top: 2px; color: #7a8595; font-size: 10px; line-height: 1.4; }

/* Article/archive */
.cf-article-card { padding: clamp(20px, 2vw, 30px); }
.cf-post-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.cf-post-card { overflow: hidden; background:#fff; border:1px solid var(--cf-line); border-radius:14px; box-shadow:0 8px 24px rgba(10,31,68,.04); }
.cf-post-card-thumb { aspect-ratio: 16/9; overflow:hidden; background:#e9edf3; }
.cf-post-card-thumb img { width:100%; height:100%; object-fit:cover; }
.cf-post-card-body { padding:16px; }
.cf-post-card h2 { margin:0 0 7px; font-size:16px; line-height:1.3; }
.cf-post-card p { margin:0; color:#778294; font-size:12px; }
.cf-meta { color:#8a95a5; font-size:10px; }
.cf-pagination { margin-top:18px; }
.cf-pagination .nav-links { display:flex; flex-wrap:wrap; gap:7px; }
.cf-pagination .page-numbers { min-width:34px; height:34px; display:grid; place-items:center; padding:0 9px; border:1px solid var(--cf-line); border-radius:9px; background:#fff; }
.cf-pagination .current { color:#fff; background:var(--cf-navy-900); border-color:var(--cf-navy-900); }

/* Footer */
.cf-footer {
    min-height: 42px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 9px clamp(18px,2.2vw,34px) 14px;
    color: #8a95a5;
    font-size: 10px;
}
.cf-footer-menu ul { display:flex; align-items:center; gap:12px; list-style:none; margin:0; padding:0; }
.cf-footer a:hover { color:#334158; }

/* Search */
.cf-search-form { display:flex; align-items:center; gap:8px; width:min(520px,100%); }
.cf-search-form input { flex:1; min-width:0; height:42px; padding:0 12px; border:1px solid var(--cf-line-strong); border-radius:10px; background:#fff; }
.cf-search-form button { height:42px; padding:0 15px; border:0; border-radius:10px; color:#fff; background:var(--cf-navy-900); cursor:pointer; }

/* Blank template */
.cf-blank-shell { min-height:100vh; }
body.page-template-blank { background:#fff; }

/* CapitalFort Trader compatibility - full working width */
body.cf-trader-page .cf-main { padding: var(--cf-content-pad) var(--cf-content-pad) calc(var(--cf-content-pad) + 2px); }
body.cf-trader-page .cft-wrap,
body.cf-trader-page .cft-auth-wrap {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
body.cf-trader-page .cft-analytics,
body.cf-trader-page .cft-chart-card,
body.cf-trader-page .cft-table-container,
body.cf-trader-page .cft-form { box-shadow: none; }
body.cf-trader-page .cft-table-container { width:100%; }
body.cf-trader-page .cft-table { min-width: 880px; }

/* WordPress utilities */
.alignwide, .alignfull { max-width:none; width:100%; margin-left:0; margin-right:0; }
.wp-caption { max-width:100%; }
.screen-reader-text { position:absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
:focus-visible { outline:3px solid rgba(201,162,39,.33); outline-offset:2px; }

/* Desktop tablet */
@media (max-width: 1180px) {
    :root { --cf-sidebar: 228px; }
    .cf-quick-actions { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .cf-post-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}


.cf-mobile-toggle-floating { position:fixed; top:14px; left:14px; z-index:1200; display:none; }
.admin-bar .cf-mobile-toggle-floating { top:60px; }

/* Mobile drawer */
@media (max-width: 900px) {
    .cf-mobile-toggle-floating { display:grid; }
    .cf-app { display:block; }
    body.cf-nav-collapsed .cf-app { display:block; }
    .cf-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: min(280px, 86vw);
        height: 100vh;
        transform: translateX(-102%);
        transition: transform .22s ease;
        box-shadow: 18px 0 52px rgba(3,10,20,.28);
    }
    .admin-bar .cf-sidebar { top:46px; height:calc(100vh - 46px); }
    body.cf-mobile-nav-open .cf-sidebar { transform: translateX(0); }
    .cf-drawer-backdrop {
        position: fixed;
        inset: 0;
        z-index: 950;
        display: block;
        opacity: 0;
        visibility: hidden;
        background: rgba(4,10,18,.54);
        backdrop-filter: blur(2px);
        transition: opacity .2s ease, visibility .2s ease;
    }
    body.cf-mobile-nav-open .cf-drawer-backdrop { opacity:1; visibility:visible; }
    body.cf-mobile-nav-open { overflow:hidden; }
    .cf-nav-collapse { display:none; }
    body.cf-nav-collapsed .cf-brand { display:flex; }
    body.cf-nav-collapsed .cf-nav-text,
    body.cf-nav-collapsed .cf-user-copy,
    body.cf-nav-collapsed .cf-profile-arrow { display:initial; }
    body.cf-nav-collapsed .cf-sidebar-nav li > a,
    body.cf-nav-collapsed .cf-login-link,
    body.cf-nav-collapsed .cf-profile-link { justify-content:flex-start; padding-inline:11px; }
    body.cf-nav-collapsed .cf-user-row { flex-direction:row; }
    body.cf-nav-collapsed .cf-user-card { justify-content:flex-start; }

    .cf-topbar { padding-inline:14px; gap:10px; }
    .cf-mobile-toggle {
        width:36px; height:36px; flex:0 0 36px; display:grid; place-items:center;
        border:1px solid var(--cf-line); border-radius:9px; color:#314058; background:#fff; cursor:pointer;
    }
    .cf-mobile-toggle svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; }
    .cf-mobile-brand { display:none; }
    .cf-topbar-date { display:none; }
    .cf-page-context h1 { font-size:17px; }
    .cf-main { padding:16px 14px 26px; }
    .cf-footer { padding-inline:14px; }
    .cf-home-hero { flex-direction:column; align-items:flex-start; }
    .cf-home-hero-actions { width:100%; }
    .cf-home-hero-actions a { flex:1; }
}

@media (max-width: 640px) {
    .cf-add-trade span:last-child { display:none; }
    .cf-add-trade { width:36px; height:36px; min-height:36px; padding:0; justify-content:center; }
    .cf-quick-actions, .cf-post-grid { grid-template-columns:1fr; }
    .cf-home-hero { padding:20px; }
    .cf-home-hero h2 { font-size:25px; }
    .cf-footer { flex-direction:column; align-items:flex-start; gap:4px; }
}

/* Configurable dark workspace mode */
body.cf-workspace-dark { --cf-line:#263349; --cf-line-strong:#35445d; color:#e6ebf3; }
body.cf-workspace-dark .cf-stage, body.cf-workspace-dark .cf-main { background:var(--cf-canvas); }
body.cf-workspace-dark .cf-topbar { background:rgba(15,24,40,.96); border-bottom-color:#263349; }
body.cf-workspace-dark .cf-page-context h1, body.cf-workspace-dark .entry-content h1, body.cf-workspace-dark .entry-content h2, body.cf-workspace-dark .entry-content h3, body.cf-workspace-dark .entry-content h4 { color:#f2f5f9; }
body.cf-workspace-dark .cf-topbar-date { color:#95a2b5; }
body.cf-workspace-dark .entry-content { color:#c9d2df; }
body.cf-workspace-dark .cf-surface, body.cf-workspace-dark .entry-content > .wp-block-group.has-background, body.cf-workspace-dark .cf-article-card, body.cf-workspace-dark .cf-chart-card { background:var(--cf-panel); border-color:#263349; }
body.cf-workspace-dark .entry-content input, body.cf-workspace-dark .entry-content select, body.cf-workspace-dark .entry-content textarea { color:#e9edf4; background:#111c2d; border-color:#35445d; }

/* -------------------------------------------------------------------------
 * v2.2 application shell refinements
 * Palette: #0A111A / #0E1621 / #DDE6F0 / #D0A732
 * ---------------------------------------------------------------------- */
body,
.cf-app,
.cf-stage,
.cf-main { background:var(--cf-canvas); color:var(--cf-ink); }

.cf-sidebar { background:var(--cf-navy-900); border-right-color:var(--cf-line); box-shadow:10px 0 30px rgba(0,0,0,.18); }
.cf-brand-row { border-bottom-color:var(--cf-line); }
.cf-brand { padding-left:8px; }
.cf-brand img,
.cf-brand .custom-logo { height:40px; max-width:218px; }

.cf-sidebar-nav li > a { color:#AEBCCB; }
.cf-sidebar-nav li > a:hover { color:var(--cf-ink); background:var(--cf-panel); transform:none; }
.cf-sidebar-nav .current-menu-item > a,
.cf-sidebar-nav .current_page_item > a,
.cf-sidebar-nav .cf-menu-item.is-current > a {
    color:#FFF4D0;
    background:var(--cf-panel);
    border-color:rgba(208,167,50,.32);
    box-shadow:inset 3px 0 0 #D0A732;
}
.cf-nav-icon { color:#7F91A4; }
.cf-sidebar-nav li > a:hover .cf-nav-icon,
.cf-sidebar-nav .current-menu-item > a .cf-nav-icon,
.cf-sidebar-nav .current_page_item > a .cf-nav-icon,
.cf-sidebar-nav .cf-menu-item.is-current > a .cf-nav-icon { color:var(--cf-gold); }

.cf-account-zone { background:var(--cf-panel); border-top-color:#1D2A38; }
.cf-profile-link { background:var(--cf-canvas); border-color:var(--cf-line); color:#C7D2DE; }
.cf-profile-link:hover,
.cf-profile-link.is-current { color:#FFF4D0; border-color:rgba(208,167,50,.38); background:rgba(255,255,255,.04); }
.cf-profile-link .cf-nav-icon { color:var(--cf-gold); }
.cf-user-copy strong { color:var(--cf-ink); }
.cf-user-copy small { color:#7F91A4; }

.cf-topbar { background:var(--cf-panel); border-bottom-color:var(--cf-line); box-shadow:0 5px 18px rgba(0,0,0,.14); }
.cf-page-context h1 { color:var(--cf-ink); }
.cf-topbar-date { color:#8FA0B3; }
.cf-top-auth {
    min-height:36px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    padding:8px 14px;
    border:1px solid #B88F20;
    border-radius:10px;
    color:var(--cf-canvas);
    background:var(--cf-gold);
    box-shadow:0 7px 18px rgba(208,167,50,.16);
    font-size:12px;
    font-weight:800;
    transition:transform .16s ease, filter .16s ease, box-shadow .16s ease;
}
.cf-top-auth:hover { transform:translateY(-1px); filter:brightness(1.05); box-shadow:0 9px 22px rgba(208,167,50,.22); }
.cf-top-auth svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }

.cf-surface,
.entry-content > .wp-block-group.has-background,
.cf-article-card,
.cf-post-card,
.cf-quick-action { background:var(--cf-panel); border-color:var(--cf-line); color:var(--cf-ink); box-shadow:var(--cf-shadow); }
.entry-content { color:#B8C5D2; }
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4 { color:var(--cf-ink); }
.entry-content a { color:var(--cf-gold); }
.entry-content th,
.entry-content td { border-bottom-color:var(--cf-line); }
.entry-content input,
.entry-content select,
.entry-content textarea,
.cf-search-form input {
    color:var(--cf-ink);
    background:var(--cf-canvas);
    border-color:#2A394A;
}
.cf-search-form button,
.cf-primary-btn { color:var(--cf-canvas); background:var(--cf-gold); }
.cf-secondary-btn { color:var(--cf-ink); background:var(--cf-panel); border-color:#2A394A; }
.cf-footer { color:#7F91A4; }

/* The old theme Add Trade shortcut is intentionally disabled in v2.2. */
.cf-add-trade,
.cf-top-login { display:none !important; }

/* Collapsed sidebar: menu icons stay visible. Text/submenus are provided by a
   dedicated hover flyout so they are never clipped by the scrollable sidebar. */
body.cf-nav-collapsed .cf-sidebar-nav > .cf-sidebar-menu > li > a { min-height:44px; }
body.cf-nav-collapsed .cf-sidebar-nav > .cf-sidebar-menu > li > a .cf-nav-icon { margin:0; }

.cf-nav-flyout {
    position:fixed;
    z-index:5000;
    min-width:190px;
    max-width:290px;
    padding:7px;
    border:1px solid var(--cf-line-strong);
    border-radius:12px;
    color:var(--cf-ink);
    background:var(--cf-panel);
    box-shadow:0 18px 46px rgba(0,0,0,.36);
    opacity:0;
    visibility:hidden;
    transform:translateX(-4px);
    transition:opacity .14s ease, transform .14s ease, visibility .14s ease;
    pointer-events:none;
}
.cf-nav-flyout.is-open { opacity:1; visibility:visible; transform:translateX(0); pointer-events:auto; }
.cf-nav-flyout-title {
    display:block;
    padding:8px 10px;
    color:#FFF4D0;
    font-size:12px;
    font-weight:800;
    border-bottom:1px solid var(--cf-line);
}
.cf-nav-flyout > a.cf-nav-flyout-title { border-bottom:0; }
.cf-nav-flyout ul { list-style:none; margin:5px 0 0; padding:0; }
.cf-nav-flyout li { margin:2px 0; }
.cf-nav-flyout li > a {
    min-height:38px;
    display:flex;
    align-items:center;
    gap:9px;
    padding:8px 10px;
    border-radius:8px;
    color:#B9C6D3;
    font-size:12px;
    font-weight:600;
}
.cf-nav-flyout li > a:hover { color:var(--cf-ink); background:rgba(255,255,255,.04); }
.cf-nav-flyout .cf-nav-icon { width:18px; height:18px; flex:0 0 18px; color:var(--cf-gold); }
.cf-nav-flyout .cf-nav-icon svg { width:16px; height:16px; }
.cf-nav-flyout .cf-nav-text { display:inline !important; overflow:visible; white-space:normal; }
.cf-nav-flyout .cf-submenu-toggle { display:none !important; }
.cf-nav-flyout .sub-menu { display:block !important; margin:2px 0 0 11px !important; padding-left:8px !important; border-left:1px solid var(--cf-line-strong) !important; }

/* Keep the profile/user block simple in collapsed mode. Authentication lives
   in the top-right, never inside this area. */
body.cf-nav-collapsed .cf-account-zone { padding:9px; }
body.cf-nav-collapsed .cf-user-row { justify-content:center; }

@media (max-width:900px) {
    .cf-topbar { background:var(--cf-panel); }
    .cf-mobile-toggle { color:var(--cf-ink); background:var(--cf-canvas); border-color:#2A394A; }
    .cf-top-auth { min-width:36px; width:36px; padding:0; }
    .cf-top-auth span { display:none; }
    .cf-nav-flyout { display:none !important; }
}
.cf-nav-flyout { max-height:calc(100vh - 16px); overflow-y:auto; }
body.cf-workspace-dark {
    --cf-line:#1D2A38;
    --cf-line-strong:#2A394A;
    color:var(--cf-ink);
}
body.cf-workspace-dark .cf-topbar { background:var(--cf-panel); border-bottom-color:var(--cf-line); }
body.cf-workspace-dark .cf-page-context h1,
body.cf-workspace-dark .entry-content h1,
body.cf-workspace-dark .entry-content h2,
body.cf-workspace-dark .entry-content h3,
body.cf-workspace-dark .entry-content h4 { color:var(--cf-ink); }
body.cf-workspace-dark .cf-topbar-date { color:#8FA0B3; }
body.cf-workspace-dark .entry-content { color:#B8C5D2; }
body.cf-workspace-dark .cf-surface,
body.cf-workspace-dark .entry-content > .wp-block-group.has-background,
body.cf-workspace-dark .cf-article-card,
body.cf-workspace-dark .cf-chart-card { background:var(--cf-panel); border-color:var(--cf-line); }
body.cf-workspace-dark .entry-content input,
body.cf-workspace-dark .entry-content select,
body.cf-workspace-dark .entry-content textarea { color:var(--cf-ink); background:var(--cf-canvas); border-color:#2A394A; }

.cf-home-hero {
    border-color:var(--cf-line);
    background:linear-gradient(135deg,#0E1621 0%,#0C141D 100%);
    box-shadow:0 14px 38px rgba(0,0,0,.18);
}
.cf-home-hero small { color:var(--cf-gold); }
.cf-home-hero h2 { color:var(--cf-ink); }
.cf-home-hero p { color:#8FA0B3; }
.cf-quick-icon { color:var(--cf-gold); background:rgba(208,167,50,.09); border-color:rgba(208,167,50,.22); }
.cf-quick-copy strong,.cf-post-card h2 { color:var(--cf-ink); }
.cf-quick-copy small,.cf-post-card p,.cf-meta { color:#8FA0B3; }
.cf-pagination .page-numbers { color:var(--cf-ink); background:var(--cf-panel); border-color:var(--cf-line); }
.cf-pagination .current { color:var(--cf-canvas); background:var(--cf-gold); border-color:var(--cf-gold); }
