/* ============================================================
   GOSSIP PORTAL — Estilos do Painel Admin (SaaS Premium)
   ============================================================ */

:root {
  --primary:    #e91e63;
  --primary-d:  #c2185b;
  --secondary:  #ff5722;
  --accent:     #7c3aed;
  --dark:       #0f172a;
  --dark-2:     #1e293b;
  --dark-3:     #334155;
  --sidebar-w:  260px;
  --card:       #1e293b;
  --card-b:     #334155;
  --text:       #f1f5f9;
  --text-muted: #94a3b8;
  --border:     rgba(255,255,255,.06);
  --success:    #10b981;
  --warning:    #f59e0b;
  --danger:     #ef4444;
  --radius:     12px;
  --shadow:     0 4px 24px rgba(0,0,0,.25);
  --font:       'Segoe UI', -apple-system, sans-serif;
  --transition: all .2s ease;
}

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

body {
  font-family: var(--font);
  background: var(--dark);
  color: var(--text);
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ─── LOGIN PAGE ─────────────────────────────────────────── */
.login-page {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--dark) 0%, #1a0533 100%);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(233,30,99,.15), transparent 70%);
  top: -200px;
  right: -100px;
  pointer-events: none;
}

.login-box {
  background: var(--card);
  border-radius: 20px;
  padding: 48px;
  width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  border: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo h1 {
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
}

.login-logo h1 span { color: var(--primary); }

.login-logo p { color: var(--text-muted); font-size: .875rem; margin-top: 4px; }

.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  background: var(--dark);
  border: 1px solid var(--card-b);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text);
  font-size: .9rem;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(233,30,99,.15);
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(233,30,99,.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(233,30,99,.4);
}

.btn-primary:disabled { opacity: .7; cursor: not-allowed; transform: none; }

/* ─── LAYOUT ──────────────────────────────────────────────── */
.admin-layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* ─── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--dark-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand h2 {
  font-size: 1.4rem;
  font-weight: 900;
  color: #fff;
}

.sidebar-brand h2 span { color: var(--primary); }
.sidebar-brand p { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 16px 12px; }

.nav-section-title {
  font-size: .65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.nav-item:hover { background: rgba(255,255,255,.05); color: var(--text); }

.nav-item.active {
  background: linear-gradient(135deg, rgba(233,30,99,.2), rgba(255,87,34,.1));
  color: #fff;
  border: 1px solid rgba(233,30,99,.3);
}

.nav-item .nav-icon { font-size: 1.1rem; width: 20px; text-align: center; }

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,.03);
  cursor: pointer;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  color: #fff;
  flex-shrink: 0;
}

.user-name  { font-size: .875rem; font-weight: 600; }
.user-role  { font-size: .75rem; color: var(--text-muted); }

/* ─── MAIN AREA ───────────────────────────────────────────── */
.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── TOP BAR ─────────────────────────────────────────────── */
.top-bar {
  background: var(--dark-2);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-title { font-size: 1.2rem; font-weight: 700; }

.top-actions { display: flex; align-items: center; gap: 12px; }

.auto-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.05);
  padding: 8px 16px;
  border-radius: 30px;
  font-size: .85rem;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.auto-toggle.active { border-color: var(--success); background: rgba(16,185,129,.1); }

.toggle-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: var(--transition);
}

.auto-toggle.active .toggle-dot { background: var(--success); box-shadow: 0 0 6px var(--success); }

.btn-run {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-run:hover { transform: translateY(-1px); opacity: .9; }

/* ─── PAGE CONTENT ────────────────────────────────────────── */
.page-content { padding: 28px; flex: 1; }

/* ─── STATS GRID ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(to right, var(--primary), var(--secondary));
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.stat-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  display: block;
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label { font-size: .8rem; color: var(--text-muted); font-weight: 500; }

.stat-change {
  font-size: .75rem;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ─── CARDS / PANELS ──────────────────────────────────────── */
.panel {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 24px;
}

.panel-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-body { padding: 24px; }

/* ─── TABLE ───────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.data-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,.02); }

.table-title {
  font-weight: 600;
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── BADGES ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-success   { background: rgba(16,185,129,.15);  color: var(--success); }
.badge-warning   { background: rgba(245,158,11,.15);  color: var(--warning); }
.badge-danger    { background: rgba(239,68,68,.15);   color: var(--danger); }
.badge-primary   { background: rgba(233,30,99,.15);   color: var(--primary); }
.badge-secondary { background: rgba(148,163,184,.1);  color: var(--text-muted); }
.badge-accent    { background: rgba(124,58,237,.15);  color: #a78bfa; }

/* ─── ACTION BUTTONS ──────────────────────────────────────── */
.action-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.action-btn.publish { background: rgba(16,185,129,.15);  color: var(--success); }
.action-btn.archive { background: rgba(148,163,184,.1);  color: var(--text-muted); }
.action-btn.delete  { background: rgba(239,68,68,.15);   color: var(--danger); }
.action-btn.view    { background: rgba(233,30,99,.15);   color: var(--primary); }
.action-btn:hover   { opacity: .8; transform: translateY(-1px); }

/* ─── AUTOMATION STATUS ───────────────────────────────────── */
.automation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.automation-card {
  background: var(--dark-3);
  border-radius: 10px;
  padding: 20px;
  border: 1px solid var(--border);
}

.automation-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .875rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.status-dot.active { background: var(--success); box-shadow: 0 0 6px var(--success); animation: pulse 2s infinite; }
.status-dot.running { background: var(--warning); box-shadow: 0 0 6px var(--warning); animation: pulse .8s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}

.automation-desc  { font-size: .8rem; color: var(--text-muted); }
.automation-time  { font-size: .75rem; color: var(--text-muted); margin-top: 6px; }

/* ─── CHART PLACEHOLDER ───────────────────────────────────── */
.chart-placeholder {
  width: 100%;
  height: 200px;
  background: var(--dark-3);
  border-radius: 10px;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  gap: 8px;
  overflow: hidden;
}

.chart-bar {
  flex: 1;
  background: linear-gradient(to top, var(--primary), rgba(233,30,99,.3));
  border-radius: 6px 6px 0 0;
  min-height: 10px;
  transition: height .5s ease;
  position: relative;
}

.chart-bar:hover { opacity: .8; }

.chart-bar-label {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: .65rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ─── LOG ─────────────────────────────────────────────────── */
.log-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }

.log-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: .8rem;
}

.log-item:last-child { border-bottom: none; }

.log-time  { color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.log-module { color: var(--primary); font-weight: 600; flex-shrink: 0; }
.log-msg    { color: var(--text); flex: 1; }
.log-status { flex-shrink: 0; }

/* ─── TWO COLUMN GRID ─────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ─── TABS ────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; }

.tab-btn {
  padding: 12px 20px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn:hover  { color: var(--text); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ─── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--dark-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .two-col, .three-col { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 16px; }
}
