:root {
  --azul-oscuro: #0a3d62;
  --azul-medio: #1e6091;
  --azul-claro: #ebf3f9;
  --amarillo-irm: #fcc006;
  --amarillo-hover: #e5ac00;
  --gris-fondo: #f4f7fa;
  --gris-card: #ffffff;
  --gris-borde: #e2e8f0;
  --texto-principal: #1e293b;
  --texto-secundario: #64748b;
  --verde-exito: #10b981;
  --rojo-error: #ef4444;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(10,61,98,0.08);
  --shadow-lg: 0 10px 25px rgba(10,61,98,0.12);
  --radius: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--gris-fondo);
  color: var(--texto-principal);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* NAVBAR */
.navbar {
  background: linear-gradient(135deg, var(--azul-oscuro), var(--azul-medio));
  color: #fff;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
}

.logo-badge {
  background: #fff;
  color: var(--amarillo-irm);
  font-family: 'Arial Black', Impact, sans-serif;
  font-size: 24px;
  font-weight: 900;
  padding: 4px 12px;
  border-radius: 6px;
  text-shadow: 1px 1px 0 #222, -1px 1px 0 #222, 1px -1px 0 #222, -1px -1px 0 #222;
  letter-spacing: 1px;
}

.brand-text h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-text span {
  font-size: 11px;
  color: var(--amarillo-irm);
  font-weight: 600;
  text-transform: uppercase;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.12);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,0.2);
}

.user-role-tag {
  background: var(--amarillo-irm);
  color: var(--azul-oscuro);
  font-weight: 800;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  text-transform: uppercase;
}

.btn-nav {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.btn-nav:hover {
  background: rgba(255,255,255,0.28);
}

.btn-nav-primary {
  background: var(--amarillo-irm);
  color: var(--azul-oscuro);
  border-color: var(--amarillo-irm);
}

.btn-nav-primary:hover {
  background: var(--amarillo-hover);
}

/* MAIN CONTAINER */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  flex: 1;
  width: 100%;
}

/* HERO SECTION */
.hero {
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.hero h2 {
  font-size: 22px;
  color: var(--azul-oscuro);
  font-weight: 700;
}

.hero p {
  color: var(--texto-secundario);
  font-size: 13.5px;
  margin-top: 4px;
}

/* SEARCH & FILTER BAR */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 240px;
  padding: 10px 14px;
  border: 1px solid var(--gris-borde);
  border-radius: var(--radius);
  font-size: 13.5px;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--azul-medio);
}

/* APP GRID */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.app-card {
  background: var(--gris-card);
  border-radius: var(--radius);
  border: 1px solid var(--gris-borde);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.app-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--azul-medio);
}

.app-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--azul-oscuro), var(--amarillo-irm));
}

.app-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.app-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--azul-claro);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.app-title-area h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--azul-oscuro);
  line-height: 1.3;
}

.app-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--azul-medio);
  background: var(--azul-claro);
  padding: 2px 8px;
  border-radius: 12px;
  margin-top: 3px;
}

.app-description {
  color: var(--texto-secundario);
  font-size: 12.5px;
  line-height: 1.5;
  margin-bottom: 18px;
  flex: 1;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--gris-borde);
}

.app-size {
  font-size: 11px;
  color: var(--texto-secundario);
}

.btn-launch {
  background: var(--azul-oscuro);
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.2s;
}

.btn-launch:hover {
  background: var(--azul-medio);
}

/* MODAL STYLES (ADMIN) */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: var(--radius);
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  background: var(--azul-oscuro);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--gris-borde);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #fafafa;
}

/* FORMS */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--texto-principal);
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gris-borde);
  border-radius: 6px;
  font-size: 13.5px;
}

.form-control:focus {
  outline: none;
  border-color: var(--azul-medio);
}

.checkbox-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--gris-borde);
  border-radius: 6px;
  background: #fafafa;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

/* TABLES */
.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 14px;
}

.user-table th, .user-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--gris-borde);
}

.user-table th {
  background: var(--azul-claro);
  color: var(--azul-oscuro);
  font-weight: 700;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 11.5px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.btn-danger {
  background: #fee2e2;
  color: var(--rojo-error);
}
.btn-danger:hover {
  background: #fca5a5;
}

.btn-edit {
  background: var(--azul-claro);
  color: var(--azul-medio);
}
.btn-edit:hover {
  background: #d0e4f5;
}

/* FOOTER */
footer {
  text-align: center;
  padding: 16px;
  color: var(--texto-secundario);
  font-size: 12px;
  background: #fff;
  border-top: 1px solid var(--gris-borde);
}
