/* ============================================================
   Threshold Staff Portal — True to cms.thresholdx.net design
   ============================================================ */

/* ----- Basier Circle font-face ----- */
@font-face { font-family: 'Basier Circle'; src: url('../fonts/basier-circle-regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Basier Circle'; src: url('../fonts/basier-circle-regular-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Basier Circle'; src: url('../fonts/basier-circle-medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Basier Circle'; src: url('../fonts/basier-circle-semibold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Basier Circle'; src: url('../fonts/basier-circle-bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Basier Circle'; src: url('../fonts/basier-circle-bold-italic.woff2') format('woff2'); font-weight: 700; font-style: italic; font-display: swap; }

/* ----- CSS Variables (light mode — default, matches CMS) ----- */
:root {
    --bg-body: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.75);
    --bg-card: #eee;
    --bg-card-hover: #e2e2e2;
    --bg-input: #f3f3f3;
    --bg-footer: #f0f0f0;
    --border: #dddedf;
    --border-focus: #0074ff;
    --fg: #363636;
    --fg-dim: #777;
    --fg-bright: #001123;
    --fg-heading: #001123;
    --accent: #0074ff;
    --accent-hover: #005acc;
    --accent-dim: rgba(0, 116, 255, 0.1);
    --green: #2e7d32;
    --green-dim: rgba(46, 125, 50, 0.1);
    --red: #d32f2f;
    --red-dim: rgba(211, 47, 47, 0.1);
    --yellow: #f57c00;
    --yellow-dim: rgba(245, 124, 0, 0.1);
    --radius: 10px;
    --shadow: 1px 1px 4px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 2px 10px rgba(0, 116, 255, 0.15);
    --max-width: 1140px;
    --header-height: 70px;
    --badge-height: 50px;
    --font-body: 'Basier Circle', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ----- Dark mode overrides ----- */
body.dark-mode {
    --bg-body: rgb(12, 12, 14);
    --bg-header: hsla(0, 0%, 25%, 0.75);
    --bg-card: #222;
    --bg-card-hover: #2a2a2a;
    --bg-input: #333;
    --bg-footer: #1a1a1a;
    --border: #444;
    --fg: #d4d4d4;
    --fg-dim: #aaa;
    --fg-bright: #fff;
    --fg-heading: #fff;
    --accent-hover: #63aaff;
    --accent-dim: rgba(0, 116, 255, 0.15);
    --green: #4caf50;
    --green-dim: rgba(76, 175, 80, 0.15);
    --red: #ef5350;
    --red-dim: rgba(239, 83, 80, 0.15);
    --yellow: #ffb74d;
    --yellow-dim: rgba(255, 183, 77, 0.15);
    --shadow: 1px 1px 4px rgba(255, 255, 255, 0.08);
    --shadow-hover: 0 2px 10px rgba(0, 116, 255, 0.3);
}

/* ----- Reset ----- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    font-size: 16px;
    background: var(--bg-body);
    color: var(--fg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

.hidden { display: none !important; }

#app { flex: 1; }

/* ============================================================
   HEADER — matches CMS glassmorphism header
   ============================================================ */
#site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 998;
    height: var(--header-height);
}

.header {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.3s;
}

body.dark-mode .header {
    background: rgba(0, 17, 35, 0.7);
}

/* When scrolled, add background */
.header-scrolled .header {
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 100px;
}

.header-left { justify-content: flex-start; }
.header-right { justify-content: flex-end; }

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.header-logo { display: flex; align-items: center; }

.site-logo {
    height: 36px;
    width: auto;
}

/* Logo swap: blue in light mode, white in dark mode */
.site-logo--dark { display: none; }
body.dark-mode .site-logo--light { display: none; }
body.dark-mode .site-logo--dark { display: block; }

.header-icon-link {
    color: var(--fg);
    font-size: 18px;
    transition: color 0.2s;
}
.header-icon-link:hover { color: var(--accent); }

/* Dark mode toggle */
.toggle-dark-mode {
    cursor: pointer;
    font-size: 18px;
    color: var(--fg);
    transition: color 0.2s;
    padding: 4px;
}
.toggle-dark-mode:hover { color: var(--accent); }

/* Burger menu button */
.burger-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 2px;
}

.burger-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--fg);
    border-radius: 1px;
    transition: transform 0.3s, opacity 0.3s;
}

.burger-toggle.open .burger-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger-toggle.open .burger-bar:nth-child(2) { opacity: 0; }
.burger-toggle.open .burger-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   NAV POPUP — matches CMS dropdown menu (full-width)
   ============================================================ */
.nav-popup {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    z-index: 999;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-popup.open { max-height: 500px; }

.nav-popup-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: -1;
}

.nav-popup.open .nav-popup-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.nav-popup-content {
    position: relative;
    background: var(--bg-card);
    padding: 30px 20px;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    max-width: var(--max-width);
    margin: 0 auto;
}

.nav-popup-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.nav-popup-col h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--fg-heading);
    margin-bottom: 16px;
}

.nav-popup-col a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: var(--fg);
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-popup-col a:hover { color: var(--accent); }
.nav-popup-col a i { width: 20px; text-align: center; color: var(--fg-dim); }
.nav-popup-col a:hover i { color: var(--accent); }

/* Staff section separator */
.nav-staff-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.nav-staff-section .nav-popup-grid {
    grid-template-columns: 1fr;
}

.nav-staff-section .nav-popup-col a {
    display: inline-flex;
    margin-right: 20px;
}

/* ============================================================
   PAGE BANNER — 500px hero image, shown on authenticated pages
   ============================================================ */
.page-banner {
    width: 100%;
    height: 500px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.page-banner-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 17, 35, 0.45);
}

.banner-inner {
    position: absolute;
    inset: 0;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    z-index: 2;
}

/* Quick actions row — 20px below header, centered full width */
.banner-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: calc(var(--header-height) + 20px);
}

.banner-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(0, 17, 35, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
}

.banner-action-btn:hover {
    background: rgba(0, 17, 35, 0.75);
    color: #fff;
}

.banner-action-btn i {
    font-size: 13px;
}

/* User account card — 80px below actions row, top-left */
.banner-profile {
    background: rgba(0, 17, 35, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius);
    padding: 14px 24px;
    color: #fff;
    margin-top: 80px;
    width: fit-content;
}

.banner-profile-name {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.banner-profile-role {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 2px;
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */

/* Page section — standard container */
.page-section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 30px 20px;
}

/* Card — the #eee rounded boxes (matches CMS article cards) */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--fg-heading);
    margin-bottom: 8px;
}

.card-subtitle {
    font-size: 14px;
    color: var(--fg-dim);
    margin-bottom: 16px;
}

/* Section headings — match CMS "HEADLINES", "RECENT UPDATES" style */
.section-heading {
    font-size: 22px;
    font-weight: 700;
    color: var(--fg-heading);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

/* ============================================================
   LOGIN PAGE — 500px banner at top + login card below
   ============================================================ */
.login-banner {
    width: 100%;
    height: 500px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.login-banner-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 17, 35, 0.45);
}

.login-section {
    display: flex;
    justify-content: center;
    padding: 60px 20px 80px;
    margin-top: -80px;
    position: relative;
    z-index: 1;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(0, 17, 35, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 40px;
    position: relative;
    z-index: 1;
    color: #d4d4d4;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header img {
    height: 40px;
    margin-bottom: 16px;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

/* Login form overrides for dark glass card */
.login-card .form-label {
    color: #aaa;
}

.login-card .form-input {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.login-card .form-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.login-card .form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 116, 255, 0.3);
}

.login-card .btn-primary {
    background: #fff;
    color: #001123;
}

.login-card .btn-primary:hover {
    opacity: 0.9;
    color: #001123;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--fg);
    font-family: var(--font-body);
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-input::placeholder {
    color: var(--fg-dim);
}

/* Buttons — match CMS "READ MORE" style */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s, color 0.2s, transform 0.1s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--fg-bright);
    color: #fff;
    width: 100%;
}

body:not(.dark-mode) .btn-primary { background: #001123; color: #fff; }
body.dark-mode .btn-primary { background: #fff; color: #001123; }

.btn-primary:hover { opacity: 0.9; color: #fff; }
body.dark-mode .btn-primary:hover { color: #001123; }

.btn-secondary {
    background: var(--bg-card);
    color: var(--fg);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--fg);
}

.btn-accent {
    background: var(--accent);
    color: #fff;
}
.btn-accent:hover { background: var(--accent-hover); color: #fff; }

.login-error {
    background: var(--red-dim);
    color: var(--red);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
}

.login-error.visible { display: block; }

/* ============================================================
   DASHBOARD — Home page
   ============================================================ */
.dashboard {
    padding: 30px 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 375px;
    gap: 20px;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Welcome card */
.welcome-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.welcome-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    flex-shrink: 0;
}

.welcome-info h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--fg-heading);
    margin-bottom: 2px;
}

.welcome-info p {
    font-size: 14px;
    color: var(--fg-dim);
}

/* Stats row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    grid-column: 1 / -1;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--fg-heading);
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--fg-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Recent activity */
.activity-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
}

.activity-card .section-heading {
    font-size: 16px;
    margin-bottom: 16px;
}

.activity-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; padding-bottom: 0; }

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.activity-icon.publish { background: var(--green-dim); color: var(--green); }
.activity-icon.edit { background: var(--accent-dim); color: var(--accent); }
.activity-icon.review { background: var(--yellow-dim); color: var(--yellow); }

.activity-text {
    font-size: 14px;
    color: var(--fg);
    line-height: 1.4;
}

.activity-text strong { color: var(--fg-heading); }

.activity-time {
    font-size: 12px;
    color: var(--fg-dim);
    margin-top: 2px;
}

/* Sidebar — matches CMS right sidebar width */
.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
}

.sidebar-card .section-heading {
    font-size: 14px;
    margin-bottom: 12px;
}

/* Quick actions */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-body);
    border-radius: 8px;
    color: var(--fg);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.quick-action:hover {
    background: var(--accent-dim);
    color: var(--accent);
}

.quick-action i {
    width: 20px;
    text-align: center;
    color: var(--fg-dim);
}

.quick-action:hover i { color: var(--accent); }

/* ============================================================
   PLACEHOLDER PAGES (Writer + Log)
   ============================================================ */
.placeholder-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    padding: 60px 20px;
}

.placeholder-icon {
    font-size: 48px;
    color: var(--fg-dim);
    margin-bottom: 16px;
    opacity: 0.5;
}

.placeholder-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--fg-heading);
    margin-bottom: 8px;
}

.placeholder-text {
    font-size: 15px;
    color: var(--fg-dim);
    max-width: 400px;
    line-height: 1.6;
}

/* ============================================================
   FOOTER — matches CMS footer
   ============================================================ */
#site-footer {
    margin-top: auto;
}

.footer {
    background: var(--bg-footer);
    border-top: 1px solid var(--border);
    padding: 40px 20px;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--fg-dim);
    font-size: 14px;
    font-weight: 500;
}
.footer-links a:hover { color: var(--accent); }

.footer-socials {
    display: flex;
    gap: 16px;
}

.footer-socials a {
    color: var(--fg);
    font-size: 20px;
    transition: color 0.2s;
}
.footer-socials a:hover { color: var(--accent); }

.footer-copy {
    font-size: 13px;
    color: var(--fg-dim);
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--fg-dim);
    font-size: 15px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 10px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   WRITER PAGE — Article WYSIWYG editor
   ============================================================ */
.writer-page {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    margin-top: -80px;
    position: relative;
    z-index: 3;
}

/* Title input — sits inside the banner */
.writer-title-wrap { margin-bottom: 40px; }

.writer-title-input {
    width: 100%;
    padding: 16px 0;
    background: transparent;
    border: none;
    color: #fff;
    font-family: var(--font-body);
    font-size: 28px;
    font-weight: 700;
    outline: none;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.writer-title-input::placeholder { color: rgba(255, 255, 255, 0.95); font-weight: 500; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7); }

/* Two-column grid: editor + sidebar */
.writer-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}

/* Main editor area */
.writer-main {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
}

/* Quill overrides to match portal design */
.writer-main .ql-toolbar {
    background: var(--bg-card);
    border: none !important;
    padding: 10px 14px;
}

.writer-main .ql-container {
    border: none !important;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--fg);
}

.writer-main .ql-editor {
    padding: 20px;
    min-height: 500px;
    line-height: 1.7;
}

.writer-main .ql-editor.ql-blank::before {
    color: var(--fg-dim);
    font-style: normal;
}

/* Quill dark mode overrides */
body.dark-mode .ql-toolbar .ql-stroke { stroke: var(--fg) !important; }
body.dark-mode .ql-toolbar .ql-fill { fill: var(--fg) !important; }
body.dark-mode .ql-toolbar .ql-picker-label { color: var(--fg) !important; }
body.dark-mode .ql-toolbar .ql-picker-options {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
}
body.dark-mode .ql-toolbar .ql-picker-item { color: var(--fg) !important; }
body.dark-mode .ql-editor { color: var(--fg); }
body.dark-mode .ql-toolbar button:hover .ql-stroke { stroke: var(--accent) !important; }
body.dark-mode .ql-toolbar button:hover .ql-fill { fill: var(--accent) !important; }
body.dark-mode .ql-toolbar button.ql-active .ql-stroke { stroke: var(--accent) !important; }
body.dark-mode .ql-toolbar button.ql-active .ql-fill { fill: var(--accent) !important; }

/* Sidebar */
.writer-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.writer-sidebar .sidebar-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
}

.writer-sidebar .section-heading {
    font-size: 13px;
    margin-bottom: 12px;
    cursor: default;
}

/* Category tree */
.cat-tree {
    max-height: 320px;
    overflow-y: auto;
}

.cat-hint {
    font-size: 12px;
    color: var(--fg-dim);
    margin-bottom: 8px;
    line-height: 1.4;
}

.cat-group { margin-bottom: 2px; }

.cat-parent-row,
.cat-child-row {
    display: flex;
    align-items: center;
    gap: 2px;
}

.cat-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    color: var(--fg-dim);
    border-radius: 4px;
    transition: color 0.2s;
}

.cat-toggle:hover { color: var(--accent); }

.cat-toggle-spacer { width: 20px; flex-shrink: 0; }

.cat-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.cat-arrow-open { transform: rotate(90deg); }

.cat-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    font-size: 14px;
    color: var(--fg);
    cursor: pointer;
}

.cat-label:hover { color: var(--accent); }
.cat-parent { font-weight: 600; }
.cat-children { padding-left: 22px; }
.cat-grandchildren { padding-left: 22px; }

.cat-children.collapsed,
.cat-grandchildren.collapsed { display: none; }

/* Tags */
.tag-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    margin: 0 6px 6px 0;
    background: var(--bg-body);
    border-radius: 6px;
    font-size: 13px;
    color: var(--fg);
    cursor: pointer;
    transition: background 0.2s;
}

.tag-label:hover {
    background: var(--accent-dim);
    color: var(--accent);
}

/* Featured image upload zone */
.featured-image-zone {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: 8px;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, background 0.2s;
}

.featured-image-zone:hover { border-color: var(--accent); }

.featured-image-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.fi-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--fg-dim);
    font-size: 14px;
    padding: 20px;
    text-align: center;
}

.fi-placeholder i { font-size: 32px; opacity: 0.5; }
.fi-hint { font-size: 12px; opacity: 0.7; }

.fi-preview {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 200px;
}

.fi-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.fi-remove:hover { background: rgba(211, 47, 47, 0.9); }

.fi-status {
    font-size: 13px;
    padding: 6px 0;
    text-align: center;
}

.fi-status.uploading { color: var(--accent); }
.fi-status.success { color: var(--green); }
.fi-status.error { color: var(--red); }

/* Excerpt */
.writer-excerpt { resize: vertical; }

.char-count {
    font-size: 12px;
    color: var(--fg-dim);
    text-align: right;
    margin-top: 4px;
}

/* SEO toggle */
.seo-toggle {
    cursor: pointer !important;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.seo-chevron {
    font-size: 12px;
    transition: transform 0.2s;
}

.seo-chevron.rotated { transform: rotate(180deg); }

.seo-auto-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--green-dim);
    color: var(--green);
    margin-left: 4px;
}

.seo-hint {
    font-size: 12px;
    color: var(--fg-dim);
    margin-top: 8px;
}

/* Action buttons */
.writer-actions { margin-top: 8px; }
.writer-actions .btn-primary { width: 100%; }

.writer-note {
    font-size: 12px;
    color: var(--fg-dim);
    text-align: center;
    margin-top: 8px;
    line-height: 1.5;
}

/* Toast notification */
.writer-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s;
}

.writer-toast.success { background: var(--green); color: #fff; }
.writer-toast.success a { color: #fff; text-decoration: underline; }
.writer-toast.error { background: var(--red); color: #fff; }
.writer-toast.info { background: var(--accent); color: #fff; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .writer-grid {
        grid-template-columns: 1fr;
    }

    .writer-title-input {
        font-size: 22px;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        flex-direction: column;
        gap: 10px;
    }

    .welcome-card {
        flex-direction: column;
        text-align: center;
    }
}
