/* =========================================================================
   MultiChannel Portal — folha de estilos
   ========================================================================= */
:root {
  --bg: #eef1f7;
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --nav: #0e1626;
  --nav-2: #0a1120;
  --nav-hover: rgba(255, 255, 255, 0.06);
  --nav-active: rgba(91, 108, 240, 0.20);
  --border: #e2e7f0;
  --border-strong: #ccd4e2;
  --text: #141b2e;
  --text-2: #5a6478;
  --text-3: #8a93a6;
  --primary: #4759e8;
  --primary-600: #3a49ce;
  --primary-100: #eaecfd;
  --accent: #17c0d9;
  --success: #0ca678;
  --success-100: #e3f7f0;
  --danger: #e5484d;
  --danger-100: #fcebec;
  --warn: #e8850c;
  --r: 12px;
  --r-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.05);
  --shadow: 0 4px 14px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 18px 50px rgba(14, 22, 38, 0.18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.015em; font-weight: 700; }

/* ------------------------------------------------------------------ Layout */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 264px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--nav) 0%, var(--nav-2) 100%);
  color: #c8d0e0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ------------------------------------------------------------------- Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 20px 18px;
}
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; display: block; }
.brand-name {
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.brand-name b { color: var(--accent); font-weight: 700; }

/* --------------------------------------------------------------------- Nav */
.nav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; }
.nav-label {
  color: #6b7690;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin: 16px 10px 7px;
}
.nav-label:first-child { margin-top: 4px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  color: #b5bed2;
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--nav-hover); color: #fff; text-decoration: none; }
.nav-link.active {
  background: var(--nav-active);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }
.nav-link.active svg { opacity: 1; }

/* ------------------------------------------------------------ Sidebar foot */
.sidebar-footer { padding: 14px 14px 16px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.user { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff; font-weight: 700; font-size: 14px;
  display: grid; place-items: center; flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; min-width: 0; }
.user-name {
  color: #fff; font-size: 13.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role { color: #7c88a0; font-size: 11.5px; }

.btn-logout {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px; border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent; color: #c8d0e0;
  border-radius: var(--r-sm); font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.btn-logout:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.2); color: #fff; }
.btn-logout svg { width: 16px; height: 16px; }

/* ------------------------------------------------------------------ Topbar */
.topbar {
  height: 62px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 26px;
  position: sticky; top: 0; z-index: 30;
}
.topbar-title { font-size: 17px; font-weight: 700; }
.menu-toggle {
  display: none;
  width: 38px; height: 38px; border: 1px solid var(--border);
  background: var(--surface); border-radius: var(--r-sm);
  font-size: 18px; cursor: pointer; color: var(--text);
}

.content { padding: 28px 26px 56px; max-width: 1120px; width: 100%; margin: 0 auto; }

/* ------------------------------------------------------------------- Flash */
.flash {
  padding: 12px 16px; border-radius: var(--r-sm);
  margin-bottom: 20px; font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 9px;
  border: 1px solid transparent;
}
.flash-success { background: var(--success-100); color: #0a7a5a; border-color: #b6e6d5; }
.flash-error { background: var(--danger-100); color: #b42a2f; border-color: #f3c9cb; }

/* ------------------------------------------------------------------ Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; margin: 0 0 16px;
}
.section-head h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); font-weight: 700; }
.section-head .count { color: var(--text-3); font-size: 13px; font-weight: 500; }

.page-intro { color: var(--text-2); margin: -4px 0 26px; max-width: 640px; }

/* -------------------------------------------------------------- Video grid */
.cat-block { margin-bottom: 34px; }
.cat-title {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-2);
  margin-bottom: 14px;
}
.cat-title::before {
  content: ""; width: 7px; height: 7px; border-radius: 2px;
  background: var(--accent); flex-shrink: 0;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 18px;
}

.video-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
  display: flex; flex-direction: column;
}
.video-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); text-decoration: none; }
.thumb { position: relative; aspect-ratio: 16 / 9; background: #0e1626; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(14, 22, 38, 0) 40%, rgba(14, 22, 38, 0.35) 100%);
  opacity: 0; transition: opacity 0.16s;
}
.video-card:hover .thumb .play { opacity: 1; }
.play-btn {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.95); display: grid; place-items: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.play-btn svg { width: 22px; height: 22px; margin-left: 3px; color: var(--primary); }
.video-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.video-title { font-size: 14.5px; font-weight: 600; color: var(--text); line-height: 1.35; }
.video-desc { font-size: 12.8px; color: var(--text-2); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ------------------------------------------------------------- Watch page */
.watch { display: grid; grid-template-columns: 1fr 300px; gap: 26px; align-items: start; }
.player {
  aspect-ratio: 16 / 9; background: #000; border-radius: var(--r);
  overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border);
}
.player iframe { width: 100%; height: 100%; border: 0; display: block; }
.watch-meta { margin-top: 18px; }
.watch-meta h1 { font-size: 22px; margin-bottom: 8px; }
.watch-cat {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--primary);
  background: var(--primary-100); padding: 3px 10px; border-radius: 999px;
  margin-bottom: 12px;
}
.watch-desc { color: var(--text-2); white-space: pre-line; line-height: 1.6; }

.related-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-2); font-weight: 700; margin-bottom: 12px; }
.related-item { display: flex; gap: 11px; padding: 8px; border-radius: var(--r-sm); transition: background 0.14s; }
.related-item:hover { background: var(--surface-2); text-decoration: none; }
.related-thumb { width: 96px; aspect-ratio: 16/9; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: #0e1626; }
.related-name { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ----------------------------------------------------------------- Manual */
.manual-layout { display: grid; grid-template-columns: 232px 1fr; gap: 34px; align-items: start; }
.toc {
  position: sticky; top: 86px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 10px; box-shadow: var(--shadow-sm);
}
.toc-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); font-weight: 700; padding: 8px 10px 6px; }
.toc a {
  display: block; padding: 7px 10px; border-radius: 7px;
  color: var(--text-2); font-size: 13.5px; font-weight: 500;
  line-height: 1.35;
}
.toc a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.toc a.active { background: var(--primary-100); color: var(--primary-600); font-weight: 600; }

.manual-index-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.manual-card {
  display: flex; align-items: center; gap: 13px;
  padding: 16px 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--shadow-sm); transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.manual-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); text-decoration: none; }
.manual-card .n {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: var(--primary-100); color: var(--primary-600);
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.manual-card span.t { font-weight: 600; color: var(--text); font-size: 14.5px; }

/* Conteudo do manual (prosa) */
.prose { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 34px 40px; box-shadow: var(--shadow-sm); }
.prose h1 { font-size: 26px; margin-bottom: 18px; }
.prose h2 { font-size: 19px; margin: 30px 0 12px; padding-top: 6px; }
.prose h3 { font-size: 15.5px; margin: 22px 0 8px; color: var(--text); }
.prose p { margin: 0 0 14px; color: #2b3446; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; color: #2b3446; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--primary); }
.prose strong { color: var(--text); font-weight: 600; }
.prose code {
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 5px; font-size: 0.88em;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: #b4265f;
}
.prose blockquote {
  margin: 16px 0; padding: 12px 18px;
  background: var(--surface-2); border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0; color: var(--text-2);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 26px 0; }
.prose a { text-decoration: underline; }

.manual-nav { display: flex; justify-content: space-between; gap: 14px; margin-top: 22px; }
.manual-nav a {
  flex: 1; padding: 14px 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--shadow-sm); transition: border-color 0.15s, box-shadow 0.15s;
}
.manual-nav a:hover { border-color: var(--border-strong); box-shadow: var(--shadow); text-decoration: none; }
.manual-nav a.next { text-align: right; }
.manual-nav .dir { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); font-weight: 600; display: block; margin-bottom: 3px; }
.manual-nav .lbl { font-weight: 600; color: var(--text); font-size: 14px; }

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--r-sm);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); text-decoration: none; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); text-decoration: none; }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #f0c3c5; }
.btn-danger:hover { background: var(--danger-100); text-decoration: none; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }

/* --------------------------------------------------------------- Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 30px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.stat .v { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; color: var(--text); line-height: 1; }
.stat .k { color: var(--text-2); font-size: 13px; font-weight: 500; margin-top: 7px; }
.stat .v span { font-size: 15px; color: var(--text-3); font-weight: 600; }

.quick-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.quick {
  display: flex; align-items: center; gap: 13px; padding: 17px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--shadow-sm); transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.quick:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); text-decoration: none; }
.quick-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-100); color: var(--primary-600); display: grid; place-items: center; flex-shrink: 0; }
.quick-ico svg { width: 20px; height: 20px; }
.quick .t { font-weight: 600; color: var(--text); font-size: 14.5px; }
.quick .d { font-size: 12.5px; color: var(--text-2); }

/* ---------------------------------------------------------------- Tables */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-sm); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3); font-weight: 700; padding: 13px 18px; background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
tbody td { padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
.td-name { font-weight: 600; color: var(--text); }
.td-sub { color: var(--text-2); font-size: 12.8px; }
.td-actions { text-align: right; white-space: nowrap; }
.td-actions form { display: inline; }
.td-actions .btn { margin-left: 6px; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.badge-admin { background: #efeafe; color: #6b3fd4; }
.badge-user { background: #e7effe; color: #2e5fd0; }
.badge-on { background: var(--success-100); color: #0a7a5a; }
.badge-off { background: #f0f1f4; color: #7a8296; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 5px 6px 5px 12px; border-radius: 999px; font-size: 13px; color: var(--text);
}
.chip form { display: inline-flex; }
.chip button {
  border: 0; background: transparent; cursor: pointer; color: var(--text-3);
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 14px;
}
.chip button:hover { background: var(--danger-100); color: var(--danger); }

/* ----------------------------------------------------------------- Forms */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-sm); padding: 26px 28px; max-width: 660px; }
.field { margin-bottom: 18px; }
.field:last-of-type { margin-bottom: 0; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.field .hint { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }
.input, .select, .textarea {
  width: 100%; padding: 10px 13px; font: inherit; font-size: 14px;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(71, 89, 232, 0.15);
}
.textarea { resize: vertical; min-height: 130px; line-height: 1.5; }
.textarea.code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; min-height: 340px; }
.form-row { display: grid; grid-template-columns: 1fr 140px; gap: 16px; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); }
.check span { font-size: 14px; color: var(--text); }
.form-actions { display: flex; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.form-error { background: var(--danger-100); color: #b42a2f; border: 1px solid #f3c9cb; padding: 11px 15px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500; margin-bottom: 20px; }

/* ----------------------------------------------------------- Empty state */
.empty { text-align: center; padding: 56px 24px; color: var(--text-2); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--r); }
.empty svg { width: 44px; height: 44px; color: var(--text-3); margin-bottom: 12px; }
.empty h3 { font-size: 16px; color: var(--text); margin-bottom: 6px; }
.empty p { margin: 0 0 18px; font-size: 14px; }

/* --------------------------------------------------------------- Login */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr;
  background: var(--bg);
}
.auth-brand {
  background: linear-gradient(150deg, #0e1626 0%, #17223c 55%, #1b2b4d 100%);
  color: #fff; padding: 56px 60px; display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.auth-brand::after {
  content: ""; position: absolute; right: -120px; bottom: -120px;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(23, 192, 217, 0.22) 0%, rgba(23, 192, 217, 0) 68%);
}
.auth-brand .brand { padding: 0; margin-bottom: auto; }
.auth-hero { position: relative; z-index: 1; margin: auto 0; }
.auth-hero h2 { font-size: 32px; line-height: 1.18; margin-bottom: 16px; letter-spacing: -0.02em; max-width: 420px; }
.auth-hero p { color: #a9b4cc; font-size: 15.5px; line-height: 1.6; max-width: 400px; }
.auth-points { list-style: none; padding: 0; margin: 28px 0 0; position: relative; z-index: 1; }
.auth-points li { display: flex; align-items: center; gap: 11px; color: #c8d0e0; font-size: 14.5px; margin-bottom: 13px; }
.auth-points svg { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; }

.auth-form-wrap { display: grid; place-items: center; padding: 40px; }
.auth-form { width: 100%; max-width: 380px; }
.auth-form h1 { font-size: 24px; margin-bottom: 6px; }
.auth-form .sub { color: var(--text-2); margin: 0 0 28px; font-size: 14.5px; }
.auth-form .field { margin-bottom: 16px; }

.brand-mark--lg { width: 40px; height: 40px; }

/* ---------------------------------------------------------------- Error */
.errpage { min-height: 100vh; display: grid; place-items: center; padding: 40px; text-align: center; }
.errpage .code { font-size: 74px; font-weight: 800; letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; line-height: 1; }
.errpage h1 { font-size: 22px; margin: 14px 0 8px; }
.errpage p { color: var(--text-2); margin: 0 0 24px; }

/* --------------------------------------------------------------- Overlay */
.overlay {
  display: none; position: fixed; inset: 0; background: rgba(14, 22, 38, 0.5);
  z-index: 35; backdrop-filter: blur(2px);
}

/* ------------------------------------------------------------ Responsive */
@media (max-width: 860px) {
  .watch { grid-template-columns: 1fr; }
  .manual-layout { grid-template-columns: 1fr; }
  .toc { position: static; margin-bottom: 22px; }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
}

@media (max-width: 720px) {
  .sidebar {
    position: fixed; left: 0; top: 0; transform: translateX(-100%);
    transition: transform 0.25s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: grid; place-items: center; }
  .overlay.show { display: block; }
  .content { padding: 22px 18px 48px; }
  .topbar { padding: 0 18px; }
  .prose { padding: 24px 22px; }
  .form-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* =========================================================================
   Capas, player e cadastro de usuarios
   ========================================================================= */
[hidden] { display: none !important; }

/* Busca de tutoriais */
.video-search { position: relative; max-width: 420px; margin: 0 0 22px; }
.video-search svg { position: absolute; left: 12px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.video-search .input { padding-left: 38px; }
.search-empty { color: var(--text-2); font-size: 14px; }

/* Player com capa */
.player-cover {
  position: absolute; inset: 0; width: 100%; height: 100%;
  padding: 0; border: 0; cursor: pointer; background: #0e1626; display: block;
}
.player-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.player-cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(14,22,38,0) 45%, rgba(14,22,38,.55) 100%);
  transition: background .2s;
}
.player-cover:hover::after { background: linear-gradient(180deg, rgba(14,22,38,.1) 0%, rgba(14,22,38,.6) 100%); }
.player-cover-play {
  position: absolute; left: 50%; top: 50%; z-index: 1;
  width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; color: var(--primary);
  box-shadow: 0 10px 30px rgba(0,0,0,.35); transition: transform .15s;
}
.player-cover-play svg { width: 30px; height: 30px; margin-left: 4px; }
.player-cover:hover .player-cover-play { transform: scale(1.07); }
.player-cover:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.player { position: relative; }
.player > iframe { position: absolute; inset: 0; }
.watch-next { margin-top: 16px; }

/* Editor de video */
.video-editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; align-items: start; }
.video-editor .form-card { max-width: none; }
.video-preview { position: sticky; top: 20px; }
.video-card--static { pointer-events: none; }
.video-card--static:hover { transform: none; }
.thumb-empty {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 16px;
  text-align: center; color: #8a93a6; font-size: 13px;
}
.preview-source { font-size: 12.5px; color: var(--text-3); margin: 10px 0 12px; min-height: 18px; }
.player--sm { margin-top: 12px; aspect-ratio: 16 / 9; border-radius: var(--r-sm); overflow: hidden; background: #000; }

.cover-drop {
  position: relative; border: 1.5px dashed var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface-2); padding: 18px; text-align: center; transition: border-color .15s, background .15s;
}
.cover-drop:hover, .cover-drop.drag { border-color: var(--primary); background: var(--primary-100); }
.cover-drop.has-file { border-style: solid; border-color: var(--success); background: var(--success-100); }
.cover-drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.cover-drop:focus-within { outline: 3px solid var(--primary-100); border-color: var(--primary); }
.cover-drop-text { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-2); font-size: 14px; pointer-events: none; }
.cover-drop-text svg { width: 26px; height: 26px; color: var(--text-3); margin-bottom: 2px; }
.cover-drop-text small { color: var(--text-3); font-size: 12px; }
.cover-file-name { display: block; margin-top: 8px; font-size: 13px; font-weight: 600; color: #0a7a5a; word-break: break-all; }

/* Usuarios: perfil e permissoes */
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-opt { cursor: pointer; }
.role-opt input { position: absolute; opacity: 0; pointer-events: none; }
.role-box {
  display: block; height: 100%; padding: 12px 14px; border: 1.5px solid var(--border);
  border-radius: var(--r-sm); background: var(--surface); transition: border-color .15s, background .15s;
}
.role-name { display: block; font-weight: 700; font-size: 14px; margin-bottom: 3px; }
.role-desc { display: block; font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.role-opt input:checked + .role-box { border-color: var(--primary); background: var(--primary-100); }
.role-opt input:focus-visible + .role-box { outline: 3px solid var(--primary-100); }
.perm-list { display: flex; flex-direction: column; gap: 10px; }
.check input:disabled + span { color: var(--text-3); }
.pass-wrap { display: flex; gap: 8px; }
.pass-wrap .input { flex: 1; }
td .badge + .badge { margin-left: 4px; }

@media (max-width: 960px) {
  .video-editor { grid-template-columns: 1fr; }
  .video-preview { position: static; }
}
@media (max-width: 560px) {
  .role-pick { grid-template-columns: 1fr; }
  .pass-wrap { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .player-cover-play, .cover-drop, .role-box { transition: none; }
}
