/* ==========================================================================
   HiFi Toolkit - Modern Admin Console Stylesheet
   ========================================================================== */

:root {
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Dark Mode Defaults */
    --bg-page: #0b0f19;
    --bg-surface: #111827;
    --bg-surface-elevated: #1f2937;
    --bg-subtle: #1e293b;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 255, 255, 0.16);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Brand Accents */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.12);
    
    --emerald: #10b981;
    --emerald-light: rgba(16, 185, 129, 0.12);
    --purple: #a855f7;
    --purple-light: rgba(168, 85, 247, 0.12);
    --cyan: #06b6d4;
    --cyan-light: rgba(6, 182, 212, 0.12);
    --amber: #f59e0b;
    --amber-light: rgba(245, 158, 11, 0.12);
    --rose: #f43f5e;
    --rose-light: rgba(244, 63, 94, 0.12);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
}

[data-theme="light"] {
    --bg-page: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f1f5f9;
    --bg-subtle: #f1f5f9;
    --border-color: #e2e8f0;
    --border-color-hover: #cbd5e1;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ==========================================================================
   Login Screen
   ========================================================================== */

.login-wrapper {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, #1e1b4b 0%, #0b0f19 70%);
    padding: 20px;
    z-index: 9999;
}

.login-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px);
    animation: fadeInScale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-box {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: white;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 1rem;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.login-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.login-footer code {
    background: var(--bg-subtle);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--primary);
    font-family: var(--font-mono);
}

/* ==========================================================================
   Main Layout (Sidebar + Content)
   ========================================================================== */

.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 270px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    padding: 0.75rem 0.75rem 0.375rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.6875rem 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

.nav-item i {
    width: 20px;
    font-size: 1.05rem;
    text-align: center;
}

.nav-item:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.nav-item .badge {
    margin-left: auto;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.user-meta {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.8125rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.btn-logout {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.btn-logout:hover {
    color: var(--rose);
    background: var(--rose-light);
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */

.main-content {
    flex: 1;
    margin-left: 270px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    height: 70px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
    backdrop-filter: blur(8px);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.theme-toggle:hover {
    color: var(--text-primary);
    border-color: var(--border-color-hover);
}

.tab-pane {
    display: none;
    padding: 2rem;
    flex: 1;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Metrics Grid
   ========================================================================== */

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-color-hover);
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.color-indigo { color: var(--primary); background: var(--primary-light); }
.color-emerald { color: var(--emerald); background: var(--emerald-light); }
.color-purple { color: var(--purple); background: var(--purple-light); }
.color-cyan { color: var(--cyan); background: var(--cyan-light); }

.metric-info {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 4px 0;
    letter-spacing: -0.03em;
}

.metric-trend {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Panel Cards & Tables
   ========================================================================== */

.panel-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.panel-title {
    font-size: 1.125rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.panel-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 600px;
}

.search-box {
    position: relative;
    flex: 1;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.search-box input {
    width: 100%;
    padding: 0.5625rem 0.875rem 0.5625rem 2.25rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
    transition: all 0.15s ease;
}

.search-box input:focus {
    border-color: var(--primary);
    background: var(--bg-surface);
}

.filter-select {
    padding: 0.5625rem 0.875rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
    cursor: pointer;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.6fr 1.2fr;
    gap: 1.5rem;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}

.data-table th {
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-subtle);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: var(--bg-subtle);
}

/* ==========================================================================
   Badges, Buttons & Forms
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--emerald-light); color: var(--emerald); }
.badge-warning { background: var(--amber-light); color: var(--amber); }
.badge-danger { background: var(--rose-light); color: var(--rose); }
.badge-info { background: var(--cyan-light); color: var(--cyan); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.5625rem 1.125rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-subtle);
    border-color: var(--border-color-hover);
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.8125rem;
}

.btn-xs {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
}

.btn-block {
    width: 100%;
}

.form-group {
    margin-bottom: 1.125rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
    font-family: inherit;
    transition: all 0.15s ease;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    border-color: var(--primary);
    background: var(--bg-surface);
}

.form-row {
    display: flex;
    gap: 1rem;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

/* ==========================================================================
   cPanel Webmail Split Interface
   ========================================================================== */

.webmail-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    min-height: 680px;
}

.mail-header-bar {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mail-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mail-header-title i {
    font-size: 24px;
}

.mail-header-title h3 {
    font-size: 1.05rem;
    font-weight: 700;
}

.mail-header-title span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.webmail-split {
    display: flex;
    flex: 1;
}

.mail-list-col {
    width: 380px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
}

.mail-list-toolbar {
    padding: 0.75rem 1rem;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mail-nav-btns {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mail-items-container {
    flex: 1;
    overflow-y: auto;
    max-height: 600px;
}

.mail-item {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s ease;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.mail-item:hover {
    background: var(--bg-subtle);
}

.mail-item.active {
    background: var(--primary-light);
    border-left: 3px solid var(--primary);
}

.mail-item.unread .mail-subject {
    font-weight: 700;
    color: var(--text-primary);
}

.mail-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 6px;
    flex-shrink: 0;
}

.mail-item-body {
    flex: 1;
    overflow: hidden;
}

.mail-sender-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
}

.mail-sender {
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.mail-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.mail-subject {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mail-view-col {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: var(--bg-page);
    display: flex;
    flex-direction: column;
}

.empty-mail-placeholder {
    margin: auto;
    text-align: center;
    max-width: 380px;
}

.empty-mail-placeholder h3 {
    margin: 1rem 0 0.5rem;
    font-size: 1.125rem;
}

.empty-mail-placeholder p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.mail-read-pane {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.mail-read-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
}

.mail-read-subject {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.mail-read-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8125rem;
}

.mail-read-body {
    line-height: 1.7;
    font-size: 0.9375rem;
    min-height: 250px;
    padding: 1rem 0;
    word-break: break-word;
}

.mail-read-actions {
    display: flex;
    gap: 10px;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   Google SERP Preview Box
   ========================================================================== */

.seo-meta-box {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-top: 1rem;
}

.google-snippet-preview {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-top: 0.75rem;
    font-family: Arial, sans-serif;
}

.snippet-url {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.snippet-title {
    font-size: 18px;
    color: #3b82f6;
    font-weight: 500;
    margin-bottom: 4px;
    cursor: pointer;
}

.snippet-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ==========================================================================
   Modals & Toast Notifications
   ========================================================================== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: fadeInScale 0.2s ease;
}

.modal-lg {
    max-width: 900px;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.editor-toolbar {
    display: flex;
    gap: 4px;
    padding: 6px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.editor-toolbar button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8125rem;
}

.editor-toolbar button:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    animation: slideInRight 0.25s ease;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast-success { border-left: 4px solid var(--emerald); }
.toast-error { border-left: 4px solid var(--rose); }

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-toggle { display: block; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .webmail-split { flex-direction: column; }
    .mail-list-col { width: 100%; border-right: none; border-bottom: 1px solid var(--border-color); }
    .blog-editor-grid { grid-template-columns: 1fr; }
    .categories-page-grid, .authors-page-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Full-Page Blog Editor (Dedicated View - No Modal)
   ========================================================================== */

.blog-editor-page-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-bottom: 3rem;
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.editor-header-bar {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    position: sticky;
    top: 80px;
    z-index: 100;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(8px);
}

.editor-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 280px;
}

.editor-heading-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
}

.editor-heading-title {
    font-size: 1.125rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 420px;
}

.editor-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.editor-stat-pills {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-subtle);
    padding: 4px 10px;
    border-radius: 9999px;
    border: 1px solid var(--border-color);
}

.stat-pill {
    font-size: 0.8125rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Two-column editor grid */
.blog-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 1.5rem;
    align-items: start;
}

.editor-main-col {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
}

.editor-field-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.editor-title-input {
    width: 100%;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0.875rem 1rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all 0.2s;
    font-family: var(--font-sans);
}

.editor-title-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: var(--bg-surface-elevated);
}

.slug-bar-container {
    display: flex;
    align-items: center;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
}

.slug-prefix {
    color: var(--text-muted);
    user-select: none;
}

.slug-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--primary);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    padding: 2px 6px;
}

.slug-input:focus {
    outline: none;
}

.editor-excerpt-input {
    width: 100%;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: var(--font-sans);
    resize: vertical;
}

.editor-excerpt-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ==========================================================================
   Advanced Rich Text Editor Toolbar (H1-H6, Underline, Color Pickers)
   ========================================================================== */

.editor-box {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-surface-elevated);
    overflow: hidden;
    margin-top: 1rem;
}

.editor-toolbar-advanced {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    user-select: none;
}

.tb-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.tb-divider {
    width: 1px;
    height: 22px;
    background: var(--border-color);
    margin: 0 4px;
}

.tb-select {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}

.tb-select:hover {
    border-color: var(--border-color-hover);
}

.tb-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.15s;
}

.tb-btn:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.tb-btn.active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.tb-btn-code {
    width: auto;
    padding: 0 8px;
    gap: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
    border-color: rgba(99, 102, 241, 0.2);
}

.tb-btn-code.active {
    background: var(--primary);
    color: white;
}

/* Color Picker Buttons */
.color-picker-btn {
    position: relative;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    border: 1px solid transparent;
    transition: all 0.15s;
}

.color-picker-btn:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.color-picker-btn input[type="color"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    cursor: pointer;
}

.color-dot {
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.2);
}

/* WYSIWYG Content Area */
.editor-wysiwyg-area {
    min-height: 520px;
    max-height: 800px;
    overflow-y: auto;
    padding: 1.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.75;
    background: var(--bg-surface);
    outline: none;
    font-family: var(--font-sans);
}

.editor-wysiwyg-area:focus {
    box-shadow: inset 0 0 0 2px var(--primary-light);
}

/* WYSIWYG Document Styles (Previewing typography) */
.editor-wysiwyg-area h1 { font-size: 2rem; font-weight: 800; margin: 1.5rem 0 0.8rem; color: var(--text-primary); border-bottom: 2px solid var(--border-color); padding-bottom: 0.4rem; }
.editor-wysiwyg-area h2 { font-size: 1.6rem; font-weight: 700; margin: 1.4rem 0 0.7rem; color: var(--primary); border-bottom: 1px solid var(--border-color); padding-bottom: 0.3rem; }
.editor-wysiwyg-area h3 { font-size: 1.3rem; font-weight: 600; margin: 1.2rem 0 0.6rem; color: var(--text-primary); }
.editor-wysiwyg-area h4 { font-size: 1.15rem; font-weight: 600; margin: 1rem 0 0.5rem; color: var(--text-primary); }
.editor-wysiwyg-area h5 { font-size: 1rem; font-weight: 600; margin: 0.8rem 0 0.4rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.editor-wysiwyg-area h6 { font-size: 0.9rem; font-weight: 600; margin: 0.8rem 0 0.4rem; color: var(--text-muted); }
.editor-wysiwyg-area p { margin-bottom: 1.1rem; }
.editor-wysiwyg-area u { text-decoration: underline; text-decoration-color: var(--primary); text-underline-offset: 3px; }
.editor-wysiwyg-area ul, .editor-wysiwyg-area ol { margin: 1rem 0 1.2rem 2rem; }
.editor-wysiwyg-area li { margin-bottom: 0.5rem; }
.editor-wysiwyg-area blockquote {
    border-left: 4px solid var(--primary);
    padding: 0.75rem 1.25rem;
    margin: 1.25rem 0;
    background: var(--bg-subtle);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text-secondary);
}
.editor-wysiwyg-area pre {
    background: #090d16;
    color: #e2e8f0;
    padding: 1.2rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    margin: 1.25rem 0;
    border: 1px solid var(--border-color);
}
.editor-wysiwyg-area code {
    background: var(--bg-subtle);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.875em;
}
.editor-wysiwyg-area pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}
.editor-wysiwyg-area img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 1.25rem 0;
    border: 1px solid var(--border-color);
}
.editor-wysiwyg-area table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
}
.editor-wysiwyg-area th, .editor-wysiwyg-area td {
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    text-align: left;
}
.editor-wysiwyg-area th {
    background: var(--bg-subtle);
    font-weight: 600;
}

/* Raw HTML Code Textarea */
.editor-raw-html-area {
    width: 100%;
    min-height: 520px;
    max-height: 800px;
    padding: 1.5rem;
    background: #090d16;
    color: #38bdf8;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    border: none;
    outline: none;
    resize: vertical;
}

/* Editor Footer Status Bar */
.editor-footer-status {
    padding: 8px 14px;
    background: var(--bg-subtle);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8125rem;
}

.quality-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

/* ==========================================================================
   Editor Right Sidebar & Cards
   ========================================================================== */

.editor-sidebar-col {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.side-panel-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.side-panel-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.side-panel-header h4 {
    font-size: 0.9375rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-date-row {
    display: flex;
    gap: 6px;
}

/* Featured Image Upload Dropzone */
.featured-upload-box {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-subtle);
}

.featured-upload-box:hover, .featured-upload-box.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-spinner-box {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
}

.featured-preview-container {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.featured-preview-container img {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    display: block;
}

.preview-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.featured-preview-container:hover .preview-overlay {
    opacity: 1;
}

/* SEO Checklist in Sidebar */
.seo-audit-list {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.seo-check-item {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}

.seo-check-item.passed {
    color: var(--emerald);
}

.seo-check-item.passed i {
    color: var(--emerald);
}

/* ==========================================================================
   Category & Author Management Pages
   ========================================================================== */

.categories-page-grid, .authors-page-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.authors-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.author-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    transition: all 0.2s;
}

.author-card:hover {
    border-color: var(--border-color-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.author-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    background: var(--bg-subtle);
}

.author-meta {
    flex: 1;
    overflow: hidden;
}

.author-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.author-designation {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
}

.author-email {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.author-bio {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.author-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8125rem;
}

.author-social-links {
    display: flex;
    gap: 8px;
}

.author-social-links a {
    color: var(--text-muted);
    transition: color 0.15s;
}

.author-social-links a:hover {
    color: var(--primary);
}

/* ==========================================================================
   Multi-Page Content Wrapper & Status Filter Tabs
   ========================================================================== */

.content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.blog-status-tabs-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.status-tab-links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.status-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-tab-btn:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}

.status-tab-btn.active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: rgba(99, 102, 241, 0.3);
}

.status-tab-btn.tab-trash.active {
    background: var(--rose-light);
    color: var(--rose);
    border-color: rgba(244, 63, 94, 0.3);
}

.status-tab-btn.tab-trash:hover {
    color: var(--rose);
}

.tab-count {
    font-size: 0.75rem;
    opacity: 0.8;
}

.status-tab-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}


