/* =============================================
   NET-UAI — ESTILOS DO PAINEL ADMINISTRATIVO
   ============================================= */

:root {
  --primary:       #7CB518;
  --primary-dark:  #5A8A0F;
  --primary-light: #A8D520;
  --accent:        #C8E63A;
  --sidebar-bg:    #0F1A05;
  --sidebar-w:     280px;
  --bg-page:       #f0f5e8;
  --bg-card:       #ffffff;
  --text-dark:     #1a2e08;
  --text-mid:      #3d5c1a;
  --text-muted:    #6b8e4e;
  --border:        #d8ecbf;
  --danger:        #e53e3e;
  --success:       #38a169;
  --warning:       #d69e2e;
  --shadow-sm:     0 2px 8px rgba(0,0,0,.07);
  --shadow-md:     0 6px 24px rgba(0,0,0,.1);
  --radius-sm:     8px;
  --radius-md:     14px;
  --transition:    all .25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Open Sans', sans-serif;
  background: var(--bg-page);
  color: var(--text-dark);
  display: flex;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
ul { list-style: none; }
button { cursor: pointer; }

/* ── SIDEBAR ─────────────────────────────── */
.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  min-height: 100vh;
  position: fixed;
  left: 0; top: 0;
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: var(--transition);
}
.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(124,181,24,.12);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-logo { height: 42px; border-radius: 8px; }
.sidebar-brand {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  color: var(--accent);
  font-size: 1.2rem;
  line-height: 1.1;
}
.sidebar-brand small {
  display: block;
  font-size: .65rem;
  font-weight: 400;
  color: rgba(255,255,255,.5);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.sidebar-nav { flex: 1; padding: 20px 12px; overflow-y: auto; }
.nav-section-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: 12px 12px 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.7);
  font-size: .9rem;
  font-weight: 600;
  transition: var(--transition);
  margin-bottom: 2px;
  cursor: pointer;
}
.sidebar-link i { width: 18px; text-align: center; font-size: 1rem; }
.sidebar-link:hover { background: rgba(124,181,24,.15); color: var(--accent); }
.sidebar-link.active { background: var(--primary); color: var(--white); }
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(124,181,24,.12);
}
.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.5);
  font-size: .85rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.sidebar-footer a:hover { color: var(--accent); background: rgba(124,181,24,.1); }

/* ── MAIN CONTENT ────────────────────────── */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.admin-topbar {
  background: var(--bg-card);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
}
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.topbar-btn:hover { background: var(--primary-dark); }
.topbar-btn.danger { background: var(--danger); }
.topbar-btn.secondary { background: var(--text-mid); }
.admin-content { padding: 32px; flex: 1; }

/* ── PAINEIS / TABS ──────────────────────── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── CARDS ───────────────────────────────── */
.admin-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 28px 32px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}
.admin-card h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-card h2 i { color: var(--primary); }

/* ── FORMULÁRIOS ─────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.form-group input,
.form-group textarea,
.form-group select {
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: inherit;
  color: var(--text-dark);
  background: var(--bg-page);
  transition: var(--transition);
  width: 100%;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(124,181,24,.15);
}
.form-group textarea { min-height: 130px; resize: vertical; }

/* ── BOTÕES ADMIN ────────────────────────── */
.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 50px;
  font-size: .9rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.btn-save { background: var(--primary); color: #fff; }
.btn-save:hover { background: var(--primary-dark); }
.btn-add { background: var(--success); color: #fff; }
.btn-add:hover { background: #2d8a5a; }
.btn-delete { background: var(--danger); color: #fff; }
.btn-delete:hover { background: #c53030; }
.btn-edit { background: var(--warning); color: #fff; }
.btn-edit:hover { background: #b7851a; }
.btn-cancel { background: #e2e8f0; color: var(--text-dark); }
.btn-cancel:hover { background: #cbd5e0; }

/* ── TABELAS ADMIN ───────────────────────── */
.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}
.admin-table th {
  padding: 12px 16px;
  background: var(--bg-page);
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-mid);
  border-bottom: 2px solid var(--border);
  text-align: left;
}
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(124,181,24,.04); }
.admin-table td img { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; }
.actions-cell { display: flex; gap: 8px; }

/* ── BADGES ──────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: .73rem;
  font-weight: 700;
}
.badge-green { background: rgba(56,161,105,.15); color: var(--success); }
.badge-red { background: rgba(229,62,62,.15); color: var(--danger); }

/* ── UPLOAD DE IMAGEM ────────────────────── */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-page);
  position: relative;
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--primary);
  background: rgba(124,181,24,.05);
}
.upload-area i { font-size: 2.5rem; color: var(--primary-light); margin-bottom: 12px; display: block; }
.upload-area p { color: var(--text-muted); font-size: .9rem; }
.upload-area strong { color: var(--primary); }
.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.upload-preview img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid var(--border);
}

/* ── LOGO UPLOAD ─────────────────────────── */
.logo-upload-area {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px;
  background: var(--bg-page);
  border-radius: var(--radius-md);
  border: 2px dashed var(--border);
}
.current-logo {
  width: 100px;
  height: 80px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--sidebar-bg);
  padding: 8px;
}
.logo-actions { display: flex; flex-direction: column; gap: 10px; }
.logo-actions label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--primary);
  color: #fff;
  border-radius: 50px;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.logo-actions label:hover { background: var(--primary-dark); }
.logo-actions input[type="file"] { display: none; }

/* ── CORES ───────────────────────────────── */
.colors-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.color-item { display: flex; align-items: center; gap: 12px; }
.color-item label { font-size: .85rem; font-weight: 600; color: var(--text-mid); flex: 1; }
.color-item input[type="color"] {
  width: 48px; height: 38px;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  cursor: pointer;
  background: none;
}

/* ── TOAST ───────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: #1a2e08;
  color: #f0f8e8;
  padding: 14px 22px;
  border-radius: 10px;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-md);
  min-width: 280px;
  max-width: 420px;
  transform: translateX(120%);
  opacity: 0;
  transition: transform .35s ease, opacity .35s ease;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--primary); }

/* ── MODAL ───────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 32px;
  max-width: 560px;
  width: 90%;
  box-shadow: var(--shadow-md);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-box h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-box h3 i { color: var(--primary); }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }

/* ── STAT CARDS ──────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-card.danger { border-left-color: var(--danger); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.success { border-left-color: var(--success); }
.stat-card-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: rgba(124,181,24,.12);
  color: var(--primary);
  flex-shrink: 0;
}
.stat-card.danger .stat-card-icon { background: rgba(229,62,62,.1); color: var(--danger); }
.stat-card.warning .stat-card-icon { background: rgba(214,158,46,.1); color: var(--warning); }
.stat-card.success .stat-card-icon { background: rgba(56,161,105,.1); color: var(--success); }
.stat-card-value {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1;
}
.stat-card-label { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }

/* TOGGLE SWITCH */
.toggle-switch { position: relative; display: inline-block; width: 46px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ccc;
  border-radius: 24px;
  transition: .3s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: .3s;
}
input:checked + .toggle-slider { background: var(--primary); }
input:checked + .toggle-slider::before { transform: translateX(22px); }

/* Highlight para plano */
.plan-highlight-row { background: rgba(124,181,24,.06) !important; }

/* RESPONSIVE ADMIN */
@media (max-width: 1024px) {
  .admin-sidebar { width: 220px; }
  .admin-main { margin-left: 220px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
    width: 260px;
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .colors-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .sidebar-toggle-btn { display: flex; }
}

.sidebar-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.2rem;
  cursor: pointer;
}
.overlay-mob {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 199;
}
.overlay-mob.active { display: block; }
