/* ==========================================================
   ÁREA DEV — referência: Dashboard de Projetos Lider BPO.png
   ========================================================== */
body.admin { background: #F3F6FB; }
.admin-shell { --sb-w: 272px; display: flex; min-height: 100vh; background: linear-gradient(90deg, #08204A 0 var(--sb-w), transparent var(--sb-w)); transition: background .25s var(--ease); }
body.sb-recolhido .admin-shell { --sb-w: 84px; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky; top: 0; height: 100vh; width: var(--sb-w); flex: none; overflow-y: auto; overflow-x: hidden;
  transition: width .25s var(--ease);
  display: flex; flex-direction: column; padding: 22px 16px 20px;
  background: linear-gradient(180deg, #071A3C 0%, #0A2450 100%); color: rgba(255, 255, 255, .86);
  z-index: 60;
}
.sidebar-brand {
  position: relative; display: flex; align-items: center; min-height: 64px; margin-bottom: 18px; padding: 4px 8px; border-radius: 12px;
  cursor: pointer; transition: background-color .2s;
}
.sidebar-brand:hover { background: rgba(255, 255, 255, .06); }
.sidebar-brand .brand-full img { height: 56px; width: auto; }
.sidebar-brand .brand-icon { display: none; width: 44px; height: 44px; margin: 0 auto; }
.sidebar-brand::after { /* setinha indicando recolher/expandir */
  content: ""; position: absolute; right: -2px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%;
  background: rgba(255, 255, 255, .12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18l-6-6 6-6'/%3E%3C/svg%3E") no-repeat center / 14px;
  opacity: 0; transition: opacity .2s, transform .25s;
}
.sidebar-brand:hover::after, .sidebar-brand:focus-visible::after { opacity: 1; }

/* Menu recolhido (só ícones) */
body.sb-recolhido .sidebar { padding-left: 12px; padding-right: 12px; }
body.sb-recolhido .sidebar-brand { justify-content: center; padding: 4px 0; }
body.sb-recolhido .sidebar-brand .brand-full { display: none; }
body.sb-recolhido .sidebar-brand .brand-icon { display: block; }
body.sb-recolhido .sidebar-brand::after { right: -8px; transform: rotate(180deg); }
body.sb-recolhido .side-link, body.sb-recolhido .side-sub { justify-content: center; padding: 12px 0; }
body.sb-recolhido .side-link > span, body.sb-recolhido .side-sub > span:not(.side-plus) { display: none; }
body.sb-recolhido .side-sub .icon { position: static; opacity: .85; width: 20px; height: 20px; }
body.sb-recolhido .side-plus { display: none; }
body.sb-recolhido .side-link--group { display: none; }
body.sb-recolhido .side-link.is-active::before { left: -12px; }
body.sb-recolhido .sidebar-card { padding: 14px 6px; }
body.sb-recolhido .sidebar-card p, body.sb-recolhido .sidebar-foot { display: none; }
body.sb-recolhido .sidebar-card .icon { margin-bottom: 0; width: 34px; height: 34px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.side-link, .side-sub {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px;
  font-size: .975rem; font-weight: 500; color: rgba(255, 255, 255, .86); transition: background-color .2s, color .2s;
}
.side-link .icon { width: 22px; height: 22px; }
.side-link:hover, .side-sub:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-link.is-active { background: rgba(255, 255, 255, .1); color: #fff; }
.side-link.is-active::before {
  content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--blue-500);
}
.side-link--group { cursor: default; }
.side-link--group:hover { background: transparent; }
.side-group { display: flex; flex-direction: column; gap: 4px; }
.side-sub { padding: 10px 14px 10px 50px; font-size: .925rem; }
.side-sub .icon { width: 18px; height: 18px; position: absolute; left: 22px; opacity: .7; }
.side-sub.is-active { background: var(--blue-600); color: #fff; box-shadow: 0 8px 18px rgba(21, 112, 239, .35); }
.side-sub.is-active .icon { opacity: 1; }
.side-plus {
  margin-left: auto; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; color: var(--blue-600);
}
.side-plus .icon { position: static; width: 16px; height: 16px; opacity: 1; }
.side-sub--novo:not(.is-active) .side-plus { background: rgba(255, 255, 255, .14); color: #fff; }

.sidebar-card {
  margin-top: auto; padding: 22px 18px; border-radius: 16px; text-align: center;
  background: linear-gradient(160deg, #0E3470, #0B2A5C); border: 1px solid rgba(255, 255, 255, .08);
}
.sidebar-card .icon { width: 44px; height: 44px; margin: 0 auto 10px; color: #2B9BFF; }
.sidebar-card p { font-size: 1.05rem; line-height: 1.35; color: #fff; }
.sidebar-card strong { font-weight: 700; }
.sidebar-card em { font-family: var(--font-hand); font-style: normal; font-size: 1.45rem; }
.sidebar-foot { margin-top: 18px; padding: 0 8px; font-size: .8rem; line-height: 1.5; color: rgba(255, 255, 255, .6); }
.sidebar-veil { display: none; }

/* ---------- Topo ---------- */
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-top {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 16px;
  padding: 12px 32px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid #E5ECF6;
}
.admin-menu-btn { display: none; width: 42px; height: 42px; border-radius: 10px; place-items: center; color: var(--ink); background: var(--bg-soft); }
.admin-menu-btn .icon { width: 22px; height: 22px; }
.admin-search { position: relative; display: flex; align-items: center; flex: 0 1 460px; }
.admin-search > .icon { position: absolute; left: 14px; width: 20px; height: 20px; color: var(--muted); }
.admin-search input {
  width: 100%; height: 46px; padding: 0 92px 0 44px; border: 1px solid #DCE5F2; border-radius: 12px; background: #F7FAFE; color: var(--ink);
}
.admin-search input:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(43, 131, 246, .18); background: #fff; }
.admin-search .kbd { position: absolute; right: 12px; }

.user-menu { position: relative; margin-left: auto; }
.user-btn { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 12px; }
.user-btn:hover { background: var(--bg-soft); }
.avatar {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--navy-900); color: #fff; font-family: var(--font-title); font-weight: 600; font-size: .95rem;
}
.user-info { display: flex; flex-direction: column; text-align: left; line-height: 1.25; }
.user-info strong { font-size: .95rem; color: var(--ink); }
.user-info small { font-size: .8rem; color: var(--muted); }
.user-caret { width: 18px; height: 18px; color: var(--muted); }
.user-drop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; padding: 8px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .2s, transform .2s, visibility .2s;
}
.user-menu.is-open .user-drop { opacity: 1; visibility: visible; transform: none; }
.user-drop a, .user-drop button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; font-size: .925rem; color: var(--ink); text-align: left;
}
.user-drop a:hover, .user-drop button:hover { background: var(--bg-soft); }
.user-drop .icon { width: 18px; height: 18px; color: var(--muted); }

/* ---------- Conteúdo ---------- */
.admin-content { padding: 28px 32px 56px; width: 100%; max-width: 1480px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: .875rem; color: #8C99AE; }
.crumbs a:hover { color: var(--blue-600); }
.crumbs .sep { width: 14px; height: 14px; }
.page-title { margin-top: 6px; font-size: clamp(1.6rem, 1.3rem + 1vw, 2.2rem); font-weight: 700; letter-spacing: -.01em; }
.page-sub { margin-top: 6px; color: #4A5D7A; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.page-actions .btn, .form-foot .btn { border-radius: 12px; }

.btn .icon { transition: none; }
.btn:hover .icon { transform: none; }
.btn-outline { background: #fff; }
.btn-block { width: 100%; }
.btn-danger { background: #DC2E3B; color: #fff; }
.btn-danger:hover { background: #C21F2C; }
.btn-ghost-danger { color: #C21F2C; padding: .9em 1.2em; border-radius: 12px; }
.btn-ghost-danger:hover { background: #FDECEC; }

.card { background: #fff; border: 1px solid #E5ECF6; border-radius: 18px; box-shadow: 0 2px 10px rgba(11, 27, 58, .04); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title { display: flex; align-items: center; gap: 12px; font-size: 1.2rem; font-weight: 700; }
.card-bar { width: 10px; height: 20px; border-radius: 4px; border: 2.5px solid var(--blue-600); flex: none; }
.card-bar--amber { border-color: #E39B12; }
.card-sub { margin: 4px 0 18px 22px; font-size: .9rem; color: #5E6E88; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: .35em .75em; border-radius: 999px; font-size: .75rem; font-weight: 600; line-height: 1; white-space: nowrap; }
.badge .icon { width: 13px; height: 13px; }
.badge-rascunho { background: #EEF1F6; color: #4A5D7A; }
.badge-pub { background: #E3F6EA; color: #137A3D; }
.badge-star { background: #FFF4D6; color: #9A6700; }

/* KPIs do painel */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.kpi {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 16px; align-items: center;
  padding: 20px 22px; border-radius: 18px; background: #fff; border: 1px solid #E5ECF6; transition: transform .2s, box-shadow .2s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-icon { grid-row: span 2; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--blue-50); color: var(--blue-600); }
.kpi-icon .icon { width: 26px; height: 26px; }
.kpi-val { font-family: var(--font-title); font-weight: 700; font-size: 1.9rem; color: var(--ink); line-height: 1.1; }
.kpi-label { font-size: .9rem; color: #5E6E88; }
.panel-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; }
.panel-grid > * { min-width: 0; }
.panel-grid .card { padding: 22px 24px; }
.mini-list li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid #EEF2F8; }
.mini-list li:first-child { border-top: 0; }
.mini-list img { width: 64px; height: 40px; object-fit: cover; border-radius: 8px; flex: none; }
.mini-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mini-info a { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-info a:hover { color: var(--blue-600); }
.mini-info small { color: var(--muted); font-size: .8rem; }
.count-pill { padding: .3em .8em; border-radius: 999px; background: #FFF4D6; color: #9A6700; font-weight: 700; font-size: .85rem; }
.pend-list li { display: flex; flex-direction: column; gap: 2px; padding: 11px 0; border-top: 1px solid #EEF2F8; }
.pend-list li:first-child { border-top: 0; }
.pend-list a { font-weight: 600; color: var(--ink); }
.pend-list a:hover { color: var(--blue-600); }
.pend-list span { font-size: .82rem; color: #8A5A00; }
.empty-mini { color: var(--muted); font-size: .9rem; padding: 8px 0; }
.empty-mini.ok { display: flex; align-items: center; gap: 8px; color: #137A3D; }
.empty-mini.ok .icon { width: 20px; height: 20px; }

/* ---------- Lista de projetos ---------- */
.list-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 16px; margin-bottom: 16px; }
.list-filters .fld { margin: 0; flex: 1 1 180px; }
.list-filters .fld--grow { flex: 2.5 1 280px; }
.list-filters.js-auto .filter-submit { display: none; }
.rows { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto auto; gap: 18px; align-items: center; padding: 14px 18px; border-top: 1px solid #EEF2F8; }
.row:first-child { border-top: 0; }
.row:hover { background: #FAFCFF; }
.row-thumb { width: 96px; height: 60px; object-fit: cover; border-radius: 10px; }
.row-title { font-weight: 600; font-size: 1.02rem; color: var(--ink); }
.row-title:hover { color: var(--blue-600); }
.row-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: .82rem; color: var(--muted); }
.row-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 360px; }
.row-actions { display: flex; gap: 6px; }
.icon-action { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: #4A5D7A; transition: background-color .2s, color .2s; }
.icon-action .icon { width: 19px; height: 19px; }
.icon-action:hover { background: var(--blue-50); color: var(--blue-600); }
.icon-action--danger:hover { background: #FDECEC; color: #C21F2C; }
.list-count { margin-top: 10px; font-size: .85rem; color: var(--muted); }
.empty-big { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 48px 24px; }
.empty-big > .icon { width: 38px; height: 38px; color: var(--blue-500); }
.empty-big h2 { font-size: 1.2rem; }

/* ---------- Campos ---------- */
.fld { display: flex; flex-direction: column; gap: 7px; position: relative; margin-bottom: 18px; }
.fld-label { font-size: .9rem; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fld-hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
.req { color: #E02D3C; font-weight: 700; }
.fld input[type="text"], .fld input[type="search"], .fld input[type="date"], .fld input[type="password"], .fld select, .fld textarea {
  width: 100%; border: 1px solid #D9E2EF; border-radius: 10px; background: #fff; color: var(--ink);
  font-size: .95rem; padding: 12px 14px; transition: border-color .2s, box-shadow .2s;
}
.fld select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7A93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 18px; }
.fld textarea { resize: vertical; min-height: 84px; line-height: 1.5; font-family: var(--font-body); }
.fld input::placeholder, .fld textarea::placeholder { color: #9AA6B8; }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(43, 131, 246, .16); }
.fld-icon { position: relative; display: flex; align-items: center; }
.fld-icon > .icon { position: absolute; left: 13px; width: 19px; height: 19px; color: var(--muted); pointer-events: none; }
.fld-icon input { padding-left: 42px !important; }
.fld-count { align-self: flex-end; margin-top: -2px; font-size: .75rem; color: #8C99AE; }
.fld-count.is-limit { color: #C21F2C; font-weight: 600; }
.fld.has-error input, .fld.has-error select, .fld.has-error textarea { border-color: #E02D3C; box-shadow: 0 0 0 3px rgba(224, 45, 60, .12); }
.fld-erro { display: flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 500; color: #C21F2C; }
.fld-erro .icon { width: 15px; height: 15px; }
.fld-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.status-select { position: relative; display: block; }
.status-select::before { content: ""; position: absolute; left: 14px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: #9AA6B8; pointer-events: none; }
.status-select[data-status-tom="verde"]::before { background: #16A34A; }
.status-select[data-status-tom="azul"]::before { background: var(--blue-600); }
.status-select[data-status-tom="ambar"]::before { background: #D99100; }
.status-select select { padding-left: 32px; }

/* Interruptor (destaque) */
.toggle-row { margin-top: 4px; }
.switch { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { position: relative; width: 50px; height: 28px; flex: none; border-radius: 999px; background: #CBD5E3; transition: background-color .2s; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s var(--ease); }
.switch input:checked + .switch-ui { background: var(--blue-600); }
.switch input:checked + .switch-ui::after { transform: translateX(22px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid var(--blue-400); outline-offset: 2px; }
.switch-txt { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; font-size: .925rem; color: var(--ink); }
.switch-txt .star { width: 20px; height: 20px; color: #F5B301; grid-row: span 2; }
.switch-txt small { grid-column: 2; color: var(--muted); font-size: .8rem; }

/* ---------- Formulário de projeto ---------- */
.form-alert {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; margin-bottom: 20px; border-radius: 14px;
  background: #FDECEC; border: 1px solid #F6C4C8; color: #8E1620;
}
.form-alert .icon { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.form-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(330px, 1fr); gap: 20px; align-items: start; }
.form-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.form-card { padding: 24px 24px 8px; }
.fc-media { padding-bottom: 20px; }
.fc-preview { position: sticky; top: 92px; padding-bottom: 22px; }
.fc-tech { padding-bottom: 22px; }
.info-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0 24px; }

/* Mídia */
.media-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.media-tab {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 10px; border-radius: 10px;
  background: #F1F5FB; color: #3D4F6B; font-size: .875rem; font-weight: 500; transition: background-color .2s, color .2s;
}
.media-tab .icon { width: 18px; height: 18px; }
.media-tab.is-active { background: var(--blue-600); color: #fff; }
.media-label { font-size: .9rem; font-weight: 600; color: var(--ink); margin: 6px 0 8px; }
.media-label small { font-weight: 400; color: var(--muted); }
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  padding: 24px 16px; border: 2px dashed #A9C7F0; border-radius: 14px; background: #F7FAFF; cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--blue-600); background: #EEF5FF; }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone:focus-within { outline: 3px solid var(--blue-400); outline-offset: 2px; }
.dz-icon { width: 38px; height: 38px; color: var(--blue-600); }
.dz-txt { font-size: .925rem; color: var(--ink); }
.dz-txt u { color: var(--blue-600); text-decoration: none; font-weight: 500; }
.dropzone small { font-size: .78rem; color: var(--muted); }
.dropzone--capa { padding: 18px 12px; }
.capa-box { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: stretch; margin-bottom: 8px; }
.capa-box:not(:has(.thumb)) { grid-template-columns: 1fr; }
.thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.thumb { position: relative; margin: 0; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: #E9EFF7; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: opacity .2s, filter .2s; }
.thumb--capa { width: 132px; aspect-ratio: auto; }
.thumb-new { outline: 2px solid var(--blue-500); outline-offset: -2px; }
.thumb-x {
  position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(0, 0, 0, .2); cursor: pointer;
}
.thumb-x input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.thumb-x .icon { width: 15px; height: 15px; }
.thumb-x:hover { background: #FDECEC; color: #C21F2C; }
.thumb.is-removed img { opacity: .25; filter: grayscale(1); }
.thumb.is-removed::after { content: "Será removida"; position: absolute; left: 6px; bottom: 6px; padding: 2px 8px; border-radius: 999px; background: #C21F2C; color: #fff; font-size: .7rem; font-weight: 600; }
.thumb.is-removed .thumb-x { background: #C21F2C; color: #fff; }
.thumb-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--blue-600); font-size: .8rem; font-weight: 500; background: #F1F5FB; border: 1px dashed #A9C7F0; }
.thumb-add .icon { width: 22px; height: 22px; }
.thumb-new .thumb-x { background: var(--blue-600); color: #fff; }
.video-atual { margin-bottom: 12px; }
.video-atual video { width: 100%; border-radius: 12px; background: #000; max-height: 220px; }
.video-atual.is-removed video { opacity: .3; }
.remove-line { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: .875rem; color: #C21F2C; cursor: pointer; }
.file-picked { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--blue-50); color: var(--ink); font-size: .875rem; display: flex; align-items: center; gap: 8px; }
.file-picked .icon { width: 18px; height: 18px; color: var(--blue-600); }
.file-picked button { margin-left: auto; color: #C21F2C; font-weight: 600; font-size: .8rem; }
.media-limit { margin-top: 12px; font-size: .78rem; color: var(--muted); }
.hint-box { display: flex; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #FFF6E5; color: #6B4100; font-size: .8rem; }
.hint-box .icon { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.upload-erro { margin-top: 8px; font-size: .82rem; color: #C21F2C; font-weight: 500; }

/* História */
.story-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.story-fld:last-child { grid-column: 1 / -1; }
.mini-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; }
.mini-icon .icon { width: 16px; height: 16px; }
.mini-icon--vermelho { background: #FDE8E8; color: #E02D3C; }
.mini-icon--ambar { background: #FFF2DC; color: #C77700; }
.mini-icon--azul { background: #E3EFFE; color: var(--blue-600); }
.mini-icon--roxo { background: #EEE9FE; color: #6D4AE0; }
.mini-icon--verde { background: #DDF6E7; color: #16A34A; }

/* Tecnologias */
.tech-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.tech-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 7px; border-radius: 12px; cursor: pointer;
  border: 1px solid #DCE5F2; background: #fff; font-size: .875rem; font-weight: 500; color: var(--ink); transition: all .15s;
}
.tech-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tech-chip:hover { border-color: var(--blue-500); }
.tech-chip.is-on { border-color: var(--blue-600); background: var(--blue-50); color: var(--blue-600); box-shadow: inset 0 0 0 1px var(--blue-600); }
.tech-chip:focus-within { outline: 3px solid var(--blue-400); outline-offset: 2px; }
.tc-badge { display: grid; place-items: center; min-width: 30px; height: 26px; padding: 0 6px; border-radius: 7px; background: var(--tech-cor); color: #fff; font-family: var(--font-title); font-weight: 700; font-size: .72rem; }
.tc-badge.is-light { color: #1B1B1B; }
.tc-icon { display: grid; place-items: center; width: 30px; height: 26px; color: var(--blue-600); }
.tc-icon .icon { width: 20px; height: 20px; }
.tech-chip.is-hidden { display: none; }

/* Pré-visualização */
.preview-card { border: 1px solid #E5ECF6; border-radius: 16px; padding: 12px; margin-bottom: 16px; }
.preview-img { aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: var(--navy-900); margin-bottom: 14px; }
.preview-img img { width: 100%; height: 100%; object-fit: cover; }
.preview-title { margin: 10px 0 6px; font-size: 1.15rem; font-weight: 700; word-break: break-word; }
.preview-resumo { font-size: .9rem; color: #4A5D7A; word-break: break-word; }
.preview-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: .85rem; color: var(--ink); }
.preview-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.preview-meta .icon { width: 18px; height: 18px; color: var(--ink); }
.preview-note { margin-top: 10px; font-size: .8rem; color: var(--muted); text-align: center; }

.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; padding-top: 20px; border-top: 1px solid #E1E8F2; flex-wrap: wrap; }
.form-foot-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.saving { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; gap: 12px; background: rgba(243, 246, 251, .75); font-weight: 600; color: var(--ink); backdrop-filter: blur(2px); }
.saving[hidden] { display: none; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #CFE0F7; border-top-color: var(--blue-600); animation: girar .8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: min(440px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 14px 14px 16px; border-radius: 14px; background: #fff;
  box-shadow: var(--shadow-lg); border-left: 5px solid var(--blue-600); font-size: .925rem; color: var(--ink);
  animation: toastIn .35s var(--ease);
}
.toast > .icon { width: 22px; height: 22px; flex: none; }
.toast span { flex: 1; }
.toast--sucesso { border-left-color: #16A34A; } .toast--sucesso > .icon { color: #16A34A; }
.toast--erro { border-left-color: #E02D3C; } .toast--erro > .icon { color: #E02D3C; }
.toast--aviso { border-left-color: #E39B12; } .toast--aviso > .icon { color: #E39B12; }
.toast-close { color: var(--muted); }
.toast-close .icon { width: 18px; height: 18px; }
.toast.is-leaving { opacity: 0; transform: translateX(20px); transition: opacity .3s, transform .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Modal de exclusão ---------- */
.confirm-modal { width: min(460px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 20px; box-shadow: var(--shadow-lg); }
.confirm-modal::backdrop { background: rgba(5, 20, 48, .55); backdrop-filter: blur(3px); }
.confirm-modal form { padding: 28px; text-align: center; }
.confirm-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: #FDE8E8; color: #E02D3C; }
.confirm-icon .icon { width: 30px; height: 30px; }
.confirm-modal h2 { font-size: 1.35rem; }
.confirm-modal p { margin-top: 10px; color: #4A5D7A; font-size: .95rem; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.confirm-actions .btn { border-radius: 12px; }

/* ---------- Login (referência "Opção 1 – Clean e Moderno") ---------- */
.login-page { min-height: 100vh; background: #051430; color: #fff; }
.lg-shell { position: relative; min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 40%) 1fr; isolation: isolate; overflow: hidden; }
.lg-photo { position: absolute; inset: 0 0 0 30%; z-index: -2; }
.lg-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 30%; }
.lg-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, #051430 0%, rgba(5, 20, 48, .55) 30%, rgba(5, 20, 48, .25) 60%, rgba(5, 20, 48, .45) 100%),
              linear-gradient(180deg, rgba(5, 20, 48, .1) 0%, rgba(5, 20, 48, .2) 55%, #051430 100%);
}
.lg-side {
  display: flex; flex-direction: column; padding: 48px clamp(28px, 4vw, 64px) 40px;
  background: linear-gradient(180deg, #071A3C 0%, #061633 60%, #051430 100%);
  box-shadow: 30px 0 60px rgba(5, 20, 48, .5);
}
.lg-brand img { height: 66px; width: auto; }
.lg-line { display: block; width: 52px; height: 3px; border-radius: 3px; background: var(--blue-500); margin: 56px 0 28px; }
.lg-title { color: #fff; font-size: clamp(2.6rem, 2rem + 2vw, 3.6rem); font-weight: 700; letter-spacing: -.02em; }
.lg-title span { color: var(--blue-500); }
.lg-sub { margin-top: 18px; font-size: clamp(1.15rem, 1rem + .5vw, 1.45rem); line-height: 1.35; color: #BFD7F7; }
.lg-list { display: flex; flex-direction: column; gap: 26px; margin-top: 44px; }
.lg-list li { display: flex; align-items: flex-start; gap: 18px; }
.lg-ic { display: grid; place-items: center; width: 44px; height: 44px; flex: none; color: #4EA2FF; }
.lg-ic .icon { width: 34px; height: 34px; stroke-width: 1.6; }
.lg-list strong { display: block; font-family: var(--font-title); font-weight: 600; font-size: 1.08rem; color: #fff; }
.lg-list small { display: block; margin-top: 2px; font-size: .92rem; color: #B5C4DB; line-height: 1.4; }
.lg-hand { margin-top: auto; padding-top: 40px; font-family: var(--font-hand); font-size: 1.85rem; line-height: 1.15; color: #9CCBFF; transform: rotate(-3deg); transform-origin: left; }

.lg-main { display: flex; align-items: center; justify-content: flex-start; padding: 40px 24px 40px 0; }
.lg-card {
  width: min(440px, 100%); margin-left: -48px; padding: 36px 36px 26px; border-radius: 26px; background: #fff; color: var(--ink);
  box-shadow: 0 40px 90px rgba(0, 0, 0, .45); text-align: center; position: relative;
}
.lg-lock { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; background: #E3EEFD; color: var(--blue-600); }
.lg-lock .icon { width: 28px; height: 28px; }
.lg-card h2 { font-size: 1.6rem; }
.lg-card-sub { margin-top: 8px; font-size: .95rem; color: #4A5D7A; }
.login-form { margin-top: 24px; text-align: left; }
.login-form .fld input { padding-top: 13px; padding-bottom: 13px; }
.lg-check { display: flex; align-items: flex-start; gap: 10px; margin: -2px 0 18px; font-size: .9rem; color: var(--ink); cursor: pointer; }
.lg-check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--blue-600); flex: none; }
.lg-check small { color: var(--muted); font-size: .78rem; }
.lg-btn { border-radius: 12px; padding: 1.05em; font-size: 1.05rem; }
.lg-enter { width: 20px; height: 20px; }
.lg-foot { margin-top: 20px; padding-top: 16px; border-top: 1px solid #E5ECF6; font-size: .82rem; color: #5E6E88; }
.fld-eye { position: absolute; right: 8px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; color: var(--muted); }
.fld-eye:hover { background: var(--bg-soft); color: var(--ink); }
.fld-eye .icon { width: 19px; height: 19px; }
.login-msg { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; padding: 10px 12px; border-radius: 10px; font-size: .875rem; font-weight: 500; }
.login-msg .icon { width: 17px; height: 17px; }
.login-msg--erro { background: #FDECEC; color: #A3141F; }
.login-msg--sucesso, .login-msg--aviso { background: var(--blue-50); color: var(--blue-600); }
.login-back { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; font-size: .9rem; color: #3D4F6B; }
.login-back:hover { color: var(--blue-600); }
.login-back .icon { width: 16px; height: 16px; }

@media (max-width: 900px) {
  .lg-shell { grid-template-columns: 1fr; }
  .lg-photo { inset: 0; }
  .lg-side { background: transparent; box-shadow: none; padding: 32px 20px 0; }
  .lg-line { margin: 26px 0 16px; }
  .lg-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 26px; }
  .lg-hand { display: none; }
  .lg-main { padding: 28px 16px 40px; justify-content: center; }
  .lg-card { margin-left: 0; }
}
@media (max-width: 520px) {
  .lg-brand img { height: 52px; }
  .lg-list { grid-template-columns: 1fr; gap: 14px; }
  .lg-list small { font-size: .85rem; }
  .lg-card { padding: 28px 22px 22px; }
}

/* Aviso de rascunho na página pública (visível só para a equipe) */
.draft-bar { position: relative; z-index: 31; background: #FFF4D6; color: #6B4100; text-align: center; font-size: .875rem; padding: 8px 16px; }
.draft-bar a { font-weight: 600; text-decoration: underline; }

/* ==========================================================
   Responsividade
   ========================================================== */
@media (max-width: 1280px) {
  .info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-grid { grid-template-columns: minmax(0, 1fr); }
  .row { grid-template-columns: 80px minmax(0, 1fr) auto; }
  .row-thumb { width: 80px; height: 50px; }
  .row-tags { grid-column: 2 / -1; justify-content: flex-start; max-width: none; grid-row: 2; }
  .row-actions { grid-column: 3; grid-row: 1; }
}
@media (max-width: 960px) {
  .sidebar { position: fixed; left: 0; top: 0; width: 272px; transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar-brand::after { display: none; }
  .sidebar.is-open { transform: none; }
  .sidebar-veil { position: fixed; inset: 0; z-index: 55; background: rgba(5, 20, 48, .45); }
  .sidebar.is-open + .sidebar-veil { display: block; }
  .admin-menu-btn { display: grid; }
  .admin-shell { background: none; }
  .admin-top { padding: 10px 16px; }
  .admin-content { padding: 22px 16px 48px; }
  .user-info { display: none; }
}
@media (max-width: 760px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-col { display: contents; }
  .fc-info { order: 1; } .fc-media { order: 2; } .fc-story { order: 3; } .fc-tech { order: 4; } .fc-preview { order: 5; position: static; }
  .info-grid, .story-fields { grid-template-columns: 1fr; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .admin-search .kbd { display: none; }
  .admin-search input { padding-right: 14px; }
  .row { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 14px; }
  .row-thumb { width: 64px; height: 42px; }
  .row-tags { grid-column: 1 / -1; grid-row: auto; }
  .row-actions { grid-column: 1 / -1; grid-row: auto; justify-content: flex-end; }
  .form-foot { flex-direction: column-reverse; align-items: stretch; }
  .form-foot-actions .btn { flex: 1; }
  .thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .mini-list li { flex-wrap: wrap; }
  .mini-info { flex-basis: calc(100% - 80px); }
  .mini-list .chip, .mini-list .badge { margin-left: 78px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi { grid-template-columns: 1fr; padding: 16px; row-gap: 6px; }
  .kpi-icon { grid-row: auto; width: 44px; height: 44px; }
  .fld-pair { grid-template-columns: 1fr; gap: 0; }
  .toasts { right: 16px; left: 16px; bottom: 16px; }
}

/* ---------- Janela de resultado (salvar / publicar / excluir) ---------- */
.result-modal { width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 24px; box-shadow: 0 40px 90px rgba(5, 20, 48, .35); overflow: visible; }
.result-modal::backdrop { background: rgba(5, 20, 48, .6); backdrop-filter: blur(4px); }
.result-modal[open] { animation: resultIn .35s var(--ease); }
@keyframes resultIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
.result-body { padding: 40px 34px 30px; text-align: center; }
.result-icon {
  display: grid; place-items: center; width: 88px; height: 88px; margin: -84px auto 18px; border-radius: 50%;
  color: #fff; border: 6px solid #fff; box-shadow: 0 14px 30px rgba(5, 20, 48, .2);
}
.result-icon .icon { width: 44px; height: 44px; stroke-width: 2.6; }
.result-modal--sucesso .result-icon { background: linear-gradient(145deg, #22C55E, #16A34A); }
.result-modal--erro .result-icon { background: linear-gradient(145deg, #F25562, #DC2E3B); }
.result-modal--aviso .result-icon { background: linear-gradient(145deg, #F5B301, #E39B12); }
.result-modal h2 { font-size: 1.7rem; }
.result-text { margin-top: 10px; color: #4A5D7A; font-size: 1.02rem; }
.result-list { margin: 18px 0 0; padding: 14px 16px 14px 34px; text-align: left; list-style: disc; border-radius: 14px; background: #F5F8FC; color: var(--ink); font-size: .9rem; }
.result-list li + li { margin-top: 6px; }
.result-modal--erro .result-list { background: #FDF0F1; color: #8E1620; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.result-actions .btn { border-radius: 12px; }
.btn-link { color: var(--blue-600); padding: .95em 1em; }
.btn-link:hover { text-decoration: underline; }

.confirm-inner { padding: 28px; text-align: center; }

/* ---------- Mídias no formulário ---------- */
.media-label small { font-weight: 400; color: var(--muted); }
.capa-atual { margin: 0 0 12px; border-radius: 14px; overflow: hidden; border: 1px solid #DCE5F2; background: #F7FAFF; }
.capa-atual img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: #E9EFF7; }
.capa-acoes { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
.capa-tag { margin-right: auto; font-size: .8rem; font-weight: 600; color: #3D4F6B; }
.mini-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 9px; font-size: .82rem; font-weight: 600;
  background: #fff; border: 1px solid #D9E2EF; color: var(--ink); transition: background-color .15s, border-color .15s, color .15s;
}
.mini-btn .icon { width: 16px; height: 16px; }
.mini-btn:hover { border-color: var(--blue-500); color: var(--blue-600); }
.mini-btn--danger { color: #C21F2C; }
.mini-btn--danger:hover { background: #FDECEC; border-color: #F3B6BC; color: #A3141F; }
.thumb .thumb-x {
  width: 32px; height: 32px; top: 6px; right: 6px; border: 0; background: rgba(255, 255, 255, .95); color: #C21F2C;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.thumb .thumb-x .icon { width: 17px; height: 17px; }
.thumb .thumb-x:hover { background: #DC2E3B; color: #fff; }
.thumb.is-removing { opacity: .4; pointer-events: none; }
.media-help { margin-top: 8px; font-size: .78rem; color: var(--muted); }
.video-atual, .video-novo { margin-bottom: 12px; border-radius: 14px; overflow: hidden; border: 1px solid #DCE5F2; background: #F7FAFF; }
.video-atual video, .video-novo video { display: block; width: 100%; max-height: 240px; background: #000; border-radius: 0; }
.video-erro { display: flex; gap: 8px; margin: 10px 12px 0; padding: 10px 12px; border-radius: 10px; background: #FDECEC; color: #8E1620; font-size: .82rem; }
.video-erro .icon { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.destaque-info { margin: 12px 0 6px 64px; padding: 12px 14px; border-radius: 12px; background: #FFF8E6; border: 1px solid #F6E0A6; font-size: .82rem; color: #6B4100; }
.destaque-info ol { margin: 6px 0; padding-left: 18px; color: var(--ink); }
.destaque-info small { color: #8A5A00; }
@media (max-width: 480px) { .destaque-info { margin-left: 0; } }

.row-actions form { display: contents; }
.icon-star { color: #9AA6B8; }
.icon-star:hover { background: #FFF4D6; color: #E39B12; }
.icon-star.is-on { color: #F5B301; }

/* Aviso de alterações não salvas */
.badge-sujo { background: #FFF1D6; color: #8A5300; margin-left: 6px; }
.badge-sujo::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #E39A00; vertical-align: 1px; }

/* "Usar como capa" na miniatura da galeria */
.thumb-capa {
  position: absolute; left: 6px; right: 6px; bottom: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: 24px; padding: 0 6px; border-radius: 7px; background: rgba(11, 27, 58, .82); color: #fff; font-size: .7rem; font-weight: 600; line-height: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s, background-color .2s;
}
.thumb-capa .icon { width: 13px; height: 13px; flex: none; }
.thumb .thumb-x { z-index: 2; }
.thumb-capa:hover { background: var(--blue-600); }
.thumb:hover .thumb-capa, .thumb:focus-within .thumb-capa { opacity: 1; transform: none; }
@media (hover: none) { .thumb-capa { opacity: 1; transform: none; } }
.confirm-icon > span { display: grid; place-items: center; }
.confirm-modal.is-alert .confirm-icon { background: #FFF1D6; color: #B86E00; }

/* Galeria: mudar a ordem arrastando */
.thumb--salva { cursor: grab; touch-action: auto; }
.thumb--salva:focus-visible { outline: 3px solid var(--blue-500); outline-offset: 2px; }
.thumb-grip {
  position: absolute; top: 6px; left: 6px; z-index: 2; display: grid; place-items: center; width: 26px; height: 32px; border-radius: 8px;
  background: rgba(255, 255, 255, .92); color: #4A5D7A; box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
  opacity: 0; transition: opacity .2s; touch-action: none; cursor: grab;
}
.thumb-grip .icon { width: 16px; height: 16px; }
.thumb--salva:hover .thumb-grip, .thumb--salva:focus .thumb-grip { opacity: 1; }
@media (hover: none) { .thumb-grip { opacity: 1; } }
.thumbs.is-sorting .thumb--salva { cursor: grabbing; }
.thumbs.is-sorting .thumb-capa, .thumbs.is-sorting .thumb-x { opacity: 0 !important; pointer-events: none; }
.thumb.is-dragging { opacity: .55; outline: 2px dashed var(--blue-500); outline-offset: -2px; pointer-events: none; z-index: 3; }
.thumbs.is-saving .thumb--salva { cursor: progress; }
