/**
 * Estilos para el Módulo de Gestión de Usuarios (TKD Pro Manager)
 */

:root {
  --bg-body: #F8FAFC;
  --bg-surface: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --border-color: #E2E8F0;
  --accent-blue: #2563EB;
  --accent-green: #16A34A;
  --danger-text: #DC2626;
  --radius-md: 16px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.navbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.15rem;
}

.navbar-brand img { height: 36px; }

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.5rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-title-group h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title-group p {
  margin: 4px 0 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Toolbar de Filtros y Acciones Alineado y Compacto (Estilo Alumnos / Dojangs) */
.toolbar-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 1.25rem;
  background-color: #FFFFFF;
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.filter-controls-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.search-box-compact {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 220px;
  max-width: 340px;
  flex: 1;
}

.search-icon-img {
  position: absolute;
  left: 8px;
  width: 15px;
  height: 15px;
  object-fit: contain;
  pointer-events: none;
}

.search-box-compact input {
  width: 100%;
  padding: 0.35rem 0.65rem 0.35rem 1.85rem;
  font-size: 0.8rem;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  outline: none;
  font-family: inherit;
  height: 32px;
  background: #FFFFFF;
  transition: border-color 0.2s ease;
}

.search-box-compact input:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control-compact {
  height: 32px;
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  outline: none;
  background-color: #FFFFFF;
  color: #0F172A;
  font-family: inherit;
  font-weight: 600;
  transition: border-color 0.2s ease;
}

.form-control-compact:focus {
  border-color: #2563EB;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  border-radius: 8px;
  height: 32px;
}

/* Tabla de Usuarios */
.table-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.users-table th {
  background: #F8FAFC;
  padding: 0.85rem 1rem;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
}

.users-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.users-table tr:last-child td {
  border-bottom: none;
}

.badge-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 800;
}

.badge-status-activo { background: #DCFCE7; color: #166534; }
.badge-status-inactivo { background: #FEE2E2; color: #991B1B; }

/* Modales */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-overlay.active { display: flex; }

.modal-container {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  width: 100%;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.form-group {
  margin-bottom: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.form-control {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
}

.form-control:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn {
  padding: 0.6rem 1.25rem;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

.btn-primary { background: var(--accent-blue); color: white; }
.btn-secondary { background: #F1F5F9; color: var(--text-main); border: 1px solid var(--border-color); }
.btn-danger { background: #FEE2E2; color: #DC2626; }
