* {
  box-sizing: border-box;
}

:root {
  --blue: #0b2a6b;
  --blue-2: #123b8a;
  --green: #8cc63f;
  --cream: #fffae8;
  --ink: #10233f;
  --muted: #697386;
  --line: rgba(11, 42, 107, 0.13);
  --card: rgba(255, 255, 255, 0.94);
  --shadow: 0 22px 58px rgba(11, 42, 107, 0.13);
  --radius: 8px;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(140, 198, 63, 0.18), transparent 320px),
    linear-gradient(135deg, var(--cream) 0%, #f8fbf0 38%, #eef7ff 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(11, 42, 107, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 42, 107, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 72%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.portal-shell {
  position: relative;
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 44px;
}

.portal-topbar,
.section-head,
.employee-card,
.employee-portal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.portal-topbar {
  min-height: 64px;
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.portal-logo {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  height: 48px;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  box-shadow: 0 14px 30px rgba(11, 42, 107, 0.24);
  font-weight: 950;
}

.portal-logo img {
  width: 78%;
  height: 78%;
  display: block;
  object-fit: contain;
}

.portal-brand strong {
  display: block;
  color: var(--blue);
  font-size: 1.08rem;
  line-height: 1.1;
}

.portal-brand small,
.portal-kicker,
.portal-card-tag,
.search-box span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.portal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.portal-button,
.portal-card-action,
.employee-action,
.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 16px;
  cursor: pointer;
  font-weight: 900;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.portal-button:hover,
.portal-card-action:hover,
.employee-action:hover,
.back-button:hover {
  transform: translateY(-1px);
}

.portal-button-light,
.back-button {
  background: rgba(255, 255, 255, 0.76);
  color: var(--blue);
}

.portal-button-dark,
.portal-card-action,
.employee-action {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #0f4fb2);
  box-shadow: 0 14px 26px rgba(11, 42, 107, 0.2);
}

.portal-message {
  margin: 30px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  font-weight: 800;
}

.portal-content {
  display: grid;
  gap: 24px;
}

.portal-hero,
.employees-panel,
.employee-portal-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.portal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  padding: 32px;
  min-height: 230px;
  overflow: hidden;
  position: relative;
}

.portal-hero::after {
  content: "";
  position: absolute;
  right: 28px;
  top: 28px;
  width: 132px;
  height: 132px;
  border: 1px solid rgba(140, 198, 63, 0.34);
  border-radius: 999px;
  opacity: 0.65;
}

.portal-hero h1 {
  margin: 8px 0 12px;
  color: var(--blue);
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.portal-hero p,
.portal-card p,
.employee-meta,
.empty-state {
  color: var(--muted);
  line-height: 1.55;
}

.portal-hero-copy p {
  max-width: 760px;
}

.portal-admin-chip {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(140, 198, 63, 0.45);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--blue);
  background: rgba(140, 198, 63, 0.13);
  font-weight: 900;
  white-space: nowrap;
}

.portal-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.portal-card {
  display: grid;
  align-content: space-between;
  gap: 12px;
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.86)),
    linear-gradient(135deg, rgba(140, 198, 63, 0.12), rgba(11, 42, 107, 0.06));
  box-shadow: 0 18px 38px rgba(11, 42, 107, 0.1);
}

.portal-card h2,
.section-head h2,
.employee-portal-top h2 {
  margin: 0;
  color: var(--blue);
  letter-spacing: 0;
}

.portal-card p {
  margin: 0;
}

.portal-card-action {
  width: fit-content;
}

.employees-panel,
.employee-portal-panel {
  padding: 22px;
}

.employee-portal-panel {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.section-head {
  align-items: end;
  margin-bottom: 18px;
}

.search-box {
  display: grid;
  gap: 6px;
  min-width: min(100%, 340px);
}

.search-box input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.search-box input:focus {
  border-color: rgba(140, 198, 63, 0.78);
  box-shadow: 0 0 0 4px rgba(140, 198, 63, 0.15);
}

.employee-list {
  display: grid;
  gap: 12px;
}

.employee-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 26px rgba(11, 42, 107, 0.07);
}

.employee-card strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
}

.employee-card-main {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.portal-employee-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 999px;
  background: #0b2a6b;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(11, 42, 107, 0.18);
  font-weight: 950;
  line-height: 1;
}

.portal-employee-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.portal-employee-avatar-sm {
  width: 38px;
  height: 38px;
  font-size: 0.78rem;
}

.portal-employee-avatar-md {
  width: 52px;
  height: 52px;
  font-size: 0.98rem;
}

.portal-employee-avatar-lg {
  width: 88px;
  height: 88px;
  font-size: 1.5rem;
}

.profile-avatar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.employee-meta {
  margin-top: 5px;
  font-size: 0.92rem;
}

.employee-action {
  flex: 0 0 auto;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(255, 255, 255, 0.62);
  font-weight: 800;
}

.employee-portal-panel {
  display: grid;
  gap: 18px;
}

.admin-portal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-view-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--blue);
  background: rgba(140, 198, 63, 0.18);
  border: 1px solid rgba(140, 198, 63, 0.38);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.employee-dashboard.admin-employee-dashboard {
  display: grid;
  gap: 22px;
}

.admin-employee-dashboard .control-panel {
  margin-top: 0;
}

.admin-employee-dashboard .timeline-list .empty-state,
.admin-employee-dashboard .training-grid .empty-state {
  width: 100%;
}

@media (max-width: 860px) {
  body {
    overflow-x: hidden;
  }

  .portal-shell,
  .portal-content,
  .employee-portal-panel,
  .employees-panel {
    max-width: 100%;
    min-width: 0;
  }

  .portal-hero,
  .section-head,
  .employee-card,
  .employee-portal-top {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .portal-topbar {
    align-items: center;
    gap: 10px;
  }

  .portal-brand {
    flex: 1 1 auto;
  }

  .portal-actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

  .portal-actions .portal-button {
    width: 44px;
    min-width: 44px;
    padding: 0;
  }

  .portal-actions .action-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .portal-card-action,
  .employee-action,
  .back-button {
    width: 100%;
  }

  .portal-card-grid {
    grid-template-columns: 1fr;
  }

  .admin-portal-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .portal-shell {
    width: min(100% - 16px, 1220px);
    padding-top: 12px;
  }

  .portal-hero,
  .employees-panel,
  .employee-portal-panel {
    border-radius: 18px;
  }

  .portal-hero,
  .employees-panel {
    padding: 18px;
  }

  .employee-card {
    padding: 14px;
  }

  .search-box input {
    width: 100%;
  }
}
.employee-pets-toggle{border:1px solid #d7dfed;border-radius:999px;background:#fff;color:#0b2a6b;font-weight:700;padding:8px 14px;cursor:pointer}.employee-pets-detail{display:grid;gap:10px;margin-top:10px}.employee-pets-detail.hidden{display:none}.employee-pets-detail article{display:flex;align-items:center;gap:10px;border:1px solid #e4e9f2;border-radius:14px;padding:10px}.employee-pet-photo{width:64px;height:64px;flex:0 0 64px;border-radius:14px;overflow:hidden;background:#edf2fa;color:#0b2a6b;display:grid;place-items:center;font-weight:800}.employee-pet-photo img{width:100%;height:100%;object-fit:cover}.employee-pets-detail p{margin:2px 0;color:#5d6675}
.employee-pets-toggle{min-height:44px}.employee-pets-detail article,.employee-pets-detail article>div{min-width:0}.employee-pets-detail p,.employee-pets-detail strong,.appointment-location{overflow-wrap:anywhere}@media(max-width:430px){.employee-pets-detail article{align-items:flex-start}.employee-pet-photo{width:56px;height:56px;flex-basis:56px}.employee-pets-toggle{width:100%}}
.appointment-location{display:inline-flex;align-items:center;min-height:44px;max-width:100%}.employee-pets-detail{min-width:0;overflow:hidden}@media(max-width:430px){.appointment-location{width:100%;justify-content:center}}

/* Variante del portal sobre la tarjeta compartida del panel de empleados. */
.employee-portal-panel .appointment-card{border-radius:17px;background:rgba(255,255,255,.97)}.employee-portal-panel .appointment-meta{background:rgba(255,250,232,.7)}.employee-portal-panel .employee-pets-detail article{background:rgba(255,250,232,.5)}
@media(max-width:560px){.employee-portal-panel .appointment-card{border-radius:15px}}

.employee-portal-panel .appointment-card {
  border-radius: 20px;
  box-shadow: 0 13px 32px rgba(11, 42, 107, 0.1);
}

.employee-portal-panel .appointment-head {
  background: #edf4ff;
}

.employee-portal-panel .employee-pets-detail article {
  border-left: 4px solid #8cc63f;
  background: #fffdf4;
}

/* Mantiene completa la foto de la cita sin alterar el tamano de la miniatura. */
.employee-pet-photo img {
  box-sizing: border-box;
  padding: 3px;
  background: #fff;
  object-fit: contain;
  object-position: center;
}

.employee-pet-behavior { margin-top: 6px; color: #334155; overflow-wrap: anywhere; }
