/* ============================================================
   RRHH CAMPAMENTOS — Estilos globales
   ============================================================ */

:root {
  --blue:        #1d4ed8;
  --blue-light:  #dbeafe;
  --blue-dark:   #1e40af;
  --green:       #15803d;
  --green-light: #dcfce7;
  --amber:       #b45309;
  --amber-light: #fef3c7;
  --red:         #dc2626;
  --red-light:   #fee2e2;
  --purple:      #7c3aed;
  --purple-light:#f5f3ff;
  --gray-50:     #fafafa;
  --gray-100:    #f5f5f4;
  --gray-200:    #e5e5e5;
  --gray-300:    #d4d4d4;
  --gray-400:    #a3a3a3;
  --gray-500:    #737373;
  --gray-700:    #404040;
  --gray-900:    #1a1a1a;
  --white:       #ffffff;
  --radius-sm:   4px;
  --radius-md:   7px;
  --radius-lg:   10px;
  --radius-xl:   12px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:   0 4px 12px rgba(0,0,0,.10);
  --shadow-lg:   0 8px 24px rgba(0,0,0,.12);
  --font:        system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  font-size: 13px;
  color: var(--gray-900);
  background: var(--gray-100);
  line-height: 1.5;
}

/* ── Layout ── */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.app-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 16px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  z-index: 100;
}

.app-nav {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 16px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.app-content {
  flex: 1;
  overflow: auto;
}

/* ── Logo / Brand ── */
.brand {
  font-size: 15px;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  white-space: nowrap;
}

/* ── Nav tabs ── */
.nav-tab {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  color: var(--gray-500);
  text-decoration: none;
  white-space: nowrap;
  transition: background .1s, color .1s;
}
.nav-tab:hover  { background: var(--gray-100); color: var(--gray-900); }
.nav-tab.active { background: var(--blue-light); color: var(--blue); font-weight: 500; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-300);
  background: var(--white);
  color: var(--gray-700);
  cursor: pointer;
  text-decoration: none;
  transition: background .1s, border-color .1s;
  white-space: nowrap;
}
.btn:hover { background: var(--gray-50); }

.btn-primary {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}
.btn-primary:hover { background: var(--blue-dark); }

.btn-danger  { background: var(--red); border-color: var(--red); color: var(--white); }
.btn-danger:hover { filter: brightness(1.1); }

.btn-sm { font-size: 11px; padding: 4px 9px; }
.btn-icon { padding: 6px; }

/* ── Forms ── */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
  margin-bottom: 5px;
}
.form-control {
  width: 100%;
  font-size: 13px;
  padding: 7px 10px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--gray-50);
  color: var(--gray-900);
  transition: border-color .15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--white);
}
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23737373' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; padding-right: 28px; }

/* ── Cards ── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-body { padding: 16px; }

/* ── Badges / Pills ── */
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
}
.badge-blue   { background: var(--blue-light);   color: var(--blue); }
.badge-green  { background: var(--green-light);  color: var(--green); }
.badge-amber  { background: var(--amber-light);  color: var(--amber); }
.badge-red    { background: var(--red-light);    color: var(--red); }
.badge-purple { background: var(--purple-light); color: var(--purple); }
.badge-gray   { background: var(--gray-200);     color: var(--gray-500); }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gray-500);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

/* ── Modal ── */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 600;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  margin-bottom: 40px;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 15px; font-weight: 600; }
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--gray-400);
  padding: 2px 5px;
  border-radius: var(--radius-sm);
}
.modal-close:hover { background: var(--gray-100); }
.modal-body   { padding: 16px 18px; }
.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Context menu ── */
.ctx-menu {
  position: fixed;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 5px;
  z-index: 500;
  min-width: 220px;
  box-shadow: var(--shadow-lg);
  display: none;
}
.ctx-header {
  padding: 7px 10px 6px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 3px;
}
.ctx-header .ctx-name { font-size: 13px; font-weight: 600; }
.ctx-header .ctx-sub  { font-size: 11px; color: var(--gray-500); margin-top: 1px; }
.ctx-info {
  padding: 4px 10px 7px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  color: var(--gray-900);
}
.ctx-item:hover     { background: var(--gray-50); }
.ctx-item.highlight { font-weight: 500; color: var(--blue); }
.ctx-item.danger    { color: var(--red); }
.ctx-sep { height: 1px; background: var(--gray-200); margin: 3px 0; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 500;
  z-index: 700;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; }

/* ── Spinner ── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Login ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 50%, #2563eb 100%);
  padding: 20px;
}
.login-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo h1 { font-size: 20px; color: var(--blue); margin-top: 8px; }
.login-logo p  { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.login-error {
  background: var(--red-light);
  color: var(--red);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-size: 12px;
  margin-bottom: 14px;
}

/* ── Utilidades ── */
.sep { flex: 1; }
.text-muted  { color: var(--gray-500); }
.text-small  { font-size: 11px; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.flex        { display: flex; align-items: center; }
.flex-gap    { gap: 8px; }
.mt-1 { margin-top: 4px;  }
.mt-2 { margin-top: 8px;  }
.mt-3 { margin-top: 16px; }
.p-3  { padding: 16px;    }
.hidden { display: none; }

/* ── Alertas ── */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  margin-bottom: 12px;
}
.alert-info  { background: var(--blue-light);  color: var(--blue); }
.alert-warn  { background: var(--amber-light); color: var(--amber); }
.alert-error { background: var(--red-light);   color: var(--red); }
.alert-ok    { background: var(--green-light); color: var(--green); }

/* ── Responsive básico ── */
@media (max-width: 768px) {
  .app-nav { overflow-x: auto; }
  .hide-mobile { display: none; }
}
