/* =========================
   RESET / BASE
   ========================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: Arial, sans-serif;
  background-color: #f0f2f5;
  color: black;
}

/* =========================
   LOGIN
   ========================= */
.login-container {
  max-width: 400px;
  margin: 80px auto;
  padding: 30px;
  background: #deebf7;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0,0,0,0.10);
  position: relative;
}

.logo-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.logo-radius { width: 40px; height: auto; }

.logo-text {
  font-size: 1.4rem;
  font-weight: bold;
  font-style: italic;
  color: #0c0f11;
}

/* Bootstrap helpers (si usas bootstrap en login) */
.form-label { font-weight: bold; text-align: left; display: block; }
.form-control { height: 45px; border: 1px solid #ccc; }
.form-control:focus { border-color: #007bff; box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25); }
.btn-primary { background-color: #007bff; border: none; }
.btn-primary:hover { background-color: #0056b3; }

/* =========================
   NAVBAR (UNIFICADO)
   ========================= */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #e6f0fc;
  padding: 10px 20px;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid #ccc;
}

.logo { display: flex; align-items: center; }
.logo img { width: 35px; margin-right: 5px; }

.radius-text {
  font-weight: bold;
  font-style: italic;
  color: #007bff;
  font-size: 18px;
}

/* Menú central */
.nav-center {
  display: flex;
  gap: 60px;
  justify-content: center;
  flex: 1;
  flex-wrap: wrap;
}

.nav-center a {
  text-decoration: none;
  color: black;
  font-weight: bold;
  font-size: 16px;
  padding: 0 10px;
}

/* Contenedor derecho (buscador + perfil) */
.nav-right{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

/* =========================
   BUSCADOR NAVBAR (AZUL)
   ========================= */
.search-container{
  display:flex;
  align-items:center;
  justify-content:flex-end;
}

.nav-search-form{
  display:flex;
  gap:8px;
  align-items:center;
}

.nav-search-form input{
  height:34px;
  border-radius:999px;
  padding:0 12px;
  border:1px solid #cfe0ff;
  outline:none;
  width:260px;
  background:#fff;
}

.nav-search-form input:focus{
  border-color:#0d6efd;
  box-shadow: 0 0 0 3px rgba(13,110,253,.12);
}

.nav-search-form button{
  height:34px;
  border-radius:999px;
  border:0;
  padding:0 14px;
  background:#0d6efd;
  color:#fff;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.nav-search-form button:hover{ filter:brightness(.95); }

@media (max-width: 900px){
  .nav-search-form input{ width: 200px; }
}
@media (max-width: 600px){
  .search-container{ width:100%; justify-content:center; }
  .nav-search-form{ width:100%; justify-content:center; }
  .nav-search-form input{ width: min(520px, 92vw); }
}

/* Perfil pill (navbar) */
.profile-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  background:#fff;
  border:1px solid #cfe0ff;
  font-size:12px;
  font-weight:700;
  white-space:nowrap;
}

.profile-pill .role{ color:#0d6efd; font-weight:900; }
.profile-pill a{
  color:#dc3545;
  font-weight:900;
  text-decoration:none;
  margin-left:6px;
}
.profile-pill a:hover{ opacity:.85; }

/* =========================
   SUBMENU
   ========================= */
.submenu {
  background-color: #cce0f5;
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 10px 0;
  border-bottom: 1px solid #ccc;
  flex-wrap: wrap;
}

.submenu a {
  text-decoration: none;
  color: black;
  font-weight: bold;
  padding: 0 10px;
}

/* =========================
   PANEL INDEX (CARDS / SOPORTE)
   ========================= */
.main-content {
  padding: 40px 20px;
  margin-top: 80px;
}

.cards-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 100px;
  margin-bottom: 60px;
}

.card {
  border: 3px solid rgb(19, 27, 27);
  padding: 20px;
  width: 200px;
  text-align: center;
}

.card i { font-size: 40px; margin-bottom: 10px; }
.card h3 { margin-bottom: 5px; font-weight: normal; }
.card p { font-weight: bold; }

.soporte{
  margin-top: 60px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
}

.soporte h4 { font-size: 18px; margin-bottom: 10px; font-weight: bold; }

.soporte-box {
  border: 2px solid black;
  padding: 10px;
  width: 200px;
  font-size: 14px;
  text-align: center;
}

.soporte-bottom{
  margin-top: 100px;
  padding-top: 20px;
  border-top: 1px dashed #dbe7ff;
}

/* =========================
   GESTION LAYOUT
   ========================= */
.gestion-container {
  display: flex;
  flex-wrap: nowrap;
  padding: 30px;
  gap: 30px;
  align-items: flex-start;
  min-height: 100vh;
}

.sidebar {
  background-color: #e3e5f0;
  padding: 20px;
  width: 240px;
  min-height: calc(100vh - 20px);
  position: sticky;
  top: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
  font-family: 'Segoe UI', sans-serif;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  border: 3px solid #444344;
  overflow: hidden;
  align-items: center;
}

.sidebar h4 {
  font-size: 18px;
  margin-bottom: 15px;
  color: #003d4d;
}

.sidebar a {
  display: block;
  margin-bottom: 12px;
  padding: 8px 10px;
  text-decoration: none;
  color: #333;
  border-radius: 4px;
  transition: background-color 0.3s ease;
  width: 100%;
}

.sidebar a:hover { background-color: #e0e0e0; color: #000; }

.text-link { color: #0066cc; }

.content-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 300px;
  align-items: flex-start;
  padding: 40px;
}

.main-panel {
  flex-grow: 1;
  width: 100%;
  padding: 30px;
}

.main-panel h1 {
  font-size: 36px;
  color: #004d4d;
  margin-bottom: 20px;
  text-align: left;
}

/* =========================
   ACTION BOX (COMPACTO)
   ========================= */
.action-box{
  border: 2px solid #000;
  padding: 6px 8px;
  line-height: 1.4;
  margin: 10px auto 12px auto;
  width: 100%;
  height: 90px;
  background-color: #f5f5f5;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
}

.action-box button{
  width: 100%;
  padding: 4px 6px;
  margin: 0;
  text-align: center;
  background-color: #6b7280;
  border: 1px solid #444;
  font-weight: bold;
  font-size: 10px;
  color: white;
  cursor: pointer;
  border-radius: 4px;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.25);
  transition: background-color 0.3s;
}

.action-box button:hover{ background-color: #4b5563; }

.action-box p{
  font-size: 10px;
  color: #222;
  text-align: center;
  margin: 2px 0 0 0;
  padding: 2px 0;
}

.action-box .user-input{
  width: 100%;
  padding: 4px;
  margin-top: 6px;
  font-size: 10px;
  text-align: center;
  border: 2px solid #000;
  background-color: #fff;
  color: #000;
  border-radius: 4px;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.15);
}

/* Botón genérico */
.action-btn {
  background-color: #cfead0;
  border: 1px solid black;
  font-weight: bold;
  font-size: 13px;
  padding: 6px 8px;
  margin-bottom: 10px;
  width: 100%;
  cursor: pointer;
  text-align: left;
  box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
  transition: background-color 0.3s ease;
}

/* =========================
   FORM CONTAINER + TABS
   ========================= */
.form-container {
  position: relative;
  width: 500px;
  max-width: 90%;
  background-color: #eef8fb;
  border-radius: 10px;
  padding: 40px 20px 20px;
  margin-top: 10px;
  margin-left: 100px;
  box-shadow: 0 0 10px rgba(0,0,0,0.10);
}

.form-container-eliminar {
  background-color: #eef8fb;
  padding: 20px;
  border-radius: 10px;
  width: 500px;
  max-width: 400px;
  margin-top: 20px;
}
.form-group{
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.form-group.full{
  width: 100%;
}

.form-group label{
  font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea{
  width: 100%;
  box-sizing: border-box;
}
/* Tabs */
.tab-header {
  position: absolute;
  top: -30px;
  left: 20px;
  display: flex;
  gap: 10px;
}

.tab-header div {
  background-color: #82c6d7;
  padding: 8px 15px;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  font-weight: bold;
}

.tab-header .active-tab {
  background-color: #48a5c4;
  color: white;
}

/* Inputs generales SOLO dentro del contenido (no navbar) */
.gestion-container form input[type="text"],
.gestion-container form input[type="password"],
.gestion-container form input[type="email"],
.gestion-container form input[type="tel"],
.gestion-container form select,
.content-panel form input[type="text"],
.content-panel form input[type="password"],
.content-panel form input[type="email"],
.content-panel form input[type="tel"],
.content-panel form select {
  width: 90%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1.5px solid #ccc;
  border-radius: 6px;
  background-color: #fdfdfd;
  transition: border-color 0.3s;
  box-shadow: 1px 1px 3px rgba(0,0,0,0.05);
}

.gestion-container form input:focus,
.gestion-container form select:focus,
.content-panel form input:focus,
.content-panel form select:focus {
  border-color: #48a5c4;
  outline: none;
}

.form-group { margin-bottom: 15px; }
.form-group label { display:block; font-weight:bold; margin-bottom:5px; }

.form-group textarea,
.form-group input,
.form-group select {
  width: 100%;
  padding: 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 5px;
  max-width: 400px;
  margin-top: 20px;
}

/* Botón guardar */
.submit-btn {
  margin-top: 30px;
  background-color: #48a5c4;
  color: white;
  font-size: 15px;
  font-weight: bold;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
  transition: background-color 0.3s;
}
.submit-btn:hover { background-color: #3a92b1; }

.mensaje-confirmacion {
  display: none;
  font-weight: bold;
  margin-top: 10px;
}

/* =========================
   TABLAS + BOTONES
   ========================= */
.user-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.user-table th, .user-table td {
  padding: 12px;
  border-bottom: 1px solid #ccc;
  text-align: left;
}

.btn-edit, .btn-delete {
  padding: 5px 10px;
  font-size: 0.9rem;
  border-radius: 4px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-edit { background-color: #ffc107; color: #000; }
.btn-edit:hover { background-color: #e0a800; }

.btn-delete { background-color: #dc3545; color: #fff; }
.btn-delete:hover { background-color: #b02a37; }

/* =========================
   ALERTAS (perfil, mensajes)
   ========================= */
.alerta {
  margin: 20px auto;
  max-width: 500px;
  padding: 15px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
}

.alertaa{
  margin: 20px auto;
  max-width: 600px;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  background:#fff;
  border:1px solid #dbe7ff;
}

.cerrar-alerta{
  float: right;
  background: none;
  border: none;
  font-weight: bold;
  font-size: 18px;
  cursor: pointer;
  color: #000;
}

.mensaje-exito {
  background-color: #d4edda;
  color: #155724;
  border-left: 5px solid #28a745;
}

.mensaje-error {
  background-color: #f8d7da;
  color: #721c24;
  border-left: 5px solid #dc3545;
}

/* =========================
   PERFILES LISTA
   ========================= */
.perfil-lista{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:20px;
  width:100%;
}

.perfil-item{
  display:flex;
  justify-content:space-between;
  align-items:center;
  background-color:#eef2f7;
  padding:10px 16px;
  border-radius:6px;
  box-shadow:0 0 3px rgba(0,0,0,0.10);
  font-weight:bold;
}

.btn-editar{
  background-color:#007bff;
  color:#fff;
  text-decoration:none;
  padding:5px 10px;
  border-radius:4px;
  font-size:13px;
  transition:background-color 0.3s ease;
  display:inline-flex;
  align-items:center;
  gap:6px;
}

.btn-editar:hover{ background-color:#0056b3; }

/* ===== Action box ancho (para editar perfil) ===== */
.action-box-wide{
  width: 100%;
  border: 2px solid #000;
  background: #ffffff;
  border-radius: 8px;
  padding: 10px;
  margin: 10px 0 12px 0;

  display: flex;
  flex-direction: column;
  gap: 8px;

  height: auto;
  align-items: stretch;
  justify-content: flex-start;
}

.action-box-wide .action-btn{
  width: 100%;
  text-align: center;
  font-size: 12px;
  background: #cccccc;
}

.action-box-wide .mini-label{
  font-size: 11px;
  font-weight: 800;
  opacity: .85;
  margin: 0;
}

/* ✅ INPUT NORMAL (arreglado) */
.sidebar .action-box-wide .user-input{
  width: 100% !important;
  max-width: 100% !important;
  margin-top: 0 !important;

  font-size: 12px !important;
  padding: 8px 10px !important;

  border-radius: 6px !important;
  border: 1.5px solid #ccc !important;
  background: #fff !important;

  box-shadow: 1px 1px 3px rgba(0,0,0,0.12) !important;
}

.form-actions{
  display:flex;
  gap:12px;
  margin-top:18px;
  flex-wrap: wrap;
}

.submit-btn.danger{
  background:#c0392b !important;
}

/* ===== Estado / Sesión (COMPACTO PRO) ===== */
.status-card{
  margin-top: 14px;
  background: #ffffff;
  border: 1px solid #e2ecf1;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.05);
  max-width: 520px;
}

.status-header{
  display:flex;
  align-items:center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.status-header h3{
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.status-badge{
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 11px;
}

.status-badge.online{
  background:#e6f6ec;
  color:#157a2e;
  border: 1px solid #bfe9cc;
}

.status-badge.offline{
  background:#fdecec;
  color:#b3261e;
  border: 1px solid #f3b7b3;
}

.status-grid{
  display:flex;
  flex-direction: column;
  gap: 6px;
}

.status-row{
  display:grid;
  grid-template-columns: 1.4fr 1fr;
  align-items:center;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f8fbfd;
  border: 1px solid #e3eef4;
}

.status-row .k{
  font-size: 13px;
  font-weight: 700;
  color:#123;
}

.status-row .v{
  font-size: 13px;
  text-align:right;
  color:#234;
  font-weight: 600;
}

.status-row .v.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.status-row.total{
  background: linear-gradient(135deg, #eef7ff, #f6fbff);
  border: 1px solid #cfe4ff;
}

.status-row.total .k{ font-weight: 900; }

.status-row.total .v{
  font-weight: 900;
  color:#0b5ed7;
}

/* =========================================================
   ✅ RESPONSIVE GENERAL (TELÉFONO)
   - Incluye sidebar estilo "rw-box" para que se vea igual que Reportes
   ========================================================= */
@media (max-width: 768px){

  /* Navbar: ordenado */
  .navbar{
    flex-direction: row;
    align-items: center;
    padding: 10px 12px;
    gap: 10px;
  }

  .logo{
    width: 100%;
    justify-content: flex-start;
  }

  /* Menú superior en scroll horizontal */
  .nav-center{
    width: 100%;
    order: 2;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 16px;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .nav-center a{
    flex: 0 0 auto;
    font-size: 14px;
    padding: 8px 10px;
  }

  /* Derecha: buscador + perfil a 100% */
  .nav-right{
    width: 100%;
    order: 3;
    justify-content: center;
    gap: 10px;
  }
  .search-container{ width: 100%; justify-content: center; }
  .nav-search-form{ width: 100%; }
  .nav-search-form input{ width: 100% !important; max-width: 100% !important; }

  .profile-pill{
    width: 100%;
    justify-content: center;
    white-space: normal;
  }

  /* Submenu como tabs en scroll */
  .submenu{
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 10px;
    padding: 10px 12px;
    -webkit-overflow-scrolling: touch;
  }
  .submenu a{
    flex: 0 0 auto;
    background:#e6f0fc;
    border:1px solid #bcd6ff;
    padding: 10px 14px;
    border-radius: 999px;
  }

  /* Index: reducir espacios */
  .main-content{
    margin-top: 18px;
    padding: 18px 12px;
  }
  .cards-container{
    gap: 14px;
    margin-bottom: 20px;
  }
  .card{
    width: 100%;
    max-width: 520px;
  }
  .soporte{
    margin-top: 26px;
    justify-content: center;
  }
  .soporte-box{
    width: 100%;
    max-width: 520px;
  }

  /* Gestión: 1 columna */
  .gestion-container{
    display: block;
    padding: 12px;
    gap: 0;
  }

  /* ✅ SIDEBAR como RW-BOX (igual a Reportes) */
  .sidebar{
    width: 100% !important;
    max-width: 560px;
    margin: 0 auto 18px auto;

    background:#f5fbff;
    border:1px solid #dbe7ff;
    border-radius:14px;
    padding:14px;

    box-shadow:0 10px 25px rgba(0,0,0,.08);

    position: static;
    top: auto;
    min-height: auto;
    overflow: hidden;
    align-items: stretch; /* mejor en móvil */
  }

  .sidebar h4{
    font-weight:900;
    font-size:18px;
    color:#0b3b4d;
    text-align:center;
    margin-bottom:12px;
    border-bottom:1px solid #dbe7ff;
    padding-bottom:6px;
  }

  .sidebar a{
    background:#ffffff;
    border:1px solid #e6efff;
    border-radius:10px;
    padding:10px 12px;
    margin-bottom:10px;
    font-weight:800;
    box-shadow:0 2px 6px rgba(0,0,0,.04);
  }

  .sidebar a:hover{ background:#eef5ff; }
.attr-select{
  width:100%;
  height:40px;
  border-radius:10px;
  border:1px solid #cfe0ff;
  padding:0 12px;
  background:#fff;
  font-weight:700;
}

  /* Action box dentro del sidebar en móvil */
  .action-box{
    background:#ffffff;
    border:1px solid #dbe7ff;
    border-radius:12px;
    padding:12px;
    gap:8px;
    height:auto;
  }
  .action-box button{
    height:40px;
    font-size:12px;
    border-radius:10px;
  }
  .action-box p{
    font-size:12px;
    font-weight:800;
  }
  .action-box .user-input{
    height:40px;
    font-size:13px;
    border-radius:10px;
    border:1px solid #cfe0ff;
    margin-top:0;
  }

  .content-panel{
    padding: 14px 6px;
    width: 100%;
  }
  .main-panel{
    padding: 10px;
  }
  .main-panel h1{
    font-size: 28px;
  }

  .form-container{
    width: 100%;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    padding: 34px 14px 14px;
  }

  .tab-header{
    left: 12px;
  }
}

/* Estado / Sesión responsive fino */
@media (max-width: 600px){
  .status-card{ max-width: 100%; }
  .status-row{ grid-template-columns: 1fr; }
  .status-row .v{ text-align:left; opacity:.85; }
}
