:root {
  --bg: #0d1522;
  --surface: rgba(18, 27, 40, 0.94);
  --surface-strong: rgba(21, 31, 46, 0.98);
  --surface-soft: rgba(255, 255, 255, 0.04);
  --border: rgba(182, 195, 214, 0.14);
  --accent: #8fa7c2;
  --accent-strong: #d7e0ea;
  --accent-warm: #c2ccd8;
  --success: #78c08f;
  --danger: #d77a72;
  --warning: #d1b56c;
  --text: #f2f5f8;
  --text-soft: #b2bcc8;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  --ung: #7f95ae;
  --isa: #9aa8b5;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --font-sans: "IBM Plex Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(164, 177, 194, 0.09), transparent 34%),
    radial-gradient(circle at bottom right, rgba(89, 104, 123, 0.1), transparent 30%),
    linear-gradient(180deg, #0b1119 0%, #101823 44%, #0d1522 100%);
  color: var(--text);
  font-family: var(--font-sans);
}

body {
  overscroll-behavior-y: contain;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.ambient {
  position: fixed;
  width: 44vmax;
  height: 44vmax;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.45;
  pointer-events: none;
  animation: pulse 10s ease-in-out infinite alternate;
}

.ambient-left {
  top: -10vmax;
  left: -10vmax;
  background: rgba(133, 148, 168, 0.12);
}

.ambient-right {
  right: -16vmax;
  bottom: -14vmax;
  background: rgba(103, 116, 133, 0.12);
}

.app-root {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 18px 16px 28px;
  display: flex;
  justify-content: center;
}

.phone-frame {
  width: min(100%, 520px);
  display: grid;
  gap: 18px;
  align-content: start;
}

.portal-mini-nav {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 1px;
}

.portal-mini-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-soft);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.portal-mini-nav a:hover,
.portal-mini-nav a.active {
  color: var(--text);
  border-color: rgba(215, 224, 234, 0.28);
  background: rgba(255, 255, 255, 0.08);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  padding: 24px;
  display: grid;
  gap: 16px;
}

.login-hero-card {
  background:
    linear-gradient(180deg, rgba(16, 24, 36, 0.98), rgba(13, 20, 31, 0.96)),
    var(--surface);
}

.login-hero-card.safety {
  background:
    linear-gradient(180deg, rgba(16, 24, 36, 0.98), rgba(13, 20, 31, 0.96)),
    var(--surface);
}

.login-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
}

.login-hero-copy {
  display: grid;
  gap: 12px;
}

.hero-copy-block {
  display: grid;
  gap: 8px;
}

.login-card-refined {
  display: grid;
  gap: 18px;
}

.login-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.employee-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  flex-shrink: 0;
}

.employee-avatar-initials {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface-soft);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--accent-strong);
  flex-shrink: 0;
}

.hero-eyebrow,
.mono {
  font-family: var(--font-mono);
  color: var(--text-soft);
  font-size: 0.84rem;
}

.hero h1,
.section-title {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1;
}

.hero-copy {
  color: var(--text-soft);
  line-height: 1.5;
  margin: 0;
}

.login-card,
.panel-card,
.upload-card,
.detail-card,
.signature-card {
  padding: 22px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field label {
  font-size: 0.92rem;
  color: var(--text-soft);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(146, 179, 255, 0.15);
  background: rgba(5, 12, 23, 0.72);
  color: var(--text);
  border-radius: 18px;
  padding: 14px 16px;
  outline: none;
  transition: border-color 160ms ease, transform 160ms ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(88, 166, 255, 0.75);
  transform: translateY(-1px);
}

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

.btn {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-primary {
  color: #0e1722;
  background: linear-gradient(180deg, #d7dee6, #b4c0cd);
  font-weight: 700;
}

.btn-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.btn-danger {
  color: white;
  background: rgba(255, 122, 102, 0.18);
  border: 1px solid rgba(255, 122, 102, 0.3);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
  font-size: 0.88rem;
}

.pill.ung {
  background: rgba(88, 166, 255, 0.14);
  color: #b9dcff;
}

.pill.isa {
  background: rgba(255, 156, 102, 0.14);
  color: #ffd6be;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  text-transform: capitalize;
}

.status.pendiente {
  background: rgba(244, 202, 98, 0.14);
  color: #ffe29f;
}

.status.leido {
  background: rgba(88, 166, 255, 0.12);
  color: #b7d8ff;
}

.status.firmado {
  background: rgba(87, 212, 134, 0.14);
  color: #bdf5cd;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.summary-item {
  background: var(--surface-soft);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 16px;
}

.summary-item strong {
  display: block;
  font-size: 1.2rem;
  margin-top: 8px;
}

.pending-signature-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(87, 212, 134, 0.34);
  border-radius: 999px;
  background: rgba(87, 212, 134, 0.12);
  color: #bdf5cd;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  min-width: 0;
}

.nav button {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
  border: 1px solid transparent;
}

.nav button.active {
  color: var(--text);
  border-color: rgba(88, 166, 255, 0.26);
  background: rgba(88, 166, 255, 0.14);
}

.nav-panel {
  padding: 14px;
}

.notification-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  min-width: 0;
}

.notification-selector .filter-chip {
  min-height: 44px;
  justify-content: space-between;
  min-width: 0;
  width: 100%;
  padding: 10px 11px;
  white-space: normal;
}

.notification-selector .filter-chip span {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: left;
  line-height: 1.15;
}

.profile-tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: max-content;
  align-self: start;
  margin-left: auto;
}

.profile-tab-avatar {
  display: inline-flex;
  width: 28px;
  height: 28px;
}

.profile-tab-avatar .employee-avatar,
.profile-tab-avatar .employee-avatar-initials {
  width: 28px;
  height: 28px;
  border-width: 1px;
  font-size: 10px;
}

.notification-list {
  display: grid;
  gap: 14px;
}

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
}

.filter-chip strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 0.82rem;
}

.filter-chip.active {
  border-color: rgba(88, 166, 255, 0.35);
  background: rgba(88, 166, 255, 0.14);
  color: var(--text);
}

@media (max-width: 640px) {
  .nav {
    display: grid;
    grid-template-columns: 1fr;
  }

  .notification-selector {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notification-selector .filter-chip {
    justify-content: space-between;
  }

  .profile-tab-button {
    width: 100%;
    min-width: 0;
    margin-left: 0;
  }
}

.category-pill {
  background: rgba(247, 169, 92, 0.14);
  color: #ffd8be;
}

.notification-card {
  padding: 18px;
  display: grid;
  gap: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.035));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 22px;
}

.notification-card h3,
.detail-card h2 {
  margin: 0;
}

.meta-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.muted {
  color: var(--text-soft);
}

.detail-card {
  display: grid;
  gap: 18px;
}

.content-box {
  padding: 18px;
  border-radius: 22px;
  background: rgba(3, 10, 19, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.06);
  white-space: pre-wrap;
  line-height: 1.55;
}

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

.doc-item {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.doc-item a {
  color: #d7ebff;
  text-decoration: none;
}

.signature-canvas {
  width: 100%;
  height: 220px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    repeating-linear-gradient(180deg, transparent 0, transparent 38px, rgba(255, 255, 255, 0.05) 39px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  touch-action: none;
}

.receipt-panel,
.receipt-form {
  display: grid;
  gap: 16px;
}

.receipt-frame-wrap {
  min-height: 58vh;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: white;
}

.receipt-frame {
  width: 100%;
  height: min(70vh, 780px);
  border: 0;
  background: white;
}

.choice-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.choice-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.choice-pill input {
  accent-color: var(--accent-strong);
}

.receipt-audit {
  display: grid;
  gap: 8px;
  color: var(--text-soft);
}

.install-banner,
.alert {
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.install-banner {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.12), rgba(247, 169, 92, 0.12));
}

.alert {
  background: rgba(255, 122, 102, 0.12);
  color: #ffd3cb;
}

.success {
  color: #bdf5cd;
}

.empty {
  padding: 26px 18px;
  text-align: center;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 22px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
}

@media (max-width: 640px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .hero,
  .login-card,
  .panel-card,
  .upload-card,
  .detail-card,
  .signature-card {
    padding: 18px;
  }
}

@keyframes pulse {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(0, 2vmax, 0) scale(1.05);
  }
}

.msg-unread-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 999px;
  background: #f97316;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}
