/* 
 * Travel Blog Generator - Notion-inspired UI
 * Clean, minimal, modern design
 */

:root {
    /* Colors - Notion-like palette */
    --bg-primary: #ffffff;
    --bg-secondary: #fbfbfa;
    --bg-tertiary: #f7f6f3;
    --bg-hover: #efefef;
    --bg-active: #e8e8e8;
    
    --text-primary: #37352f;
    --text-secondary: #6b6b6b;
    --text-muted: #9b9a97;
    --text-link: #2383e2;
    
    --border-color: #e9e9e7;
    --border-dark: #dfdfde;
    
    --accent-blue: #2383e2;
    --accent-green: #0f7b6c;
    --accent-red: #e03e3e;
    --accent-orange: #d9730d;
    --accent-purple: #9065b0;
    --accent-yellow: #dfab01;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    
    /* Spacing */
    --sidebar-width: 260px;
    --header-height: 45px;
    --radius: 6px;
    --radius-lg: 8px;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.skip-nav-link {
    position: absolute;
    left: 12px;
    top: -48px;
    z-index: 2000;
    background: var(--text-primary);
    color: var(--bg-primary);
    border-radius: 8px;
    padding: 8px 12px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    transition: top 0.15s ease;
}

.skip-nav-link:focus {
    top: 12px;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-tertiary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9375rem;
}

.logo-icon {
    font-size: 1.25rem;
}

.sidebar-toggle {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.15s ease;
}

.sidebar-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.toggle-icon {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

/* Sidebar Collapsed State */
.sidebar-collapsed .sidebar {
    width: 60px;
}

.sidebar-collapsed .logo-text,
.sidebar-collapsed .nav-section-title,
.sidebar-collapsed .nav-item span:last-child,
.sidebar-collapsed .sidebar-footer span:not(.status-dot) {
    display: none;
}

.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 12px 8px;
}

.sidebar-collapsed .sidebar-toggle {
    margin: 0;
}

.sidebar-collapsed .toggle-icon {
    transform: rotate(180deg);
}

.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 10px;
}

.sidebar-collapsed .nav-icon {
    margin: 0;
}

.sidebar-collapsed .main-content {
    margin-left: 60px;
}

.sidebar-collapsed .sidebar-footer {
    justify-content: center;
}

.sidebar-collapsed .api-status {
    justify-content: center;
}

/* Navigation */
.sidebar-nav {
    padding: 8px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.nav-section {
    margin-bottom: 16px;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 10px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

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

.nav-item.active {
    background: var(--bg-active);
    color: var(--text-primary);
    font-weight: 500;
}

.nav-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid var(--border-color);
}

.api-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-dot.online {
    background: var(--accent-green);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-primary);
}

.page-content {
    padding: 32px 48px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Page Header */
.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--text-primary);
}

.breadcrumbs .separator {
    color: var(--text-muted);
}

/* Cards */
.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 4px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.dashboard-stats-secondary {
    margin-bottom: 24px;
}

.dashboard-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dashboard-quick-actions,
.dashboard-errors {
    margin-bottom: 24px;
}

.dashboard-ai-summary {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}

.dashboard-error-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.dashboard-error-item {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    background: var(--bg-secondary);
}

.dashboard-error-title {
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.35;
}

.dashboard-error-message {
    color: var(--accent-red);
    font-size: 0.84rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dashboard-error-details {
    margin-top: 6px;
}

.dashboard-error-details summary {
    cursor: pointer;
    color: var(--accent-blue);
    font-size: 0.78rem;
    user-select: none;
}

.dashboard-error-details[open] .dashboard-error-message {
    margin-top: 6px;
    display: block;
}

.dashboard-error-date {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.76rem;
}

.panel-loading {
    margin-top: 12px;
}

.panel-loading__title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 14px;
}

.panel-loading__bar {
    height: 12px;
    border-radius: 999px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
    background-size: 240% 100%;
    animation: panel-loading-shimmer 1.2s ease-in-out infinite;
}

.panel-loading__bar.short {
    max-width: 60%;
}

@keyframes panel-loading-shimmer {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

.dashboard-lists-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.dashboard-ai-activity {
    display: grid;
    gap: 10px;
}

.dashboard-ai-activity__sparkline {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    padding: 8px 10px;
}

.dashboard-ai-activity__sparkline svg {
    width: 100%;
    height: 24px;
}

.dashboard-ai-activity__sparkline polyline {
    fill: none;
    stroke: var(--accent-blue);
    stroke-width: 1.8;
}

.dashboard-ai-activity__row {
    display: grid;
    grid-template-columns: 96px 1fr auto;
    gap: 10px;
    align-items: center;
}

.dashboard-ai-activity__day {
    font-family: monospace;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.dashboard-ai-activity__bars {
    display: grid;
    gap: 4px;
}

.dashboard-ai-activity__bar {
    height: 8px;
    border-radius: 999px;
    background: var(--bg-secondary);
    overflow: hidden;
}

.dashboard-ai-activity__bar > div {
    height: 100%;
    border-radius: inherit;
}

.dashboard-ai-activity__bar-tokens > div {
    background: var(--accent-blue);
}

.dashboard-ai-activity__bar-requests > div {
    background: var(--accent-green);
}

.dashboard-ai-activity__meta {
    font-size: 0.82rem;
}

.badge-static-mode {
    background: rgba(59, 130, 246, 0.14);
    color: #bfdbfe;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.badge-wordpress-mode {
    background: rgba(16, 185, 129, 0.14);
    color: #a7f3d0;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Tables */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
    font-size: 0.875rem;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--bg-tertiary);
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--bg-secondary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
}

.btn-primary:hover {
    background: #1a73d1;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-danger {
    background: var(--accent-red);
    color: white;
}

.btn-danger-outline {
    background: transparent;
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.45);
}

.btn-danger-outline:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
}

.btn-danger:hover {
    background: #c93232;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-input,
.form-control,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus,
.form-control:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(35, 131, 226, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    align-items: end;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
}

.filter-bar .form-group {
    flex: 1 1 170px;
    margin-bottom: 0;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-writing {
    background: #cce5ff;
    color: #004085;
}

.badge-written {
    background: #d4edda;
    color: #155724;
}

.badge-published {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-draft {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.badge-active {
    background: #d4edda;
    color: #155724;
}

.badge-paused {
    background: #fff3cd;
    color: #856404;
}

.badge-error {
    background: #fee2e2;
    color: #991b1b;
}

.badge-completed,
.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-processing {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-skipped,
.badge-not_relevant {
    background: #e5e7eb;
    color: #374151;
}

/* Topic pillar types */
.badge-pillar {
    background: #cce5ff;
    color: #004085;
    font-weight: 600;
}

.badge-cluster {
    background: #d4edda;
    color: #155724;
}

.badge-support {
    background: #e2e3e5;
    color: #383d41;
}

/* Places status */
.badge-has_image {
    background: #d4edda;
    color: #155724;
}

.badge-processed {
    background: #cce5ff;
    color: #004085;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin: 16px 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.5;
    color: inherit;
}

.alert-close:hover {
    opacity: 1;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state-text {
    margin-bottom: 24px;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(-20px);
    transition: transform 0.2s ease;
}

.modal-backdrop.active .modal {
    transform: translateY(0);
}

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

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

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

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Preview crop popup */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    width: min(920px, 100%);
    max-height: 90vh;
    overflow: auto;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0 18px 18px;
}

.modal-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.tab {
    padding: 12px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.15s ease;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

/* Actions */
.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Code/Prompt Editor */
.prompt-editor {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    min-height: 300px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
}

.prompt-editor--x3 {
    min-height: 900px;
}

/* Progress Bar */
.progress {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent-blue);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Image Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.image-card {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s ease;
}

.image-card:hover {
    border-color: var(--accent-blue);
}

.image-card.selected {
    border-color: var(--accent-blue);
}

.image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    font-size: 0.75rem;
}

/* Topics page */
.topics-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}
.topics-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.topics-header .subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.topics-stats {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.topics-stat {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    transition: all .15s;
    border: 1px solid var(--border-color);
}
.topics-stat:hover { opacity: .9; }
.topics-stat.active { box-shadow: 0 0 0 2px var(--accent-blue); }
.stat-all { background: #f3f4f6; color: #374151; }
.stat-pending { background: #fef3c7; color: #92400e; }
.stat-writing { background: #dbeafe; color: #1e40af; }
.stat-written { background: #d1fae5; color: #065f46; }
.stat-published { background: #e0e7ff; color: #3730a3; }
.topics-filters {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.notion-topics {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: auto;
}
.notion-topics table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1080px;
}
.notion-topics thead { background: var(--bg-secondary); }
.notion-topics th {
    padding: 8px 14px;
    text-align: left;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}
.notion-topics td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}
.notion-topics tr:last-child td { border-bottom: none; }
.notion-topics tr:hover { background: var(--bg-hover); }
.topic-cell { max-width: 420px; }
.topic-name {
    font-weight: 500;
    font-size: .88rem;
    color: var(--text-primary);
    line-height: 1.4;
}
.topic-places {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}
.place-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    background: #f3f4f6;
    border-radius: 4px;
    font-size: 0.68rem;
    color: #6b7280;
    white-space: nowrap;
}
.status-chip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: .72rem;
    font-weight: 500;
}
.status-chip-pending { background: #fef3c7; color: #92400e; }
.status-chip-writing { background: #dbeafe; color: #1e40af; }
.status-chip-written { background: #d1fae5; color: #065f46; }
.status-chip-published { background: #e0e7ff; color: #3730a3; }
.status-chip-skeleton { background: #fef3c7; color: #92400e; }
.status-chip-draft { background: #dbeafe; color: #1e40af; }
.status-chip-ready { background: #d1fae5; color: #065f46; }
.status-chip-regenerating { background: #dbeafe; color: #1e40af; }
.status-chip-expanding { background: #e0e7ff; color: #3730a3; }
.article-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: .72rem;
    font-weight: 500;
    text-decoration: none;
}
.article-chip-skeleton { background: #fef3c7; color: #92400e; }
.article-chip-draft { background: #f3f4f6; color: #6b7280; }
.article-chip-ready { background: #d1fae5; color: #065f46; }
.article-chip-expanding { background: #dbeafe; color: #1e40af; }
.article-chip-published { background: #e0e7ff; color: #3730a3; }
.topic-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.topic-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: .75rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.topic-btn:hover { background: var(--bg-secondary); border-color: var(--text-muted); }
.topic-btn-primary { background: var(--accent-blue); color: #fff; border-color: var(--accent-blue); }
.topic-btn-expand { background: #eff6ff; color: #1d4ed8; border-color: #93c5fd; }
.topic-btn-danger { color: #dc2626; border-color: #fca5a5; }
.topic-btn-danger:hover { background: #fef2f2; }
.topic-actions-more {
    position: relative;
}
.topic-actions-more > summary {
    list-style: none;
}
.topic-actions-more > summary::-webkit-details-marker {
    display: none;
}
.topic-actions-popover {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 150px;
    display: grid;
    gap: 6px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 20;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
    .main-content {
        margin-left: 200px;
    }
    .page-content {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        z-index: 100;
        transition: left 0.3s ease;
    }
    .sidebar.open {
        left: 0;
    }
    .main-content {
        margin-left: 0;
    }
    .form-row {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 16px;
    }

    th, td {
        padding: 10px 12px;
    }

    .table-container {
        border-radius: var(--radius);
    }

    .dashboard-error-list,
    .dashboard-lists-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   Article Content Preview - WordPress Blockquote Styles
   ===================================================== */
.content-preview blockquote {
    margin: 16px 0;
    padding: 16px 20px;
    border-left: 4px solid var(--accent-blue);
    border-radius: 0 var(--radius) var(--radius) 0;
    background: var(--bg-tertiary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.content-preview blockquote strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1rem;
}

.content-preview blockquote.tip {
    border-left-color: #8b5cf6;
    background: #f5f3ff;
}

.content-preview blockquote.lifehack {
    border-left-color: var(--accent-green);
    background: #ecfdf5;
}

.content-preview blockquote.warning {
    border-left-color: var(--accent-red);
    background: #fef2f2;
}

.content-preview blockquote.important {
    border-left-color: var(--accent-orange);
    background: #fff7ed;
}

.content-preview blockquote.price {
    border-left-color: var(--accent-yellow);
    background: #fefce8;
}

.content-preview blockquote.insider {
    border-left-color: var(--accent-purple);
    background: #faf5ff;
}

.content-preview blockquote.photo {
    border-left-color: #06b6d4;
    background: #ecfeff;
}

/* Article H1, H2, H3 styling in preview */
.content-preview h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.content-preview h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 32px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.content-preview h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 24px 0 12px;
    color: var(--text-secondary);
}

.content-preview p {
    margin-bottom: 16px;
    line-height: 1.7;
}

.content-preview a {
    color: var(--text-link);
    text-decoration: underline;
}

.content-preview a:hover {
    text-decoration: none;
}

/* Info Block Styles (WordPress compatible) */
.content-preview .info-block {
    padding: 16px 20px;
    margin: 20px 0;
    border-radius: 8px;
    border-left: 4px solid;
    font-size: 0.95rem;
    line-height: 1.6;
}

.content-preview .info-block strong {
    margin-right: 5px;
}

.content-preview .info-block.tip {
    background: #e8f4fd;
    border-left-color: #2196F3;
    color: #1565c0;
}

.content-preview .info-block.warning {
    background: #fff3e0;
    border-left-color: #ff9800;
    color: #e65100;
}

.content-preview .info-block.price {
    background: #e8f5e9;
    border-left-color: #4CAF50;
    color: #2e7d32;
}

.content-preview .info-block.honest {
    background: #ffebee;
    border-left-color: #f44336;
    color: #c62828;
}

.content-preview .info-block.insider {
    background: #f3e5f5;
    border-left-color: #9c27b0;
    color: #7b1fa2;
}

/* Photo placeholder styling in preview */
.content-preview [photo],
.content-preview .photo-placeholder {
    display: block;
    background: #fff3cd;
    border: 2px dashed #ffc107;
    padding: 16px 20px;
    margin: 16px 0;
    border-radius: 8px;
    color: #856404;
    font-style: italic;
    text-align: center;
}

/* Article figure/image styling */
.content-preview figure.article-image {
    margin: 24px 0;
    padding: 0;
}

.content-preview figure.article-image img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
}

.content-preview figure.article-image figcaption {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: center;
}

.content-preview figure.preview-image {
    margin: 20px 0;
}

.content-preview figure.preview-image img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    display: block;
}

.preview-image-moderation {
    border: 1px solid var(--border-color);
}

.preview-image-moderation__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.preview-image-moderation__header h3 {
    margin: 0;
    font-size: 1rem;
}

.preview-image-moderation__header small {
    color: var(--text-muted);
}

.preview-image-moderation__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.preview-image-moderation__item {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    background: var(--bg-secondary);
}

.preview-image-moderation__item img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.preview-image-moderation__meta {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preview-image-moderation__meta small {
    color: var(--text-muted);
}

.preview-image-moderation__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.preview-image-moderation__actions .btn.is-active {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.preview-image-inline-controls {
    margin-top: 10px;
}

.preview-image-moderation__inline-block {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    background: color-mix(in srgb, var(--bg-secondary) 88%, black 12%);
}

.preview-image-moderation__inline-meta {
    display: block;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-size: 0.78rem;
}

/* Lists in preview */
.content-preview ul, .content-preview ol {
    margin: 16px 0;
    padding-left: 24px;
}

.content-preview li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* Table styling */
.content-preview table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.content-preview table th,
.content-preview table td {
    padding: 12px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.content-preview table th {
    background: var(--bg-tertiary);
    font-weight: 600;
}

/* Button improvements */
.btn {
    line-height: 1.4;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Actions cell in tables */
td.actions {
    white-space: nowrap;
}

td.actions .btn {
    vertical-align: middle;
}

.articles-table-container {
    border-radius: 14px;
}

.articles-table {
    min-width: 0 !important;
    table-layout: fixed;
}

.articles-table th:nth-child(1) { width: 29%; }
.articles-table th:nth-child(2) { width: 9%; }
.articles-table th:nth-child(3) { width: 7%; }
.articles-table th:nth-child(4) { width: 11%; }
.articles-table th:nth-child(5) { width: 10%; }
.articles-table th:nth-child(6) { width: 8%; }
.articles-table th:nth-child(7) { width: 8%; }
.articles-table th:nth-child(8) { width: 18%; }

.articles-table th,
.articles-table td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    vertical-align: top;
}


.articles-updated {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.articles-title-cell a {
    display: inline-block;
    line-height: 1.35;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
}

.articles-title-cell a:hover {
    color: var(--accent-blue);
    text-decoration: underline;
}

.articles-metric-link {
    text-decoration: none;
    color: inherit;
}

.articles-metric-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.77rem;
    font-weight: 600;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.articles-metric-badge-primary {
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

.articles-metric-stack {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.articles-model-cell {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.articles-actions-cell {
    white-space: normal !important;
}

.articles-action-icon {
    width: 30px;
    min-width: 30px;
    height: 30px;
    padding: 0;
    font-size: 0.95rem;
    border-radius: 8px;
}

.articles-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 30px);
    gap: 6px;
    justify-content: end;
    align-content: start;
}

.articles-actions-grid .articles-action-icon {
    margin: 0;
}

.video-queue-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(28px, max-content));
    gap: 6px;
    justify-content: start;
}

.video-queue-action-icon {
    width: 28px;
    min-width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 7px;
    font-size: 0.9rem;
}

.version-compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 16px;
}

.version-compare-column {
    min-height: 70vh;
}

.version-compare-column__meta {
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.version-compare-column__meta h3 {
    margin: 0 0 6px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.version-compare-column__title {
    margin: 0 0 14px;
    font-size: 1.2rem;
}

.version-compare-column__content {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

@media (max-width: 1280px) {
    .articles-table th:nth-child(5),
    .articles-table td:nth-child(5) {
        display: none;
    }

    .articles-table th:nth-child(1) { width: 31%; }
    .articles-table th:nth-child(8) { width: 22%; }
}

@media (max-width: 1100px) {
    .articles-table {
        min-width: 980px !important;
    }
}

.moderation-blocked-card {
    margin-bottom: 16px;
}

.moderation-blocked-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.moderation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.moderation-card {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
}

.moderation-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.moderation-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.moderation-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.moderation-video {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.35;
}

.moderation-channel {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.moderation-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.moderation-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
