:root {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: #f8f7ff;
  background: #030617;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 5%, rgba(78, 32, 255, .35), transparent 28%),
    radial-gradient(circle at 85% 25%, rgba(0, 153, 255, .22), transparent 30%),
    radial-gradient(circle at 60% 100%, rgba(222, 0, 255, .16), transparent 34%),
    linear-gradient(135deg, #020411 0%, #06122b 50%, #07031b 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.app {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

/* =========================
   MENU IZQUIERDO
========================= */

.sidebar {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px 18px;
  overflow: hidden;
  border-right: 1px solid rgba(157, 78, 255, .35);
  background:
    radial-gradient(circle at top, rgba(102, 0, 255, .38), transparent 35%),
    linear-gradient(180deg, rgba(10, 7, 43, .98), rgba(2, 12, 35, .98));
  box-shadow:
    12px 0 45px rgba(0, 58, 255, .12),
    inset -1px 0 rgba(255, 255, 255, .04);
}

.sidebar::after {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  left: -100px;
  bottom: -80px;
  border-radius: 50%;
  background: #6d00ff;
  filter: blur(95px);
  opacity: .35;
  pointer-events: none;
}

.brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 5px 9px 34px;
}

.crown {
  font-size: 39px;
  filter: drop-shadow(0 0 13px rgba(255, 196, 0, .75));
}

.brand h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .05em;
}

.brand span {
  display: block;
  margin-top: 4px;
  color: #39bfff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
}

nav {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.nav {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 15px;
  color: #c8c9e7;
  background: transparent;
  text-align: left;
  font-weight: 650;
  transition: .2s ease;
}

.nav:hover {
  color: white;
  border-color: rgba(73, 147, 255, .28);
  background: rgba(32, 65, 135, .22);
}

.nav.active {
  color: white;
  border-color: rgba(55, 196, 255, .45);
  background: linear-gradient(100deg, #087cff, #661cff 58%, #d000ff);
  box-shadow:
    0 10px 30px rgba(76, 32, 255, .35),
    0 0 25px rgba(0, 174, 255, .18);
}

.sidebar-bottom {
  position: relative;
  z-index: 1;
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 17px;
  border: 1px solid rgba(98, 82, 255, .28);
  border-radius: 16px;
  color: #cdd3f5;
  background: rgba(16, 22, 63, .55);
  box-shadow: inset 0 0 25px rgba(67, 30, 255, .08);
}

.status-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border-radius: 50%;
  background: #14f195;
  box-shadow:
    0 0 8px #14f195,
    0 0 20px rgba(20, 241, 149, .7);
}

/* =========================
   CONTENIDO
========================= */

main {
  min-width: 0;
  padding: 30px;
}

/* HERO */

header {
  position: relative;
  overflow: hidden;
  min-height: 235px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 38px 42px;
  border: 1px solid rgba(173, 46, 255, .65);
  border-radius: 25px;
  background:
    linear-gradient(110deg, rgba(11, 18, 60, .94), rgba(40, 10, 95, .87)),
    radial-gradient(circle at 80% 30%, rgba(0, 153, 255, .35), transparent 30%);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, .38),
    0 0 28px rgba(116, 21, 255, .18),
    inset 0 0 40px rgba(33, 108, 255, .08);
}

header::before {
  content: "";
  position: absolute;
  width: 380px;
  height: 380px;
  right: -100px;
  top: -180px;
  border-radius: 50%;
  background: linear-gradient(135deg, #006eff, #d000ff);
  filter: blur(85px);
  opacity: .36;
}

header::after {
  content: "CQ";
  position: absolute;
  right: 55px;
  bottom: -35px;
  color: rgba(255, 255, 255, .025);
  font-size: 190px;
  font-weight: 1000;
  line-height: 1;
  pointer-events: none;
}

header > * {
  position: relative;
  z-index: 2;
}

.eyebrow {
  margin: 0 0 9px;
  color: #25c6ff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .18em;
}

h1 {
  margin: 0;
  color: white;
  font-size: clamp(38px, 5vw, 63px);
  font-weight: 900;
  letter-spacing: -.04em;
  line-height: .98;
}

h1 span {
  background: linear-gradient(90deg, #00c8ff, #7760ff, #f000ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(100, 80, 255, .25));
}

.subtitle {
  margin: 15px 0 0;
  color: #b6bddc;
  font-size: 17px;
}

/* BOTON PRINCIPAL */

.add-btn,
.save-btn {
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 14px;
  padding: 14px 21px;
  color: white;
  font-weight: 850;
  background: linear-gradient(100deg, #087cff, #6835ff 52%, #f000df);
  box-shadow:
    0 12px 35px rgba(79, 38, 255, .38),
    0 0 22px rgba(232, 0, 255, .18);
  transition: transform .18s ease, box-shadow .18s ease;
}

.add-btn:hover,
.save-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 15px 40px rgba(79, 38, 255, .48),
    0 0 30px rgba(232, 0, 255, .28);
}

/* BUSCADOR + CONTADOR */

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 16px;
  margin: 20px 0 30px;
}

.search {
  min-height: 59px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border: 1px solid rgba(83, 90, 255, .38);
  border-radius: 17px;
  background: linear-gradient(90deg, rgba(13, 25, 66, .88), rgba(34, 13, 76, .7));
  box-shadow:
    inset 0 0 25px rgba(49, 55, 255, .07),
    0 10px 30px rgba(0, 0, 0, .15);
}

.search input {
  width: 100%;
  border: 0;
  outline: none;
  color: white;
  background: transparent;
  font-size: 15px;
}

.search input::placeholder {
  color: #8187aa;
}

.counter {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 9px 20px;
  border: 1px solid rgba(226, 28, 255, .4);
  border-radius: 17px;
  background: linear-gradient(135deg, rgba(63, 23, 138, .68), rgba(8, 44, 109, .68));
  box-shadow: 0 0 28px rgba(125, 20, 255, .1);
}

.counter strong {
  color: white;
  font-size: 27px;
}

.counter span {
  color: #b7bde0;
  font-size: 12px;
}

/* SECCION */

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title h3 {
  margin: 0;
  font-size: 26px;
  font-weight: 850;
}

/* TARJETAS */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 17px;
}

.card {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  padding: 20px;
  border: 1px solid rgba(70, 111, 255, .32);
  border-radius: 21px;
  background:
    radial-gradient(circle at top right, rgba(116, 39, 255, .18), transparent 40%),
    linear-gradient(145deg, rgba(12, 29, 68, .92), rgba(17, 9, 49, .92));
  box-shadow:
    0 18px 40px rgba(0, 0, 0, .26),
    inset 0 0 28px rgba(43, 81, 255, .05);
  transition: .2s ease;
}

.card:nth-child(3n + 2) {
  border-color: rgba(215, 38, 255, .3);
  background:
    radial-gradient(circle at top right, rgba(236, 0, 255, .18), transparent 40%),
    linear-gradient(145deg, rgba(29, 14, 72, .92), rgba(13, 15, 48, .92));
}

.card:nth-child(3n + 3) {
  border-color: rgba(0, 220, 255, .3);
  background:
    radial-gradient(circle at top right, rgba(0, 211, 255, .16), transparent 40%),
    linear-gradient(145deg, rgba(6, 38, 69, .92), rgba(17, 10, 52, .92));
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(108, 143, 255, .7);
  box-shadow:
    0 22px 55px rgba(0, 0, 0, .32),
    0 0 28px rgba(76, 69, 255, .15);
}

.card-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border: 1px solid rgba(93, 153, 255, .4);
  border-radius: 17px;
  font-size: 29px;
  background: linear-gradient(135deg, rgba(0, 119, 255, .32), rgba(119, 0, 255, .32));
  box-shadow:
    inset 0 0 20px rgba(255, 255, 255, .04),
    0 0 22px rgba(63, 66, 255, .15);
}

.category {
  display: inline-block;
  margin-bottom: 8px;
  color: #22caff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.card h3 {
  margin: 0 0 20px;
  color: white;
  font-size: 21px;
  word-break: break-word;
}

.card-actions {
  display: flex;
  gap: 9px;
}

.card-actions a,
.delete {
  position: relative;
  z-index: 2;
  flex: 1;
  padding: 11px 10px;
  border-radius: 11px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.card-actions a {
  border: 1px solid rgba(255, 255, 255, .12);
  background: linear-gradient(100deg, #087cff, #6934ff, #d400ff);
  box-shadow: 0 8px 20px rgba(79, 42, 255, .24);
}

.delete {
  border: 1px solid rgba(255, 76, 133, .25);
  color: #ffb4ca;
  background: rgba(124, 18, 62, .2);
}

/* CUANDO NO HAY ENLACES */

.empty {
  position: relative;
  overflow: hidden;
  grid-column: 1 / -1;
  min-height: 330px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 45px 24px;
  border: 1px solid rgba(76, 102, 255, .4);
  border-radius: 24px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 50%, rgba(98, 34, 255, .18), transparent 32%),
    linear-gradient(145deg, rgba(8, 27, 67, .88), rgba(21, 7, 53, .9));
  box-shadow:
    inset 0 0 45px rgba(47, 76, 255, .05),
    0 20px 50px rgba(0, 0, 0, .18);
}

.empty::before,
.empty::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 120px;
  border-radius: 50%;
  filter: blur(45px);
  opacity: .22;
}

.empty::before {
  left: -130px;
  bottom: -65px;
  background: #006eff;
}

.empty::after {
  right: -130px;
  bottom: -65px;
  background: #e000ff;
}

.empty-icon {
  position: relative;
  z-index: 1;
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border: 2px solid #6f5cff;
  border-radius: 50%;
  color: white;
  font-size: 39px;
  background: linear-gradient(135deg, #5119b9, #083c99);
  box-shadow:
    0 0 0 7px rgba(108, 57, 255, .12),
    0 0 30px rgba(82, 62, 255, .55),
    0 0 45px rgba(0, 174, 255, .2);
}

.empty h3,
.empty p {
  position: relative;
  z-index: 1;
}

.empty h3 {
  margin: 0;
  font-size: 23px;
}

.empty p {
  margin: 9px 0 0;
  color: #aeb6dc;
}

/* MODAL AGREGAR */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(1, 3, 16, .78);
  backdrop-filter: blur(14px);
}

.hidden {
  display: none !important;
}

.modal-card {
  position: relative;
  width: min(480px, 100%);
  padding: 30px;
  border: 1px solid rgba(151, 48, 255, .58);
  border-radius: 25px;
  background:
    radial-gradient(circle at top right, rgba(120, 25, 255, .2), transparent 35%),
    linear-gradient(145deg, #0b1838, #14072d);
  box-shadow:
    0 35px 100px rgba(0, 0, 0, .7),
    0 0 35px rgba(105, 26, 255, .22);
}

.modal-card h2 {
  margin: 0 0 22px;
  color: white;
  font-size: 28px;
}

.modal-card label {
  display: block;
  margin: 15px 0 7px;
  color: #d3d7ee;
  font-size: 13px;
  font-weight: 750;
}

.modal-card input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(99, 119, 255, .32);
  border-radius: 12px;
  outline: none;
  color: white;
  background: rgba(8, 19, 48, .88);
}

.modal-card input:focus {
  border-color: #855cff;
  box-shadow:
    0 0 0 3px rgba(122, 80, 255, .12),
    0 0 20px rgba(84, 57, 255, .12);
}

.modal-card input::placeholder {
  color: #697393;
}

.save-btn {
  width: 100%;
  margin-top: 22px;
}

.close {
  position: absolute;
  top: 15px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 11px;
  color: white;
  background: rgba(255, 255, 255, .06);
  font-size: 25px;
}

/* =========================
   TELEFONO
========================= */

@media (max-width: 900px) {
  .app {
    display: block;
  }

  .sidebar {
    min-height: auto;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid rgba(111, 58, 255, .28);
  }

  .brand {
    padding-bottom: 14px;
  }

  nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }

  .nav {
    justify-content: center;
    padding: 10px 6px;
  }

  .nav span {
    display: none;
  }

  .sidebar-bottom {
    display: none;
  }

  main {
    padding: 16px;
  }

  header {
    min-height: 220px;
    align-items: flex-start;
    flex-direction: column;
    padding: 27px 24px;
  }

  header::after {
    right: 10px;
    font-size: 120px;
  }

  .add-btn {
    width: 100%;
  }

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

  .counter {
    min-height: 65px;
  }

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

@media (max-width: 560px) {
  main {
    padding: 11px;
  }

  header {
    border-radius: 20px;
  }

  h1 {
    font-size: 39px;
  }

  .subtitle {
    font-size: 14px;
  }

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

  .card {
    min-height: 195px;
  }

  .empty {
    min-height: 290px;
  }
}