/* ===== Reset y base ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #1a1a1a;
  background: #f4f6f8;
}
body.guest {
  background: linear-gradient(135deg, #0b3d61 0%, #186faf 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
a { color: #0b3d61; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Topbar ===== */
.topbar {
  background: #0b3d61;
  color: #fff;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.topbar .brand a { color: #fff; font-weight: 700; font-size: 16px; }
.topbar .nav { display: flex; gap: 16px; flex: 1; margin-left: 32px; }
.topbar .navlink {
  color: rgba(255,255,255,.85);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
}
.topbar .navlink:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
  text-decoration: none;
}
.topbar .user { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.topbar .user-name { font-weight: 600; }
.topbar .user-rol {
  font-size: 10px;
  text-transform: uppercase;
  background: rgba(255,255,255,.15);
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: .5px;
}
.btn-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border-radius: 4px;
  font-size: 16px;
}
.btn-icon:hover { background: rgba(255,255,255,.15); text-decoration: none; }

/* ===== Container ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* ===== Login ===== */
.login-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.login-card {
  background: #fff;
  border-radius: 14px;
  padding: 36px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 18px 40px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-card h1 {
  color: #0b3d61;
  font-size: 22px;
  margin-bottom: 0;
}
.login-card .sub { color: #888; font-size: 13px; margin-bottom: 8px; }

/* ===== Forms genéricos ===== */
.field { display: flex; flex-direction: column; gap: 4px; }
.field span { font-size: 12px; color: #555; font-weight: 600; }
.field input {
  border: 1px solid #cfd8dc;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
  outline: none;
}
.field input:focus { border-color: #186faf; box-shadow: 0 0 0 3px rgba(24,111,175,.15); }

.btn-primary {
  background: #0b3d61;
  color: #fff;
  border: none;
  padding: 11px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
}
.btn-primary:hover { background: #0a4d7c; }

.form-wrap { max-width: 480px; margin: 0 auto; }
.form-wrap h1 { color: #0b3d61; margin-bottom: 16px; }
.form-card {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ===== Alerts ===== */
.alert {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  border: 1px solid;
}
.alert.error { background: #fff5f5; color: #b3261e; border-color: #f3b8b3; }
.alert.success { background: #f0faf2; color: #1b7a35; border-color: #b7e2c3; }

/* ===== Home stats ===== */
.welcome { margin-bottom: 24px; }
.welcome h1 { color: #0b3d61; font-size: 24px; }
.welcome .sub { color: #666; font-size: 14px; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat {
  background: #fff;
  padding: 18px 20px;
  border-radius: 10px;
  border: 1px solid #e6ebee;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.stat .v {
  font-size: 26px;
  font-weight: 700;
  color: #0b3d61;
  font-variant-numeric: tabular-nums;
}
.stat .l {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  margin-top: 4px;
  letter-spacing: .3px;
}
.stat.highlight { border-color: #1b7a35; }
.stat.highlight .v { color: #1b7a35; }
.stat.warn { border-color: #f0c000; }
.stat.warn .v { color: #b06b00; }

.notice {
  background: #fffbe6;
  border-left: 3px solid #f0c000;
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 13px;
  color: #6b5500;
}

/* ===== Error page ===== */
.error-page {
  text-align: center;
  padding: 64px 16px;
  background: #fff;
  border-radius: 10px;
}
.error-code {
  font-size: 64px;
  font-weight: 700;
  color: #b3261e;
}
.error-page p { font-size: 16px; color: #555; margin: 16px 0 24px; }
.error-page .btn-primary { display: inline-block; }
