/* ===========================================================================
   Painel Analytics — 361 Digital
   Paleta tirada da marca: laranja #F59B1F sobre o azul-quase-preto do logo.
   =========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root{
  --navy:#0F1829; --navy-deep:#09111F; --orange:#F59B1F; --orange-soft:#FDC26B;
  --bg:#F4F5F7; --panel:#fff; --line:#E4E7EC; --text:#1F2937; --muted:#6B7280;
  --green:#1F9D57; --green-bg:#E6F6EC; --red:#D4453A; --red-bg:#FBE9E7;
  --font:'Inter',sans-serif;
}
body{ font-family:var(--font); background:var(--bg); color:var(--text); -webkit-font-smoothing:antialiased; }
a{ color:inherit; text-decoration:none; }
input, select, textarea, button{ font-family:inherit; }
code{ font-size:12.5px; background:rgba(15,24,41,.06); padding:1px 6px; border-radius:5px; }

/* ---------- LOGIN ---------- */
.adm-login-body{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px;
  background:linear-gradient(135deg,#0F1829 0%,#09111F 100%); }
.adm-login-card{ background:#fff; width:100%; max-width:400px; border-radius:20px; padding:42px 38px; box-shadow:0 30px 80px rgba(0,0,0,.4); }
.adm-login-brand{ text-align:center; margin-bottom:26px; }
.adm-login-logo{ width:52px; height:52px; object-fit:contain; }
.adm-login-brand h1{ font-size:22px; color:var(--navy); margin-top:12px; letter-spacing:-.02em; }
.adm-login-brand p{ font-size:13px; color:var(--muted); margin-top:4px; }
.adm-login-form{ display:flex; flex-direction:column; gap:16px; }
.adm-login-form label{ display:flex; flex-direction:column; gap:7px; font-size:13px; font-weight:600; color:var(--navy); }
.adm-login-form input{ padding:13px 15px; border:1.5px solid #DDE2EC; border-radius:10px; font-size:14.5px; color:var(--navy); background:#F9FAFC; outline:none; transition:border-color .2s,box-shadow .2s; }
.adm-login-form input:focus{ border-color:var(--orange); box-shadow:0 0 0 3px rgba(245,155,31,.18); background:#fff; }

/* ---------- SHELL ---------- */
.adm-shell{ display:flex; min-height:100vh; }
.adm-sidebar{ width:250px; background:var(--navy); color:#fff; display:flex; flex-direction:column; position:fixed; top:0; bottom:0; left:0; z-index:50; }
.adm-brand{ display:flex; align-items:center; gap:12px; padding:22px 22px 24px; border-bottom:1px solid rgba(255,255,255,.08); }
.adm-brand-logo{ width:36px; height:36px; object-fit:contain; flex-shrink:0; }
.adm-brand-text{ display:flex; flex-direction:column; line-height:1.2; }
.adm-brand-text strong{ font-size:15px; }
.adm-brand-text span{ font-size:11.5px; color:rgba(255,255,255,.5); }
.adm-nav{ display:flex; flex-direction:column; gap:3px; padding:18px 14px; flex:1; }
.adm-nav-link{ display:flex; align-items:center; gap:12px; padding:11px 14px; border-radius:11px; color:rgba(255,255,255,.72); font-size:14px; font-weight:500; transition:background .18s,color .18s; }
.adm-nav-link svg{ width:18px; height:18px; flex-shrink:0; }
.adm-nav-link:hover{ background:rgba(255,255,255,.07); color:#fff; }
.adm-nav-link.active{ background:var(--orange); color:var(--navy-deep); font-weight:600; }
.adm-sidebar-foot{ padding:16px 18px; border-top:1px solid rgba(255,255,255,.08); }
.adm-view-site{ display:flex; align-items:center; gap:9px; font-size:13px; color:rgba(255,255,255,.65); transition:color .2s; }
.adm-view-site svg{ width:16px; height:16px; }
.adm-view-site:hover{ color:var(--orange); }

.adm-main{ flex:1; margin-left:250px; display:flex; flex-direction:column; min-width:0; }
.adm-topbar{ background:#fff; border-bottom:1px solid var(--line); padding:16px 30px; display:flex; align-items:center; gap:16px; position:sticky; top:0; z-index:40; }
.adm-burger{ display:none; background:none; border:none; cursor:pointer; color:var(--navy); padding:4px; }
.adm-burger svg{ width:24px; height:24px; }
.adm-page-title{ font-size:18px; font-weight:700; color:var(--navy); letter-spacing:-.02em; flex:1; }
.adm-user{ display:flex; align-items:center; gap:10px; }
.adm-user-avatar{ width:34px; height:34px; border-radius:50%; background:var(--orange); color:var(--navy-deep); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:14px; }
.adm-user-name{ font-size:13.5px; font-weight:600; color:var(--navy); }
.adm-logout{ display:inline-flex; padding:7px; border-radius:9px; color:var(--muted); transition:background .2s,color .2s; }
.adm-logout svg{ width:18px; height:18px; }
.adm-logout:hover{ background:#F3F4F6; color:var(--red); }
.adm-content{ padding:30px; flex:1; }

/* ---------- FLASH / DIAGNÓSTICO ---------- */
.adm-flash{ padding:13px 18px; border-radius:11px; font-size:14px; font-weight:500; margin-bottom:18px; border:1px solid transparent; }
.adm-flash-success{ background:var(--green-bg); color:var(--green); border-color:#BCE6CB; }
.adm-flash-error{ background:var(--red-bg); color:var(--red); border-color:#F3C7C2; }
.adm-diag{ padding:14px 18px; border-radius:12px; font-size:14px; line-height:1.55; margin-bottom:18px; border:1px solid transparent; }
.adm-diag-error{ background:var(--red-bg); color:#B0342A; border-color:#F3C7C2; }
.adm-diag-info{ background:#FEF6E7; color:#8A5A08; border-color:#F7DFB4; }

/* ---------- PERÍODO ---------- */
.adm-toolbar{ display:flex; align-items:center; gap:14px; margin-bottom:12px; flex-wrap:wrap; }
.adm-toolbar-range{ display:flex; flex-wrap:wrap; align-items:center; gap:14px; }
.adm-tabs{ display:flex; gap:4px; background:#fff; border:1px solid var(--line); border-radius:12px; padding:4px; }
.adm-tab{ font-size:13.5px; font-weight:600; color:var(--muted); padding:8px 16px; border-radius:9px; transition:all .18s; border:none; background:none; cursor:pointer; }
.adm-tab:hover{ color:var(--navy); }
.adm-tab.active{ background:var(--navy); color:#fff; }
.adm-range-form{ display:none; flex-wrap:wrap; align-items:flex-end; gap:10px; }
.adm-range-form.is-open{ display:flex; }
.adm-range-form label{ display:flex; flex-direction:column; gap:4px; font-size:12px; font-weight:600; color:var(--muted); }
.adm-range-form input[type=date]{ font-family:inherit; font-size:13.5px; padding:8px 10px; border:1.5px solid var(--line); border-radius:9px; background:#fff; color:inherit; outline:none; }
.adm-range-form input[type=date]:focus{ border-color:var(--orange); box-shadow:0 0 0 3px rgba(245,155,31,.15); }
.adm-range-form .adm-btn{ padding:9px 18px; }
.adm-range-caption{ margin:0 0 18px; font-size:13px; color:var(--muted); font-weight:500; }

/* ---------- TEMPO REAL ---------- */
.adm-live{ display:inline-flex; align-items:center; gap:9px; background:#fff; border:1px solid var(--line); border-radius:999px; padding:8px 16px; font-size:13.5px; margin-bottom:18px; }
.adm-live strong{ color:var(--navy); }
.adm-live-dot{ width:8px; height:8px; border-radius:50%; background:var(--green); box-shadow:0 0 0 0 rgba(31,157,87,.5); animation:admPulse 2s infinite; }
@keyframes admPulse{ 70%{ box-shadow:0 0 0 8px rgba(31,157,87,0); } 100%{ box-shadow:0 0 0 0 rgba(31,157,87,0); } }

/* ---------- STATS ---------- */
.adm-stats{ display:grid; grid-template-columns:repeat(4,1fr); gap:18px; margin-bottom:26px; }
.adm-stats-4{ grid-template-columns:repeat(4,1fr); }
.adm-stats-6{ grid-template-columns:repeat(6,1fr); }
.adm-stat{ background:#fff; border:1px solid var(--line); border-radius:16px; padding:20px 22px; display:flex; flex-direction:column; gap:4px; }
.adm-stat-num{ font-size:26px; font-weight:700; color:var(--navy); letter-spacing:-.03em; }
.adm-stat-label{ font-size:12.5px; color:var(--muted); font-weight:500; }
.adm-stat-delta{ font-size:11.5px; font-weight:600; color:var(--muted); margin-top:5px; }
.adm-stat-delta.up{ color:var(--green); }
.adm-stat-delta.down{ color:var(--red); }

/* ---------- CARD / TABELA ---------- */
.adm-card{ background:#fff; border:1px solid var(--line); border-radius:16px; padding:6px; overflow:hidden; }
.adm-card-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:18px 20px 14px; }
.adm-card-head h2{ font-size:16px; font-weight:700; color:var(--navy); }
.adm-card-link{ font-size:12.5px; font-weight:600; color:var(--muted); }
.adm-card-link:hover{ color:var(--orange); }
.adm-card-body{ padding:0 20px 18px; }
.adm-table{ width:100%; border-collapse:collapse; }
.adm-table th{ text-align:left; font-size:11.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); padding:12px 20px; border-bottom:1px solid var(--line); }
.adm-table td{ padding:14px 20px; border-bottom:1px solid #F3F4F6; font-size:14px; vertical-align:middle; }
.adm-table tr:last-child td{ border-bottom:none; }
.adm-table tr:hover td{ background:#FAFAFB; }
.adm-link-strong{ font-weight:600; color:var(--navy); }
.adm-muted{ color:var(--muted); }
.adm-row-sub{ font-size:12px; color:var(--muted); margin-top:3px; }
.adm-empty{ text-align:center; padding:44px 20px; color:var(--muted); font-size:14.5px; line-height:1.6; }

/* ---------- BOTÕES ---------- */
.adm-btn{ display:inline-flex; align-items:center; justify-content:center; gap:7px; font-size:13.5px; font-weight:600; padding:10px 18px; border-radius:10px; border:1.5px solid var(--line); background:#fff; color:var(--navy); cursor:pointer; transition:all .18s; white-space:nowrap; }
.adm-btn:hover{ border-color:#CBD2DC; background:#FAFAFB; }
.adm-btn-primary{ background:var(--navy); border-color:var(--navy); color:#fff; }
.adm-btn-primary:hover{ background:#1A2740; border-color:#1A2740; }
.adm-btn-block{ width:100%; }
.adm-btn-sm{ padding:7px 12px; font-size:12.5px; }
.adm-btn-danger{ color:var(--red); border-color:#F3C7C2; }
.adm-btn-danger:hover{ background:var(--red-bg); border-color:#E5A9A2; }

/* ---------- CAMPOS ---------- */
.adm-editor-grid{ display:grid; grid-template-columns:1fr 320px; gap:22px; align-items:start; }
.adm-cat-grid{ grid-template-columns:1fr 340px; }
.adm-field{ display:flex; flex-direction:column; gap:7px; margin-bottom:14px; }
.adm-label{ font-size:13px; font-weight:600; color:var(--navy); }
.adm-input, .adm-textarea{ width:100%; padding:11px 14px; border:1.5px solid var(--line); border-radius:10px; font-size:14px; color:var(--navy); background:#fff; outline:none; transition:border-color .2s,box-shadow .2s; }
.adm-input:focus, .adm-textarea:focus{ border-color:var(--orange); box-shadow:0 0 0 3px rgba(245,155,31,.15); }
.adm-role-select{ width:auto; padding:7px 10px; font-size:12.5px; }
.adm-actions{ display:flex; gap:7px; align-items:center; flex-wrap:wrap; }
.adm-panel{ background:#fff; border:1px solid var(--line); border-radius:14px; padding:18px; }
.adm-panel h3{ font-size:13px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--navy); margin-bottom:14px; }
.adm-panel-row{ font-size:13.5px; color:var(--muted); display:flex; align-items:center; gap:8px; margin-bottom:10px; line-height:1.5; }
.adm-panel-actions{ display:flex; gap:9px; margin-top:14px; }
.adm-panel-actions .adm-btn{ flex:1; }
.adm-hint{ font-size:11.5px; color:var(--muted); margin-top:9px; line-height:1.55; }

/* ---------- GRÁFICOS ---------- */
.adm-grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:20px; align-items:start; }
.adm-chart-wrap{ padding:10px 20px 20px; }
.adm-chart-svg{ width:100%; height:170px; display:block; }
.adm-bar{ fill:var(--orange); transition:fill .15s; }
.adm-bar-g:hover .adm-bar{ fill:var(--navy); }

/* barras horizontais (origens, campanhas, dispositivos) */
.adm-src{ display:flex; flex-direction:column; gap:15px; padding:6px 0 2px; }
.adm-src-row{ display:flex; flex-direction:column; gap:7px; }
.adm-src-top{ display:flex; justify-content:space-between; align-items:baseline; gap:12px; }
.adm-src-label{ font-size:14px; font-weight:600; color:var(--navy); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.adm-src-val{ font-size:13px; font-weight:600; color:var(--muted); white-space:nowrap; }
.adm-src-track{ height:8px; border-radius:999px; background:#EEF0F4; overflow:hidden; }
.adm-src-bar{ height:100%; border-radius:999px; background:var(--orange); min-width:6px; }

/* ---------- RESPONSIVO ---------- */
@media (max-width:1100px){
  .adm-editor-grid, .adm-cat-grid, .adm-grid-2{ grid-template-columns:1fr; }
  .adm-stats{ grid-template-columns:repeat(2,1fr); }
  .adm-stats-6{ grid-template-columns:repeat(3,1fr); }
}
@media (max-width:760px){
  .adm-sidebar{ transform:translateX(-100%); transition:transform .28s ease; box-shadow:0 0 40px rgba(0,0,0,.3); }
  .adm-sidebar.open{ transform:translateX(0); }
  .adm-main{ margin-left:0; }
  .adm-burger{ display:inline-flex; }
  .adm-content{ padding:20px 16px; }
  .adm-table{ display:block; overflow-x:auto; white-space:nowrap; }
  .adm-stats, .adm-stats-6{ grid-template-columns:repeat(2,1fr); }
}
