/* ============================================================
   Lunex Admin — Estilos do Painel Administrativo
   ============================================================ */

:root {
  --a-primary:    #121875;
  --a-accent:     #ff4b0f;
  --a-sidebar:    #0c0f28;
  --a-sidebar-t:  #c8cde8;
  --a-bg:         #f0f2f8;
  --a-card:       #ffffff;
  --a-border:     #e0e0e8;
  --a-text:       #1b1b1b;
  --a-muted:      #6b7280;
  --a-danger:     #dc3545;
  --a-success:    #198754;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--a-bg);
  color: var(--a-text);
  font-size: 14px;
  line-height: 1.5;
}

/* ── Layout ──────────────────────────────────────────────── */
.admin-wrap {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--a-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-brand {
  padding: 1.4rem 1.2rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-brand img {
  height: 30px;
  width: auto;
}
.sidebar-brand span {
  color: #fff;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: .85;
}

.sidebar-nav {
  flex: 1;
  padding: .75rem 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .7rem 1.2rem;
  color: var(--a-sidebar-t);
  text-decoration: none;
  font-size: .875rem;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}
.nav-item:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}
.nav-item.active {
  background: rgba(255,75,15,.15);
  color: #ff7a52;
  border-left-color: var(--a-accent);
}

.nav-badge {
  background: var(--a-accent);
  color: #fff;
  border-radius: 20px;
  font-size: .68rem;
  font-weight: 700;
  padding: .1rem .45rem;
  margin-left: auto;
}

.sidebar-footer {
  padding: 1rem 1.2rem;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.admin-username {
  color: rgba(255,255,255,.5);
  font-size: .78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-logout {
  color: rgba(255,255,255,.45);
  text-decoration: none;
  font-size: .78rem;
  transition: color .15s;
}
.sidebar-logout:hover { color: #fff; }

/* ── Main Content ────────────────────────────────────────── */
.admin-main {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-topbar {
  background: var(--a-card);
  border-bottom: 1px solid var(--a-border);
  padding: .9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.admin-topbar h1 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--a-primary);
}

.admin-content {
  padding: 1.5rem;
  flex: 1;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--a-card);
  border: 1px solid var(--a-border);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 6px rgba(0,0,0,.05);
}

/* ── Stats ───────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--a-card);
  border: 1px solid var(--a-border);
  border-radius: 12px;
  padding: 1.2rem;
  text-align: center;
  box-shadow: 0 1px 6px rgba(0,0,0,.04);
}
.stat-card .stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--a-primary);
  line-height: 1;
}
.stat-card .stat-label {
  font-size: .78rem;
  color: var(--a-muted);
  margin-top: .4rem;
}
.stat-card.highlight .stat-num { color: var(--a-accent); }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
thead th {
  background: var(--a-bg);
  text-align: left;
  padding: .65rem .9rem;
  font-weight: 600;
  color: var(--a-muted);
  border-bottom: 2px solid var(--a-border);
  white-space: nowrap;
}
tbody td {
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--a-border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(18,24,117,.026); }
.tr-new { background: rgba(255,75,15,.04); }
.tr-new td:first-child {
  border-left: 3px solid var(--a-accent);
  padding-left: calc(.9rem - 3px);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .9rem;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  line-height: 1.4;
}
.btn:hover { opacity: .85; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--a-primary); color: #fff; }
.btn-accent  { background: var(--a-accent);  color: #fff; }
.btn-success { background: var(--a-success); color: #fff; }
.btn-danger  { background: var(--a-danger);  color: #fff; }
.btn-ghost   {
  background: transparent;
  color: var(--a-muted);
  border: 1px solid var(--a-border);
}
.btn-sm { padding: .3rem .65rem; font-size: .75rem; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: .35rem;
  font-size: .875rem;
  color: var(--a-text);
}
.form-control {
  width: 100%;
  padding: .65rem .9rem;
  border: 1px solid var(--a-border);
  border-radius: 8px;
  font-size: .875rem;
  font-family: inherit;
  color: var(--a-text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
  border-color: var(--a-accent);
  box-shadow: 0 0 0 3px rgba(255,75,15,.15);
}
select.form-control { appearance: auto; cursor: pointer; }
textarea.form-control { resize: vertical; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  padding: .8rem 1rem;
  border-radius: 8px;
  font-size: .875rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}
.alert-success { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.alert-danger  { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.alert-info    { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.alert-warning { background: #fef9c3; color: #854d0e; border-color: #fde68a; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-muted   { background: #e5e7eb; color: #6b7280; }

/* ── Img preview ─────────────────────────────────────────── */
.img-preview {
  max-width: 64px;
  max-height: 44px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--a-border);
  display: block;
}

/* ── Login page ──────────────────────────────────────────── */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--a-sidebar);
  padding: 1.5rem;
}
.login-box {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.login-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}
.login-logo img {
  height: 48px;
  background: #0c0f28;
  border-radius: 10px;
  padding: 8px 14px;
}
.login-logo p {
  color: var(--a-muted);
  font-size: .83rem;
  margin-top: .5rem;
}
.login-title {
  text-align: center;
  color: var(--a-primary);
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}

/* ── Detail grid ─────────────────────────────────────────── */
.detail-grid {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.detail-list  { flex: 1 1 420px; }
.detail-panel { flex: 1 1 320px; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-240px); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,.4); }
  .admin-main { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
