@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg: #0a0a0a;
    --bg-raised: #111;
    --bg-subtle: #161616;
    --bg-hover: #1a1a1a;
    --border: #1e1e1e;
    --border-light: #181818;
    --text: #e8e8e8;
    --text-secondary: #777;
    --text-muted: #444;
    --accent: #fff;
    --danger: #e53935;
    --danger-hover: #c62828;
    --success: #43a047;
    --radius: 10px;
    --radius-sm: 6px;
    --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
.hidden { display: none !important; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.04;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 512px 512px;
}

a { color: var(--text); text-decoration: none; transition: color var(--transition); }
a:hover { color: #fff; }

::selection { background: rgba(255,255,255,0.12); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }

/* ═══════════════════ Page Wrapper ═══════════════════ */
.page-wrapper {
    animation: fadeUp 0.35s ease-out;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════ Header ═══════════════════ */
header {
    border-bottom: 1px solid var(--border);
    padding: 0;
    background: rgba(10,10,10,0.85);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
header .container { display: flex; justify-content: space-between; align-items: center; height: 56px; }
.header-logo { height: 24px; width: 24px; object-fit: contain; vertical-align: middle; margin-right: 8px; margin-bottom: 2px; }
header h1 {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: #fff;
}
header nav { display: flex; gap: 2px; font-size: 13px; }
.nav-link {
    color: var(--text-secondary);
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.06); text-decoration: none; }
.nav-icon { width: 16px; height: 16px; flex-shrink: 0; }

/* ═══════════════════ Forms ═══════════════════ */
input, select, textarea {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 14px;
    font-size: 13px;
    font-family: inherit;
    width: 100%;
    border-radius: var(--radius-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.03);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
select { cursor: pointer; }
select option { background: var(--bg-raised); color: var(--text); }

button, .btn {
    background: #fff;
    color: #000;
    border: none;
    padding: 9px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    letter-spacing: -0.2px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}
button:hover, .btn:hover { background: #e0e0e0; transform: translateY(-1px); }
button:active, .btn:active { transform: translateY(0) scale(0.98); }

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: #333; }

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

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #388e3c; }

.btn-primary-glow {
    background: #fff;
    color: #000;
    box-shadow: 0 0 20px rgba(255,255,255,0.1), 0 0 40px rgba(255,255,255,0.04);
}
.btn-primary-glow:hover {
    box-shadow: 0 0 24px rgba(255,255,255,0.15), 0 0 48px rgba(255,255,255,0.06);
}

.btn-icon {
    background: transparent;
    border: none;
    padding: 6px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
}
.btn-icon:hover { transform: none; }
.btn-danger-ghost { color: var(--text-muted); }
.btn-danger-ghost:hover { color: var(--danger); background: rgba(229,57,53,0.08); }

.btn-small { padding: 6px 14px; font-size: 12px; border-radius: var(--radius-sm); }

/* ═══════════════════ Tables ═══════════════════ */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border-light); font-size: 13px; }
th { font-weight: 600; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--bg-subtle); }

/* ═══════════════════ Badges ═══════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-radius: 20px;
    border: 1px solid transparent;
}
.badge-uploading { background: rgba(255,255,255,0.04); color: #555; border-color: #222; }
.badge-analyzing, .badge-selecting, .badge-cutting, .badge-rendering { background: rgba(245,166,35,0.08); color: #f5a623; border-color: rgba(245,166,35,0.15); }
.badge-review_raw, .badge-review_final { background: rgba(100,149,237,0.08); color: #6495ed; border-color: rgba(100,149,237,0.15); }
.badge-queued { background: rgba(67,160,71,0.08); color: #66bb6a; border-color: rgba(67,160,71,0.15); }
.badge-published { background: rgba(255,255,255,0.9); color: #000; }
.badge-error { background: rgba(229,57,53,0.08); color: #ef5350; border-color: rgba(229,57,53,0.15); }
.badge-draft { background: rgba(255,255,255,0.04); color: #555; border-color: #222; }
.badge-approved { background: rgba(67,160,71,0.08); color: #66bb6a; border-color: rgba(67,160,71,0.15); }
.badge-deleted { background: rgba(229,57,53,0.08); color: #ef5350; border-color: rgba(229,57,53,0.15); }
.badge-rendered { background: rgba(100,149,237,0.08); color: #6495ed; border-color: rgba(100,149,237,0.15); }
.badge-pending { background: rgba(245,166,35,0.08); color: #f5a623; border-color: rgba(245,166,35,0.15); }
.badge-scheduled { background: rgba(100,149,237,0.08); color: #6495ed; border-color: rgba(100,149,237,0.15); }
.badge-publishing { background: rgba(245,166,35,0.08); color: #f5a623; border-color: rgba(245,166,35,0.15); }

/* ═══════════════════ Utility ═══════════════════ */
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mt-8 { margin-top: 8px; }
.text-muted { color: var(--text-secondary); font-size: 13px; }
.text-right { text-align: right; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ═══════════════════ Page ═══════════════════ */
.page-header { padding: 32px 0 24px; }
.page-header h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; padding-top: 0; margin-bottom: 2px; }
h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 2px; padding-top: 32px; }
h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.2px; margin-bottom: 2px; }

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

/* ═══════════════════ Login ═══════════════════ */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 100px);
}
.login-card {
    width: 100%;
    max-width: 380px;
    padding: 40px;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 12px;
    animation: fadeUp 0.4s ease-out;
}
.login-brand {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 32px;
    color: #fff;
}
.login-error {
    color: var(--danger);
    font-size: 13px;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: rgba(229,57,53,0.06);
    border: 1px solid rgba(229,57,53,0.12);
    border-radius: var(--radius-sm);
}
.login-card .field { margin-bottom: 18px; }
.login-card label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.login-btn { width: 100%; padding: 12px; margin-top: 8px; font-size: 14px; }
.error { color: var(--danger); font-size: 13px; margin-bottom: 12px; }

/* ═══════════════════ Upload ═══════════════════ */
.upload-page { max-width: 600px; margin: 0 auto; }
.upload-header { padding-top: 32px; margin-bottom: 28px; }
.upload-header h2 { padding-top: 0; margin-bottom: 4px; }
.upload-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}
.upload-card .field { margin-bottom: 20px; }
.upload-card label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dropzone {
    border: 1px dashed #2a2a2a;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.dropzone:hover { border-color: #444; background: rgba(255,255,255,0.02); }
.dropzone.dragover { border-color: #fff; background: rgba(255,255,255,0.03); }
.dropzone input[type="file"] { display: none; }
.dropzone-icon { width: 40px; height: 40px; color: var(--text-muted); margin-bottom: 4px; }
.dropzone-text { font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.dropzone-hint { font-size: 12px; color: var(--text-muted); }

.upload-progress-header { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.upload-bar { width: 100%; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.upload-bar-fill { height: 100%; background: #fff; border-radius: 3px; width: 0%; transition: width 0.2s ease; }
.upload-progress-footer { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); }
.upload-submit { width: 100%; padding: 12px; font-size: 14px; }

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.file-info span { font-size: 13px; flex: 1; }

/* ═══════════════════ Progress / Pipeline ═══════════════════ */
.progress-bar { width: 100%; height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.progress-bar-fill, .progress-fill { height: 100%; background: #fff; transition: width 0.3s; }

.pipeline {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-top: 24px;
}
.pipeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}
.pipeline-status { display: flex; align-items: center; gap: 10px; }
.pipeline-label { font-size: 14px; font-weight: 600; color: var(--text); }

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f5a623;
    animation: pulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(245,166,35,0.4);
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.pipeline-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 24px;
}
.pipeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 72px;
}
.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
    transition: all 0.3s ease;
}
.step-icon .nav-icon { width: 18px; height: 18px; }
.step-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.pipeline-step.active .step-icon {
    background: #fff;
    color: #000;
    border-color: #fff;
    box-shadow: 0 0 16px rgba(255,255,255,0.2);
}
.pipeline-step.active .step-label { color: #fff; }

.pipeline-step.done .step-icon {
    background: rgba(67,160,71,0.1);
    color: #66bb6a;
    border-color: rgba(67,160,71,0.3);
}
.pipeline-step.done .step-label { color: var(--text-secondary); }

.pipeline-connector {
    width: 40px;
    height: 1px;
    background: var(--border);
    flex-shrink: 0;
    margin: 0 4px;
    margin-bottom: 24px;
}
.pipeline-connector.done { background: rgba(67,160,71,0.4); }

.pipeline-bar {
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}
.pipeline-bar-fill {
    height: 100%;
    background: #fff;
    border-radius: 2px;
    transition: width 0.5s ease;
}
.pipeline-bar-pulse {
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: barPulse 1.5s ease-in-out infinite;
}
@keyframes barPulse {
    0% { transform: translateX(-100%); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(200%); opacity: 0; }
}

/* ═══════════════════ Detail Header ═══════════════════ */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 32px;
    margin-bottom: 4px;
}
.detail-header-left { display: flex; align-items: center; gap: 16px; }
.detail-header-left h2 { padding-top: 0; margin-bottom: 0; }
.back-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition);
}
.back-link:hover { background: var(--bg-hover); color: #fff; }

/* ═══════════════════ Movie Header ═══════════════════ */
.movie-header { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; padding-top: 32px; }
.movie-header h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; padding-top: 0; margin-bottom: 0; }

/* ═══════════════════ Clip Row ═══════════════════ */
.clip-row {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-raised);
    transition: border-color var(--transition);
    overflow: hidden;
}
.clip-row:hover { border-color: #282828; }
.clip-row + .clip-row { margin-top: 12px; }
.clip-row-body { display: flex; gap: 24px; padding: 20px; }
.clip-row-video { flex: 0 0 420px; }
.clip-row-video .clip-preview { aspect-ratio: 9/16; max-height: 560px; border-radius: var(--radius-sm); overflow: hidden; }
.clip-row-meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; }
.clip-row-settings { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.clip-reason {
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 16px;
    text-align: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    line-height: 1.6;
}
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.clip-row-settings .field { margin-bottom: 0; }
.clip-row-settings .field label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
    display: block;
}
.clip-row-settings .field input,
.clip-row-settings .field select { font-size: 13px; padding: 8px 12px; }
.clip-row-actions { display: flex; gap: 8px; margin-top: 18px; }

.clip-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
}

.regen-inline { display: flex; gap: 8px; align-items: center; }
.regen-input { width: 280px; font-size: 13px; padding: 8px 12px; }

@media (max-width: 768px) {
    .clip-row-body { flex-direction: column; }
    .clip-row-video { flex: none; }
    .settings-grid { grid-template-columns: 1fr; }
    .regen-inline { flex-direction: column; align-items: stretch; }
    .regen-input { width: 100%; }
    .section-header { flex-direction: column; gap: 12px; align-items: flex-start; }
}

/* ═══════════════════ Clip Preview ═══════════════════ */
.clip-preview { position: relative; background: #000; aspect-ratio: 9/16; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); overflow: hidden; }
.clip-preview video { width: 100%; height: 100%; object-fit: contain; }
.clip-preview img { width: 100%; height: 100%; object-fit: contain; }
.clip-placeholder { color: var(--text-muted); font-size: 13px; }

/* ═══════════════════ Custom Player ═══════════════════ */
.clip-player { position: relative; background: #000; aspect-ratio: 9/16; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: var(--radius-sm); cursor: pointer; }
.clip-player video { width: 100%; height: 100%; object-fit: contain; }
.player-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.player-play-icon { width: 56px; height: 56px; background: rgba(255,255,255,0.08); backdrop-filter: blur(8px); border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: transform 0.15s, opacity 0.15s; }
.player-play-icon.hidden { opacity: 0; transform: scale(0.8); pointer-events: none; }
.player-play-icon svg { margin-left: 3px; }
.player-controls { position: absolute; bottom: 0; left: 0; right: 0; padding: 8px 10px 6px; background: linear-gradient(transparent, rgba(0,0,0,0.8)); display: flex; flex-direction: column; gap: 4px; }
.player-progress { height: 3px; background: rgba(255,255,255,0.12); border-radius: 2px; cursor: pointer; position: relative; transition: height 0.1s; }
.player-progress:hover { height: 5px; }
.player-progress-loaded { position: absolute; top: 0; left: 0; height: 100%; background: rgba(255,255,255,0.15); border-radius: 2px; pointer-events: none; }
.player-progress-bar { position: absolute; top: 0; left: 0; height: 100%; background: #fff; border-radius: 2px; pointer-events: none; transition: width 0.1s linear; }
.player-bottom { display: flex; justify-content: space-between; align-items: center; }
.player-time { font-size: 11px; color: rgba(255,255,255,0.6); font-variant-numeric: tabular-nums; }
.player-mute { background: none; border: none; color: rgba(255,255,255,0.6); cursor: pointer; padding: 2px; display: flex; align-items: center; }
.player-mute:hover { color: #fff; background: transparent; }

/* ═══════════════════ Clip Card ═══════════════════ */
.clip-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-raised);
    transition: border-color var(--transition);
}
.clip-card:hover { border-color: #282828; }
.clip-body { padding: 14px; }
.clip-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.clip-info strong { font-size: 14px; }
.clip-comment { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; line-height: 1.4; }
.clip-status { margin-bottom: 10px; }
.clip-actions { display: flex; gap: 8px; }
.clip-action-btn { flex: 1; text-align: center; padding: 8px 12px; font-size: 12px; border-radius: var(--radius-sm); }
.clip-action-btn:disabled { opacity: 0.25; cursor: not-allowed; }

/* ═══════════════════ Clips Grid ═══════════════════ */
.clip-group { margin-bottom: 24px; }
.clip-group-header { padding: 8px 0; border-bottom: 1px solid var(--border); margin-bottom: 12px; font-size: 15px; }
.clips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

/* ═══════════════════ Grid / Cards ═══════════════════ */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card { border: 1px solid var(--border); background: var(--bg-raised); border-radius: var(--radius); overflow: hidden; }
.card img, .card video { width: 100%; display: block; }
.card-body { padding: 14px; }
.card-body h3 { font-size: 14px; margin-bottom: 4px; }
.card-body p { font-size: 12px; color: var(--text-secondary); }
.card-actions { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border-light); }

/* ═══════════════════ Section Divider ═══════════════════ */
.section-divider { border-top: 1px solid var(--border-light); margin: 32px 0; }

/* ═══════════════════ Styling Form ═══════════════════ */
.styling-form fieldset { border: 1px solid var(--border); padding: 16px; margin-bottom: 12px; border-radius: var(--radius); background: var(--bg-raised); }
.styling-form legend { font-weight: 600; font-size: 14px; padding: 0 8px; color: var(--text); }
.segment-reason { font-size: 12px; color: var(--text-secondary); margin-bottom: 12px; font-style: italic; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.field { margin-bottom: 8px; }

/* ═══════════════════ Status Banners ═══════════════════ */
.status-banner {
    padding: 20px 24px;
    border-radius: var(--radius);
    margin-top: 20px;
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
}
.status-queued { background: rgba(67,160,71,0.06); color: #66bb6a; border: 1px solid rgba(67,160,71,0.12); }
.status-published { background: rgba(255,255,255,0.06); color: #fff; border: 1px solid rgba(255,255,255,0.1); }

/* ═══════════════════ Error ═══════════════════ */
.error-message {
    padding: 20px 24px;
    border-radius: var(--radius);
    margin-top: 20px;
    background: rgba(229,57,53,0.06);
    color: #ef5350;
    border: 1px solid rgba(229,57,53,0.12);
    font-size: 14px;
}

/* ═══════════════════ Assets ═══════════════════ */
.assets-section { margin-bottom: 40px; }
.assets-section .section-header { margin-bottom: 16px; }

.upload-inline {
    display: flex;
    gap: 8px;
    align-items: center;
}
.upload-inline input[type="text"] { width: 180px; }
.upload-inline input[type="file"] { width: auto; border: none; padding: 0; font-size: 12px; color: var(--text-secondary); }

.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.asset-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-raised);
    transition: border-color var(--transition);
}
.asset-card:hover { border-color: #282828; }
.asset-preview { width: 100%; height: 120px; object-fit: cover; display: block; }
.color-field { display: flex; align-items: center; gap: 8px; }
.color-field input[type="color"] {
    width: 36px;
    height: 36px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    cursor: pointer;
}
.color-field input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.color-field input[type="color"]::-webkit-color-swatch { border-radius: 3px; border: none; }
.color-hex { font-size: 12px; color: var(--text-secondary); font-family: monospace; }

.asset-audio {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-subtle);
}
.asset-audio-icon { width: 32px; height: 32px; color: var(--text-muted); }
.asset-card-footer {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
}
.asset-card p { padding: 10px 14px; font-size: 13px; }
.asset-card form { padding: 0 14px 14px; }

/* Legacy upload form */
.upload-form { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; }
.upload-form input[type="text"] { max-width: 200px; }
.upload-form input[type="file"] { width: auto; border: none; padding: 0; font-size: 13px; }

/* ═══════════════════ Schedule ═══════════════════ */
.schedule-section { margin-bottom: 32px; }

/* Mode switcher */
.schedule-mode-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.mode-switch {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.mode-btn {
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}
.mode-btn:hover { color: var(--text); }
.mode-btn-active {
    background: var(--text);
    color: var(--bg);
}

/* Bulk view */
.bulk-view { }
.bulk-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    flex-wrap: wrap;
}
.bulk-toolbar-left { margin-right: 8px; }
.bulk-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    flex-wrap: wrap;
}
.bulk-toolbar-sep {
    width: 1px;
    height: 20px;
    background: var(--border);
    flex-shrink: 0;
}
.batch-acc-name { font-size: 12px; }
.bulk-interval-pills {
    display: flex;
    gap: 2px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 2px;
}
.bulk-pill {
    cursor: pointer;
    font-size: 12px;
}
.bulk-pill input { display: none; }
.bulk-pill span {
    display: block;
    padding: 4px 10px;
    border-radius: calc(var(--radius-sm) - 1px);
    color: var(--text-muted);
    transition: all var(--transition);
}
.bulk-pill input:checked + span {
    background: var(--text);
    color: var(--bg);
}
.bulk-toolbar input[type="text"].input-sm { width: 100px; }

/* Bulk clip list */
.bulk-clip-list {
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 400px;
    overflow-y: auto;
}
.bulk-clip-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background var(--transition);
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}
.bulk-clip-row:last-child { border-bottom: none; }
.bulk-clip-row:hover { background: var(--bg-raised); }
.bulk-clip-row input[type="checkbox"] { margin: 0; width: auto; flex-shrink: 0; }
.bulk-clip-thumb {
    width: 32px;
    height: 48px;
    border-radius: 3px;
    overflow: hidden;
    background: #000;
    flex-shrink: 0;
}
.bulk-clip-thumb img { width: 100%; height: 100%; object-fit: cover; }
.clip-placeholder-sm { width: 100%; height: 100%; background: #1a1a1a; }
.bulk-clip-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bulk-clip-dur { color: var(--text-muted); font-size: 12px; flex-shrink: 0; }
.bulk-clip-time {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 80px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* Bulk footer */
.bulk-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}
.batch-summary {
    font-size: 13px;
    color: var(--text-muted);
}

.draft-list { display: flex; flex-direction: column; gap: 12px; }
.draft-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-raised);
    display: flex;
    gap: 20px;
    padding: 18px;
    transition: border-color var(--transition);
}
.draft-card:hover { border-color: #282828; }
.draft-left { flex: 0 0 160px; }
.draft-preview { aspect-ratio: 9/16; max-height: 180px; background: #000; border-radius: var(--radius-sm); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.draft-preview video, .draft-preview img { width: 100%; height: 100%; object-fit: contain; }
.draft-body { margin-top: 8px; }
.draft-body strong { font-size: 13px; display: block; }
.draft-body .text-muted { font-size: 12px; }
.draft-form { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.draft-actions { display: flex; gap: 8px; margin-top: 12px; }

.platform-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-light); }
.platform-row:last-of-type { border-bottom: none; }
.check-label { font-size: 13px; display: flex; align-items: center; gap: 8px; cursor: pointer; min-width: 110px; }
.check-label input { margin: 0; width: auto; }
.platform-name { text-transform: capitalize; font-weight: 500; }
.platform-datetime { display: flex; gap: 8px; }
.platform-datetime.disabled { opacity: 0.15; pointer-events: none; }
.input-sm { padding: 6px 10px; font-size: 13px; }

/* ═══════════════════ Calendar ═══════════════════ */
.cal-nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 16px; }
.cal-title { font-size: 15px; font-weight: 600; min-width: 220px; text-align: center; letter-spacing: -0.3px; }
.cal-grid-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: grab;
}
.cal-grid-wrap:active { cursor: grabbing; }
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(200px, 1fr));
    gap: 1px;
    background: var(--border-light);
    min-width: max-content;
}
.cal-day { background: var(--bg-raised); min-height: 140px; width: 200px; }
.cal-day-header {
    padding: 8px 10px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
}
.cal-today { background: rgba(255,255,255,0.02); }
.cal-day-name { color: var(--text-muted); text-transform: uppercase; font-weight: 600; font-size: 10px; letter-spacing: 0.5px; }
.cal-day-num { font-weight: 600; color: var(--text); }
.cal-day-body { padding: 4px; }
.cal-entry {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    margin-bottom: 3px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    transition: all var(--transition);
}
.cal-entry:hover { background: var(--bg-hover); border-color: #333; }
.cal-entry-top { display: flex; align-items: center; gap: 4px; }
.cal-entry-time { font-weight: 600; min-width: 36px; }
.cal-entry-account { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); font-weight: 500; }
.cal-entry-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); font-size: 11px; padding-left: 40px; }
.cal-entry-movie {
    font-size: 10px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-left: 40px;
    opacity: 0.7;
}
.draft-movie-title {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cal-empty { font-size: 12px; padding: 8px; text-align: center; color: var(--text-muted); }

/* ═══════════════════ Platform Badges ═══════════════════ */
.platform-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 7px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.platform-instagram { background: #e1306c; color: #fff; }
.platform-tiktok { background: #fff; color: #000; }
.platform-youtube { background: #c00; color: #fff; }

@media (max-width: 768px) {
    .cal-grid { grid-template-columns: 1fr; }
    .platform-columns { grid-template-columns: 1fr; }
}

/* ═══════════════════ Form Groups ═══════════════════ */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ═══════════════════ Settings ═══════════════════ */
.settings-form { max-width: 640px; }
.settings-section {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}
.settings-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-toggles { display: flex; flex-direction: column; gap: 12px; }
.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
}
.toggle-label input[type="checkbox"] { width: 16px; height: 16px; margin: 0; cursor: pointer; }
.toggle-text { font-weight: 500; }

/* ═══════════════════ Buttons ═══════════════════ */
button, .btn { transition: all var(--transition); border-radius: var(--radius-sm); }
.action-bar { display: flex; gap: 12px; margin-top: 24px; }
.btn-action { flex: 1; padding: 14px 0; font-size: 14px; font-weight: 600; text-align: center; border-radius: var(--radius); }

.btn-publish-now { background: #fff; color: #000; }
.btn-publish-now:hover { background: #e0e0e0; }

/* ═══════════════════ Custom Checkboxes ═══════════════════ */
.check-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid #333;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    background: var(--bg);
    transition: all var(--transition);
}
.check-label input[type="checkbox"]:checked {
    background: #fff;
    border-color: #fff;
}
.check-label input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ═══════════════════ Setup ═══════════════════ */
.setup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 16px; }
.setup-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-raised);
    transition: border-color var(--transition);
}
.setup-card:hover { border-color: #282828; }
.setup-card-header { padding: 14px 18px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; gap: 8px; }
.setup-card-platform { font-size: 13px; font-weight: 600; text-transform: capitalize; }
.setup-card-body { padding: 18px; }
.setup-card-label { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.setup-card-meta { font-size: 12px; line-height: 2; color: var(--text-secondary); }
.setup-card-meta span { margin-right: 4px; }
.setup-card-actions { padding: 14px 18px; border-top: 1px solid var(--border-light); display: flex; gap: 8px; }

/* ═══════════════════ Movie List ═══════════════════ */
.movie-list { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.movie-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    background: var(--bg-raised);
}
.movie-card:hover { border-color: #282828; background: var(--bg-subtle); }
.movie-card-link { display: flex; align-items: center; gap: 14px; flex: 1; text-decoration: none; color: inherit; }
.movie-thumb { width: 72px; height: 40px; border-radius: 6px; overflow: hidden; background: #000; flex-shrink: 0; }
.movie-thumb img { width: 100%; height: 100%; object-fit: cover; }
.movie-thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.movie-info { display: flex; flex-direction: column; gap: 3px; }
.movie-info strong { font-size: 13px; font-weight: 600; }
.movie-info div { display: flex; align-items: center; gap: 8px; font-size: 12px; }

/* ═══════════════════ Empty State ═══════════════════ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    text-align: center;
    gap: 16px;
}
.empty-icon { width: 48px; height: 48px; color: var(--text-muted); }
.empty-state p { color: var(--text-secondary); font-size: 15px; }

/* ═══════════════════ HTMX States ═══════════════════ */
.htmx-request { opacity: 0.5; pointer-events: none; }
button.htmx-request, .btn.htmx-request {
    position: relative;
    color: transparent;
}
button.htmx-request::after, .btn.htmx-request::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border: 2px solid rgba(255,255,255,0.15);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.5s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════ Toasts ═══════════════════ */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    animation: toast-in 0.3s ease-out;
    cursor: pointer;
    max-width: 360px;
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
}
.toast-success { background: rgba(17,17,17,0.9); color: #66bb6a; border-color: rgba(67,160,71,0.2); }
.toast-error { background: rgba(17,17,17,0.9); color: #ef5350; border-color: rgba(229,57,53,0.2); }
.toast-info { background: rgba(17,17,17,0.9); color: #6495ed; border-color: rgba(100,149,237,0.2); }
.toast-out { animation: toast-out 0.2s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; transform: translateY(-12px); } }

/* ═══════════════════ Modal ═══════════════════ */
.modal { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.65); backdrop-filter: blur(6px); }
.modal-content {
    position: relative;
    background: var(--bg-raised);
    padding: 28px;
    border-radius: 12px;
    min-width: 340px;
    max-width: 480px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: modalIn 0.2s ease-out;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-content h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.3px; }
.modal-content p { margin-bottom: 20px; font-size: 14px; color: var(--text-secondary); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ═══════════════════ Date Picker ═══════════════════ */
.dp-wrap { position: relative; display: inline-block; }
.dp-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 8000;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
    padding: 12px;
    width: 260px;
}
.dp-dropdown.hidden { display: none; }
.dp-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dp-header button { background: none; border: none; font-size: 18px; cursor: pointer; padding: 4px 8px; color: var(--text); border-radius: 4px; }
.dp-header button:hover { background: var(--bg-hover); }
.dp-title { font-size: 13px; font-weight: 600; }
.dp-days-header { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 10px; color: var(--text-muted); margin-bottom: 4px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.dp-day, .dp-empty { padding: 6px 0; font-size: 13px; cursor: pointer; border-radius: 4px; color: var(--text); }
.dp-day:hover { background: var(--bg-hover); }
.dp-today { font-weight: 700; }
.dp-selected { background: #fff; color: #000; }
.dp-selected:hover { background: #e0e0e0; }

/* ═══════════════════ Time Picker ═══════════════════ */
.tp-wrap { position: relative; display: inline-block; }
.tp-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 8000;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
    width: 100px;
    max-height: 240px;
    overflow-y: auto;
}
.tp-dropdown.hidden { display: none; }
.tp-option { padding: 8px 12px; font-size: 13px; cursor: pointer; color: var(--text); }
.tp-option:hover { background: var(--bg-hover); }

/* ═══════════════════ Scrollbar ═══════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }

/* ═══════════════════ Link Transitions ═══════════════════ */
a { transition: color var(--transition); }

/* ═══════════════════ Checkbox (settings) ═══════════════════ */
.checkbox-label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: normal; }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; margin: 0; cursor: pointer; }

/* ═══════════════════ Platform columns ═══════════════════ */
.platform-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.platform-col { border: 1px solid var(--border); border-radius: var(--radius); min-height: 200px; background: var(--bg-raised); }
.platform-col-header { padding: 12px; border-bottom: 1px solid var(--border-light); }
.platform-col-header strong { font-size: 14px; text-transform: capitalize; }

/* ═══════════════════ Schedule legacy ═══════════════════ */
.schedule-day { border-bottom: 1px solid var(--border-light); }
.schedule-day-header { padding: 8px 12px; font-size: 12px; font-weight: 600; color: var(--text-muted); background: var(--bg-subtle); }
.schedule-entry { padding: 8px 12px; border-bottom: 1px solid var(--border-light); }
.schedule-entry:last-child { border-bottom: none; }
.schedule-entry-top { display: flex; align-items: center; gap: 8px; }
.schedule-entry-time { font-size: 14px; font-weight: 600; min-width: 42px; }
.schedule-entry-info { flex: 1; display: flex; gap: 6px; align-items: center; }
.schedule-entry-title { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.schedule-entry-actions { display: flex; gap: 4px; margin-top: 6px; }
.schedule-edit-form { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-light); }
.schedule-edit-form .field-row { gap: 8px; }

/* ─── Templates feature (Stage B) ─────────────────────────────── */

/* Third zone in clip row: template selector */
.clip-row-template {
    flex: 0 0 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 20px;
    border-left: 1px solid var(--border-light);
    gap: 6px;
}
.clip-row-template label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.clip-row-template select {
    width: 100%;
}

/* When a template is selected, the manual settings grid is muted.
   Actions (Approve/Delete) inside .clip-row-settings remain active. */
.clip-row-settings.is-template-active .settings-grid {
    opacity: 0.4;
    pointer-events: none;
    user-select: none;
    filter: blur(0.5px);
    transition: opacity 0.15s ease, filter 0.15s ease;
}
.clip-row-settings .settings-grid {
    transition: opacity 0.15s ease, filter 0.15s ease;
}

/* Wider modal for the template form */
.modal-content-wide {
    max-width: 720px;
    width: 90vw;
}

/* Template card on /templates page */
.template-card {
    border: 1px solid #282828;
    border-radius: var(--radius-sm);
    padding: 16px;
    background: var(--bg-card, #181818);
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 220px;
}
.template-card:hover { border-color: #383838; }
.template-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.template-card-header strong {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.template-card-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.template-card-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
}
.template-card-summary .label {
    font-weight: 600;
    margin-right: 4px;
    color: var(--text-secondary, #888);
}
.template-card-summary .color-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.color-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid #383838;
}

/* Conditional render-template dropdown in /settings */
.conditional-render-template {
    margin: 8px 0 8px 24px;
    padding-left: 12px;
    border-left: 2px solid var(--border-light);
}

/* Stack the third zone below on narrow screens (existing media query
   already collapses .clip-row-body to column) */
/* ─── Multi-file upload cards ──────────────────────────────── */

#upload-queue {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.upload-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 16px;
    background: var(--bg-card, #181818);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.15s ease;
}
.upload-card:hover { border-color: #383838; }
.upload-card[data-state="done"] { border-color: #2d6a2d; opacity: 0.8; }
.upload-card[data-state="error"] { border-color: #6a2d2d; }

.upload-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.upload-card-filename {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.upload-card-settings {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.upload-card-row {
    display: flex;
    gap: 12px;
    align-items: end;
}
.upload-card-row .field { min-width: 0; }

.upload-card-toggles {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 0;
}

.upload-card-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-top: 4px;
    color: var(--text-muted);
}

.upload-card-actions {
    display: flex;
    justify-content: flex-end;
}

.upload-card-done {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
}

.text-danger { color: #e55; }

/* ─── Custom checkboxes (schedule, bulk) ──────────────────── */

.check-label input[type="checkbox"],
.bulk-clip-row input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #444;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: background 0.15s, border-color 0.15s;
    margin: 0;
    vertical-align: middle;
}
.check-label input[type="checkbox"]:hover,
.bulk-clip-row input[type="checkbox"]:hover {
    border-color: #888;
}
.check-label input[type="checkbox"]:checked,
.bulk-clip-row input[type="checkbox"]:checked {
    background: #fff;
    border-color: #fff;
}
.check-label input[type="checkbox"]:checked::after,
.bulk-clip-row input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 8px;
    border: solid #111;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -65%) rotate(45deg);
}
.check-label input[type="checkbox"]:indeterminate,
.bulk-clip-row input[type="checkbox"]:indeterminate {
    background: #666;
    border-color: #666;
}
.check-label input[type="checkbox"]:indeterminate::after,
.bulk-clip-row input[type="checkbox"]:indeterminate::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 6px;
    width: 8px;
    height: 2px;
    background: #fff;
}

/* ─── Custom toggle switch ────────────────────────────────── */

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #333;
    border-radius: 22px;
    transition: background 0.2s ease;
}
.toggle-switch .slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    bottom: 3px;
    background: #999;
    border-radius: 50%;
    transition: transform 0.2s ease, background 0.2s ease;
}
.toggle-switch input:checked + .slider {
    background: #fff;
}
.toggle-switch input:checked + .slider::before {
    transform: translateX(18px);
    background: #111;
}
.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    user-select: none;
}

/* ─── Assets page: inline upload bar ──────────────────────── */

.asset-upload-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0 12px;
}
.asset-upload-bar h3 {
    margin: 0;
    white-space: nowrap;
    min-width: 120px;
}
.asset-upload-bar input[type="text"] {
    width: 180px;
    flex: none;
}
.asset-upload-bar .file-pick-btn {
    width: 120px;
    justify-content: center;
}
.asset-upload-bar .btn {
    width: 80px;
    text-align: center;
}
.file-pick-btn {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    background: #222;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #ccc;
    transition: border-color 0.15s, color 0.15s;
    white-space: nowrap;
}
.file-pick-btn:hover { border-color: #555; color: #fff; }
.file-pick-btn input[type="file"] { display: none; }

/* ─── Upload queue limit badge ────────────────────────────── */

.upload-queue-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 12px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #aaa;
}
.upload-queue-badge.badge-full {
    border-color: #6a2d2d;
    color: #e55;
}
.badge-warning {
    color: #e55;
    font-weight: 400;
}

/* ─── Transparent file input overlay on dropzone ──────────── */

.dropzone-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.dropzone { position: relative; }

/* ─── Volume slider (template modal, clip row) ────────────── */

.volume-slider {
    display: flex;
    align-items: center;
    gap: 10px;
}
.volume-slider label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 55px;
}
.volume-slider input[type="range"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    flex: 1;
    height: 4px;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    background: #333;
    margin: 0;
    padding: 0;
}
.volume-slider input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: #333;
    border-radius: 2px;
}
.volume-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.volume-slider input[type="range"]::-moz-range-track {
    height: 4px;
    background: #333;
    border-radius: 2px;
    border: none;
}
.volume-slider input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.volume-slider .volume-value {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    min-width: 30px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
    .clip-row-template {
        flex: 0 0 auto;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid var(--border-light);
        padding-top: 16px;
    }
}

.sub-banner { padding:10px 16px; text-align:center; font-size:13px; font-weight:500; border-bottom:1px solid transparent; }
.sub-banner a { text-decoration:underline; margin-left:8px; }
.sub-banner-warn { background:rgba(255,193,7,.12); color:#ffc107; border-color:rgba(255,193,7,.3); }
.sub-banner-error { background:rgba(244,67,54,.12); color:#f44336; border-color:rgba(244,67,54,.3); }

.lang-switcher { position:relative; display:inline-block; }
.lang-btn { background:none; border:none; color:inherit; cursor:pointer; padding:8px; display:flex; align-items:center; font-size:16px; }
.lang-btn:hover { opacity:.7; }
.lang-menu { position:absolute; right:0; top:100%; background:#1a1a1a; border:1px solid #2a2a2a; border-radius:10px; min-width:140px; padding:6px 0; display:none; z-index:100; }
.lang-menu.open { display:block; }
.lang-opt { display:block; padding:8px 14px; color:#ccc; text-decoration:none; font-size:13px; white-space:nowrap; }
.lang-opt:hover { background:rgba(255,255,255,.05); color:#fff; }
.lang-opt.active { color:#fff; font-weight:600; }
