:root{--ldtv:#0b5ed7;--navy:#0a2c5b;--bg:#f4f7fb;--border:#dfe6ef;--muted:#667085}html{font-size:15px}body{background:var(--bg);color:#172033}.topbar{background:linear-gradient(115deg,#0b5ed7,#092c68);box-shadow:0 3px 15px #0002}.navbar-brand img{width:34px;height:34px;object-fit:contain;background:#fff;border-radius:9px;padding:3px}.navbar-brand span{font-weight:800}.page-hero{background:linear-gradient(135deg,#fff,#eef5ff);border:1px solid #d8e7ff;border-radius:18px;padding:20px;margin-bottom:16px}.page-hero h1{font-size:26px;font-weight:800;margin:0}.page-hero p{color:var(--muted);margin:6px 0 0}.card-soft{border:1px solid var(--border);border-radius:16px;box-shadow:0 3px 14px #0000000c}.panel-title{font-size:16px;font-weight:800}.audio-list{max-height:68vh;overflow:auto}.audio-row{border:1px solid var(--border);border-radius:12px;padding:10px;margin-bottom:8px;background:#fff}.audio-name{font-weight:700;word-break:break-word}.meta{font-size:12px;color:var(--muted)}.schedule-table th{font-size:12px;text-transform:uppercase;color:#667085;white-space:nowrap}.schedule-table td{vertical-align:middle}.type-badge{font-size:11px;font-weight:800}.gap-row td{background:#fff8e1!important;color:#8a5b00;font-weight:700}.issue-danger{border-left:4px solid #dc3545}.issue-warning{border-left:4px solid #ffc107}.issue-info{border-left:4px solid #0dcaf0}.sticky-side{position:sticky;top:12px}.btn{border-radius:10px}.form-control,.form-select{border-radius:10px}.empty-box{border:2px dashed #cad5e3;border-radius:16px;padding:28px;text-align:center;color:#667085;background:#fff}.status-pill{border-radius:999px;padding:4px 9px;font-size:11px;font-weight:800}.status-program{background:#e7f1ff;color:#084298}.status-filler{background:#e8f7ee;color:#146c43}.status-live{background:#fbe9ee;color:#b02a37}.status-waiting{background:#fff3cd;color:#856404}@media(max-width:991px){.sticky-side{position:static}.audio-list{max-height:none}.schedule-table{font-size:13px}.page-hero h1{font-size:22px}}
.shift-card{background:#fff}.shift-head{background:linear-gradient(90deg,#f8fbff,#fff)}.shift-title{font-weight:800;font-size:18px;color:#183153}.shift-time{width:118px}.item-time{min-width:112px}.schedule-tools{background:#f8fafc}.tool-panel{background:#fff;border:1px solid var(--border);border-radius:12px;padding:12px}.filler-list{max-height:260px;overflow:auto}.filler-pick{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px;border-bottom:1px solid #eef2f6}.filler-pick:last-child{border-bottom:0}.min-w-0{min-width:0}.empty-shift{padding:22px;text-align:center;color:#7b8794;border-top:1px solid var(--border);background:#fcfdff}.bg-light-subtle{background:#f8fafc!important}@media(max-width:767px){.shift-time{width:108px}.item-time{min-width:105px}.shift-head form{width:100%}.shift-head form .shift-time{flex:1}}

/* v0.4 - lập lịch theo điểm chèn */
.audio-row-used{border-color:#8fd0a8;background:#f3fff7;box-shadow:inset 3px 0 0 #198754}.usage-badge{display:inline-block;background:#d1e7dd;color:#0f5132;border-radius:999px;padding:2px 7px;font-size:11px;font-weight:700}.insert-table-row td{padding:4px 10px!important;background:#f9fbfd!important;border-top:0!important;border-bottom:0!important;text-align:center}.insert-link{border:1px dashed #b9c7d8;background:#fff;color:#5b6b7f;border-radius:999px;padding:3px 14px;font-size:12px;transition:.15s}.insert-link:hover{border-color:#0b5ed7;color:#0b5ed7;background:#f2f7ff}.insert-zone{padding:10px;text-align:center;border-top:1px solid var(--border);background:#fbfdff}.status-replay{background:#ede7f6;color:#5e35b1}.filler-choice,.replay-choice{width:100%;border:0;border-bottom:1px solid #eef2f6;background:#fff;padding:10px 8px;display:flex;justify-content:space-between;align-items:center;gap:12px;text-align:left}.filler-choice:hover,.replay-choice:hover{background:#f4f8ff}.filler-choice span:first-child,.replay-choice span:first-child{min-width:0;display:flex;flex-direction:column}.filler-choice strong,.replay-choice strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.filler-choice small,.replay-choice small{color:var(--muted)}.replay-list{max-height:360px;overflow:auto;border:1px solid var(--border);border-radius:10px}.schedule-item-row td{background:#fff}.modal-content{border-radius:16px;border:1px solid var(--border)}

/* v0.5 - thao tác kiểu app, lịch sử và khóa lịch đã phát */
.ajax-state{display:inline-flex;align-items:center;min-height:24px;padding:2px 8px;border-radius:999px;font-size:12px;font-weight:700;color:var(--muted);transition:.15s}.ajax-working{background:#fff3cd;color:#7a5a00}.ajax-ok{background:#d1e7dd;color:#0f5132}.ajax-error{background:#f8d7da;color:#842029}#programPanel,#scheduleHeader,#scheduleIssues,.shift-card{transition:opacity .12s ease}.form-control.bg-light{background:#f8fafc!important}.schedule-item-row{transition:background .12s}.schedule-item-row:hover td{background:#fbfdff}.btn:disabled{cursor:wait}


/* v0.7 - toolbar cân hàng, chốt không khóa trước ngày phát */
.schedule-toolbar-grid{display:grid;grid-template-columns:minmax(230px,1.05fr) minmax(190px,.72fr) minmax(360px,1.8fr) auto;gap:12px;align-items:start}
.schedule-toolbar-field{min-width:0}.schedule-toolbar-field .form-label{margin-bottom:6px}.schedule-toolbar-history{min-width:0}.schedule-toolbar-status{display:flex;align-items:center;justify-content:flex-end;padding-top:30px;white-space:nowrap}.schedule-toolbar-status .badge{font-size:12px}
@media(max-width:1100px){.schedule-toolbar-grid{grid-template-columns:1fr 1fr}.schedule-toolbar-history{grid-column:1/-1}.schedule-toolbar-status{grid-column:1/-1;justify-content:flex-start;padding-top:0}}
@media(max-width:640px){.schedule-toolbar-grid{grid-template-columns:1fr}.schedule-toolbar-history,.schedule-toolbar-status{grid-column:auto}.schedule-toolbar-status{padding-top:0}}
.select-col{width:38px;text-align:center}.bulk-delete-bar{position:fixed;left:50%;bottom:22px;transform:translateX(-50%);z-index:1080;display:flex;align-items:center;gap:10px;background:#172033;color:#fff;padding:10px 14px;border-radius:14px;box-shadow:0 10px 30px #0005;border:1px solid #ffffff22}.bulk-delete-bar.d-none{display:none!important}.bulk-delete-bar .btn{white-space:nowrap}@media(max-width:700px){.bulk-delete-bar{width:calc(100% - 24px);justify-content:center;flex-wrap:wrap;bottom:12px}.select-col{width:32px}}

/* v0.10 - nghe thử WAV + waveform */
.audio-mini-play{border:1px solid #cbd5e1;background:#fff;color:#0b5ed7;width:26px;height:26px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:11px;line-height:1;padding:0;transition:.15s}.audio-mini-play:hover{background:#0b5ed7;color:#fff;border-color:#0b5ed7}.schedule-waveform{display:block;width:min(220px,100%);height:32px;margin-top:5px;border-radius:7px;background:#f6f9fc;border:1px solid #e3eaf2;cursor:pointer}.schedule-waveform:hover{border-color:#8cb8f2;background:#f1f7ff}.audio-preview-modal .modal-content{overflow:hidden}.audio-preview-waveform{display:block;width:100%;height:150px;border-radius:12px;background:#f6f9fc;border:1px solid #dfe6ef}.audio-preview-modal audio{height:46px}.waveform-error{opacity:.45}

/* v0.11 - Thong ke ca + thu gon/mo rong */
.shift-heading-block{min-width:280px;flex:1 1 420px}.shift-summary{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.shift-summary-chip{display:inline-flex;align-items:center;gap:4px;padding:3px 8px;border-radius:999px;background:#eef3f8;color:#536273;font-size:12px;line-height:1.35;border:1px solid #e2e8f0}.shift-summary-chip strong{color:#183153;font-weight:800}.summary-live{background:#e9f8ef;border-color:#c9ecd7;color:#18723b}.summary-live strong{color:#116331}.summary-waiting{background:#fff7df;border-color:#f2df9f;color:#8a6510}.summary-waiting strong{color:#745207}.summary-filler{background:#eef8f2;border-color:#d5eadc;color:#2e7148}.summary-duration{background:#eaf3ff;border-color:#cfe1f8;color:#245b97}.summary-duration strong{color:#174b84}.shift-toggle{width:28px;height:28px;border-radius:8px;border:1px solid #dbe4ee;background:#fff;color:#45617e;font-weight:800;display:inline-flex;align-items:center;justify-content:center;line-height:1;padding:0;transition:.15s}.shift-toggle:hover{background:#f0f6ff;border-color:#b9d2ee;color:#0b5ed7}.shift-card.is-collapsed .shift-body{display:none}.shift-card.is-collapsed .shift-head{border-bottom:0}.shift-card.is-collapsed .shift-toggle{transform:none}@media(max-width:767px){.shift-heading-block{min-width:100%;flex-basis:100%}.shift-summary{gap:4px}.shift-summary-chip{font-size:11px;padding:3px 7px}}

/* v0.12 - Cue Simian */
.cue-cell{min-width:145px}.cue-select{min-width:135px;font-size:.78rem}

/* v0.15 - highlight vị trí thiếu/dư thời lượng */
.insert-table-row.insert-gap-needed td{background:#fff8df!important}.insert-link.insert-gap-needed{color:#9a6700;font-weight:700}.insert-table-row.insert-gap-over td{background:#fff0f0!important}.insert-link.insert-gap-over{color:#b42318;font-weight:700}

/* v0.15.1 - trạng thái kiểm tra hiển thị trực tiếp trên lịch */
.summary-error{background:#fff0f0;border-color:#f2c6c6;color:#a61b1b}.summary-error strong{color:#8f1515}.summary-note{background:#eef8ff;border-color:#cce7f6;color:#24627d}.schedule-name-missing{color:#c62828!important;font-weight:800!important}.inline-issue{font-size:11px;font-weight:700;margin-top:3px}.inline-issue-missing{color:#c62828}.duration-cell{min-width:118px}.duration-main{font-weight:700}.duration-cell.duration-gap{background:#fff7db!important;border-left:3px solid #e0a800}.duration-cell.duration-gap .duration-main,.duration-cell.duration-gap .duration-hint{color:#8a6500}.duration-cell.duration-over{background:#fff0f0!important;border-left:3px solid #dc3545}.duration-cell.duration-over .duration-main,.duration-cell.duration-over .duration-hint{color:#b42318}.duration-hint{font-size:11px;font-weight:800;white-space:nowrap;margin-top:2px}.schedule-row-overlap td{border-bottom-color:#efc2c2}.insert-link strong{font-weight:800}.schedule-issues-details summary{cursor:pointer;list-style:none}.schedule-issues-details summary::-webkit-details-marker{display:none}.schedule-issues-details summary:after{content:"▾";float:right;color:#667085}.schedule-issues-details[open] summary:after{content:"▴"}

/* v0.15.8 - compact Loại/Cue + visible Map status */
.type-cue-cell{min-width:145px;white-space:nowrap}.type-cue-cell .cue-select{min-width:138px;max-width:155px}.map-badge{display:inline-block;border-radius:999px;padding:4px 9px;font-size:11px;font-weight:800;white-space:nowrap;border:1px solid transparent}.map-matched{background:#d1e7dd;color:#0f5132;border-color:#badbcc}.map-replay{background:#cff4fc;color:#055160;border-color:#b6effb}.map-missing{background:#fff3cd;color:#664d03;border-color:#ffecb5}.map-ambiguous{background:#f8d7da;color:#842029;border-color:#f5c2c7}.map-na{background:#e2e3e5;color:#41464b;border-color:#d3d6d8}.map-manual{background:#eef2f6;color:#344054;border-color:#d0d5dd}.schedule-table th:nth-child(4),.schedule-table td:nth-child(4){width:155px}

/* v0.16: lựa chọn WAV trong hộp Thay file */
.js-replace-choice.is-selected{outline:2px solid #0d6efd;background:#eef5ff}
