:root {
  --bg: #f3f6fb;
  --card: #ffffff;
  --border: #dbe3ef;
  --text: #1b2430;
  --muted: #657083;
  --primary: #1f5fbf;
  --primary-soft: #eaf2ff;
  --danger: #c13a3a;
  --success: #117a44;
  --user-green: #1e9b45;
  --user-green-dark: #157536;
  --shadow: 0 12px 30px rgba(17, 31, 61, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body.admin-page.locked {
  overflow: hidden;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 24px 32px;
  background: linear-gradient(135deg, #183764, #265da6);
  color: #fff;
}

.site-header h1 { margin: 0 0 8px; font-size: 1.9rem; }
.site-header p { margin: 0; color: rgba(255,255,255,.85); }
.compact-header { justify-content: center; text-align: center; }

.brand-inline {
  display: flex;
  align-items: center;
  gap: 16px;
}

.centered-brand {
  justify-content: center;
}

.brand-logo {
  width: 78px;
  height: 78px;
  object-fit: contain;
  border-radius: 16px;
  background: rgba(255,255,255,.14);
  padding: 8px;
  flex-shrink: 0;
}

.nav-links { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.nav-links a,
.ghost-btn {
  text-decoration: none;
  color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  padding: 10px 14px;
  border-radius: 12px;
  background: transparent;
}
.nav-links a.active,
.nav-links a:hover,
.ghost-btn:hover { background: rgba(255,255,255,.14); }

.container {
  width: min(1200px, calc(100% - 32px));
  margin: 24px auto 32px;
}

.admin-layout,
.user-page-layout {
  display: grid;
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.wide-card { overflow: hidden; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.wrap { flex-wrap: wrap; }

h2 { margin-top: 0; margin-bottom: 16px; font-size: 1.25rem; }

.stack-form {
  display: grid;
  gap: 14px;
  max-width: 520px;
}

.small-form { max-width: 420px; }

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #c9d5e6;
  border-radius: 12px;
  font-size: 0.98rem;
}

button {
  border: none;
  background: var(--primary);
  color: white;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
}

button:hover { filter: brightness(1.04); }
button.secondary { background: #4c678f; }
button.danger { background: var(--danger); }

.user-grid,
.selector-grid,
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.user-card,
.user-pick {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
}

.user-pick {
  background: var(--user-green);
  color: #fff;
  min-height: 110px;
  border: 1px solid rgba(0,0,0,.08);
}

.user-pick .meta {
  color: rgba(255,255,255,.92);
}

.user-pick.selected {
  border: 3px solid #c7ffd7;
  background: var(--user-green-dark);
  transform: translateY(-1px);
}

.user-card h3,
.user-pick h3 {
  margin: 0 0 8px;
  font-size: 1.03rem;
}

.meta {
  color: var(--muted);
  font-size: 0.93rem;
  margin-bottom: 12px;
}

.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-actions button { flex: 1; }
.inline-actions .small-danger { background: var(--danger); }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 999px;
  font-weight: 700;
}

.toolbar {
  display: flex;
  gap: 10px;
}

.toolbar input { min-width: 280px; }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th { background: #f7f9fc; }

.empty-state,
.selected-user,
.status-message {
  margin: 16px 0 0;
  color: var(--muted);
}

.empty-state-box:empty::before {
  content: "No hay datos disponibles.";
  color: var(--muted);
}

.mark-btn {
  min-height: 82px;
  font-size: 1rem;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 16px 18px;
  text-align: left;
  box-shadow: 0 8px 18px rgba(17, 31, 61, 0.10);
}

.status-success { color: var(--success); font-weight: 700; }
.status-error { color: var(--danger); font-weight: 700; }

.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 17, 31, 0.68);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}

.login-overlay.hidden {
  display: none;
}

.login-card {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 24px 50px rgba(0,0,0,.22);
}

.login-help {
  margin: 16px 0 0;
  color: var(--muted);
}

@media (max-width: 800px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .brand-inline {
    align-items: flex-start;
  }

  .toolbar,
  .section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar input { min-width: auto; }
}


.mark-btn {
  min-height: 82px;
  font-size: 1rem;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 16px 18px;
  text-align: left;
  box-shadow: 0 8px 18px rgba(17, 31, 61, 0.10);
}

.mark-btn .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.mark-btn span:last-child {
  line-height: 1.2;
}

.entrada-btn {
  background: linear-gradient(135deg, #1f9d55, #157f43);
}

.colacion-salida-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.colacion-entrada-btn {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.salida-btn {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}
