:root { --bg:#0a0b0d; --panel:#111318; --ink:#eae7df; --muted:#8d8a81; --gold:#d9a441; --hair:rgba(234,231,223,0.13); }
* { margin:0; padding:0; box-sizing:border-box; }
body { background:var(--bg); color:var(--ink); font-family:'Space Grotesk',sans-serif; font-weight:300; min-height:100vh; }
.shell { min-height:100vh; }
a { color:var(--gold); text-decoration:none; }
.side { position:fixed; top:0; left:0; bottom:0; width:232px; z-index:70; display:flex; flex-direction:column;
  background:var(--panel); border-right:1px solid var(--hair); padding:22px 0 0; }
.side .logo { font-size:15px; letter-spacing:0.28em; color:var(--ink); font-weight:500; }
.side .logo b { color:var(--gold); font-weight:500; }
.side .logo span { font-family:'Cormorant Garamond',serif; font-style:italic; letter-spacing:0.02em; color:var(--muted); font-size:14px; text-transform:none; }
.side nav { flex:1; overflow-y:auto; padding:10px 0 16px; }
.side nav a { color:var(--muted); padding:10px 12px; border-radius:8px; font-size:13.5px; }
.side nav a:hover { color:var(--ink); background:rgba(234,231,223,0.05); }
.side-foot { border-top:1px solid var(--hair); padding:14px 22px; display:flex; justify-content:space-between; font-size:12.5px; }
.content { margin-left:232px; padding:88px 44px 60px; min-width:0; }
h1 { font-weight:300; font-size:26px; margin-bottom:22px; }
h2 { font-weight:300; font-size:19px; margin:34px 0 14px; }
.page-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:22px; }
.page-head h1 { margin:0; }
.hint { color:var(--muted); font-size:13px; line-height:1.7; margin-bottom:22px; }
.flash { border-radius:10px; padding:12px 16px; font-size:13.5px; margin-bottom:20px; }
.flash.ok { background:rgba(120,190,90,0.12); border:1px solid rgba(120,190,90,0.4); color:#b9e29a; }
.flash.err { background:rgba(220,90,90,0.1); border:1px solid rgba(220,90,90,0.4); color:#eea; }
table { width:100%; border-collapse:collapse; font-size:13.5px; }
th { text-align:left; font-weight:400; font-size:11px; letter-spacing:0.14em; text-transform:uppercase; color:var(--muted); padding:10px 12px; border-bottom:1px solid var(--hair); }
td { padding:11px 12px; border-bottom:1px solid rgba(234,231,223,0.06); vertical-align:middle; }
td a { color:var(--ink); }
td a:hover { color:var(--gold); }
td code { color:var(--muted); font-size:12px; }
.acts { white-space:nowrap; text-align:right; }
.acts a, .acts form, .acts button { display:inline-block; vertical-align:middle; }
.acts a { margin-right:14px; }
.acts form { margin:0; }
.link-danger { background:none; border:none; color:#d77; font-family:inherit; font-size:13.5px; cursor:pointer; padding:0; }
.badge { font-size:11px; letter-spacing:0.08em; border-radius:999px; padding:4px 10px; border:1px solid var(--hair); color:var(--muted); }
.badge.published { border-color:rgba(217,164,65,0.55); color:var(--gold); }
.btn { display:inline-block; border:1px solid rgba(217,164,65,0.6); background:rgba(217,164,65,0.12); color:var(--ink); border-radius:999px; padding:11px 24px; font-family:inherit; font-size:12px; letter-spacing:0.08em; text-transform:uppercase; cursor:pointer; }
.btn:hover { background:rgba(217,164,65,0.22); }
.btn.ghost { border-color:var(--hair); background:transparent; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; max-width:860px; }
.form-grid .full { grid-column:1 / -1; }
label { display:flex; flex-direction:column; gap:7px; font-size:12px; letter-spacing:0.08em; text-transform:uppercase; color:var(--muted); }
label.check { flex-direction:row; align-items:center; gap:10px; text-transform:none; letter-spacing:0; font-size:13.5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], select, textarea {
  background:rgba(234,231,223,0.04); border:1px solid var(--hair); border-radius:10px; color:var(--ink);
  font-family:inherit; font-size:14px; font-weight:300; padding:11px 13px;
}
input:focus, select:focus, textarea:focus { border-color:rgba(217,164,65,0.6); outline:none; }
select option { background:#14161b; }
input[type=checkbox] { accent-color:var(--gold); width:16px; height:16px; }
textarea { resize:vertical; }
.actions { display:flex; gap:12px; margin-top:8px; }
.thumb { margin-top:8px; max-width:220px; border-radius:10px; border:1px solid var(--hair); }
.cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:14px; margin-bottom:12px; }
.stat-card { border:1px solid var(--hair); border-radius:14px; padding:20px; background:var(--panel); display:flex; flex-direction:column; gap:6px; }
.stat-card b { font-size:24px; font-weight:300; color:var(--ink); }
.stat-card span { font-size:12px; color:var(--muted); }
.stat-card:hover { border-color:rgba(217,164,65,0.5); }
.pager { display:flex; gap:8px; margin-top:18px; }
.pager a { border:1px solid var(--hair); border-radius:8px; padding:6px 12px; color:var(--muted); font-size:13px; }
.pager a.on { border-color:var(--gold); color:var(--gold); }
/* ---- telas de autenticação ---- */
body.auth { align-items:center; justify-content:center; padding:20px; }
.auth-card { width:100%; max-width:400px; background:var(--panel); border:1px solid var(--hair); border-radius:18px; padding:36px; }
.logo-big { font-size:19px; letter-spacing:0.3em; font-weight:500; margin-bottom:26px; }
.logo-big b { color:var(--gold); }
.logo-big span { font-family:'Cormorant Garamond',serif; font-style:italic; letter-spacing:0.02em; color:var(--muted); font-size:16px; }
.auth-card h1 { font-size:21px; }
.auth-card form { display:flex; flex-direction:column; gap:14px; margin-top:18px; }
.auth-card button { margin-top:6px; border:1px solid rgba(217,164,65,0.6); background:rgba(217,164,65,0.12); color:var(--ink); border-radius:999px; padding:13px; font-family:inherit; font-size:12px; letter-spacing:0.1em; text-transform:uppercase; cursor:pointer; }
.auth-card button:hover { background:rgba(217,164,65,0.22); }
.auth-card .code { text-align:center; font-size:24px; letter-spacing:0.4em; }
.qr { display:flex; justify-content:center; margin:18px 0; }
.qr img, .qr canvas { border-radius:10px; padding:8px; background:#eae7df; }
.secret { text-align:center; font-size:12px; color:var(--muted); margin-bottom:6px; }
.secret code { color:var(--gold); word-break:break-all; }

.glyph-preview { width:240px; height:240px; background:#0a0b0d; border:1px solid var(--hair); border-radius:14px; overflow:hidden; }
.glyph-preview canvas { width:100%; height:100%; display:block; }

.thumb-mini { width:64px; height:40px; object-fit:cover; border-radius:8px; border:1px solid var(--hair); display:block; }
span.thumb-mini { display:flex; align-items:center; justify-content:center; font-size:9px; letter-spacing:0.18em; color:var(--muted); background:rgba(234,231,223,0.03); }
span.thumb-mini b { color:var(--gold); font-weight:500; }

html { scrollbar-width: thin; scrollbar-color: #2e3038 #0a0b0d; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0a0b0d; }
::-webkit-scrollbar-thumb { background: #2e3038; border-radius: 999px; border: 2px solid #0a0b0d; }
::-webkit-scrollbar-thumb:hover { background: rgba(217, 164, 65, 0.55); }
::-webkit-scrollbar-corner { background: #0a0b0d; }

.crumbs { font-size:12.5px; color:var(--muted); margin-bottom:20px; display:flex; gap:8px; align-items:center; }
.crumbs a { color:var(--muted); }
.crumbs a:hover { color:var(--gold); }
.crumbs b { color:var(--ink); font-weight:400; }
.ia-box { border:1px solid rgba(217,164,65,0.35); border-radius:14px; padding:18px; margin-bottom:6px; background:rgba(217,164,65,0.04); }
.ia-box h3 { font-size:13px; letter-spacing:0.12em; text-transform:uppercase; color:var(--gold); font-weight:400; margin-bottom:12px; }
.ia-box .row { display:flex; gap:12px; flex-wrap:wrap; align-items:flex-end; margin-top:12px; }
.ia-box textarea { width:100%; }
.ia-status { font-size:12.5px; color:var(--muted); }
.avatar-prev { width:96px; height:96px; border-radius:50%; object-fit:cover; border:1px solid rgba(217,164,65,0.5); display:block; margin-top:8px; }

.net-lbl { display:flex; align-items:center; gap:8px; }
.net-ic { display:inline-flex; width:16px; height:16px; }
.net-ic svg { width:16px; height:16px; fill:none; stroke:var(--gold); stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; opacity:.85; }

/* ---- barra superior ---- */
.topbar { position:fixed; top:0; left:232px; right:0; z-index:60; height:58px; display:flex; align-items:center; gap:16px;
  padding:0 22px; background:var(--panel); border-bottom:1px solid var(--hair); }
.tb-search { position:relative; flex:1; max-width:560px; margin-left:auto; }
.tb-search input { width:100%; }
.tb-results { position:absolute; top:calc(100% + 6px); left:0; right:0; background:var(--panel);
  border:1px solid var(--hair); border-radius:12px; overflow:hidden; display:none; box-shadow:0 14px 40px rgba(0,0,0,0.45); }
.tb-results.open { display:block; }
.tb-results a { display:flex; gap:10px; align-items:center; padding:10px 14px; color:var(--ink); font-size:13.5px;
  border-bottom:1px solid rgba(128,128,128,0.08); }
.tb-results a:last-child { border-bottom:none; }
.tb-results a:hover { background:rgba(217,164,65,0.08); }
.tb-results a span { font-size:10px; letter-spacing:0.12em; text-transform:uppercase; color:var(--gold);
  border:1px solid rgba(217,164,65,0.35); border-radius:999px; padding:2px 8px; flex-shrink:0; }
.tb-empty { padding:12px 14px; color:var(--muted); font-size:13px; }
.tb-user { display:flex; align-items:center; gap:12px; text-decoration:none; }
.tb-name { text-align:right; color:var(--ink); font-size:13.5px; line-height:1.25; display:flex; flex-direction:column; }
.tb-name small { color:var(--muted); font-size:11px; }
.tb-avatar { width:38px; height:38px; border-radius:50%; object-fit:cover; border:1px solid rgba(217,164,65,0.55); }
.tb-avatar.ini { display:inline-flex; align-items:center; justify-content:center; color:var(--gold); background:rgba(217,164,65,0.1); font-size:15px; }
.tb-out { color:var(--muted); font-size:12.5px; }
.tb-out:hover { color:var(--gold); }
.theme-btn { background:none; border:1px solid var(--hair); color:var(--muted); border-radius:50%;
  width:34px; height:34px; cursor:pointer; font-size:15px; line-height:1; }
.theme-btn:hover { color:var(--gold); border-color:rgba(217,164,65,0.5); }
/* ---- rodapé do painel ---- */
.iris-foot { margin-top:70px; border-top:1px solid var(--hair); padding-top:34px; }
.if-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:22px; }
.if-grid h4 { font-size:11px; letter-spacing:0.18em; text-transform:uppercase; color:var(--gold); font-weight:400; margin-bottom:12px; }
.if-grid a { display:block; color:var(--muted); font-size:13px; padding:3px 0; }
.if-grid a:hover { color:var(--ink); }
.if-bottom { display:flex; justify-content:space-between; gap:14px; flex-wrap:wrap; border-top:1px solid var(--hair);
  margin-top:26px; padding:16px 0 4px; color:var(--muted); font-size:12px; }
/* ---- drag ---- */
td.drag { cursor:grab; color:var(--muted); width:34px; text-align:center; user-select:none; font-size:15px; }
tr.sortable-ghost { opacity:0.4; background:rgba(217,164,65,0.08); }
/* ---- gráficos ---- */
.charts { display:grid; grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); gap:16px; margin:6px 0 10px; }
.chart-card { border:1px solid var(--hair); border-radius:14px; background:var(--panel); padding:18px 18px 12px; }
.chart-card h3 { font-size:12px; letter-spacing:0.12em; text-transform:uppercase; color:var(--muted); font-weight:400; margin-bottom:16px; }
.bars { display:flex; align-items:flex-end; gap:8px; height:120px; }
.bar-col { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; height:100%; gap:5px; }
.bar { width:100%; max-width:34px; background:linear-gradient(180deg, rgba(217,164,65,0.85), rgba(217,164,65,0.35)); border-radius:5px 5px 2px 2px; }
.bar-col .lbl { font-size:10px; color:var(--muted); }
.bar-col .val { font-size:11px; color:var(--gold); min-height:14px; }
/* =====================================================================
   TEMA CLARO — mesma identidade, papel claro e dourado profundo
   ===================================================================== */
html[data-theme="light"] body { --bg:#f4f1ea; --panel:#fdfcf8; --ink:#211f1a; --muted:#6f6a5e; --gold:#a1731c; --hair:rgba(33,31,26,0.14); }
html[data-theme="light"] .flash.ok { color:#3c6b22; }
html[data-theme="light"] .tb-results { box-shadow:0 14px 40px rgba(70,60,30,0.18); }
html[data-theme="light"] select option { background:#fdfcf8; }
html[data-theme="light"] input[type=text], html[data-theme="light"] input[type=email], html[data-theme="light"] input[type=password],
html[data-theme="light"] input[type=number], html[data-theme="light"] input[type=datetime-local],
html[data-theme="light"] select, html[data-theme="light"] textarea { background:rgba(33,31,26,0.04); }
html[data-theme="light"] .side nav a:hover { background:rgba(33,31,26,0.05); }
html[data-theme="light"] .stat-card:hover, html[data-theme="light"] .glyph-preview { background:#fdfcf8; }
html[data-theme="light"] ::-webkit-scrollbar-track { background:#f4f1ea; }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background:#cfc8b8; border-color:#f4f1ea; }
html[data-theme="light"] { scrollbar-color:#cfc8b8 #f4f1ea; }

/* ---- grupos colapsáveis da sidebar ---- */
.ng-head { width:100%; text-align:left; background:none; border:none; cursor:pointer; color:var(--muted);
  font:inherit; font-size:13.5px; padding:9px 22px; display:flex; justify-content:space-between; align-items:center;
  letter-spacing:0.04em; }
.ng-head:hover { color:var(--ink); }
.ng-head span { font-size:10px; transition:transform 0.2s ease; }
.nav-group.open .ng-head span { transform:rotate(180deg); }
.nav-group.open .ng-head { color:var(--gold); }
.ng-sub { display:none; }
.nav-group.open .ng-sub { display:block; }
.ng-sub a { padding-left:38px !important; font-size:13px !important; }
/* ---- construtor de menus ---- */
.mb-wrap { display:grid; grid-template-columns:280px minmax(0,1fr); gap:26px; align-items:start; }
.mb-add { border:1px solid var(--hair); border-radius:14px; background:var(--panel); padding:16px; }
.mb-add h3 { font-size:12px; letter-spacing:0.14em; text-transform:uppercase; color:var(--muted); font-weight:400; margin-bottom:10px; }
.mb-add details { border-top:1px solid var(--hair); }
.mb-add summary { cursor:pointer; padding:10px 2px; color:var(--ink); font-size:13.5px; }
.mb-cat { padding:4px 0 12px; display:flex; flex-direction:column; gap:7px; max-height:260px; overflow-y:auto; }
.mb-add-btn { text-align:left; background:none; border:1px dashed var(--hair); border-radius:8px; padding:7px 10px;
  color:var(--muted); cursor:pointer; font:inherit; font-size:12.5px; }
.mb-add-btn:hover { color:var(--gold); border-color:rgba(217,164,65,0.5); }
.mb-list, .mb-children { list-style:none; padding:0; margin:0; min-height:14px; }
.mb-list > li, .mb-children > li { border:1px solid var(--hair); border-radius:10px; background:var(--panel);
  margin-bottom:8px; padding:8px 10px; }
.mb-row { display:flex; align-items:center; gap:10px; }
.mb-row .drag { cursor:grab; color:var(--muted); }
.mb-row input.lbl { flex:1; background:transparent; border:none; color:var(--ink); font:inherit; font-size:13.5px; padding:2px 4px; }
.mb-row input.lbl:focus { outline:1px solid rgba(217,164,65,0.4); border-radius:6px; }
.mb-row .tp { font-size:9.5px; letter-spacing:0.12em; text-transform:uppercase; color:var(--gold);
  border:1px solid rgba(217,164,65,0.35); border-radius:999px; padding:2px 8px; flex-shrink:0; }
.mb-row .nt { font-size:11px; color:var(--muted); display:flex; gap:4px; align-items:center; flex-shrink:0; }
.mb-row .rm { background:none; border:none; color:var(--muted); cursor:pointer; font-size:15px; }
.mb-row .rm:hover { color:#e5484d; }
.mb-children { margin:8px 0 2px 34px; border-left:1px dashed var(--hair); padding-left:10px; }
.sortable-ghost { opacity:0.4; }
.inline-form { display:flex; gap:12px; margin:14px 0 26px; flex-wrap:wrap; }
.inline-form input[type=text] { min-width:280px; }
/* ---- thumbs na busca do topo ---- */
.tb-results a img.thumb-s { width:34px; height:24px; object-fit:cover; border-radius:5px; border:1px solid var(--hair); flex-shrink:0; }
.nav-btn { display:none; background:none; border:1px solid var(--hair); color:var(--muted); border-radius:9px;
  width:36px; height:36px; cursor:pointer; font-size:16px; line-height:1; flex-shrink:0; }
.nav-scrim { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.45); z-index:65; }
@media (max-width: 900px) {
  .side { transform:translateX(-100%); transition:transform 0.25s ease; box-shadow:0 0 40px rgba(0,0,0,0.5); }
  body.nav-open .side { transform:none; }
  body.nav-open .nav-scrim { display:block; }
  .topbar { left:0; }
  .content { margin-left:0; padding:84px 18px 50px; }
  .nav-btn { display:inline-flex; align-items:center; justify-content:center; }
  .tb-name { display:none; }
  .tb-out { display:none; }
  .tb-search input { font-size:13px; }
  .mb-wrap { grid-template-columns:1fr; }
  .if-bottom { flex-direction:column; gap:6px; }
  table { display:block; overflow-x:auto; white-space:nowrap; }
}

/* ---- correção da sidebar: empilhamento e respiros ---- */
.side { padding: 0; }
.side > .logo { display: block; padding: 26px 22px 16px; }
.side nav { display: flex; flex-direction: column; }
.side nav > a, .ng-sub a { display: block; }
.ng-sub { display: none; flex-direction: column; }
.nav-group.open .ng-sub { display: flex; }

/* ---- logo maior na sidebar ---- */
.side > .logo { font-size: 21px; letter-spacing: 0.24em; }
.side > .logo span { font-size: 13px; }
/* ---- página Sobre (FY-CMS) ---- */
.fy-hero { display:flex; gap:22px; align-items:center; margin-bottom:26px; }
.fy-logo { width:88px; height:88px; flex-shrink:0; }
.fy-v { font-size:13px; color:var(--gold); border:1px solid rgba(217,164,65,0.4); border-radius:999px; padding:3px 10px; vertical-align:middle; margin-left:8px; }
.prose-sobre { max-width:780px; }
.prose-sobre h2 { margin:30px 0 10px; }
.prose-sobre p, .prose-sobre li { color:var(--muted); font-size:14.5px; line-height:1.75; }
.prose-sobre li strong, .prose-sobre p strong { color:var(--ink); font-weight:500; }
.prose-sobre ul { padding-left:20px; display:flex; flex-direction:column; gap:8px; margin:10px 0; }
.fy-rel { border-left:2px solid rgba(217,164,65,0.4); padding-left:16px; margin:16px 0; }
.fy-rel h3 { font-size:15px; font-weight:400; }
.fy-date { color:var(--muted); font-size:12px; margin-left:8px; }
.link-btn { background:none; border:none; color:var(--muted); cursor:pointer; font:inherit; font-size:13px; padding:0; margin-right:14px; }
.link-btn:hover { color:var(--gold); }

.fy-dedica { border: 1px solid rgba(217,164,65,0.35); border-radius: 14px; background: rgba(217,164,65,0.05);
  padding: 20px 24px; margin: 22px 0 6px; }
.fy-dedica p { color: var(--ink) !important; font-size: 15px !important; line-height: 1.8 !important; }
.fy-hearts { letter-spacing: 2px; }
.fy-assina { text-align: right; color: var(--muted) !important; font-style: italic; margin-top: 6px; }

/* ---- login: card centralizado (independente do shell do painel) ---- */
body.auth { display:flex; align-items:center; justify-content:center; min-height:100vh; padding:24px; }
body.auth .card { margin:0; }
/* ---- flashes legíveis no tema claro ---- */
html[data-theme="light"] .flash.erro { background:#f7e4e4; border-color:#d9a5a5; color:#8c2f36; }
html[data-theme="light"] .flash.ok { background:#e8f0dd; border-color:#b5c99a; color:#3c6b22; }
/* ---- tabelas ocupam a largura toda ---- */
.content table { width:100%; }
/* ---- gráfico de linhas ---- */
.line-chart { width:100%; height:130px; display:block; }
.line-chart polyline { fill:none; stroke:var(--gold); stroke-width:2; stroke-linejoin:round; stroke-linecap:round; }
.line-chart .area { fill:rgba(217,164,65,0.12); stroke:none; }
.line-chart circle { fill:var(--gold); }
.lc-labels { display:flex; justify-content:space-between; margin-top:6px; }
.lc-labels span { font-size:10px; color:var(--muted); flex:1; text-align:center; }

/* ---- contenção do editor no formulário (nunca estoura a coluna) ---- */
.form-grid, .form-grid > label { min-width:0; }
.form-grid .tox-tinymce { width:100% !important; max-width:100% !important; }
/* ---- TinyMCE no tema claro: chrome coerente ---- */
html[data-theme="light"] .tox-tinymce { border-color:var(--hair) !important; }

/* ---- Aparência: temas e templates ---- */
.theme-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:14px; margin:14px 0 26px; }
.theme-card { border:1px solid var(--hair); border-radius:14px; background:var(--panel); padding:16px;
  display:flex; flex-direction:column; gap:12px; cursor:pointer; text-transform:none; letter-spacing:0; }
.theme-card:has(input:checked) { border-color:var(--gold); box-shadow:0 0 0 1px var(--gold) inset; }
.theme-card input { position:absolute; opacity:0; }
.tc-sw { display:flex; gap:4px; }
.tc-sw i { width:22px; height:22px; border-radius:6px; border:1px solid rgba(128,128,128,0.25); }
.tc-sw i:nth-child(5) { margin-left:10px; }
.tc-name { font-size:13.5px; color:var(--ink); }
.pv-bar { display:flex; justify-content:space-between; align-items:center; gap:14px; flex-wrap:wrap; margin:6px 0 10px; }
.pv-devices { display:flex; gap:8px; }
.pv-frame-wrap { border:1px solid var(--hair); border-radius:16px; background:var(--bg); padding:10px; text-align:center; margin-bottom:30px; }
.pv-frame { width:100%; max-width:100%; height:560px; border:none; border-radius:10px; background:#0a0b0d; transition:width 0.3s ease; margin:0 auto; display:block; }

/* ---- opções por fonte RSS ---- */
.rss-opts { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.rss-opts .check { display: flex; gap: 5px; align-items: center; font-size: 12px; color: var(--muted); text-transform: none; letter-spacing: 0; }
.sc-copy { font-size: 12px; color: var(--gold); background: rgba(217,164,65,0.08); border: 1px solid rgba(217,164,65,0.3); border-radius: 7px; padding: 4px 9px; cursor: text; user-select: all; }
