:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0d6b6b;
  --accent-text: #ffffff;
  --accent-soft: #e6f4f4;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(15 23 42 / .04), 0 8px 24px rgb(15 23 42 / .06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0f1a;
    --surface: #111827;
    --surface-2: #162031;
    --border: #1f2c40;
    --text: #e6edf6;
    --muted: #94a3b8;
    --accent: #2dd4bf;
    --accent-text: #05231f;
    --accent-soft: #0f2e2c;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .35);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 68rem; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

/* ---------- Cabecera ---------- */

.hero {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 1.5rem 0;
}

.hero__inner { max-width: 68rem; margin: 0 auto; }

.hero__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.hero__eyebrow {
  margin: 0 0 .15rem;
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero__title { margin: 0; font-size: 1.6rem; letter-spacing: -0.02em; font-weight: 650; }

.hero__account { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

.chip {
  display: inline-block;
  font-size: .8125rem;
  padding: .35rem .75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--muted);
  background: var(--bg);
  white-space: nowrap;
}

.chip--link { color: var(--accent); font-weight: 550; }
.chip--link:hover { background: var(--accent-soft); border-color: var(--accent); }

/* ---------- Buscador ---------- */

.search {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 .9rem;
  box-shadow: var(--shadow);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.search:focus-within { border-color: var(--accent); }

.search__icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round;
}

.search__input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: .85rem .7rem;
  min-width: 0;
}

.search__input::-webkit-search-cancel-button { cursor: pointer; }

.search__hint {
  font: 600 .75rem/1 ui-monospace, monospace;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: .25rem .4rem;
  flex: none;
}

@media (max-width: 30rem) { .search__hint { display: none; } }

/* ---------- Filtros de seccion ---------- */

.filters {
  display: flex;
  gap: .4rem;
  overflow-x: auto;
  padding: 1rem 0;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar { display: none; }

.filter {
  font: inherit;
  font-size: .8125rem;
  white-space: nowrap;
  padding: .4rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: all .12s ease;
}

.filter:hover { color: var(--text); border-color: var(--accent); }

.filter[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 550;
}

.filter__count { opacity: .65; margin-left: .3rem; }

/* ---------- Resultados ---------- */

.results-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.results-head h2 { margin: 0; font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }
.results-count { font-size: .8125rem; color: var(--muted); }

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

.card {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: 1.05rem 1.1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.card__head { display: flex; align-items: center; gap: .55rem; }

.card__kind {
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .2rem .45rem;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
}

.card--folder .card__kind { background: var(--accent-soft); color: var(--accent); }

.card__section { font-size: .75rem; color: var(--muted); }

.card__title {
  margin: 0;
  font-size: .975rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.card__desc {
  margin: 0;
  font-size: .8125rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__foot {
  margin-top: auto;
  padding-top: .5rem;
  font-size: .75rem;
  color: var(--muted);
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}

.tag {
  font-size: .6875rem;
  padding: .15rem .4rem;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
}

/* ---------- Estado vacio ---------- */

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1.5rem;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}

.empty h3 { margin: 0 0 .4rem; font-size: 1rem; color: var(--text); font-weight: 600; }
.empty p { margin: 0 auto; max-width: 28rem; font-size: .875rem; }
.empty a { color: var(--accent); }

/* ---------- Recientes ---------- */

.recent { margin-top: 3rem; }
.recent h2 { font-size: 1.05rem; font-weight: 600; margin: 0 0 .9rem; letter-spacing: -0.01em; }

.recent__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.recent__list li { border-bottom: 1px solid var(--border); }
.recent__list li:last-child { border-bottom: 0; }

.recent__list a {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  padding: .75rem 1rem;
  text-decoration: none;
  color: inherit;
}

.recent__list a:hover { background: var(--surface); }
.recent__name { font-weight: 500; }
.recent__meta { margin-left: auto; font-size: .75rem; color: var(--muted); white-space: nowrap; }

@media (max-width: 34rem) {
  .recent__meta { display: none; }
}

/* ---------- Pie ---------- */

.foot {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
}

.foot p { margin: 0; font-size: .75rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
