*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0a; --surface: #111; --surface2: #181818;
  --border: rgba(255,255,255,0.07); --border-hi: rgba(255,255,255,0.12);
  --red: #ff3131; --red-dim: rgba(255,49,49,0.1);
  --text: #f0f0f0; --muted: #555; --muted2: #2a2a2a; --radius: 12px;
}

html, body { height: 100%; }
body { background: var(--bg); color: var(--text); font-family: 'Inter', sans-serif; min-height: 100vh; }

/* LOADING */
#loading-screen {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; flex-direction: column; gap: 20px; transition: opacity 0.3s ease;
}
.loading-logo { display: flex; align-items: center; gap: 12px; }
.loading-logo-box { width: 48px; height: 48px; background: var(--red); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; color: #fff; }
.loading-logo-name { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.loading-logo-name em { font-style: normal; color: var(--red); }
.loading-bar { width: 160px; height: 2px; background: var(--muted2); border-radius: 99px; overflow: hidden; }
.loading-bar-fill { height: 100%; background: var(--red); border-radius: 99px; animation: loadFill 1.2s ease forwards; }
@keyframes loadFill { from { width: 0; } to { width: 100%; } }

/* LOGIN */
#login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px; position: relative; z-index: 1;
}
.login-card {
  background: var(--surface); border: 1px solid var(--border-hi); border-radius: 20px;
  padding: 48px 40px; width: 100%; max-width: 400px; position: relative; overflow: hidden;
}
.login-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--red), transparent); }
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 36px; }
.login-logo-box { width: 44px; height: 44px; background: var(--red); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; color: #fff; flex-shrink: 0; }
.login-logo-info span:first-child { display: block; font-size: 17px; font-weight: 800; letter-spacing: -0.5px; }
.login-logo-info span:last-child { display: block; font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--red); letter-spacing: 2px; text-transform: uppercase; margin-top: 2px; }
.login-title { font-size: 24px; font-weight: 800; letter-spacing: -0.8px; margin-bottom: 6px; }
.login-sub { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 32px; }
.btn-google { width: 100%; height: 50px; border-radius: 10px; background: var(--surface2); border: 1px solid var(--border-hi); color: var(--text); font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: background 0.2s, transform 0.15s; }
.btn-google:hover { background: rgba(255,255,255,0.05); transform: translateY(-1px); }
#login-error { margin-top: 14px; padding: 11px 14px; background: rgba(255,49,49,0.08); border: 1px solid rgba(255,49,49,0.2); border-radius: 8px; font-size: 12px; color: var(--red); display: none; }
.login-footer { margin-top: 28px; font-size: 11px; color: var(--muted); text-align: center; }

/* SIDEBAR */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 230px;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 20px 14px; z-index: 10;
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 0 6px; margin-bottom: 28px; }
.sidebar-logo-box { width: 36px; height: 36px; background: var(--red); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; color: #fff; flex-shrink: 0; }
.sidebar-logo-name { font-size: 16px; font-weight: 800; letter-spacing: -0.5px; }
.sidebar-logo-name em { font-style: normal; color: var(--red); }
.sidebar-label { font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; padding: 0 8px; margin-bottom: 6px; }
.sidebar-nav { list-style: none; display: flex; flex-direction: column; gap: 1px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; transition: background 0.15s, color 0.15s; user-select: none; border: 1px solid transparent; }
.nav-item svg { flex-shrink: 0; opacity: 0.5; transition: opacity 0.15s; }
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item:hover svg { opacity: 0.8; }
.nav-item.active { background: var(--red-dim); color: var(--text); border-color: rgba(255,49,49,0.15); }
.nav-item.active svg { opacity: 1; color: var(--red); }
.sidebar-bottom { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; }
.user-card { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px; background: var(--surface2); border: 1px solid var(--border); }
.user-initial { width: 30px; height: 30px; border-radius: 50%; background: var(--red-dim); border: 1px solid rgba(255,49,49,0.25); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--red); flex-shrink: 0; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--red); letter-spacing: 1px; }
.btn-logout { background: none; border: none; cursor: pointer; color: var(--muted); padding: 4px; border-radius: 5px; transition: color 0.15s; display: flex; }
.btn-logout:hover { color: var(--text); }

/* HAMBURGER */
.hamburger { display: none; position: fixed; top: 16px; left: 16px; z-index: 11; width: 38px; height: 38px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border-hi); align-items: center; justify-content: center; cursor: pointer; color: var(--text); }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 9; backdrop-filter: blur(2px); }

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: none; }
  .sidebar.open ~ .sidebar-overlay, #sidebar-overlay.show { display: block; }
  .main { margin-left: 0 !important; padding: 20px 16px !important; }
}

/* MAIN */
.main { margin-left: 230px; min-height: 100vh; padding: 36px 40px; }

/* COMPONENTS */
.page-header { margin-bottom: 28px; }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -0.8px; line-height: 1; margin-bottom: 5px; }
.page-sub { font-size: 13px; color: var(--muted); }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.topbar-badge { display: flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--red-dim); border: 1px solid rgba(255,49,49,0.15); border-radius: 99px; font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--red); letter-spacing: 1px; }
.topbar-badge span { width: 5px; height: 5px; border-radius: 50%; background: var(--red); animation: pulse 2s ease infinite; }
.topbar-time { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); }
.section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px; overflow: hidden; }
.section-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.section-title { font-size: 13px; font-weight: 700; }
.section-body { padding: 20px; }
.badge { font-family: 'JetBrains Mono', monospace; font-size: 9px; padding: 3px 9px; border-radius: 99px; letter-spacing: 1px; text-transform: uppercase; }
.badge-red { background: var(--red-dim); color: var(--red); border: 1px solid rgba(255,49,49,0.15); }
.badge-green { background: rgba(34,197,94,0.08); color: #4ade80; border: 1px solid rgba(34,197,94,0.15); }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; transition: border-color 0.2s, transform 0.2s; }
.stat-card:hover { border-color: rgba(255,49,49,0.2); transform: translateY(-2px); }
.stat-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--red-dim); border: 1px solid rgba(255,49,49,0.15); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; color: var(--red); }
.stat-label { font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 6px; }
.stat-value { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; }
.info-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.info-row:last-child { border-bottom: none; }
.info-row .label { color: var(--muted); }
.info-row .value { font-weight: 500; font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.coming-soon { text-align: center; padding: 56px 24px; }
.coming-soon-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--red-dim); border: 1px solid rgba(255,49,49,0.15); display: flex; align-items: center; justify-content: center; font-size: 22px; margin: 0 auto 16px; }
.coming-soon h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.coming-soon p { font-size: 12px; color: var(--muted); }

/* FORM */
.config-row { margin-bottom: 16px; }
.config-label { display: block; font-size: 11px; font-family: 'JetBrains Mono', monospace; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px; }
.config-input { width: 100%; background: var(--surface2); border: 1px solid var(--border-hi); border-radius: 8px; padding: 10px 12px; color: var(--text); font-family: 'Inter', sans-serif; font-size: 13px; outline: none; resize: vertical; transition: border-color 0.2s; }
.config-input:focus { border-color: rgba(255,49,49,0.4); }
.style-options { display: flex; flex-wrap: wrap; gap: 8px; }
.style-btn { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; background: var(--surface2); border: 1px solid var(--border); color: var(--muted); font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.15s; }
.style-btn:hover { border-color: var(--border-hi); color: var(--text); }
.style-btn.active { background: var(--red-dim); border-color: rgba(255,49,49,0.3); color: var(--text); }
.btn-salvar { margin-top: 16px; height: 38px; padding: 0 20px; border-radius: 8px; background: var(--red); border: none; color: #fff; font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 700; cursor: pointer; transition: opacity 0.2s; }
.btn-salvar:hover { opacity: 0.85; }
.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-track { position: absolute; inset: 0; background: var(--muted2); border-radius: 99px; transition: background 0.2s; }
.toggle-track::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform 0.2s; }
.toggle-switch input:checked + .toggle-track { background: var(--red); }
.toggle-switch input:checked + .toggle-track::before { transform: translateX(18px); }
.botao-card { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.botao-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.botao-card-title { font-size: 13px; font-weight: 700; }
.botao-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
@media(max-width:600px) { .botao-row { grid-template-columns: 1fr; } }
.cor-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.cor-btn { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform 0.15s, border-color 0.15s; }
.cor-btn:hover { transform: scale(1.15); }
.cor-btn.selected { border-color: #fff; transform: scale(1.15); }

/* STATUS BUTTONS */
.status-btn { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: border-color 0.15s, background 0.15s, transform 0.15s; text-align: left; color: var(--text); font-family: 'Inter', sans-serif; }
.status-btn:hover { background: rgba(255,255,255,0.03); border-color: var(--border-hi); transform: translateY(-1px); }
.status-btn.active { border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.05); }
.status-btn.selected { border-color: rgba(255,49,49,0.4); background: rgba(255,49,49,0.08); }
.status-btn-icon { width: 36px; height: 36px; border-radius: 8px; border: 1px solid; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.status-btn-info { display: flex; flex-direction: column; gap: 2px; }
.status-btn-title { font-size: 13px; font-weight: 700; }
.status-btn-sub { font-size: 11px; color: var(--muted); }
#btn-apply-status { display: none; height: 40px; padding: 0 20px; border-radius: 8px; background: var(--red); border: none; color: #fff; font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 700; cursor: pointer; align-items: center; gap: 8px; transition: opacity 0.2s; }
#btn-apply-status:hover { opacity: 0.85; }
#btn-apply-status:disabled { opacity: 0.5; cursor: not-allowed; }

@keyframes pulse { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:0.5; transform:scale(0.8); } }
@keyframes ping { 0%,100%{transform:scale(1);opacity:0.75} 50%{transform:scale(1.8);opacity:0;} }
@keyframes fadeUp { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
