:root {
  --surface: #f8f9ff; --surface-card: #fff; --surface-soft: #eff4ff; --surface-muted: #e5eeff;
  --ink: #0b1c30; --muted: #566078; --red: #dc2626; --red-deep: #b70011; --red-soft: #ffdad6;
  --blue: #2563eb; --line: #dce4f2; --shadow: 0 1px 3px rgba(15,23,42,.05),0 6px 20px rgba(15,23,42,.04);
  --radius: 12px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--surface); color: var(--ink); font-family: "Plus Jakarta Sans", Arial, sans-serif; font-size: 14px; line-height: 1.5; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { border: 0; cursor: pointer; }
.material-symbols-outlined { font-size: 20px; line-height: 1; vertical-align: middle; }
.topbar { height: 64px; position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); box-shadow: 0 1px 3px rgba(15,23,42,.04); backdrop-filter: blur(10px); }
.topbar__inner { max-width: 1500px; height: 100%; margin: auto; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 9px; min-width: max-content; }
.brand__logo { height: 36px; flex: 0 0 auto; overflow: hidden; }
.brand__logo img { display: block; width: auto; height: 36px; max-width: none; }
.brand__logo--full { width: 175px; }
.brand__logo--compact { display: none; width: 36px; }
.brand__mark { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg,var(--red),#8b0010); box-shadow: 0 4px 10px rgba(220,38,38,.24); }
.brand__mark .material-symbols-outlined { font-size: 23px; }
.brand__copy { display: flex; flex-direction: column; line-height: 1.05; }
.brand__copy strong { font-size: 15px; letter-spacing: -.02em; }
.brand__copy small { margin-top: 4px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .14em; }
.main-nav { display: flex; align-self: stretch; align-items: center; gap: 26px; margin-left: 16px; flex: 1; }
.main-nav a { display: flex; align-items: center; height: 100%; color: var(--muted); font-size: 13px; white-space: nowrap; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a.is-active { color: var(--red); }
.main-nav a.is-active { border-color: var(--red); font-weight: 700; }
.topbar__actions { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.topbar__connection { display: inline-flex; align-items: center; gap: 6px; color: #15803d; font-size: 11px; font-weight: 700; white-space: nowrap; }
.topbar__connection i { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
.topbar__connection--error { color: #b91c1c; }
.topbar__connection--error i { background: #ef4444; }
kbd { padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; background: #fff; font: 10px "JetBrains Mono", monospace; }
.topbar__user { display: flex; align-items: center; gap: 8px; padding-left: 8px; border-left: 1px solid var(--line); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--red); }
.avatar .material-symbols-outlined { font-size: 18px; }
.topbar__user-copy { display: flex; flex-direction: column; line-height: 1.2; }
.topbar__user-copy strong { color: var(--ink); font-size: 12px; }
.topbar__user-copy small { font-size: 10px; color: var(--muted); margin-top: 3px; }
.logout-button { display: inline-flex; align-items: center; gap: 5px; padding: 7px 8px; border-radius: 8px; color: #ba1a1a; background: transparent; font-size: 12px; }
.logout-button:hover { background: #ffdad6; }
.logout-button .material-symbols-outlined { font-size: 18px; }
.page-shell { max-width: 1500px; min-height: calc(100vh - 124px); margin: auto; padding: 32px; }
.alert { display: flex; align-items: center; gap: 8px; padding: 12px 16px; margin: -8px 0 20px; border-radius: 8px; font-size: 13px; }
.alert--success { color: #166534; background: #dcfce7; border: 1px solid #bbf7d0; }
.alert--error { color: #991b1b; background: #fee2e2; border: 1px solid #fecaca; }
.dashboard { display: flex; flex-direction: column; gap: 24px; }
.dashboard-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.breadcrumb { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; }
.breadcrumb .material-symbols-outlined { font-size: 14px; }
.breadcrumb b { color: var(--red); font-weight: 600; }
.heading-line { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
h1, h2, h3, p { margin: 0; }
.heading-line h1 { font-size: clamp(24px,3vw,32px); line-height: 1.25; letter-spacing: -.04em; }
.system-status { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; color: var(--ink); background: var(--surface-muted); border-radius: 999px; font-size: 12px; }
.system-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: pulse 1.8s infinite; }
.system-status--error { color: #991b1b; background: #fee2e2; }
@keyframes pulse { 50% { opacity: .35; } }
.storage-widget { min-width: 250px; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.storage-widget__icon { width: 42px; height: 42px; display: grid; place-items: center; color: var(--red); border-radius: 8px; background: var(--surface-muted); }
.storage-widget__body { flex: 1; min-width: 170px; }
.storage-widget__body > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 10px; color: var(--muted); }
.storage-widget strong { color: var(--ink); font-size: 13px; white-space: nowrap; }
.storage-widget strong small { color: var(--muted); font-size: 10px; font-weight: 400; }
.progress { height: 6px; margin-top: 7px; overflow: hidden; border-radius: 999px; background: var(--surface-muted); }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--red); }
.section-label-row, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-label-row > span, .eyebrow { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.link-button { display: inline-flex; align-items: center; gap: 5px; color: var(--red); background: transparent; font-size: 12px; }
.link-button .material-symbols-outlined { font-size: 16px; }
.date-ribbon { display: flex; gap: 8px; padding: 10px 0 3px; overflow-x: auto; }
.date-ribbon__tools { display: flex; gap: 8px; flex-shrink: 0; }
.date-pill { min-width: 75px; padding: 9px 12px; display: flex; flex-direction: column; align-items: center; gap: 3px; border-radius: 11px; background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.date-pill small { color: var(--muted); font-size: 10px; font-weight: 700; }
.date-pill strong { font-size: 15px; }
.date-pill:hover { background: var(--surface-muted); }
.date-pill--active { color: #fff; background: var(--red); box-shadow: 0 6px 14px rgba(220,38,38,.2); }
.date-pill--active small { color: #fee2e2; }
.date-pill--calendar { justify-content: center; cursor: pointer; }
.date-pill--calendar .material-symbols-outlined { font-size: 20px; color: var(--red); }
.date-picker-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.control-panel, .upload-panel { padding: 16px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.control-panel__top { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 12px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; }
.tab { position: relative; display: inline-flex; padding: 8px 12px; color: var(--muted); background: transparent; border: 0; text-decoration: none; white-space: nowrap; font-size: 13px; font-weight: 600; cursor: pointer; }
.tab--active { color: var(--red); }
.tab--active::after { content: ""; position: absolute; right: 12px; bottom: 0; left: 12px; height: 2px; border-radius: 2px; background: var(--red); }
.tab em { margin-left: 5px; padding: 2px 6px; border-radius: 999px; color: var(--red); background: var(--red-soft); font-size: 10px; font-style: normal; }
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 700; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button--primary { color: #fff; background: var(--red); box-shadow: 0 4px 10px rgba(220,38,38,.13); }
.button--primary:hover { background: var(--red-deep); }
.button--muted { color: var(--ink); background: var(--surface-muted); }
.button--muted:hover { background: #d6e2f7; }
.button--secondary { color: var(--ink); background: #fff; border: 1px solid var(--line); }
.button--ghost { color: var(--muted); background: var(--surface); }
.button--ghost:hover { color: var(--ink); background: var(--surface-muted); }
.button--small { min-height: 34px; padding: 7px 9px; font-size: 11px; }
.filters { display: grid; grid-template-columns: minmax(240px,2fr) 1fr 1fr auto; gap: 8px; padding-top: 4px; }
.search-field, .filters select, .category-field input { width: 100%; height: 40px; border: 1px solid transparent; border-radius: 8px; color: var(--ink); background: var(--surface); }
.search-field { position: relative; display: flex; align-items: center; }
.search-field .material-symbols-outlined { position: absolute; left: 11px; color: #94a3b8; font-size: 19px; }
.search-field input { width: 100%; height: 100%; padding: 0 12px 0 38px; border: 0; outline: 0; color: inherit; background: transparent; }
.filters select { padding: 0 12px; outline: 0; }
.search-field:focus-within, .filters select:focus, .category-field input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(220,38,38,.1); }
.filter-submit { display: inline-flex; align-items: center; gap: 5px; padding: 0 15px; border-radius: 8px; color: var(--red); background: var(--red-soft); font-weight: 700; }
.upload-panel { scroll-margin-top: 80px; background: linear-gradient(135deg,#fff 0%,#f7f9ff 100%); }
.upload-panel__heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.upload-panel h2 { margin-top: 4px; font-size: 20px; letter-spacing: -.02em; }
.upload-panel p { margin-top: 3px; color: var(--muted); font-size: 12px; }
.upload-panel__icon { color: var(--red); font-size: 35px; }
.dropzone { min-height: 155px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 20px; border: 2px dashed #cbd5e1; border-radius: 12px; text-align: center; cursor: pointer; background: #fff; transition: .18s ease; }
.dropzone:hover, .dropzone.is-dragging { border-color: var(--red); background: #fff9f8; }
.dropzone input { display: none; }
.dropzone__icon { margin-bottom: 3px; padding: 10px; border-radius: 50%; color: var(--red); background: var(--red-soft); font-size: 28px; }
.dropzone strong { font-size: 14px; }
.dropzone u { color: var(--red); text-underline-offset: 4px; }
.dropzone small { color: var(--muted); font-size: 11px; }
.file-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; color: #334155; background: var(--surface-muted); font-size: 11px; }
.file-chip__duration { color: var(--muted); font: 10px "JetBrains Mono",monospace; }
.upload-options { display: grid; grid-template-columns: 1fr 1fr 220px; gap: 10px; margin-top: 12px; }
.upload-options > label:not(.category-field) { display: flex; align-items: flex-start; gap: 8px; padding: 10px; border-radius: 8px; background: var(--surface); }
.upload-options input[type=checkbox] { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--red); }
.upload-options b, .upload-options small { display: block; }
.upload-options b { font-size: 12px; }
.upload-options small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.category-field { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.category-field input { height: 36px; padding: 0 10px; border-color: var(--line); background: #fff; outline: 0; font-size: 12px; }
.category-field__label { display: flex; align-items: baseline; gap: 6px; min-height: 16px; }
.category-field__label small { margin-top: 0; white-space: nowrap; font-size: 10px; font-weight: 600; }
.tag-editor { min-height: 36px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.tag-editor:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px rgba(220,38,38,.1); }
.tag-editor__chips { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 999px; color: #1d4ed8; background: #eff6ff; font-size: 11px; font-weight: 700; }
.tag-chip--2 { color: #047857; background: #ecfdf5; }
.tag-chip--3 { color: #b45309; background: #fffbeb; }
.tag-chip--4 { color: #7e22ce; background: #faf5ff; }
.tag-chip button { display: grid; place-items: center; width: 16px; height: 16px; padding: 0; border: 0; border-radius: 50%; color: #2563eb; background: transparent; cursor: pointer; }
.tag-chip button:hover { color: #fff; background: #2563eb; }
.tag-editor input { flex: 1; min-width: 145px; height: 26px; padding: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.thumbnail-candidates { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.thumbnail-candidates__group { display: flex; flex-direction: column; gap: 7px; }
.thumbnail-candidates__heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--ink); font-size: 11px; }
.thumbnail-candidates__heading small { color: var(--muted); font-size: 10px; font-weight: 500; }
.thumbnail-candidates__grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.thumbnail-candidate { min-width: 0; padding: 3px; border: 2px solid transparent; border-radius: 8px; color: var(--muted); background: var(--surface); text-align: left; }
.thumbnail-candidate:hover, .thumbnail-candidate.is-selected { border-color: var(--red); color: var(--red); background: #fff8f7; }
.thumbnail-candidate img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 5px; }
.thumbnail-candidate span { display: block; padding: 4px 3px 2px; font-size: 9px; font-weight: 700; }
.upload-submit { margin-top: 14px; }
.section-heading { margin-top: 2px; }
.section-heading h2 { font-size: 22px; letter-spacing: -.03em; }
.section-heading span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.view-toggle { display: flex; gap: 4px; }
.view-toggle button { display: grid; place-items: center; padding: 6px; border-radius: 7px; color: var(--muted); background: transparent; }
.view-toggle button.is-active, .view-toggle button:hover { color: var(--ink); background: #fff; box-shadow: var(--shadow); }
.video-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-top: 14px; }
.video-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 11px; background: #fff; box-shadow: var(--shadow); transition: .18s ease; }
.video-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15,23,42,.1); }
.video-poster { position: relative; aspect-ratio: 16/9; overflow: hidden; display: flex; align-items: flex-end; padding: 10px; color: #fff; background: #172554; }
.video-poster::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top,rgba(0,0,0,.8),transparent 65%); }
.tone-1 { background: linear-gradient(135deg,#064e3b,#be123c 58%,#1e293b); }
.tone-2 { background: linear-gradient(135deg,#172554,#0f766e 55%,#111827); }
.tone-3 { background: linear-gradient(135deg,#312e81,#b91c1c 60%,#0f172a); }
.tone-4 { background: linear-gradient(135deg,#1e3a8a,#854d0e 58%,#111827); }
.video-poster__category, .video-poster__status { position: absolute; z-index: 1; top: 9px; padding: 3px 6px; border-radius: 4px; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.video-poster__category { left: 9px; background: var(--red); }
.video-poster__status { right: 9px; background: rgba(0,0,0,.58); }
.video-poster__title { position: relative; z-index: 1; max-width: 75%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.video-poster__play { position: absolute; z-index: 2; top: 50%; left: 50%; padding: 9px; border-radius: 50%; color: #fff; background: rgba(220,38,38,.9); opacity: 0; transform: translate(-50%,-50%) scale(.8); transition: .18s ease; }
.video-card:hover .video-poster__play { opacity: 1; transform: translate(-50%,-50%) scale(1); }
.video-poster--playable { cursor: pointer; }
.video-poster--disabled .video-poster__play { opacity: .35; }
.video-poster__duration { position: absolute; z-index: 1; right: 9px; bottom: 8px; padding: 2px 5px; border-radius: 3px; background: rgba(0,0,0,.7); font: 10px "JetBrains Mono",monospace; }
.video-card__body { display: flex; flex-direction: column; gap: 8px; padding: 12px; flex: 1; }
.video-card__meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; }
.video-card__meta span:last-child { display: flex; align-items: center; gap: 3px; }
.video-card__meta .material-symbols-outlined { font-size: 14px; }
.video-card h3 { min-height: 42px; font-size: 13px; line-height: 1.6; }
.file-name { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font: 10px "JetBrains Mono",monospace; }
.video-card__actions { display: grid; grid-template-columns: 1.15fr .85fr; gap: 5px; margin-top: auto; padding-top: 3px; }
.video-card__actions form { display: contents; }
.video-card__actions .button { width: 100%; white-space: nowrap; }
.empty-state { grid-column: 1/-1; padding: 50px 20px; text-align: center; color: var(--muted); background: #fff; border-radius: var(--radius); }
.empty-state .material-symbols-outlined { font-size: 42px; color: #b8c5da; }
.empty-state h3 { margin-top: 10px; color: var(--ink); }
.empty-state p { margin-top: 4px; font-size: 12px; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 32px; color: var(--muted); border-top: 1px solid var(--line); background: #fff; font-size: 11px; }
.site-footer__links { display: flex; gap: 22px; }
.site-footer a:hover { color: var(--ink); }
.modal { position: fixed; z-index: 40; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(15,23,42,.5); backdrop-filter: blur(5px); }
.modal[hidden] { display: none; }
.modal__card { width: min(680px,100%); max-height: 90vh; overflow: auto; border-radius: 16px; background: #fff; box-shadow: 0 20px 40px rgba(15,23,42,.2); }
.modal__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px; border-bottom: 1px solid var(--line); }
.modal__header h2 { margin-top: 5px; font-size: 19px; }
.modal__header p { margin-top: 4px; color: var(--muted); font-size: 11px; }
.icon-button { display: grid; place-items: center; padding: 7px; border-radius: 7px; color: var(--muted); background: transparent; }
.icon-button:hover { color: var(--ink); background: var(--surface-muted); }
.modal__body { display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.embed-preview { aspect-ratio: 16/9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; color: #cbd5e1; background: linear-gradient(135deg,#172554,#7f1d1d 55%,#111827); font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.embed-preview .material-symbols-outlined { color: #fff; font-size: 52px; }
.embed-tabs { display: grid; grid-template-columns: repeat(3,1fr); gap: 3px; padding: 4px; border-radius: 9px; background: var(--surface-muted); }
.embed-tabs button { padding: 9px 5px; border-radius: 6px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 700; }
.embed-tabs button.is-active { color: var(--red); background: #fff; box-shadow: var(--shadow); }
.embed-code > div { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.embed-code button { display: inline-flex; align-items: center; gap: 4px; color: var(--blue); background: transparent; font-size: 11px; font-weight: 700; letter-spacing: 0; }
.embed-code button .material-symbols-outlined { font-size: 16px; }
.embed-code code { display: block; min-height: 82px; padding: 14px; overflow: auto; border-radius: 9px; color: #e2e8f0; background: #0f172a; font: 11px/1.7 "JetBrains Mono",monospace; white-space: pre-wrap; word-break: break-word; }
.embed-layout-option { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-muted); }
.embed-layout-option label { color: var(--ink); font-size: 11px; font-weight: 700; }
.embed-layout-option select { width: 100%; min-height: 38px; padding: 8px 10px; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.embed-layout-option small { color: var(--muted); font-size: 11px; line-height: 1.5; }

/* The simple embed is intentionally only the native player frame. */
.embed-simple { display: block; min-height: 0; padding: 0; background: #000; }
.player-shell--simple { width: 100%; max-width: none; border: 0; border-radius: 0; box-shadow: none; background: #000; }
.player-shell--simple .player { aspect-ratio: 16/9; background: #000; }

/* Login, based on template/dang-nhap/code.html */
.login-page { min-height: 100vh; background: radial-gradient(circle at 0 0,rgba(255,218,214,.65),transparent 30%),var(--surface); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(620px,100%); overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 20px 50px rgba(15,23,42,.1); }
.login-card__body { padding: 38px clamp(22px,6vw,52px); }
.brand--large .brand__mark { width: 48px; height: 48px; border-radius: 11px; }
.brand--large .brand__mark .material-symbols-outlined { font-size: 30px; }
.brand--large .brand__logo--full { width: 175px; height: 36px; }
.brand--large .brand__logo--compact { width: 36px; height: 36px; }
.brand--large .brand__copy strong { color: var(--red); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.brand--large .brand__copy small { color: var(--ink); font-size: 16px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.login-intro { margin: 26px 0; }
.login-intro h1 { font-size: 24px; letter-spacing: -.035em; line-height: 1.35; }
.login-intro p { margin-top: 7px; color: var(--muted); line-height: 1.65; }
.login-form { display: flex; flex-direction: column; gap: 17px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field__label-row { color: var(--ink); font-size: 12px; font-weight: 700; }
.field__label-row { display: flex; align-items: center; justify-content: space-between; }
.field__label-row a { color: var(--red); font-size: 11px; }
.input-with-icon { position: relative; display: flex; align-items: center; }
.input-with-icon > .material-symbols-outlined { position: absolute; left: 12px; color: var(--muted); font-size: 20px; pointer-events: none; }
.input-with-icon input { width: 100%; height: 44px; padding: 0 14px 0 42px; border: 1px solid var(--line); border-radius: 8px; outline: 0; color: var(--ink); background: var(--surface); }
.input-with-icon input:focus { border-color: var(--red); background: #fff; box-shadow: 0 0 0 3px rgba(220,38,38,.1); }
.input-with-action input { padding-right: 42px; }
.input-with-action button { position: absolute; right: 7px; display: grid; place-items: center; padding: 5px; border-radius: 5px; color: var(--muted); background: transparent; }
.input-with-action button:hover { color: var(--ink); background: var(--surface-muted); }
.input-with-action button .material-symbols-outlined { font-size: 19px; }
.check-row { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.check-row input { accent-color: var(--red); }
.button--full { width: 100%; height: 46px; }
.login-divider { position: relative; margin: 25px 0 14px; text-align: center; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.login-divider::before { content: ""; position: absolute; top: 50%; right: 0; left: 0; height: 1px; background: var(--line); }
.login-divider span { position: relative; padding: 0 12px; background: #fff; }
.login-sso { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sso-google { width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; color: #4285f4; font-weight: 700; }
.icon-blue { color: var(--blue); }
.login-note { margin-top: 20px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--surface-soft); font-size: 11px; }
.login-note strong { display: flex; align-items: center; gap: 5px; color: var(--red); font-size: 12px; }
.login-note strong .material-symbols-outlined { font-size: 17px; }
.login-note ul { margin: 8px 0 0; padding-left: 18px; }
.login-note li + li { margin-top: 4px; }
.login-note code { color: var(--ink); font-family: "JetBrains Mono",monospace; font-weight: 700; }
.login-card__footer { padding: 17px 20px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: 10px; }
.validation-summary, .field-error { color: #b91c1c; font-size: 11px; }
.validation-summary:empty, .field-error:empty { display: none; }

@media (max-width: 1150px) { .video-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } .topbar__user-copy, .main-nav a:nth-child(n+3) { display: none; } }
@media (max-width: 850px) { .topbar__inner, .page-shell { padding-right: 16px; padding-left: 16px; } .dashboard-heading { align-items: flex-start; flex-direction: column; } .storage-widget { width: 100%; } .control-panel__top { align-items: stretch; flex-direction: column; } .filters { grid-template-columns: 1fr 1fr; } .search-field { grid-column: 1/-1; } .upload-options { grid-template-columns: 1fr 1fr; } .category-field { grid-column: 1/-1; } .site-footer { padding: 18px 16px; flex-direction: column; align-items: flex-start; } }
@media (max-width: 620px) { .main-nav { display: none; } .topbar__actions { margin-left: auto; } .brand__logo--full { display: none; } .brand__logo--compact { display: block; } .video-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .video-card__actions { grid-template-columns: 1fr; } .filters, .upload-options, .login-sso { grid-template-columns: 1fr; } .category-field { grid-column: auto; } .site-footer__links { flex-wrap: wrap; gap: 8px 14px; } .heading-line { align-items: flex-start; flex-direction: column; } .system-status { font-size: 10px; } }
@media (max-width: 620px) { .thumbnail-candidates__grid { grid-template-columns: repeat(3,minmax(0,1fr)); } .thumbnail-candidates__heading { align-items: flex-start; flex-direction: column; gap: 2px; } }
@media (max-width: 420px) { .page-shell { padding: 22px 12px; } .video-grid { grid-template-columns: 1fr; } .login-shell { padding: 12px; } .login-card__body { padding: 28px 18px; } }

/* Functional CMS modules */
.date-picker { position: relative; cursor: pointer; }
.date-picker input { width: 0; height: 0; opacity: 0; position: absolute; }
.video-poster__status.status-new { background: #334155; }
.video-poster__status.status-pendingreview { color: #78350f; background: #fde68a; }
.video-poster__status.status-approved { background: #15803d; }
.video-poster__status.status-removed { background: #991b1b; }
.video-card__description { display: -webkit-box; min-height: 34px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; min-height: 20px; }
.tag-list span { padding: 3px 6px; border-radius: 999px; color: var(--blue); background: #eff6ff; font-size: 9px; }
.video-card__actions { grid-template-columns: repeat(2, minmax(0,1fr)); }
.video-card__actions .button { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.category-field--wide { grid-column: 1/-1; }
.category-field textarea, .form-field textarea { resize: vertical; }
.category-field select { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; outline: 0; color: var(--ink); background: #fff; font-size: 12px; }
.category-field select:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(220,38,38,.1); }
.field-help { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 500; }
.tag-editor input, .tag-editor input:focus { width: auto; height: 26px; min-width: 145px; padding: 0; border: 0; border-radius: 0; outline: 0; box-shadow: none; background: transparent; }
.category-field input, .category-field textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; outline: 0; color: var(--ink); background: #fff; font-size: 12px; }
.category-field textarea { min-height: 54px; }
.category-field input:focus, .category-field textarea:focus, .form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(220,38,38,.1); }
.upload-progress { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.upload-progress__item { display: grid; grid-template-columns: minmax(120px,1fr) 120px auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--surface); font-size: 11px; }
.upload-progress__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-progress__bar { height: 6px; overflow: hidden; border-radius: 999px; background: #dbe4f2; }
.upload-progress__bar i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--red); transition: width .12s linear; }
.upload-progress__state { color: var(--muted); font-size: 10px; white-space: nowrap; }
.upload-progress__item.is-done .upload-progress__bar i { background: #16a34a; }
.upload-progress__item.is-error .upload-progress__bar i { background: #b91c1c; }
.editor-page, .users-page { display: flex; flex-direction: column; gap: 20px; }
.editor-page__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.editor-page__heading h1 { margin-top: 5px; font-size: clamp(24px,3vw,32px); letter-spacing: -.04em; }
.editor-page__heading p { margin-top: 5px; color: var(--muted); font-size: 13px; }
.editor-page__heading .system-status { flex-shrink: 0; }
.editor-card { padding: 22px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.editor-card form { display: flex; flex-direction: column; gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; color: var(--ink); font-size: 12px; font-weight: 700; }
.form-field input, .form-field textarea, .form-field select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; outline: 0; color: var(--ink); background: var(--surface); font-size: 13px; font-weight: 400; }
.form-field input, .form-field select { height: 42px; }
.form-field small { color: var(--muted); font-size: 10px; font-weight: 400; }
.password-tools { display: grid; grid-template-columns: minmax(0,1fr) 42px 42px; gap: 6px; }
.password-tools input { min-width: 0; }
.password-tools__button { display: grid; place-items: center; min-height: 42px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface); }
.password-tools__button:hover { color: var(--ink); border-color: var(--red); background: #fff; }
.password-tools__button .material-symbols-outlined { font-size: 19px; }
.form-field .tag-editor input, .form-field .tag-editor input:focus { width: auto; height: 26px; min-width: 145px; padding: 0; border: 0; border-radius: 0; outline: 0; box-shadow: none; background: transparent; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.editor-card__footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 5px; border-top: 1px solid var(--line); }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.card-heading h2 { font-size: 18px; }
.card-heading p { margin-top: 3px; color: var(--muted); font-size: 11px; }
.card-heading > .material-symbols-outlined, .user-list-card > .section-heading > .material-symbols-outlined { color: var(--red); font-size: 30px; }
.user-layout { display: grid; grid-template-columns: minmax(0,2fr) minmax(240px,1fr); gap: 20px; }
.user-summary { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.user-summary > div { display: flex; align-items: center; gap: 12px; min-height: 82px; padding: 15px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.user-summary__icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; color: var(--red); background: var(--red-soft); }
.user-summary__icon--green { color: #15803d; background: #dcfce7; }
.user-summary__icon--amber { color: #b45309; background: #fef3c7; }
.user-summary small, .user-summary strong { display: block; }
.user-summary small { color: var(--muted); font-size: 10px; }
.user-summary strong { margin-top: 3px; font-size: 22px; }
.user-list-card > .section-heading { margin-bottom: 15px; }
.user-table-wrap { overflow-x: auto; }
.user-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.user-table th { padding: 10px 8px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 700; text-align: left; text-transform: uppercase; letter-spacing: .06em; }
.user-table td { padding: 12px 8px; border-bottom: 1px solid #eef2f7; white-space: nowrap; }
.user-table tbody tr:hover { background: var(--surface); }
.user-cell { display: flex; align-items: center; gap: 9px; }
.user-cell .avatar { width: 30px; height: 30px; font-size: 12px; font-weight: 700; }
.user-cell strong, .user-cell small { display: block; }
.user-cell strong { color: var(--ink); font-size: 12px; }
.user-cell small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.role-badge { padding: 4px 7px; border-radius: 5px; color: var(--blue); background: #eff6ff; font-size: 10px; font-weight: 700; }
.account-status { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; }
.account-status i { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; }
.account-status--active { color: #15803d; }.account-status--active i { background: #16a34a; }
.account-status--pending { color: #b45309; }.account-status--pending i { background: #f59e0b; }
.account-status--locked, .account-status--disabled { color: #b91c1c; }.account-status--locked i, .account-status--disabled i { background: #dc2626; }
.table-actions { display: flex; gap: 3px; }
.table-actions form { display: contents; }
.table-actions .icon-button { padding: 6px; }
.table-empty { padding: 28px 8px !important; color: var(--muted); text-align: center; }
.report-page { display: flex; flex-direction: column; gap: 20px; }
.report-filter { display: grid; grid-template-columns: minmax(180px,1fr) minmax(180px,1fr) auto; align-items: end; gap: 12px; }
.report-filter .button { height: 42px; }
.report-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.report-summary > div { display: flex; align-items: center; gap: 12px; min-height: 88px; padding: 15px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.report-summary__icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 9px; color: var(--red); background: var(--red-soft); }
.report-summary__icon--blue { color: var(--blue); background: #dbeafe; }
.report-summary__icon--green { color: #15803d; background: #dcfce7; }
.report-summary small, .report-summary strong { display: block; }
.report-summary small { color: var(--muted); font-size: 10px; }
.report-summary strong { margin-top: 3px; font-size: 22px; }
.report-card { padding: 18px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.report-card > .section-heading { margin-bottom: 15px; }
.report-card > .section-heading > .material-symbols-outlined { color: var(--red); font-size: 30px; }
.report-table td strong { display: block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-duration { font-family: "JetBrains Mono",monospace; }
.public-player-page { min-height: calc(100vh - 120px); display: grid; place-items: center; padding: 34px 16px; background: radial-gradient(circle at 0 0,rgba(255,218,214,.7),transparent 34%), var(--surface); }
.public-player-card { width: min(980px,100%); overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 20px 50px rgba(15,23,42,.12); }
.public-player-card__header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.public-player-card__header .brand { flex-shrink: 0; }
.public-player-card__header small { color: var(--muted); font-size: 11px; }
.public-player-frame { aspect-ratio: 16/9; background: #020617; }
.public-player-frame video, .public-player-frame audio { width: 100%; height: 100%; display: block; object-fit: contain; }
.public-player-card__body { padding: 24px; }
.public-player-card__body h1 { font-size: clamp(22px,4vw,34px); letter-spacing: -.04em; line-height: 1.25; }
.public-player-card__body p { max-width: 760px; margin-top: 10px; color: var(--muted); line-height: 1.7; }
.public-player-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; color: var(--muted); font-size: 11px; }
.public-player-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 16px; }
.public-player-tags span { padding: 4px 8px; border-radius: 999px; color: var(--blue); background: #eff6ff; font-size: 10px; }
.public-player-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.public-player-note { margin-top: 18px; color: var(--muted); font-size: 11px; }
.settings-note { margin-top: 14px; padding: 13px 15px; border-radius: 9px; color: var(--muted); background: var(--surface-soft); font-size: 11px; line-height: 1.6; }
.settings-preview { display: block; margin-top: 8px; padding: 10px 12px; overflow: auto; border-radius: 8px; color: var(--blue); background: #eff6ff; font: 11px "JetBrains Mono",monospace; white-space: nowrap; }
@media (max-width: 850px) { .user-layout { grid-template-columns: 1fr; } .upload-progress__item { grid-template-columns: 1fr 100px auto; } }
@media (max-width: 850px) { .report-filter { grid-template-columns: 1fr 1fr; } .report-filter .button { grid-column: 1/-1; } .report-summary { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .form-grid, .user-layout { grid-template-columns: 1fr; } .editor-page__heading { flex-direction: column; } .video-card__actions { grid-template-columns: 1fr 1fr; } .category-field--wide { grid-column: auto; } .public-player-card__header { align-items: flex-start; flex-direction: column; } .public-player-card__body { padding: 18px; } .report-filter { grid-template-columns: 1fr; } .report-filter .button { grid-column: auto; } }

/* Mobile layout: keep controls readable and touch-friendly. */
@media (max-width: 620px) {
    body { overflow-x: hidden; }
    .topbar { height: auto; }
    .topbar__inner { min-height: 60px; padding: 10px 12px; gap: 10px; }
    .topbar__actions { min-width: 0; gap: 5px; }
    .topbar__connection { max-width: 104px; overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
    .logout-button { min-height: 40px; padding: 7px 4px; font-size: 11px; }
    .page-shell { padding: 22px 12px 32px; }
    .dashboard { gap: 18px; }
    .breadcrumb { max-width: 100%; overflow-x: auto; padding-bottom: 2px; white-space: nowrap; }
    .dashboard-heading { gap: 14px; }
    .storage-widget { min-width: 0; }
    .storage-widget__body { min-width: 0; }
    .storage-widget strong { font-size: 12px; }
    .control-panel, .upload-panel, .editor-card, .report-card, .user-list-card { padding: 12px; }
    .filter-submit, .upload-submit { width: 100%; min-height: 44px; }
    .dropzone { min-height: 135px; padding: 16px 10px; }
    .dropzone strong { font-size: 13px; line-height: 1.45; }
    .dropzone small { font-size: 10px; line-height: 1.45; }
    .category-field__label { align-items: flex-start; flex-wrap: wrap; gap: 2px 6px; }
    .category-field__label small { white-space: normal; line-height: 1.35; }
    .tag-editor input, .form-field .tag-editor input, .form-field .tag-editor input:focus { min-width: 110px; }
    .thumbnail-candidates { padding: 8px; }
    .thumbnail-candidates__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .thumbnail-candidate { min-height: 44px; }
    .upload-progress__item { grid-template-columns: 1fr; gap: 6px; }
    .upload-progress__bar { width: 100%; }
    .video-grid { grid-template-columns: 1fr; gap: 12px; }
    .video-card__meta { flex-wrap: wrap; }
    .video-card__actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .video-card__actions .button { min-height: 44px; padding: 8px 6px; font-size: 12px; white-space: normal; line-height: 1.25; }
    .section-heading { align-items: flex-start; }
    .section-heading h2 { font-size: 20px; }
    .view-toggle button, .icon-button { min-width: 44px; min-height: 44px; }
    .modal { padding: 10px; }
    .modal__card { max-height: 94vh; }
    .modal__header, .modal__body { padding: 14px; }
    .modal__header { gap: 10px; }
    .embed-tabs { grid-template-columns: 1fr; }
    .embed-tabs button { min-height: 44px; }
    .embed-code > div { align-items: flex-start; flex-wrap: wrap; gap: 8px; }
    .user-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .user-table { min-width: 680px; }
    .report-table { min-width: 620px; }
    .public-player-card__header { padding: 14px; }
    .public-player-actions .button { width: 100%; min-height: 44px; }
}
