/* 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;
}

