/* ===== SAINT-ESPRIT V3 - ULTRA CLEAN ===== */

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

:root {
    /* Colors */
    --bg-dark: #0d1117;
    --bg-darker: #010409;
    --bg-light: #161b22;
    --bg-lighter: #21262d;

    --border: #30363d;
    --border-light: #484f58;

    --text: #e6edf3;
    --text-muted: #8b949e;

    --primary: #58a6ff;
    --primary-hover: #79c0ff;
    --success: #3fb950;
    --danger: #f85149;
    --warning: #d29922;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    /* Radius */
    --radius: 8px;
    --radius-lg: 12px;

    /* Shadows */
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 260px;
    background: var(--bg-darker);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.sidebar-header .logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
}

.sidebar-header h1 {
    font-size: 18px;
    font-weight: 600;
}

.nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.nav-btn:hover {
    background: var(--bg-light);
    color: var(--text);
}

.nav-btn.active {
    background: var(--bg-lighter);
    color: var(--primary);
}

.nav-btn .icon {
    font-size: 18px;
}

.sidebar-footer {
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.user-avatar {
    font-size: 20px;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
}

.logout-btn {
    width: 100%;
    padding: var(--space-sm);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: var(--bg-light);
    border-color: var(--border-light);
    color: var(--text);
}

/* ===== MAIN CONTENT ===== */
.main {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.view {
    display: none;
    flex-direction: column;
    height: 100%;
    padding: var(--space-xl);
    overflow-y: auto;
}

.view.active {
    display: flex;
}

.view-header {
    margin-bottom: var(--space-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-header h2 {
    font-size: 28px;
    font-weight: 600;
}

.date {
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== DASHBOARD ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    max-width: 1000px;
    margin: 0 auto;
}

@media (max-width: 1200px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    cursor: pointer;
    transition: all 0.3s;
    min-height: 140px;
    display: flex;
    flex-direction: column;
}

.card:hover {
    background: var(--bg-lighter);
    border-color: var(--border-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-external {
    background: linear-gradient(135deg, var(--bg-light) 0%, rgba(102, 126, 234, 0.1) 100%);
    border-color: rgba(102, 126, 234, 0.3);
}

.card-external:hover {
    border-color: rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, var(--bg-lighter) 0%, rgba(102, 126, 234, 0.15) 100%);
}

.card-icon {
    font-size: 36px;
    margin-bottom: var(--space-sm);
}

.card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.card p {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: var(--space-sm);
}

.card-stat {
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
}

.card-onair {
    border-color: var(--danger);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(248, 81, 73, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(248, 81, 73, 0); }
}

/* ===== SPLIT VIEW (News) ===== */
.split-view {
    display: flex;
    gap: var(--space-lg);
    height: 100%;
    overflow: hidden;
}

.list-panel {
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.editor-panel {
    flex: 1;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    overflow-y: auto;
}

.search-input {
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
}

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

.list {
    flex: 1;
    overflow-y: auto;
}

.empty-state {
    text-align: center;
    padding: var(--space-xl);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

.editor-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.placeholder-icon {
    font-size: 64px;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

/* ===== BUTTONS ===== */
.btn {
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius);
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: #000;
}

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

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

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

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ===== AUDIO EDITOR ===== */
.view-header-left,
.view-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.audio-editor-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    gap: var(--space-lg);
}

.audio-toolbar {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    flex-wrap: wrap;
    box-shadow: var(--shadow);
}

.toolbar-section {
    display: flex;
    gap: var(--space-sm);
    padding-right: var(--space-lg);
    border-right: 2px solid var(--border);
    align-items: center;
}

.toolbar-section:last-child {
    border-right: none;
}

.toolbar-btn {
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 0 var(--space-md);
    background: var(--bg-darker);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 18px;
    font-weight: 500;
    white-space: nowrap;
}

.toolbar-btn:hover:not(:disabled) {
    background: var(--bg-lighter);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

.toolbar-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: var(--border);
}

.toolbar-btn.active {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

.toolbar-btn.danger:hover:not(:disabled) {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.toolbar-btn.success:hover:not(:disabled) {
    background: var(--success);
    border-color: var(--success);
    color: #000;
}

.waveform-container {
    flex: 1;
    background: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

#waveform-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

.transport-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.time-display {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

.time-display .separator {
    color: var(--text-muted);
    margin: 0 var(--space-sm);
}

.zoom-controls {
    display: flex;
    gap: var(--space-xs);
}

/* ===== CONDUCTOR ===== */
.conductor-header-info {
    display: flex;
    gap: var(--space-xl);
    padding: var(--space-lg);
    background: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
}

.conductor-info-item {
    text-align: center;
}

.conductor-info-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.conductor-info-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Courier New', monospace;
}

.conductor-timeline {
    display: flex;
    gap: var(--space-lg);
}

.conductor-segments {
    flex: 1;
}

.conductor-sidebar {
    width: 300px;
}

.segment {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    cursor: move;
    transition: all 0.2s;
    position: relative;
}

.segment:hover {
    border-color: var(--border-light);
    transform: translateX(4px);
}

.segment.current {
    border-color: var(--success);
    border-width: 2px;
    background: rgba(63, 185, 80, 0.05);
}

.segment.dragging {
    opacity: 0.5;
}

.segment-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: var(--space-md);
}

.segment-number {
    width: 32px;
    height: 32px;
    background: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
}

.segment.current .segment-number {
    background: var(--success);
    color: #000;
    border-color: var(--success);
}

.segment-time {
    text-align: right;
}

.segment-timecode {
    font-size: 18px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: var(--text);
}

.segment-duration {
    font-size: 12px;
    color: var(--text-muted);
}

.segment-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space-sm);
}

.segment-content {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: var(--space-md);
}

.segment-type {
    display: inline-block;
    padding: 4px 8px;
    border-radius: var(--radius);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.segment-actions {
    display: flex;
    gap: var(--space-xs);
    margin-top: var(--space-md);
}

.segment-actions button {
    padding: var(--space-xs) var(--space-sm);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.segment-actions button:hover {
    background: var(--bg-darker);
    border-color: var(--primary);
}

.type-news {
    background: rgba(88, 166, 255, 0.2);
    color: var(--primary);
}

.type-music {
    background: rgba(188, 140, 255, 0.2);
    color: #bc8cff;
}

.type-pub {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.type-animation {
    background: rgba(63, 185, 80, 0.2);
    color: var(--success);
}

.type-codec {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.stats-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
}

.stats-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.stats-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--bg-darker);
}

.stats-row:last-child {
    border-bottom: none;
}

.stats-label {
    font-size: 13px;
    color: var(--text-muted);
}

.stats-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.progress-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.progress-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-darker);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), #3fb950);
    transition: width 0.3s;
}

.progress-text {
    margin-top: var(--space-sm);
    font-size: 18px;
    font-weight: 700;
    color: var(--success);
    text-align: center;
    font-family: 'Courier New', monospace;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

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

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

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.2s;
    font-size: 20px;
}

.modal-close:hover {
    background: var(--bg-darker);
    color: var(--text);
}

.modal-body {
    padding: var(--space-lg);
}

.modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
}

/* ===== JOURNAUX ===== */
.journal-editor-main {
    flex: 1;
    overflow-y: auto;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    gap: var(--space-md);
}

.title-input {
    flex: 1;
    padding: 10px 12px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e6edf3;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.title-input:focus {
    border-color: var(--primary);
}

.journal-info-bar {
    display: flex;
    gap: var(--space-xl);
    padding: var(--space-lg);
    background: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
}

.journal-info-bar .info-item {
    flex: 1;
}

.journal-info-bar .info-item label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.journal-info-bar .info-item input {
    width: 100%;
    padding: 10px 12px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e6edf3;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.journal-info-bar .info-item input:focus {
    border-color: var(--primary);
}

.journal-info-item {
    text-align: center;
}

.journal-info-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.journal-info-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Courier New', monospace;
}

.journal-info-value.success {
    color: var(--success);
}

.journal-info-value.warning {
    color: var(--warning);
}

.journal-info-value.danger {
    color: var(--danger);
}

.journal-stats-bar {
    display: flex;
    gap: var(--space-xl);
    padding: var(--space-lg);
    background: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    justify-content: space-around;
}

.journal-stats-bar .stat-item {
    text-align: center;
    flex: 1;
}

.journal-stats-bar .stat-item span {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.journal-stats-bar .stat-item strong {
    display: block;
    font-size: 20px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

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

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: var(--space-lg) 0 var(--space-md) 0;
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border);
}

.news-picker {
    margin-bottom: var(--space-lg);
    padding: var(--space-lg);
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.news-picker label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.news-picker-row {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.news-picker-row select {
    flex: 1;
    padding: 10px 12px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e6edf3;
    font-size: 14px;
    outline: none;
}

.news-picker-row select:focus {
    border-color: var(--primary);
}

.news-picker-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.news-picker-controls {
    display: flex;
    gap: var(--space-sm);
}

.news-picker-controls select {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
}

.add-news-btn {
    padding: var(--space-sm) var(--space-lg);
    background: var(--success);
    color: #000;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.add-news-btn:hover {
    background: #3fb950;
}

.journal-news-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.journal-news-item {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    cursor: move;
    transition: all 0.2s;
    position: relative;
}

.journal-news-item:hover {
    border-color: var(--border-light);
    transform: translateX(4px);
}

.journal-news-item.dragging {
    opacity: 0.5;
}

.news-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: var(--space-sm);
}

.news-item-number {
    width: 28px;
    height: 28px;
    background: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--primary);
}

.news-item-duration {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--success);
}

.news-item-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.news-item-excerpt {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: var(--space-sm);
}

.news-item-actions {
    display: flex;
    gap: var(--space-xs);
}

.news-item-actions button {
    padding: var(--space-xs) var(--space-sm);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.news-item-actions button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.news-item-actions button.danger:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* Badges pour catégorie, lancement et pied */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    margin-right: 6px;
}

.badge-category {
    background: var(--bg-darker);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.badge-lancement {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
}

.badge-pied {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #a855f7;
}

.news-item-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.journal-sidebar {
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.action-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.action-card .btn {
    width: 100%;
    margin-bottom: var(--space-sm);
}

.action-card .btn:last-child {
    margin-bottom: 0;
}

.duration-alert {
    padding: var(--space-md);
    border-radius: var(--radius);
    font-size: 13px;
    margin-top: var(--space-md);
}

.duration-alert.warning {
    background: rgba(210, 153, 34, 0.1);
    border: 1px solid var(--warning);
    color: var(--warning);
}

.duration-alert.success {
    background: rgba(63, 185, 80, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.duration-alert.danger {
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 80px;
        padding: var(--space-md);
    }

    .sidebar-header h1,
    .nav-btn span:not(.icon),
    .user-name {
        display: none;
    }

    .split-view {
        flex-direction: column;
    }

    .list-panel {
        width: 100%;
        height: 200px;
    }

    .audio-toolbar {
        flex-direction: column;
    }

    .toolbar-section {
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding-bottom: var(--space-sm);
        padding-right: 0;
    }

    .toolbar-section:last-child {
        border-bottom: none;
    }

    .transport-controls {
        flex-direction: column;
        gap: var(--space-md);
    }
}

/* ===== EXPORT MENU ===== */
.export-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    z-index: 1000;
    overflow: hidden;
}

.export-menu.active {
    display: block;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.export-menu-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border);
}

.export-menu-item:last-child {
    border-bottom: none;
}

.export-menu-item:hover {
    background: var(--bg-lighter);
}

.export-menu-icon {
    font-size: 24px;
    margin-right: 12px;
    flex-shrink: 0;
}

.export-menu-text {
    flex: 1;
}

.export-menu-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 2px;
}

.export-menu-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== NEWS TABLE VIEW ===== */
.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--border);
}

.news-header h1 {
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.news-count {
    background: var(--bg-lighter);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-muted);
}

/* ===== NEWS TOOLBAR ===== */
.news-toolbar {
    background: var(--bg-light);
    padding: var(--space-md);
    border-radius: var(--radius);
    margin-bottom: var(--space-md);
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    background: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
}

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

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

.filter-group {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.filter-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.news-toolbar select {
    padding: 8px 12px;
    background: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
}

.news-toolbar select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===== NEWS TABLE ===== */
.news-table-container {
    background: var(--bg-light);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.news-table {
    width: 100%;
    border-collapse: collapse;
}

.news-table thead {
    background: var(--bg-darker);
}

.news-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
}

.news-table th:hover {
    color: var(--text);
    background: var(--bg-light);
}

.news-table th .sort-indicator {
    font-size: 10px;
    margin-left: 4px;
    opacity: 0.5;
}

.news-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
    position: relative;
    cursor: pointer;
}

.news-table tbody tr:hover {
    background: var(--bg-darker);
}

.news-table td {
    padding: 12px 16px;
    font-size: 14px;
    vertical-align: middle;
}

/* ===== STATUS BADGES ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.status-draft {
    background: rgba(139, 148, 158, 0.15);
    color: var(--text-muted);
}

.status-review {
    background: rgba(210, 153, 34, 0.15);
    color: var(--warning);
}

.status-ready {
    background: rgba(63, 185, 80, 0.15);
    color: var(--success);
}

.status-published {
    background: rgba(88, 166, 255, 0.15);
    color: var(--info);
}

.status-archived {
    background: rgba(139, 148, 158, 0.1);
    color: #6e7681;
}

.status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.status-draft .status-indicator {
    background: var(--text-muted);
}

.status-review .status-indicator {
    background: var(--warning);
}

.status-ready .status-indicator {
    background: var(--success);
}

.status-published .status-indicator {
    background: var(--info);
}

/* ===== CATEGORY BADGES ===== */
.category-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    background: var(--bg-darker);
    color: var(--text-muted);
    border: 1px solid var(--border);
    white-space: nowrap;
}

/* ===== AUTHOR INFO ===== */
.author-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--success));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

.author-name {
    font-size: 13px;
}

/* ===== DATE & TIME ===== */
.date-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.date-primary {
    font-size: 13px;
    color: var(--text);
}

.date-secondary {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== DURATION ===== */
.duration {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted);
}

.duration-with-audio {
    color: var(--success);
}

/* ===== ACTIONS ===== */
.actions {
    display: flex;
    gap: 4px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: var(--bg-lighter);
    color: var(--text);
}

.action-btn.primary:hover {
    background: rgba(88, 166, 255, 0.15);
    color: var(--primary);
}

.action-btn.danger:hover {
    background: rgba(248, 81, 73, 0.15);
    color: var(--danger);
}

/* ===== TITLE CELL ===== */
.title-cell {
    max-width: 300px;
}

.news-title {
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-excerpt {
    font-size: 12px;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== PRIORITY INDICATOR ===== */
.priority-indicator {
    width: 4px;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
}

.priority-high {
    background: var(--danger);
}

.priority-medium {
    background: var(--warning);
}

.priority-low {
    background: var(--success);
}

/* ===== FOOTER STATS ===== */
.news-footer {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-light);
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-footer .stats {
    display: flex;
    gap: var(--space-lg);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.stat-label {
    color: var(--text-muted);
}

.stat-value {
    font-weight: 600;
    color: var(--text);
}

/* ===== RESPONSIVE TABLE ===== */
@media (max-width: 1200px) {
    .news-table th:nth-child(6),
    .news-table td:nth-child(6) {
        display: none;
    }
}

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

    .news-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        min-width: 100%;
    }
}

/* ===== MULTITRACK EDITOR (MAQUETTE DESIGN) ===== */
.multitrack-container {
    padding: 20px;
    background: #2a2a2a;
    height: 100%;
    overflow-y: auto;
    border-radius: 12px;
}

/* Header */
.multitrack-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #3a3a3a;
}

.multitrack-title {
    font-size: 24px;
    font-weight: 700;
    color: #00ff9f;
}

.multitrack-actions {
    display: flex;
    gap: 10px;
}

/* Toolbar */
.multitrack-toolbar {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #1a1a1a;
    border-radius: 8px;
    margin-bottom: 20px;
    align-items: center;
}

.multitrack-toolbar .toolbar-section {
    display: flex;
    gap: 8px;
    padding-right: 15px;
    border-right: 1px solid #3a3a3a;
}

.multitrack-toolbar .toolbar-section:last-child {
    border-right: none;
}

.toolbar-btn {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: none;
    background: #3a3a3a;
    color: #e0e0e0;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toolbar-btn:hover {
    background: #4a4a4a;
    transform: translateY(-1px);
}

.toolbar-btn.active {
    background: #00ff9f;
    color: #1a1a1a;
}

/* Transport Controls */
.multitrack-transport {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #1a1a1a;
    border-radius: 8px;
    margin-bottom: 20px;
}

.transport-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: #3a3a3a;
    color: #00ff9f;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.transport-btn:hover {
    background: #4a4a4a;
    transform: scale(1.1);
}

.transport-btn.play {
    background: #00ff9f;
    color: #1a1a1a;
    width: 60px;
    height: 60px;
    font-size: 24px;
}

.transport-btn.play:hover {
    background: #00cc7f;
}

.timecode {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    color: #00ff9f;
    background: #1a1a1a;
    padding: 10px 20px;
    border-radius: 6px;
    min-width: 120px;
    text-align: center;
    border: 2px solid #3a3a3a;
}

/* In/Out Display Bar */
.multitrack-inout-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #1a1a1a;
    border-radius: 8px;
    margin-bottom: 15px;
    min-height: 40px;
}

.inout-info {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #00ff9f;
    font-weight: 600;
}

.inout-shortcuts {
    display: flex;
    gap: 15px;
}

.shortcut-hint {
    font-size: 11px;
    color: #888;
    background: #2a2a2a;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
}

.shortcut-hint:hover {
    background: #3a3a3a;
    color: #aaa;
}

/* Timeline */
.multitrack-timeline-container {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 20px;
}

.multitrack-timeline-container canvas {
    width: 100%;
    height: auto;
    display: block;
}

/* Tracks Container */
.multitrack-tracks-container {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 15px;
    overflow: hidden;
}

.multitrack-tracks-container canvas {
    width: 100%;
    height: 400px;
    display: block;
    cursor: crosshair;
}

/* Horizontal Scroll Controls */
.multitrack-scroll-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: #1a1a1a;
    border-radius: 8px;
    margin-bottom: 20px;
}

.scroll-btn {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: none;
    background: #3a3a3a;
    color: #00ff9f;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.scroll-btn:hover {
    background: #4a4a4a;
    transform: scale(1.05);
}

.scroll-btn:active {
    transform: scale(0.95);
}

.multitrack-scrollbar {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: #3a3a3a;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.multitrack-scrollbar {
    --thumb-width: 60px; /* Default value, will be updated dynamically */
}

.multitrack-scrollbar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: var(--thumb-width, 60px);
    height: 20px;
    border-radius: 10px;
    background: #00ff9f;
    cursor: grab;
    transition: background 0.2s, width 0.2s;
}

.multitrack-scrollbar::-webkit-slider-thumb:hover {
    background: #00cc7f;
}

.multitrack-scrollbar::-webkit-slider-thumb:active {
    cursor: grabbing;
    background: #00aa6f;
}

.multitrack-scrollbar::-moz-range-thumb {
    width: var(--thumb-width, 60px);
    height: 20px;
    border-radius: 10px;
    background: #00ff9f;
    cursor: grab;
    border: none;
    transition: background 0.2s, width 0.2s;
}

.multitrack-scrollbar::-moz-range-thumb:hover {
    background: #00cc7f;
}

.multitrack-scrollbar::-moz-range-thumb:active {
    cursor: grabbing;
    background: #00aa6f;
}

/* Audio Library (Chutier) */
.multitrack-library-section {
    margin-bottom: 20px;
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
}

.library-header {
    padding: 12px 20px;
    background: #2a2a2a;
    border-bottom: 1px solid #3a3a3a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.library-title {
    font-weight: 600;
    color: #e0e0e0;
    font-size: 14px;
}

.library-hint {
    font-size: 12px;
    color: #888;
}

.multitrack-library {
    padding: 15px;
    min-height: 100px;
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.library-empty {
    width: 100%;
    text-align: center;
    padding: 30px;
    color: #666;
}

.library-empty p {
    margin: 4px 0;
    font-size: 14px;
}

.library-empty .hint {
    font-size: 12px;
    opacity: 0.7;
}

.library-item {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    padding: 10px;
    min-width: 160px;
    cursor: grab;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.library-item:hover {
    background: #3a3a3a;
    border-color: #00ff9f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.library-item:active {
    cursor: grabbing;
}

.library-item-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.library-item-info {
    flex: 1;
    min-width: 0;
}

.library-item-name {
    font-size: 13px;
    font-weight: 500;
    color: #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.library-item-duration {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

/* Export Panel */
.multitrack-export-panel {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 20px;
    border-top: 2px solid #3a3a3a;
}

.export-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #00ff9f;
}

.export-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.export-option {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.export-option label {
    font-size: 12px;
    color: #888;
}

.export-option select,
.export-option input {
    padding: 8px 12px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 14px;
}

.export-option select:focus,
.export-option input:focus {
    outline: none;
    border-color: #00ff9f;
}

/* Responsive Multitrack */
@media (max-width: 768px) {
    .multitrack-transport {
        flex-wrap: wrap;
    }

    .transport-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .transport-btn.play {
        width: 55px;
        height: 55px;
        font-size: 20px;
    }

    .export-options {
        flex-direction: column;
    }

    .export-option {
        width: 100%;
    }
}

/* Form row layouts for multi-site support */
.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.form-row-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 900px) {
    .form-row-3, .form-row-4 {
        grid-template-columns: 1fr;
    }
}
