:root {
  color-scheme: dark;
  --bg: #050b14;
  --panel: #0b1524;
  --panel-2: #0f1c2f;
  --line: rgba(148, 163, 184, 0.14);
  --text: #f8fafc;
  --muted: #94a3b8;
  --cyan: #22d3ee;
  --purple: #8b5cf6;
  --green: #34d399;
  --yellow: #fbbf24;
  --red: #fb7185;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body, #app { min-height: 100%; margin: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 80% 10%, rgba(124, 58, 237, 0.12), transparent 28rem),
    radial-gradient(circle at 20% 90%, rgba(34, 211, 238, 0.08), transparent 34rem),
    var(--bg);
  color: var(--text);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 252px 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 24px 18px;
  background: rgba(7, 17, 31, 0.92); border-right: 1px solid var(--line);
  backdrop-filter: blur(24px); display: flex; flex-direction: column; z-index: 10;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 5px 8px 26px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--cyan), var(--purple)); color: #03101c;
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.25); font-size: 21px; font-weight: 900;
}
.brand strong { font-size: 16px; letter-spacing: -0.3px; }
.brand span { display: block; color: var(--cyan); font-size: 10px; text-transform: uppercase; letter-spacing: 2px; margin-top: 2px; }
.nav { display: grid; gap: 6px; }
.nav button {
  border: 0; color: var(--muted); background: transparent; border-radius: 12px;
  text-align: left; padding: 12px 13px; display: flex; align-items: center; gap: 12px;
  transition: .2s ease;
}
.nav button:hover, .nav button.active { color: white; background: rgba(34, 211, 238, 0.09); }
.nav button.active { box-shadow: inset 3px 0 var(--cyan); }
.nav-ico { width: 23px; text-align: center; font-size: 16px; }
.side-status {
  margin-top: auto; padding: 15px; border-radius: 16px; background: linear-gradient(145deg, rgba(34,211,238,.08), rgba(124,58,237,.08));
  border: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.5;
}
.side-status b { color: white; display: block; margin-bottom: 5px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 6px; box-shadow: 0 0 10px var(--green); }

.main { min-width: 0; }
.topbar {
  min-height: 78px; padding: 16px 30px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: rgba(5, 11, 20, .7); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 5;
}
.page-title h1 { font-size: 22px; margin: 0 0 3px; letter-spacing: -0.6px; }
.page-title p { margin: 0; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.search {
  width: 245px; border: 1px solid var(--line); background: var(--panel); color: white;
  padding: 10px 14px; border-radius: 12px; outline: none;
}
.search:focus { border-color: rgba(34, 211, 238, .6); }
.btn {
  border: 1px solid var(--line); color: white; background: var(--panel-2); border-radius: 11px;
  padding: 10px 15px; font-weight: 700; font-size: 13px; transition: .2s ease;
}
.btn:hover { transform: translateY(-1px); border-color: rgba(34,211,238,.4); }
.btn.primary { background: linear-gradient(135deg, #0891b2, #6d28d9); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.danger { color: #fecdd3; border-color: rgba(251,113,133,.25); }
.content { padding: 28px 30px 50px; max-width: 1500px; margin: auto; }

.hero {
  overflow: hidden; position: relative; min-height: 190px; border: 1px solid var(--line); border-radius: 24px;
  background: linear-gradient(115deg, rgba(8,145,178,.25), rgba(109,40,217,.25)), var(--panel);
  box-shadow: var(--shadow); padding: 30px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.hero::after { content: ""; position: absolute; width: 340px; height: 340px; right: -50px; border: 40px solid rgba(34,211,238,.07); border-radius: 50%; }
.hero-copy { position: relative; z-index: 1; max-width: 650px; }
.eyebrow { color: var(--cyan); font-size: 11px; letter-spacing: 2.4px; text-transform: uppercase; font-weight: 800; }
.hero h2 { font-size: clamp(26px, 3vw, 42px); margin: 9px 0 10px; letter-spacing: -1.6px; }
.hero p { color: #cbd5e1; margin: 0; line-height: 1.6; }
.hero-actions { display: flex; gap: 10px; margin-top: 21px; }
.hero-screen {
  width: 235px; aspect-ratio: 16/10; border: 8px solid #101827; border-radius: 15px; padding: 10px;
  background: linear-gradient(145deg, #0e7490, #4c1d95); box-shadow: 0 20px 35px rgba(0,0,0,.35); z-index: 1;
  display: grid; align-content: end; transform: perspective(700px) rotateY(-9deg);
}
.hero-screen span { font-size: 11px; opacity: .85; }.hero-screen b { font-size: 19px; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin: 22px 0; }
.card { background: rgba(11,21,36,.88); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: 0 14px 40px rgba(0,0,0,.15); }
.metric { display: flex; justify-content: space-between; align-items: flex-start; }
.metric small { color: var(--muted); display: block; margin-bottom: 8px; }
.metric strong { font-size: 29px; letter-spacing: -1px; }
.metric .delta { color: var(--green); font-size: 11px; margin-top: 5px; }
.metric-ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: rgba(34,211,238,.1); color: var(--cyan); }

.grid-2 { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.section-head h3 { margin: 0; font-size: 16px; }.section-head span { color: var(--muted); font-size: 12px; }
.device-list, .activity-list { display: grid; gap: 9px; }
.device {
  display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 12px;
  padding: 11px; border-radius: 13px; background: rgba(15,28,47,.65); border: 1px solid transparent;
}
.device:hover { border-color: var(--line); }
.device-icon { width: 38px; height: 38px; border-radius: 10px; background: #13243a; display: grid; place-items: center; }
.device b { font-size: 13px; }.device small { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; }
.pill { padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.pill.online { color: #a7f3d0; background: rgba(52,211,153,.12); }.pill.offline { color: #fecdd3; background: rgba(251,113,133,.12); }
.activity { padding: 10px 0; display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: start; border-bottom: 1px solid var(--line); }
.activity:last-child { border: 0; }.activity i { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); margin-top: 5px; }.activity b { font-size: 12px; }.activity small { color: var(--muted); font-size: 10px; }

.toolbar { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 17px; align-items: center; }
.toolbar h2 { margin: 0; font-size: 21px; }.toolbar p { color: var(--muted); margin: 4px 0 0; font-size: 12px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 18px; background: rgba(11,21,36,.88); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; text-align: left; padding: 15px 18px; background: rgba(15,28,47,.75); }
td { padding: 15px 18px; border-top: 1px solid var(--line); font-size: 13px; }
td small { color: var(--muted); display: block; margin-top: 4px; }
.code { font-family: ui-monospace, monospace; color: var(--cyan); letter-spacing: 1px; }
.mini-btn { border: 1px solid var(--line); background: transparent; color: white; border-radius: 8px; padding: 6px 9px; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.media-card { overflow: hidden; padding: 0; }
.media-preview { aspect-ratio: 16/9; display: grid; place-items: center; position: relative; background: linear-gradient(145deg, #0e7490, #4c1d95); }
.media-preview.alt { background: linear-gradient(145deg, #92400e, #be123c); }.media-preview.green { background: linear-gradient(145deg, #065f46, #0e7490); }
.media-preview strong { font-size: 23px; text-align: center; padding: 20px; }.media-preview span { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.55); padding: 4px 7px; border-radius: 6px; font-size: 9px; }
.media-info { padding: 14px; }.media-info b { font-size: 13px; }.media-info small { display: block; color: var(--muted); margin-top: 5px; }

.playlist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 16px; }
.playlist-card h3 { margin: 3px 0 6px; }.playlist-card p { color: var(--muted); font-size: 12px; margin: 0 0 16px; }.playlist-bar { height: 7px; border-radius: 999px; overflow: hidden; background: #13243a; }.playlist-bar span { display: block; height: 100%; background: linear-gradient(90deg,var(--cyan),var(--purple)); }
.playlist-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; margin-top: 9px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.field { display: grid; gap: 7px; }.field.full { grid-column: 1/-1; }.field label { color: #cbd5e1; font-size: 11px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); background: #081321; color: white; border-radius: 10px; padding: 11px 12px; outline: none; }
.field input:focus, .field select:focus { border-color: rgba(34,211,238,.6); }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.72); backdrop-filter: blur(7px); display: grid; place-items: center; padding: 20px; }
.modal { width: min(610px, 100%); max-height: 90vh; overflow: auto; background: #0b1524; border: 1px solid var(--line); border-radius: 22px; padding: 23px; box-shadow: var(--shadow); }
.modal h2 { margin: 0 0 5px; }.modal > p { color: var(--muted); font-size: 12px; margin: 0 0 20px; }.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.empty { padding: 50px; text-align: center; color: var(--muted); }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; background: #10223a; border: 1px solid rgba(34,211,238,.25); border-radius: 12px; padding: 13px 16px; box-shadow: var(--shadow); font-size: 12px; animation: toast .3s ease; }
@keyframes toast { from { transform: translateY(15px); opacity: 0; } }

/* Player para Android TV / TV Box */
.player { position: fixed; inset: 0; overflow: hidden; background: #020617; color: white; }
.player-stage { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 30% 30%, #155e75, transparent 45%), linear-gradient(135deg,#06131f,#2e1065); transition: opacity .45s ease; }
.player-stage.ad-2 { background: radial-gradient(circle at 70% 20%, #be123c, transparent 40%), linear-gradient(135deg,#32100a,#1e1b4b); }
.player-stage.ad-3 { background: radial-gradient(circle at 25% 80%, #059669, transparent 45%), linear-gradient(135deg,#022c22,#083344); }
.ad-copy { max-width: 900px; text-align: center; padding: 40px; }
.ad-copy .eyebrow { font-size: clamp(12px,1.2vw,22px); }.ad-copy h1 { font-size: clamp(48px,7vw,120px); letter-spacing: -4px; margin: 16px 0; }.ad-copy p { font-size: clamp(18px,2vw,34px); color: #dbeafe; }
.player-top { position: absolute; z-index: 4; left: 0; right: 0; top: 0; padding: 25px 32px; display: flex; justify-content: space-between; align-items: flex-start; background: linear-gradient(rgba(0,0,0,.55),transparent); }
.player-brand { display: flex; align-items: center; gap: 12px; font-weight: 900; font-size: 22px; }.player-brand .brand-mark { width: 38px; height: 38px; border-radius: 11px; font-size: 17px; }
.weather { display: flex; gap: 12px; align-items: center; text-align: right; }.weather-icon { font-size: 33px; }.weather strong { font-size: 25px; }.weather small { display: block; opacity: .7; }
.player-bottom { position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; background: rgba(3,7,18,.88); border-top: 1px solid rgba(255,255,255,.12); display: grid; grid-template-columns: auto 1fr auto; align-items: center; }
.ticker-label { align-self: stretch; display: flex; align-items: center; padding: 20px 26px; background: linear-gradient(135deg,#0891b2,#6d28d9); font-size: clamp(15px,1.1vw,20px); font-weight: 900; letter-spacing: 1.2px; }.ticker { overflow: hidden; white-space: nowrap; font-size: clamp(22px,1.55vw,30px); font-weight: 600; }.ticker span { display: inline-block; padding-left: 100%; animation: ticker 24s linear infinite; }.clock { padding: 0 30px; font-size: clamp(32px,2vw,42px); line-height: 1; font-variant-numeric: tabular-nums; font-weight: 900; }
@keyframes ticker { to { transform: translateX(-100%); } }
.player-controls { position: absolute; z-index: 10; right: 25px; bottom: 70px; opacity: .15; transition: .2s; }.player-controls:hover { opacity: 1; }

@media (max-width: 1000px) {
  .shell { grid-template-columns: 82px 1fr; }.sidebar { padding: 20px 12px; }.brand-copy, .nav-label, .side-status { display: none; }.brand { padding-left: 7px; }.nav button { justify-content: center; }.metrics { grid-template-columns: repeat(2,1fr); }.grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .shell { display: block; }.sidebar { position: fixed; width: 100%; height: 67px; bottom: 0; top: auto; padding: 7px 10px; border: 0; border-top: 1px solid var(--line); }.brand { display:none; }.nav { grid-template-columns: repeat(6,1fr); }.nav button { padding: 8px 3px; }.nav button:nth-child(n+7) { display:none; }.nav-ico { font-size: 18px; }.main { padding-bottom: 70px; }.topbar { padding: 14px 17px; }.search { display:none; }.content { padding: 20px 16px 35px; }.hero { padding: 22px; }.hero-screen { display:none; }.metrics { grid-template-columns: 1fr 1fr; }.metric { padding: 15px; }.metric strong { font-size: 24px; }.form-grid { grid-template-columns: 1fr; }.field.full { grid-column:auto; }
}

/* Recursos profissionais */
.brand { color: inherit; text-decoration: none; }
.pill.pending { color: #fde68a; background: rgba(251,191,36,.12); }
.media-preview img, .media-preview video { width: 100%; height: 100%; object-fit: cover; }
.toast-error { border-color: rgba(251,113,133,.6); color: #fecdd3; }
.welcome { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.welcome-glow { position: absolute; width: 620px; height: 620px; border-radius: 50%; background: radial-gradient(circle, rgba(34,211,238,.16), rgba(109,40,217,.08) 45%, transparent 70%); }
.welcome-card, .loading-card { width: min(680px,100%); position: relative; text-align: center; padding: 48px; border: 1px solid var(--line); border-radius: 28px; background: rgba(11,21,36,.9); box-shadow: var(--shadow); }
.welcome-card h1 { margin: 20px 0 12px; font-size: clamp(35px,6vw,64px); letter-spacing: -2.5px; }
.welcome-card p, .loading-card p { color: #cbd5e1; line-height: 1.7; }
.welcome-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 26px; }
.brand-mark.large { width: 66px; height: 66px; border-radius: 20px; margin: auto; font-size: 28px; }
.loader { width: 38px; height: 38px; margin: 0 auto 18px; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--cyan); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.campaign-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(285px,1fr)); gap: 16px; }
.campaign-card h3 { margin: 14px 0 4px; }.campaign-card > p { margin: 0 0 18px; color: var(--muted); }
.campaign-card > small { display: block; color: var(--muted); margin-top: 12px; line-height: 1.5; }
.contract-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 15px; }
.contract-meta span { background: rgba(15,28,47,.65); border-radius: 11px; padding: 10px; color: var(--muted); font-size: 10px; }
.contract-meta b { color: white; font-size: 15px; display: block; margin-bottom: 3px; }
.campaign-mini { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.campaign-mini:last-child { border: 0; }.campaign-mini small { color: var(--muted); }.campaign-mini > .playlist-bar, .campaign-mini > small { grid-column: 1/-1; }
.role-label { color: var(--muted); font-size: 11px; padding: 0 8px; }
.check-list { max-height: 250px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.check-list label { display: flex; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); align-items: center; }
.check-list label:last-child { border: 0; }.check-list small { display: block; color: var(--muted); margin-top: 3px; }
.setting-toggle { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting-toggle:last-child { border: 0; }.setting-toggle small { display: block; color: var(--muted); margin-top: 4px; }
.report-intro { text-align: center; padding: 55px 20px; }.report-icon { font-size: 45px; margin-bottom: 12px; }.report-intro p { color: var(--muted); }
.report-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 20px; }
.report-logo { display: flex; align-items: center; gap: 10px; }.report-logo strong { display: block; }.report-logo small { color: var(--muted); }
.report-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 18px; }.report-metrics .card { padding: 15px; }.report-metrics small { color: var(--muted); display: block; }.report-metrics strong { font-size: 24px; }
.player-media { width: 100%; height: 100%; object-fit: cover; }
.transition-slide .player-media { animation: slideIn .55s ease; }.transition-zoom .player-media { animation: zoomIn .7s ease; }.transition-cut { transition-duration: 0s; }
@keyframes slideIn { from { transform: translateX(7%); opacity: .2; } }
@keyframes zoomIn { from { transform: scale(1.06); opacity: .2; } }
.activation { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; padding: 35px; background: radial-gradient(circle at center,rgba(34,211,238,.14),transparent 35%); }
.activation h1 { font-size: clamp(58px,10vw,150px); letter-spacing: .12em; margin: 14px 0; }.activation p { color: #cbd5e1; }.activation small { color: var(--muted); }
.offline-ribbon { position: absolute; z-index: 12; top: 90px; left: 0; padding: 9px 15px; border-radius: 0 9px 9px 0; background: #92400e; color: #fef3c7; font-weight: 800; font-size: 11px; }

@media print {
  body.print-report { background: white; color: #111827; }
  body.print-report .sidebar, body.print-report .topbar, body.print-report .toolbar, body.print-report .btn, body.print-report .toast { display: none !important; }
  body.print-report .shell { display: block; } body.print-report .content { padding: 0; max-width: none; }
  body.print-report .card, body.print-report .table-wrap { box-shadow: none; background: white; color: #111827; border-color: #d1d5db; }
  body.print-report th { background: #f3f4f6; color: #4b5563; } body.print-report td { border-color: #e5e7eb; }
}
