:root {
  --radius: 18px;
  --blur: 16px;
}
body {
  background: radial-gradient(
      1200px 600px at 20% -10%,
      hsl(228 20% 14% / 0.6),
      transparent
    ),
    radial-gradient(
      1000px 500px at 120% 0%,
      hsl(210 40% 10% / 0.6),
      transparent
    ),
    linear-gradient(180deg, hsl(220 17% 9%), hsl(220 17% 7%));
  min-height: 100dvh;
}
body.chat-page {
  overflow: hidden;
}
main.container {
  padding-bottom: calc(var(--tabbar-h) + 20px);
}
.appbar {
  backdrop-filter: saturate(1.2) blur(var(--blur));
  -webkit-backdrop-filter: saturate(1.2) blur(var(--blur));
  border-bottom: 1px solid hsl(210 10% 20% / 0.4);
  position: sticky;
  top: 0;
  z-index: 30;
}
.glass {
  background: hsl(220 17% 12% / 0.6);
  border: 1px solid hsl(210 10% 25% / 0.45);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px hsl(220 50% 2% / 0.5) inset,
    0 10px 30px hsl(220 70% 2% / 0.2);
}
.hero {
  padding: 1rem;
}
.block {
  padding: 1rem;
  margin-bottom: 1rem;
}
main.container > section.block:first-child,
main.container > .balance-grid:first-of-type {
  margin-top: 1rem;
}
.rounded {
  border-radius: var(--radius);
}
.pill {
  border-radius: 9999px;
}
.ios-title {
  font-weight: 700;
  letter-spacing: -0.02em;
}
.muted {
  color: hsl(210 10% 70%);
}
.grid {
  grid-column-gap: var(--pico-grid-column-gap);
  grid-row-gap: var(--pico-grid-row-gap);
  display: block;
  grid-template-columns: 1fr;
}
.grid.cards > article {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.grid.cards > article:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px hsl(220 50% 2% / 0.45);
}
.tabbar {
  position: fixed; /* <- ahora es fija en todas las vistas */
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-top: 1px solid hsl(210 10% 20% / 0.4);
}
.tabbar nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
}
.tabbar a,
.tabbar button {
  width: 100%;
  background: transparent;
  border: 0;
  padding: 0.6rem 0.4rem;
  color: var(--pico-color);
  display: grid;
  place-items: center;
  row-gap: 0.25rem;
  text-decoration: none;
}
.tabbar [aria-current="page"] {
  color: var(--pico-primary);
}
.hidden {
  display: none !important;
}
.chip {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: hsl(210 90% 45%);
  color: white;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
  border: none;
  border-radius: 9999px;
  line-height: 1.2;
}
.category-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}
.category {
  text-align: center;
  padding: 0.7rem 0.3rem;
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #89f7fe, #66a6ff);
  display: grid;
  place-items: center;
  font-weight: 700;
}
.money {
  font-variant-numeric: tabular-nums;
}
input,
select,
textarea {
  border-radius: 14px;
}
.map {
  height: 220px;
  background: repeating-linear-gradient(
    45deg,
    #0f141b,
    #0f141b 10px,
    #10161e 10px,
    #10161e 20px
  );
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: #94a3b8;
}
@supports (padding: max(0px)) {
  main {
    padding-bottom: max(88px, env(safe-area-inset-bottom));
  }
}
.ai-center {
  align-items: center;
}
.price {
  justify-self: end;
  text-align: right;
}
.profile-price-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}
.profile-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.profile-photo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid hsl(210 10% 30%);
}
.profile-details {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.profile-name {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
}
.rating {
  color: hsl(210 10% 70%);
  font-size: 0.85rem;
}
.job-card {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.job-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px hsl(220 50% 2% / 0.55);
}
.job-detail-modal article {
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}
.job-detail-modal article header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-content {
  padding: 0 0.5rem;
}
.search-modal article header,
.post-modal article header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.close-btn {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  color: var(--pico-color);
  cursor: pointer;
}
.wide-btn {
  width: 100%;
  padding: 0.8rem;
  font-weight: 600;
  border-radius: 12px;
}
:root {
  --radius: 18px;
  --blur: 16px;
  --tabbar-h: 72px;
}
#map {
  width: 100%;
  height: 280px;
}
.my-job-card {
  margin-bottom: 1rem;
}
.my-job-layout {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.my-job-photo-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.my-job-photo {
  width: 100px;
  height: 100px;
  border-radius: var(--radius);
  object-fit: cover;
  border: 2px solid hsl(210 10% 30%);
}
.my-job-stats {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.my-job-name {
  font-weight: 600;
  color: hsl(210 10% 90%);
  font-size: 0.9rem;
}
.my-job-stats .money {
  margin: 0;
  margin-top: 0.25rem;
  font-size: 1rem;
  color: var(--pico-primary);
}
.my-job-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.my-job-details h4 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.3;
}
.my-job-details small {
  display: block;
}

.my-job-card:hover {
  transform: translateY(-2px);
  transition: transform 0.2s ease;
}
.profile-header {
  text-align: center;
}
.profile-header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.profile-photo-large {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid hsl(210 10% 30%);
  box-shadow: 0 4px 12px hsl(220 50% 2% / 0.4);
}
.profile-header-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.profile-header-info h3 {
  margin: 0;
}
.balance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 576px) {
  .balance-grid {
    grid-template-columns: 1fr;
  }
}
.balance-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1rem;
  margin-bottom: 0 !important;
}
.balance-icon {
  font-size: 2.5rem;
  line-height: 1;
}
.balance-info {
  text-align: center;
  width: 100%;
}
.balance-info small {
  display: block;
  margin-bottom: 0.5rem;
}
.balance-info h3 {
  margin: 0 0 1rem 0;
  font-size: 1.8rem;
}
.balance-btn {
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}
.verification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.verification-header h5 {
  margin: 0;
}
.verification-badge {
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
}
.verification-badge.pending {
  background: hsl(40 90% 50% / 0.2);
  color: hsl(40 90% 60%);
  border: 1px solid hsl(40 90% 50% / 0.3);
}
.verification-badge.verified {
  background: hsl(140 60% 50% / 0.2);
  color: hsl(140 70% 60%);
  border: 1px solid hsl(140 60% 50% / 0.3);
}
.verification-badge.rejected {
  background: hsl(0 70% 50% / 0.2);
  color: hsl(0 80% 60%);
  border: 1px solid hsl(0 70% 50% / 0.3);
}
.document-upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 576px) {
  .document-upload-grid {
    grid-template-columns: 1fr;
  }
}
.document-upload-card {
  padding: 1.5rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  border: 2px dashed hsl(210 10% 25% / 0.5);
}
.document-icon {
  font-size: 2.5rem;
  line-height: 1;
}
.document-upload-card h6 {
  margin: 0;
  font-size: 0.95rem;
}
.document-upload-card button {
  width: 100%;
  max-width: 200px;
}
.message-card {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  padding: 0.75rem 1rem;
}
.message-card:hover {
  transform: translateX(4px);
  box-shadow: 0 8px 24px hsl(220 50% 2% / 0.4);
}
.message-card.unread {
  border-left: 3px solid var(--pico-primary);
}
.message-layout {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
}
.message-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}
.message-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid hsl(210 10% 30%);
}
.online-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background: hsl(140 70% 55%);
  border: 2px solid hsl(220 17% 12%);
  border-radius: 50%;
}
.message-content {
  flex: 1;
  min-width: 0;
}
.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}
.message-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: hsl(210 10% 95%);
}
.message-card.unread .message-name {
  color: hsl(210 10% 98%);
}
.message-time {
  color: hsl(210 10% 60%);
  font-size: 0.85rem;
  white-space: nowrap;
}
.message-preview {
  margin: 0;
  color: hsl(210 10% 70%);
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.message-card.unread .message-preview {
  color: hsl(210 10% 85%);
  font-weight: 500;
}
.message-badge {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: var(--pico-primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  min-width: 24px;
  text-align: center;
}
.chat-modal article {
  max-width: 700px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.chat-modal article header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid hsl(210 10% 20% / 0.4);
  flex-shrink: 0;
}
.chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.chat-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid hsl(210 10% 30%);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem 1rem 9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: hsl(220 17% 9%);
  height: calc(100vh - 60px);
}
.chat-messages::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
  background: hsl(220 17% 12%);
  border-radius: 3px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: hsl(210 10% 35%);
  border-radius: 3px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
  background: hsl(210 10% 45%);
}
.chat-message {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}
.chat-message.received {
  flex-direction: row;
}
.chat-message.sent {
  flex-direction: row-reverse;
  justify-content: flex-start;
}
.chat-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.chat-bubble {
  max-width: 70%;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  background: hsl(220 17% 15%);
  border: 1px solid hsl(210 10% 25% / 0.4);
}
.chat-message.sent .chat-bubble {
  background: var(--pico-primary);
  border: 1px solid var(--pico-primary);
  color: white;
}
.chat-bubble p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
}
.chat-time {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: hsl(210 10% 60%);
}
.chat-message.sent .chat-time {
  color: hsl(210 10% 90%);
  opacity: 0.8;
}
.chat-footer {
  padding: 1rem;
  border-top: 1px solid hsl(210 10% 20% / 0.4);
  flex-shrink: 0;
  background: hsl(220 17% 12%);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
}
.chat-input-form {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin: 0;
  padding: 0.5rem 0.75rem;
  background: hsl(220 17% 15%);
  border-radius: 24px;
  border: 1px solid hsl(210 10% 25% / 0.4);
  min-height: 48px;
}
.chat-input-form button[type="submit"] {
  flex-shrink: 0;
  flex-grow: 0;
  width: auto;
}
.chat-input {
  flex: 1;
  margin: 0 !important;
  border: none;
  background: transparent;
  padding: 0;
  font-size: 1rem;
  color: hsl(210 10% 95%);
  resize: none;
  outline: none;
  min-height: 36px;
  max-height: 120px;
  height: 36px;
  display: flex;
  align-items: center;
  line-height: 1;
}
.chat-input::placeholder {
  color: hsl(210 10% 60%);
}
.chat-send-btn {
  margin: 0;
  padding: 0.5rem 1rem;
  white-space: nowrap;
  border-radius: 16px;
  font-weight: 600;
  font-size: 0.85rem;
  min-width: 60px;
  max-width: 80px;
  width: auto;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  flex-grow: 0;
}
.chat-main {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.chat-avatar-small {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid hsl(210 10% 30%);
}
.chat-attach-btn {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  padding: 0.4rem;
  cursor: pointer;
  color: hsl(210 10% 70%);
  transition: color 0.2s ease;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-attach-btn:hover {
  color: hsl(210 10% 85%);
  background: hsl(210 10% 20% / 0.3);
}

/* Clases para tarjetas de información legal */
.legal-card-grid {
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.legal-card-link {
  text-decoration: none;
}

.legal-card {
  padding: 1.25rem;
  border-radius: var(--radius);
  background: hsl(220 17% 15%);
  text-align: center;
}

.legal-card-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.legal-card-title {
  margin: 0;
}

.legal-copyright {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: hsl(220 17% 12%);
  text-align: center;
}

/* Clases para perfiles */
.profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.profile-header-content {
  flex: 1;
}

.profile-photo-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid hsl(210 10% 30%);
}

.profile-header-info h2 {
  margin: 0;
  font-size: 1.5rem;
  color: hsl(210 10% 95%);
}

.profile-header-info small {
  color: hsl(210 10% 70%);
  font-size: 0.9rem;
}

.profile-stats {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.profile-stat {
  text-align: center;
}

.profile-stat .number {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--pico-primary);
}

.profile-stat .label {
  font-size: 0.8rem;
  color: hsl(210 10% 70%);
}

/* Clases para tarjetas de balance */
.balance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.balance-card {
  background: hsl(220 17% 12%);
  border: 1px solid hsl(210 10% 20% / 0.4);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  margin-bottom: 0 !important;
}

.balance-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.balance-info h4 {
  margin: 0;
  color: var(--pico-primary);
  font-size: 1.5rem;
}

.balance-info p {
  margin: 0.25rem 0 0 0;
  color: hsl(210 10% 70%);
  font-size: 0.9rem;
}

.balance-btn {
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

/* Clases para verificación */
.verification-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.verification-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.verification-badge.pending {
  background: hsl(45 100% 50% / 0.2);
  color: hsl(45 100% 60%);
  border: 1px solid hsl(45 100% 50% / 0.3);
}

.verification-badge.verified {
  background: hsl(142 76% 36% / 0.2);
  color: hsl(142 76% 60%);
  border: 1px solid hsl(142 76% 36% / 0.3);
}

.verification-badge.rejected {
  background: hsl(0 84% 60% / 0.2);
  color: hsl(0 84% 70%);
  border: 1px solid hsl(0 84% 60% / 0.3);
}

/* Clases para upload de documentos */
.document-upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.document-upload-card {
  background: hsl(220 17% 12%);
  border: 2px dashed hsl(210 10% 30%);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  transition: border-color 0.2s ease;
  cursor: pointer;
}

.document-upload-card:hover {
  border-color: var(--pico-primary);
}

.document-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.7;
}

.document-upload-card h6 {
  margin: 0 0 0.25rem 0;
  font-size: 0.9rem;
  color: hsl(210 10% 85%);
}

.document-upload-card small {
  color: hsl(210 10% 60%);
  font-size: 0.8rem;
}

/* Clases para formularios */
.form-grid-2 {
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.no-margin {
  margin: 0;
}

.wide-btn {
  width: 100%;
}

/* Clases para trabajos */
.job-location {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

.job-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.job-status-chip.completed {
  background: hsl(142 76% 36% / 0.2);
  color: hsl(142 76% 60%);
  border: 1px solid hsl(142 76% 36% / 0.3);
}

.job-status-chip.pending {
  background: hsl(45 100% 50% / 0.2);
  color: hsl(45 100% 60%);
  border: 1px solid hsl(45 100% 50% / 0.3);
}

.job-status-chip.in-progress {
  background: hsl(217 91% 60% / 0.2);
  color: hsl(217 91% 70%);
  border: 1px solid hsl(217 91% 60% / 0.3);
}

.job-status-chip.cancelled {
  background: hsl(0 84% 60% / 0.2);
  color: hsl(0 84% 70%);
  border: 1px solid hsl(0 84% 60% / 0.3);
}

.job-category-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: hsl(220 17% 20%);
  color: hsl(210 10% 80%);
  border: 1px solid hsl(210 10% 25%);
  margin-bottom: 0.5rem;
}

.job-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.job-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.job-user-photo {
  width: 100px;
  height: 100px;
  border-radius: var(--radius);
  object-fit: cover;
  border: 2px solid hsl(210 10% 30%);
  transition: transform 0.2s ease;
}

.job-user-photo:hover {
  transform: scale(1.05);
}
