/* ======== VARIABLES DE TEMA ======== */
:root {
    --bg: #ffffff;
    --text: #222222;
    --card-bg: #f3f3f3;
    --border: #cccccc;
    --shadow-strong: 0 16px 40px rgba(0,0,0,0.8);
}

[data-theme="dark"] {
    --bg: #181818;
    --text: #bdbdbd;
    --card-bg: #262626;
    --border: #444444;
}

/* ============================
   TOPBAR
   ============================ */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--color-bg-alt);
  padding: 0 24px;
  height: 56px;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(7px);
  position: sticky;
  top: 0;
  z-index: 20;
}

/* LOGO */
.logo img {
  height: 26px;
  width: auto;
  display: block;
  filter: brightness(1.08);
  transition: opacity 0.25s ease;
}

.logo img:hover {
  opacity: 0.85;
}

[data-theme="light"] .logo img {
  filter: none;
}

/* NAV */
.main-nav {
  display: flex;
  gap: 28px;
}

.nav-item {
  position: relative;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.18s ease;
  padding-bottom: 6px;
}

.nav-item:hover {
  color: #6cd3ff;
}

.nav-item.active {
  color: #6cd3ff;
  font-weight: 600;
}

.nav-item.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background-color: #a5e9ff;
  border-radius: 999px;
}

/* LOGOUT BTN */

.logout-btn {
  background: none;
  border: 1px solid rgba(255, 152, 0, 0.7);
  border-radius: 999px;
  color: var(--hanwha);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  transition: all 0.18s ease;
}

.logout-btn:hover {
  background-color: #b4b4b4
  color: #111827;
  box-shadow: 0 0 14px rgba(255, 152, 0, 0.55);
}

/* ======== ESTILOS GENERALES ======== */

body {
  background: linear-gradient(135deg, #205a91 0%, #141414 40%, #205a91 100%);
  color: #9fbedb;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  padding: 0;
}

header {
    margin-bottom: 20px;
}

main {
    max-width: 600px;
    margin: auto;
}

/* ======== CARDS ======== */
.card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    margin-top: 25px;
    margin-bottom: 25px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

/* ======== ROWS ======== */
.row {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
}

.row label {
    font-weight: bold;
}

/* ======== SELECT ======== */
select {
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    transition: 0.2s;
}

select:hover {
    border-color: #888;
}

/* ======== BOTÓN VOLVER ======== */
.back-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 15px;
    transition: 0.25s;
}

.back-btn:hover {
    background: var(--card-bg);
    transform: translateX(-3px);
}


/* ============================================================
   PANEL ADMIN – CREACIÓN Y LISTADO DE USUARIOS
   ============================================================ */

#adminPanel h3, 
#adminPanel h4 {
    margin-bottom: 12px;
    font-weight: 600;
}

/* Inputs del panel admin */
#adminPanel input,
#adminPanel select {
    width: 100%;
    padding: 7px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    margin-top: 4px;
    margin-bottom: 10px;
    box-sizing: border-box;
}

/* Botón Crear Usuario */
#adminPanel button {
    background: #ff9800;
    color: #111;
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    margin-top: 10px;
    font-weight: 600;
    transition: 0.2s;
}

#adminPanel button:hover {
    background: #ffad33;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.45);
}

/* Tabla de usuarios */
.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 14px;
}

.user-table thead {
    background: var(--card-bg);
}

.user-table th, 
.user-table td {
    border: 1px solid var(--border);
    padding: 8px;
    text-align: left;
}

/* Encabezado tabla */
.user-table th {
    background: rgba(255, 152, 0, 0.15);
    color: var(--text);
    font-weight: 600;
}

/* Alternancia de filas */
.user-table tr:nth-child(even) {
    background: var(--bg);
}

.user-table tr:nth-child(odd) {
    background: var(--card-bg);
}

/* Botones de acción en tabla */
.user-table td button {
    margin-right: 4px;
    padding: 6px 10px;
    border-radius: 5px;
    border: none;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s;
}

/* Colores de acción */
.user-table td button:nth-child(1) { /* Reset pass */
    background: #03a9f4;
    color: #fff;
}
.user-table td button:nth-child(1):hover {
    background: #29b6f6;
}

.user-table td button:nth-child(2) { /* Activar/Desactivar */
    background: #ff9800;
    color: #111;
}
.user-table td button:nth-child(2):hover {
    background: #ffad33;
}

.user-table td button:nth-child(3) { /* Eliminar */
    background: #e53935;
    color: #fff;
}
.user-table td button:nth-child(3):hover {
    background: #ef5350;
}

/* Dark mode enhancement */
[data-theme="dark"] .user-table th {
    background: rgba(255, 152, 0, 0.25);
}

[data-theme="dark"] .user-table td button:nth-child(1) {
    background: #0288d1;
}
[data-theme="dark"] .user-table td button:nth-child(2) {
    background: #fb8c00;
}
[data-theme="dark"] .user-table td button:nth-child(3) {
    background: #d32f2f;
}

/* Corrige filas solo dentro del panel admin */
#adminPanel .row {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: center;
    column-gap: 12px;
}
