/* App Hub — estilos (sin dependencias externas) */

:root {
  --bg: #0d1117;
  --bg-elev: #161b22;
  --bg-elev-2: #1c2128;
  --bg-elev-3: #22272e;
  --border: #30363d;
  --border-soft: #21262d;
  --fg: #e6edf3;
  --fg-muted: #8b949e;
  --fg-subtle: #6e7681;
  --accent: #2f81f7;
  --accent-hover: #4493f8;
  --accent-soft: rgba(47, 129, 247, 0.14);
  --green: #3fb950;
  --green-soft: rgba(63, 185, 80, 0.14);
  --red: #f85149;
  --red-soft: rgba(248, 81, 73, 0.12);
  --orange: #d29922;
  --purple: #bc8cff;
  --hover: rgba(177, 186, 196, 0.1);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  --tok-key: #ff7b72;
  --tok-str: #a5d6ff;
  --tok-com: #8b949e;
  --tok-num: #79c0ff;
  --tok-fn: #d2a8ff;
  --radius: 8px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
}

html[data-theme="light"] {
  --bg: #ffffff;
  --bg-elev: #f6f8fa;
  --bg-elev-2: #eef1f4;
  --bg-elev-3: #e6eaef;
  --border: #d0d7de;
  --border-soft: #dfe3e8;
  --fg: #1f2328;
  --fg-muted: #59636e;
  --fg-subtle: #6e7781;
  --accent: #0969da;
  --accent-hover: #0a5cc2;
  --accent-soft: rgba(9, 105, 218, 0.09);
  --green: #1a7f37;
  --green-soft: rgba(26, 127, 55, 0.1);
  --red: #cf222e;
  --red-soft: rgba(207, 34, 46, 0.08);
  --orange: #9a6700;
  --purple: #8250df;
  --hover: rgba(208, 215, 222, 0.4);
  --shadow: 0 16px 40px rgba(31, 35, 40, 0.15);
  --tok-key: #cf222e;
  --tok-str: #0a3069;
  --tok-com: #6e7781;
  --tok-num: #0550ae;
  --tok-fn: #8250df;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

::selection { background: var(--accent-soft); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------------------------------------------------------------- layout */

.app {
  display: grid;
  grid-template-areas: "header header" "sidebar main";
  grid-template-columns: 280px minmax(0, 1fr);
  grid-template-rows: 58px minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}

.topbar {
  grid-area: header;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  z-index: 30;
}

.sidebar {
  grid-area: sidebar;
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.main {
  grid-area: main;
  overflow-y: auto;
  padding: 26px 30px 70px;
  scroll-behavior: smooth;
}

.main:focus { outline: none; }

.search {
  position: relative;
  flex: 1;
  max-width: 460px;
  margin-left: 8px;
}
.search svg {
  position: absolute;
  left: 10px; top: 50%;
  width: 15px; height: 15px;
  transform: translateY(-50%);
  color: var(--fg-muted);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 34px;
  padding: 0 12px 0 33px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
  outline: none;
}
.search input::placeholder { color: var(--fg-subtle); }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(145deg, #1f6feb, #0b3d91);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 14px; letter-spacing: 0.2px; }
.brand-text small { font-size: 10px; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.9px; }

.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.user-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 11px;
  border-radius: 999px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--fg-muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-chip::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
  flex-shrink: 0;
}

.icon-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--fg-muted);
  cursor: pointer;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--hover); color: var(--fg); }

.menu-btn { display: none; }

/* -------------------------------------------------------------- sidebar */

.sidebar-content { padding: 16px 12px 24px; }

.side-nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 18px; }
.side-nav a {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--fg-muted);
  font-size: 13px;
  font-weight: 500;
}
.side-nav a svg { width: 15px; height: 15px; opacity: 0.9; }
.side-nav a:hover { background: var(--hover); color: var(--fg); text-decoration: none; }
.side-nav a.active { background: var(--accent-soft); color: var(--fg); }
.side-nav a.active svg { color: var(--accent); }

.side-head {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.side-head .count {
  padding: 0 6px;
  border-radius: 999px;
  background: var(--bg-elev-2);
  font-size: 10px;
  line-height: 17px;
  color: var(--fg-muted);
}
.side-head button {
  margin-left: auto;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  border-radius: 6px;
  color: var(--fg-muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.side-head button:hover { color: var(--fg); border-color: var(--fg-muted); }

.repo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.repo-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--fg-muted);
  min-width: 0;
}
.repo-item:hover { background: var(--hover); text-decoration: none; }
.repo-item.active { background: var(--bg-elev-3); color: var(--fg); }
.repo-item .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--fg-subtle);
  flex-shrink: 0;
}
.repo-item.has-image .dot { background: var(--green); }
.repo-item .name {
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.repo-item.active .name { color: var(--fg); font-weight: 500; }

.side-empty { padding: 8px 10px; color: var(--fg-subtle); font-size: 12px; }

.side-foot {
  margin-top: 22px;
  padding: 12px 10px 0;
  border-top: 1px solid var(--border-soft);
  font-size: 11.5px;
  color: var(--fg-muted);
  display: flex; flex-direction: column; gap: 7px;
}
.side-foot .row { display: flex; align-items: center; gap: 7px; min-width: 0; }
.side-label { font-size: 10px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; color: var(--fg-subtle); }
.side-foot .row span.value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--fg-subtle); flex-shrink: 0; }
.status-dot.ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.status-dot.bad { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }

.scrim { display: none; }

/* --------------------------------------------------------------- botones */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elev-2);
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}
.btn:hover { background: var(--bg-elev-3); text-decoration: none; }
.btn svg { width: 15px; height: 15px; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--fg-muted); }
.btn-ghost:hover { color: var(--fg); background: var(--hover); }
.btn-sm { height: 27px; padding: 0 9px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 23px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  color: var(--fg-muted);
  font-size: 11.5px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip.mono { font-family: var(--mono); font-size: 11px; }
.chip.accent { color: var(--accent); border-color: rgba(47, 129, 247, 0.4); background: var(--accent-soft); }
.chip.ok { color: var(--green); border-color: rgba(63, 185, 80, 0.4); background: var(--green-soft); }
.chip.bad { color: var(--red); border-color: rgba(248, 81, 73, 0.4); background: var(--red-soft); }
.chip svg { width: 12px; height: 12px; }

/* ------------------------------------------------------------- Home/hero */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 34px;
  align-items: center;
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    radial-gradient(900px 320px at 8% -30%, var(--accent-soft), transparent 60%),
    var(--bg-elev);
  overflow: hidden;
}
.eyebrow {
  margin: 0 0 10px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--accent);
}
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.6px;
}
.hero .lead { margin: 0 0 22px; color: var(--fg-muted); font-size: 14.5px; max-width: 52ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero-card .bar {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev-2);
  font-size: 11px;
  color: var(--fg-muted);
}
.hero-card .bar .lights { display: flex; gap: 4px; }
.hero-card .bar .lights i { width: 8px; height: 8px; border-radius: 50%; background: var(--border); display: block; }
.hero-card pre { margin: 0; padding: 14px 16px; font-family: var(--mono); font-size: 11.8px; line-height: 1.75; overflow-x: auto; }
.hero-card .copy-row { position: relative; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 18px 0 30px; }
.stat {
  padding: 15px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elev);
}
.stat b { display: block; font-size: 23px; line-height: 1.2; letter-spacing: -0.4px; }
.stat span { color: var(--fg-muted); font-size: 12px; }

.section-head {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px;
}
.section-head h2 { margin: 0; font-size: 16px; letter-spacing: -0.2px; }
.section-head .count { color: var(--fg-muted); font-size: 12px; }
.section-head .grow { flex: 1; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 14px; }
.card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elev);
  color: var(--fg);
  transition: border-color 0.12s, transform 0.12s;
}
.card:hover { border-color: var(--fg-subtle); text-decoration: none; transform: translateY(-1px); }
.card-top { display: flex; align-items: flex-start; gap: 10px; }
.card-ico {
  width: 32px; height: 32px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}
.card-ico svg { width: 17px; height: 17px; }
.card h3 { margin: 1px 0 2px; font-size: 14.5px; letter-spacing: -0.1px; }
.card .sub { color: var(--fg-subtle); font-family: var(--mono); font-size: 11px; }
.card p { margin: 0; color: var(--fg-muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 37px; }
.card .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.card .foot { display: flex; align-items: center; gap: 6px; color: var(--fg-subtle); font-size: 11px; border-top: 1px solid var(--border-soft); padding-top: 10px; }
.card .foot .sep { margin: 0 2px; }

.empty {
  padding: 46px 24px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--fg-muted);
  background: var(--bg-elev);
}
.empty svg { width: 34px; height: 34px; color: var(--fg-subtle); margin-bottom: 10px; }
.empty h3 { margin: 0 0 6px; color: var(--fg); font-size: 15px; }
.empty p { margin: 0 auto 16px; max-width: 46ch; font-size: 13px; }

/* -------------------------------------------------------------- proyecto */

.crumbs { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--fg-muted); margin-bottom: 14px; }
.crumbs a { color: var(--fg-muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--fg-subtle); }
.crumbs .now { color: var(--fg); font-family: var(--mono); }

.repo-header { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.repo-header h1 { margin: 0 0 6px; font-size: 25px; letter-spacing: -0.5px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.repo-header .desc { margin: 0 0 12px; color: var(--fg-muted); max-width: 75ch; }
.repo-header .chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.repo-actions { display: flex; gap: 8px; flex-shrink: 0; }

.tabs {
  display: flex; gap: 2px;
  margin: 22px 0 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 13px 11px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--fg-muted);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.tab svg { width: 14px; height: 14px; }
.tab:hover { color: var(--fg); }
.tab.active { color: var(--fg); border-bottom-color: var(--orange); font-weight: 500; }
.tab .n { padding: 0 5px; border-radius: 999px; background: var(--bg-elev-2); font-size: 10px; color: var(--fg-muted); }

.tab-body { padding-top: 22px; }

/* README + metadatos */
.readme-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 28px; align-items: start; }
.readme-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elev);
  overflow: hidden;
}
.readme-panel .head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev-2);
  font-size: 12px;
  color: var(--fg-muted);
}
.readme-panel .head .grow { flex: 1; }
.readme-panel .body { padding: 20px 24px; }
.readme-panel .body:empty { padding: 0; }

.side-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elev);
  padding: 16px;
}
.side-card + .side-card { margin-top: 14px; }
.side-card h4 { margin: 0 0 10px; font-size: 11px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--fg-muted); }
.side-card dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 10px; font-size: 12px; }
.side-card dt { color: var(--fg-subtle); }
.side-card dd { margin: 0; color: var(--fg); overflow: hidden; text-overflow: ellipsis; }
.side-card dd.mono { font-family: var(--mono); font-size: 11.5px; }
.side-card .btn { width: 100%; margin-top: 4px; }

/* ficheros */
.files-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.file-tree {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elev);
  overflow: hidden;
  position: sticky;
  top: 0;
}
.file-tree .head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev-2);
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.file-tree .head .grow { flex: 1; }
.file-tree .head button {
  width: 21px; height: 21px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  border-radius: 5px;
  color: var(--fg-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.file-tree .head button:hover { color: var(--fg); }
.tree { padding: 6px; max-height: calc(100vh - 260px); overflow: auto; }
.tree-item {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 8px;
  border-radius: 5px;
  color: var(--fg-muted);
  font-size: 12.5px;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: var(--mono);
}
.tree-item svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--fg-subtle); }
.tree-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-item:hover { background: var(--hover); color: var(--fg); }
.tree-item.active { background: var(--accent-soft); color: var(--fg); }
.tree-item.active svg { color: var(--accent); }
.tree-item .sz { margin-left: auto; font-size: 10px; color: var(--fg-subtle); flex-shrink: 0; }
.tree-dir { padding: 5px 8px; font-family: var(--mono); font-size: 11px; color: var(--fg-subtle); display: flex; gap: 6px; align-items: center; }
.tree-dir svg { width: 12px; height: 12px; }

.file-view { min-width: 0; }
.file-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: var(--bg-elev-2);
  flex-wrap: wrap;
}
.file-head .path { font-family: var(--mono); font-size: 12.5px; color: var(--fg); display: flex; align-items: center; gap: 7px; min-width: 0; }
.file-head .path svg { width: 14px; height: 14px; color: var(--fg-muted); flex-shrink: 0; }
.file-head .meta { font-size: 11px; color: var(--fg-subtle); }
.file-head .grow { flex: 1; }

.code-shell {
  border: 1px solid var(--border);
  border-radius: 0 0 10px 10px;
  background: var(--bg-elev);
  overflow: hidden;
}
.code-wrap {
  display: flex;
  max-height: 68vh;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12.4px;
  line-height: 1.62;
  background: var(--bg-elev);
}
.code-gutter {
  position: sticky; left: 0;
  display: flex; flex-direction: column;
  padding: 14px 10px 14px 14px;
  text-align: right;
  color: var(--fg-subtle);
  background: var(--bg-elev);
  border-right: 1px solid var(--border-soft);
  user-select: none;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.code-wrap pre { margin: 0; padding: 14px 18px; flex: 1; tab-size: 2; }
.code-wrap code { font-family: inherit; white-space: pre; }

.tok-k { color: var(--tok-key); }
.tok-s { color: var(--tok-str); }
.tok-c { color: var(--tok-com); font-style: italic; }
.tok-n { color: var(--tok-num); }
.tok-f { color: var(--tok-fn); }
.tok-b { color: var(--purple); }

.editor-shell {
  border: 1px solid var(--accent);
  border-radius: 0 0 10px 10px;
  background: var(--bg);
  overflow: hidden;
}
.editor-shell textarea {
  display: block;
  width: 100%;
  min-height: 56vh;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 12.6px;
  line-height: 1.62;
  resize: vertical;
  outline: none;
  tab-size: 2;
}
.editor-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-elev-2);
  flex-wrap: wrap;
}
.editor-bar .grow { flex: 1; }
.editor-bar .hint { font-size: 11px; color: var(--fg-subtle); }
.dirty-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); display: inline-block; margin-right: 5px; }

/* --------------------------------------------------------------- registry */

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: -0.4px; }
.page-head p { margin: 0; color: var(--fg-muted); }
.page-head .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

.panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elev);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev-2);
  flex-wrap: wrap;
}
.panel-head h2 { margin: 0; font-size: 13px; letter-spacing: 0.1px; }
.panel-head .grow { flex: 1; }
.panel-head input[type="search"] {
  height: 30px;
  padding: 0 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  outline: none;
  min-width: 200px;
}
.panel-head input[type="search"]:focus { border-color: var(--accent); }

.reg-row { border-bottom: 1px solid var(--border-soft); }
.reg-row:last-child { border-bottom: 0; }
.reg-toggle {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 13px 16px;
  background: transparent;
  border: 0;
  color: var(--fg);
  cursor: pointer;
  text-align: left;
}
.reg-toggle:hover { background: var(--hover); }
.reg-toggle .chev { transition: transform 0.15s; color: var(--fg-muted); display: grid; place-items: center; }
.reg-toggle .chev svg { width: 14px; height: 14px; }
.reg-toggle.open .chev { transform: rotate(90deg); }
.reg-toggle .img-name { font-family: var(--mono); font-size: 12.8px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.reg-toggle .tag-count { font-size: 11px; color: var(--fg-muted); }
.reg-body { padding: 0 16px 16px 42px; }
.reg-body .loading-block { padding: 10px 0; }
.tag-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.tag-table th {
  text-align: left;
  padding: 6px 10px 6px 0;
  color: var(--fg-subtle);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-soft);
}
.tag-table td { padding: 7px 10px 7px 0; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.tag-table tr:last-child td { border-bottom: 0; }
.tag-table .tag-name { font-family: var(--mono); color: var(--accent); }
.tag-table .digest { font-family: var(--mono); color: var(--fg-subtle); font-size: 11px; }
.tag-table .right { text-align: right; }
.pull-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pull-row code { font-family: var(--mono); font-size: 11.5px; color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------------ markdown */

.markdown { font-size: 14px; line-height: 1.68; word-wrap: break-word; }
.markdown > :first-child { margin-top: 0; }
.markdown > :last-child { margin-bottom: 0; }
.markdown h1, .markdown h2, .markdown h3, .markdown h4 { margin: 1.6em 0 0.6em; line-height: 1.25; letter-spacing: -0.2px; scroll-margin-top: 20px; }
.markdown h1 { font-size: 1.7em; padding-bottom: 0.3em; border-bottom: 1px solid var(--border); }
.markdown h2 { font-size: 1.35em; padding-bottom: 0.28em; border-bottom: 1px solid var(--border-soft); }
.markdown h3 { font-size: 1.12em; }
.markdown h4 { font-size: 1em; }
.markdown p { margin: 0 0 1em; }
.markdown a { text-decoration: underline; text-underline-offset: 2px; }
.markdown ul, .markdown ol { margin: 0 0 1em; padding-left: 1.6em; }
.markdown li { margin: 0.25em 0; }
.markdown li > code, .markdown p > code { font-size: 0.88em; }
.markdown code {
  font-family: var(--mono);
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: 0.12em 0.38em;
  font-size: 0.88em;
}
.markdown pre {
  margin: 0 0 1.2em;
  padding: 13px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
  font-size: 12.4px;
  line-height: 1.6;
}
.markdown pre code { background: transparent; border: 0; padding: 0; font-size: inherit; }
.markdown blockquote {
  margin: 0 0 1em;
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--border);
  color: var(--fg-muted);
}
.markdown hr { border: 0; border-top: 1px solid var(--border); margin: 1.8em 0; }
.markdown img { max-width: 100%; border-radius: 6px; }
.markdown table { border-collapse: collapse; margin-bottom: 1em; font-size: 13px; }
.markdown th, .markdown td { border: 1px solid var(--border); padding: 6px 10px; }
.markdown th { background: var(--bg-elev-2); }

/* ------------------------------------------------------------------ código */

.callout {
  display: flex; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 8px;
  background: var(--bg-elev);
  font-size: 12.5px;
  color: var(--fg-muted);
  margin-bottom: 16px;
}
.callout svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.callout.warn { border-left-color: var(--orange); }
.callout.bad { border-left-color: var(--red); }
.callout.ok { border-left-color: var(--green); }
.callout strong { color: var(--fg); }
.callout code { font-family: var(--mono); font-size: 11.5px; background: var(--bg-elev-2); padding: 1px 5px; border-radius: 4px; }

.cmd-block {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 14px;
  background: var(--bg);
}
.cmd-block .cmd-head {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  background: var(--bg-elev-2);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--fg-muted);
}
.cmd-block .cmd-head .grow { flex: 1; }
.cmd-block pre { margin: 0; padding: 12px 14px; font-family: var(--mono); font-size: 12px; line-height: 1.7; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

.steps { counter-reset: step; display: flex; flex-direction: column; gap: 26px; }
.step { position: relative; padding-left: 44px; }
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-muted);
}
.step h3 { margin: 3px 0 4px; font-size: 14.5px; }
.step p { margin: 0 0 12px; color: var(--fg-muted); font-size: 13px; }
.deploy-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }

/* ------------------------------------------------------------------ dialog */

.dialog {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev);
  color: var(--fg);
  box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgba(1, 4, 9, 0.66); backdrop-filter: blur(2px); }
.dialog form { margin: 0; }
.dlg-head {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 18px 20px 12px;
}
.dlg-head .grow { flex: 1; }
.dlg-head h3 { margin: 0 0 4px; font-size: 16px; }
.dlg-head p { margin: 0; color: var(--fg-muted); font-size: 12.5px; }
.dlg-body { padding: 4px 20px 8px; display: flex; flex-direction: column; gap: 14px; max-height: 62vh; overflow-y: auto; }
.dlg-foot {
  display: flex; align-items: center; gap: 8px; justify-content: flex-end;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border-soft);
  margin-top: 10px;
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 500; color: var(--fg-muted); }
.field label .req { color: var(--red); }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}
.field textarea { resize: vertical; min-height: 68px; font-family: inherit; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field .help { font-size: 11px; color: var(--fg-subtle); }
.field .error { font-size: 11.5px; color: var(--red); min-height: 15px; }
.field-row { display: grid; grid-template-columns: 1fr 130px; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--fg-muted); }
.check input { accent-color: var(--accent); }

/* ------------------------------------------------------------------ toasts */

.toasts {
  position: fixed;
  right: 18px; bottom: 18px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 100;
  max-width: min(400px, calc(100vw - 36px));
}
.toast {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev-3);
  color: var(--fg);
  font-size: 12.5px;
  box-shadow: var(--shadow);
  animation: toast-in 0.16s ease-out;
}
.toast svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }
.toast.ok svg { color: var(--green); }
.toast.err svg { color: var(--red); }
.toast.info svg { color: var(--accent); }
.toast.out { animation: toast-out 0.2s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------------------------------------------------------------- loading */

.loading-block { display: flex; align-items: center; gap: 10px; color: var(--fg-muted); padding: 40px 0; font-size: 13px; }
.spinner {
  width: 15px; height: 15px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton { border-radius: 8px; background: linear-gradient(90deg, var(--bg-elev) 25%, var(--bg-elev-2) 37%, var(--bg-elev) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.mono { font-family: var(--mono); }
.muted { color: var(--fg-muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.hide { display: none !important; }
.grow { flex: 1; }
.copyable { position: relative; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1100px) {
  .readme-layout { grid-template-columns: minmax(0, 1fr); }
  .deploy-grid { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 26px; }
}

@media (max-width: 920px) {
  .app { grid-template-areas: "header" "main"; grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: grid; }
  .sidebar {
    position: fixed;
    top: 58px; bottom: 0; left: 0;
    width: 280px;
    z-index: 40;
    transform: translateX(-102%);
    transition: transform 0.18s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 58px 0 0; background: rgba(1, 4, 9, 0.5); z-index: 35; }
  .main { padding: 20px 18px 60px; }
  .files-layout { grid-template-columns: minmax(0, 1fr); }
  .file-tree { position: static; }
  .tree { max-height: 240px; }
  .hide-sm { display: none; }
  .repo-header { flex-direction: column; }
}

@media (max-width: 620px) {
  .brand-text small { display: none; }
  .search { margin-left: 0; }
  .stats { grid-template-columns: 1fr; }
  .tab { padding: 9px 10px 11px; }
  .field-row { grid-template-columns: 1fr; }
  .reg-body { padding-left: 16px; }
  .tag-table .hide-xs { display: none; }
}

/* -------------------------------------------------------------- utilidades */

.mw-0 { min-width: 0; }
.ml-2 { margin-left: 8px; }
.mt-2 { margin-top: 10px; }
.mt-4 { margin-top: 18px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 10px; }
.break { word-break: break-all; overflow-wrap: anywhere; }
.empty-flat { border: 0; background: transparent; }
.empty-pad { padding: 20px; }
.readme-flush { border: 0; border-radius: 0; }
.editing-head { border-color: var(--accent); }
.h2-compact { margin: 0 0 6px; font-size: 17px; }
.copy-area { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; }

.code-gutter span { display: block; }
.scrim[hidden] { display: none !important; }

.side-foot svg { width: 12px; height: 12px; flex-shrink: 0; }
.readme-panel .head svg { width: 14px; height: 14px; }
.side-card dt svg { width: 12px; height: 12px; }
.tree-dir svg, .card .foot svg { width: 12px; height: 12px; }
.card .foot svg { vertical-align: -1px; }

/* Ajustes finos de móvil */
.main { min-width: 0; }
.code-wrap { max-width: 100%; }
.markdown table { max-width: 100%; }
.markdown { overflow-wrap: anywhere; }

@media (max-width: 620px) {
  .search { display: none; }
  .topbar { gap: 8px; padding: 0 12px; }
  .brand { gap: 8px; }
  .brand-text strong { font-size: 13px; }
  .brand-mark { width: 30px; height: 30px; border-radius: 8px; }
  .user-chip { max-width: 86px; padding: 0 8px; }
  .main { padding: 16px 14px 60px; }
  .repo-header h1 { font-size: 21px; }
  .repo-actions { width: 100%; }
  .repo-actions .btn { flex: 1; justify-content: center; }
  .files-layout { gap: 12px; }
  .file-head { gap: 6px; }
  .file-head .meta { display: none; }
  .file-head .btn { padding: 0 7px; }
  .tab-body { padding-top: 16px; }
  .markdown table { display: block; overflow-x: auto; }
  .hero { padding: 20px; }
  .stats { gap: 10px; }
  .stat { padding: 12px 14px; }
  .panel-head input[type="search"] { min-width: 0; flex: 1; }
  .toasts { right: 10px; bottom: 10px; left: 10px; max-width: none; }
}

/* ------------------------------------------------------------------ login */

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 460px at 50% -20%, var(--accent-soft), transparent 65%),
    var(--bg);
}

.login-card {
  width: min(380px, 100%);
  padding: 30px 28px 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elev);
  box-shadow: var(--shadow);
}

.login-logo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  border-radius: 11px;
  background: linear-gradient(145deg, #1f6feb, #0b3d91);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.login-logo svg { width: 24px; height: 24px; }

.login-card h1 { margin: 0 0 6px; font-size: 21px; letter-spacing: -0.3px; }
.login-sub { margin: 0 0 18px; color: var(--fg-muted); font-size: 13px; line-height: 1.5; }

.login-form { display: flex; flex-direction: column; gap: 6px; }
.login-form label { margin-top: 8px; font-size: 12px; font-weight: 500; color: var(--fg-muted); }
.login-form input {
  height: 38px;
  padding: 0 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--fg);
  font-size: 14px;
  outline: none;
}
.login-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-submit { width: 100%; height: 38px; margin-top: 16px; }

.login-error {
  margin: 0 0 8px;
  padding: 9px 11px;
  border: 1px solid rgba(248, 81, 73, 0.4);
  border-radius: 7px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12.5px;
}
.login-note { margin: 18px 0 0; text-align: center; font-size: 11px; color: var(--fg-subtle); }
