:root {
  color-scheme: dark;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #080808;
  color: #fafafa;
}

/* Animaciones Globales */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInFromTop {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

* {
  box-sizing: border-box;
}

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

body {
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.06), transparent 20%),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.04), transparent 18%),
    #080808;
}

.page-shell {
  min-height: 100vh;
}

.topbar {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 40px 20px;
  z-index: 1;
}

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

.brand img {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  padding: 10px;
  object-fit: contain;
}

.brand-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
}

.brand-subtitle {
  color: #d1d5db;
  font-size: 0.95rem;
}

.hero-section {
  position: relative;
  overflow: hidden;
  padding-bottom: 80px;
}

.hero-float {
  position: absolute;
  width: 420px;
  height: 420px;
  top: 20px;
  right: -120px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 60%);
  filter: blur(75px);
  z-index: 0;
}

.hero-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
  padding: 120px 0 0;
  position: relative;
  z-index: 1;
}

.hero-content {
  max-width: 760px;
  margin: 0 auto;
}

.eyebrow {
  display: flex;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: #d1d5db;
  font-size: 1rem;
  margin-bottom: 18px;
}

.hero-content h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(3.2rem, 8vw, 5.6rem);
  line-height: 1.02;
  text-align: center;
}

.hero-content p {
  margin-top: 24px;
  color: #d1d5db;
  font-size: 1.2rem;
  line-height: 1.75;
  text-align: center;
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.hero-actions .button--primary {
  width: min(520px, 100%);
  padding: 24px 48px;
  font-size: 1.15rem;
  border-radius: 50px;
  letter-spacing: 0.5px;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-actions .button--primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.hero-highlights {
  display: grid;
  gap: 16px;
  margin-top: 30px;
}

.hero-highlights div {
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
}

.hero-highlights strong {
  display: block;
  color: #ffffff;
  font-size: 1rem;
  margin-bottom: 8px;
}

.hero-highlights span {
  color: #d1d5db;
  font-size: 0.95rem;
}

.main-content {
  padding: 60px 40px 80px;
  max-width: 1400px;
  margin: 0 auto;
}

.panel {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  padding: 48px;
  margin-bottom: 32px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 28px 100px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
}

.hidden {
  display: none !important;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-container {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1001;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  transition: all 0.3s ease-out;
  will-change: transform, opacity;
}

.modal-container.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.95);
}

.close-button {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fafafa;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1002;
}

.close-button:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.15) rotate(90deg);
}

.modal-panel {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  padding: 48px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
}

.panel-label {
  display: inline-block;
  color: #d1d5db;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 10px;
}

.panel-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 40px;
}

.panel-header h2 {
  margin: 0;
  font-size: 2.2rem;
}

.field {
  display: grid;
  gap: 10px;
  margin-bottom: 28px;
}

.grid-2 .field:nth-child(1) { animation-delay: 0.1s; }
.grid-2 .field:nth-child(2) { animation-delay: 0.15s; }

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

label {
  color: #d1d5db;
  font-size: 1.05rem;
}

.field-note {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
}

input,
textarea {
  width: 100%;
  padding: 18px 22px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #fafafa;
  outline: none;
  font-size: 1.05rem;
  transition: border-color 0.2s ease-out, box-shadow 0.2s ease-out, background 0.2s ease-out;
  animation: none;
  will-change: border-color, box-shadow, background;
}

.field:nth-child(1) input,
.field:nth-child(1) textarea { }
.field:nth-child(2) input,
.field:nth-child(2) textarea { }
.field:nth-child(3) input,
.field:nth-child(3) textarea { }
.field:nth-child(4) input,
.field:nth-child(4) textarea { }

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.62);
}

input:focus,
textarea:focus {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

button {
  border: none;
  border-radius: 32px;
  padding: 14px 28px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, background 0.2s ease-out;
  will-change: transform, box-shadow, background;
}

button:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

button:active {
  transform: translateY(-1px);
}

.button--primary {
  background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 100%);
  color: #111111;
  box-shadow: 0 14px 28px rgba(255, 255, 255, 0.15);
  border-radius: 28px;
  font-weight: 700;
}

.button--primary:hover {
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
}

.button--secondary,
.button--ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fafafa;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 32px;
}

.button--secondary:hover,
.button--ghost:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

#search {
  min-width: 280px;
  animation: slideUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

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

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 20px;
  min-width: 720px;
}

th,
td {
  text-align: left;
  padding: 24px 24px;
}

th {
  color: #d1d5db;
  font-size: 1rem;
  font-weight: 600;
}

td {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  color: #f8fafc;
  transition: all 0.15s ease-out;
}

tr:nth-child(1) td { animation-delay: 0s; }
tr:nth-child(2) td { }
tr:nth-child(2) td { }
tr:nth-child(3) td { }
tr:nth-child(4) td { }
tr:nth-child(5) td { }
tr:nth-child(6) td { }
tr:nth-child(7) td { }
tr:nth-child(8) td { }
tr:nth-child(9) td { }
tr:nth-child(10) td { }
tr:hover td {
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.01);
}

tr td:first-child {
  border-top-left-radius: 18px;
  border-bottom-left-radius: 18px;
}

tr td:last-child {
  border-top-right-radius: 18px;
  border-bottom-right-radius: 18px;
}

.action-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  padding: 12px 20px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.15s ease-out;
  will-change: background, transform, box-shadow;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.action-btn.delete {
  background: rgba(255, 255, 255, 0.08);
  color: #ffeded;
}

.action-btn.delete:hover {
  background: rgba(255, 100, 100, 0.2);
}

/* Credential Image Styles */
.credential-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
}

.credential-img {
  width: 100%;
  max-width: 180px;
  height: auto;
  max-height: 140px;
  object-fit: contain;
  border-radius: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.credential-img:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

/* Image Modal */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-out;
}

.image-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.image-modal-content {
  position: relative;
  width: min(100%, 920px);
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border-radius: 28px;
  background: rgba(15, 15, 15, 0.95);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  transform: translateY(12px);
  transition: transform 0.25s ease-out;
}

.image-modal.active .image-modal-content {
  transform: translateY(0);
}

.image-modal-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.image-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: #fafafa;
  font-size: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2001;
}

.image-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.15) rotate(90deg);
  border-color: rgba(255, 255, 255, 0.5);
}

.auth-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.94);
  z-index: 3000;
}

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

.auth-panel {
  width: min(420px, calc(100% - 40px));
  padding: 34px 28px;
  border-radius: 30px;
  background: rgba(15, 15, 15, 0.98);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
  text-align: center;
  color: #f8fafc;
}

.auth-panel h2 {
  margin: 0 0 14px;
  font-size: 2rem;
}

.auth-panel p {
  margin: 0 0 22px;
  color: #d1d5db;
}

#auth-password {
  width: 100%;
  margin-bottom: 18px;
}

.auth-error {
  margin-top: 12px;
  color: #ff7b7b;
  min-height: 20px;
}

@media (max-width: 1080px) {
  .hero-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar,
  .hero-container,
  .main-content {
    padding-left: 24px;
    padding-right: 24px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 18px 16px;
  }

  table {
    min-width: 100%;
  }
}
