/* JFLab — tema "letrero de laboratorio": negro profundo + glow blanco cálido (según logo JF) */
:root {
  --bg: #070707;
  --surface: #111013;
  --surface-2: #1a181c;
  --text: #f0ece4;
  --muted: #9a948a;
  --border: #262329;
  --border-strong: #37333b;
  --accent: #f2e6cf;          /* blanco champán del glow del logo */
  --accent-strong: #fff7e6;
  --accent-soft: rgba(242, 230, 207, .10);
  --glow-c: rgba(242, 230, 207, .55);
  --green: #b8e6c8;
  --red: #f0a8a8;
  --shadow: 0 1px 2px rgba(0, 0, 0, .6), 0 8px 28px rgba(0, 0, 0, .45);
  --glow: 0 0 0 1px rgba(242, 230, 207, .35), 0 0 24px rgba(242, 230, 207, .12);
  --radius: 14px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}
/* Textura de fondo tipo lona + halo cálido superior (como el logo sobre tela) */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background-image:
    radial-gradient(720px 400px at 50% -8%, rgba(242, 230, 207, .07), transparent 62%),
    radial-gradient(1.5px 1.5px at 22% 34%, rgba(255, 255, 255, .045) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 68% 12%, rgba(255, 255, 255, .035) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 84% 58%, rgba(255, 255, 255, .04) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 38% 76%, rgba(255, 255, 255, .03) 50%, transparent 51%),
    linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px);
  background-size: auto, 260px 260px, 320px 320px, 300px 300px, 340px 340px, 36px 36px, 36px 36px;
  mask-image: linear-gradient(#000 55%, rgba(0, 0, 0, .5));
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -.02em; }
h2 { font-size: 18px; margin: 0 0 6px; letter-spacing: -.01em; }
h3 { font-size: 16px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }

/* ---- Monograma JF (recreación CSS del logo) ---- */
.jf-logo {
  font-style: italic; font-weight: 900; letter-spacing: -.06em;
  color: #0a0a0a;
  -webkit-text-stroke: 1.6px var(--accent);
  text-stroke: 1.6px var(--accent);
  filter: drop-shadow(0 0 6px rgba(242, 230, 207, .55)) drop-shadow(0 0 18px rgba(242, 230, 207, .18));
  font-size: 24px; line-height: 1;
  display: inline-block; padding: 2px 1px;
  user-select: none;
}
.jf-logo-lg {
  font-size: 64px;
  -webkit-text-stroke: 2.5px var(--accent);
  filter: drop-shadow(0 0 10px rgba(242, 230, 207, .6)) drop-shadow(0 0 32px rgba(242, 230, 207, .22));
}

/* ---- Barra superior ---- */
.topbar {
  background: rgba(7, 7, 7, .85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner {
  max-width: 1100px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav-link { padding: 6px 12px; border-radius: 8px; color: var(--text); font-weight: 500; }
.nav-link:hover { background: var(--surface-2); text-decoration: none; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.whoami { font-weight: 500; }
.badge {
  font-size: 11px; padding: 2px 8px; border-radius: 99px; font-weight: 600;
  vertical-align: middle; font-family: var(--mono);
}
.badge-admin { background: var(--accent-soft); color: var(--accent-strong); border: 1px solid rgba(242, 230, 207, .3); }

/* ---- Layout ---- */
.container { max-width: 1100px; width: 100%; margin: 0 auto; padding: 28px 20px 60px; flex: 1; }
.narrow { max-width: 640px; margin: 0 auto; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 18px; font-family: var(--mono); }
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.breadcrumbs-top { font-size: 13px; margin-bottom: 6px; }
.breadcrumbs-top a { color: var(--muted); }
.proj-meta { font-size: 13px; font-family: var(--mono); }

/* ---- Hero (landing) ---- */
.hero { padding: 34px 0 36px; }
.eyebrow {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent);
  margin: 0 0 10px;
  text-shadow: 0 0 12px rgba(242, 230, 207, .35);
}
.hero-title {
  font-size: clamp(42px, 7vw, 68px); font-weight: 900; letter-spacing: -.045em;
  font-style: italic;
  margin: 0; color: var(--text);
  text-shadow:
    0 0 14px rgba(242, 230, 207, .28),
    0 0 42px rgba(242, 230, 207, .14);
}
.cursor { color: var(--accent); animation: blink 1.1s steps(1) infinite; font-style: normal; }
@keyframes blink { 50% { opacity: 0; } }
.hero-sub { font-size: 16px; margin: 8px 0 22px; }
.stats-row { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--accent-strong); text-shadow: 0 0 12px rgba(242, 230, 207, .3); }
.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-family: var(--mono); }
.hero-cta { margin-left: auto; }

/* ---- Tarjetas ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.project-card {
  display: block; color: var(--text); margin-bottom: 0;
  position: relative; overflow: hidden;
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.project-card::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity .14s ease;
}
.project-card:hover {
  text-decoration: none; transform: translateY(-3px);
  border-color: rgba(242, 230, 207, .4); box-shadow: var(--glow);
}
.project-card:hover::after { opacity: .9; }
.pc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.pc-tile {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 11px;
  font-weight: 900; font-style: italic; font-size: 19px;
  color: var(--accent-strong);
  background: #0c0b0d;
  border: 1.5px solid rgba(242, 230, 207, .55);
  box-shadow: 0 0 14px rgba(242, 230, 207, .18), inset 0 0 10px rgba(242, 230, 207, .06);
  text-shadow: 0 0 8px rgba(242, 230, 207, .5);
}
.pc-arrow { color: var(--muted); font-size: 18px; transition: transform .14s ease, color .14s ease; }
.project-card:hover .pc-arrow { transform: translateX(4px); color: var(--accent); }
.card-desc { min-height: 42px; font-size: 14px; margin: 4px 0 12px; }
.card-meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.card-date { margin-left: auto; }

/* ---- Botones ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 9px;
  padding: 8px 14px; font-size: 14px; font-weight: 500;
  cursor: pointer; text-decoration: none;
  transition: filter .1s ease, background .1s ease, box-shadow .1s ease;
}
.btn:hover { filter: brightness(1.15); text-decoration: none; }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #0a0a0a; font-weight: 700;
  box-shadow: 0 0 18px rgba(242, 230, 207, .28);
}
.btn-accent {
  background: #0c0b0d; border: 1.5px solid var(--accent); color: var(--accent-strong); font-weight: 600;
  box-shadow: 0 0 16px rgba(242, 230, 207, .25), inset 0 0 12px rgba(242, 230, 207, .06);
  text-shadow: 0 0 8px rgba(242, 230, 207, .4);
}
.btn-success { background: var(--green); border-color: var(--green); color: #0a0a0a; font-weight: 600; }
.btn-danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #0a0a0a; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline; }
.icon-btn {
  background: none; border: none; cursor: pointer; font-size: 14px;
  padding: 4px 6px; border-radius: 6px; color: var(--muted); text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); text-decoration: none; }

/* ---- Formularios ---- */
label { display: block; margin-bottom: 14px; font-weight: 500; font-size: 14px; }
.label-text { display: block; margin-bottom: 8px; font-weight: 500; font-size: 14px; }
input[type="text"], input[type="password"], textarea, select {
  width: 100%; margin-top: 5px;
  background: #0a0a0b; color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 9px 11px; font: inherit;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; }
.form-card { padding: 20px 22px; }
.checks { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; max-height: 220px; overflow-y: auto; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 0; padding: 4px 2px; }
.check input { width: auto; margin: 0; accent-color: var(--accent); }

/* ---- Login / setup ---- */
.auth-wrap { display: flex; justify-content: center; padding: 9vh 16px 0; }
.auth-card {
  width: 100%; max-width: 400px;
  background: rgba(13, 12, 14, .92);
  border: 1px solid var(--border-strong); border-radius: 18px;
  padding: 36px 34px; box-shadow: var(--shadow), 0 0 80px rgba(242, 230, 207, .06);
  text-align: center; position: relative; overflow: hidden;
}
.auth-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .8;
}
.auth-card h1 { margin-top: 18px; font-style: italic; letter-spacing: -.03em; text-shadow: 0 0 16px rgba(242, 230, 207, .25); }
.auth-card form { text-align: left; margin-top: 22px; }
.auth-logo { display: flex; justify-content: center; }

/* ---- Alertas ---- */
.alert { border-radius: 9px; padding: 10px 14px; margin: 14px 0; font-size: 14px; }
.alert-error { background: rgba(240, 168, 168, .1); color: var(--red); border: 1px solid rgba(240, 168, 168, .38); }
.alert-ok { background: rgba(184, 230, 200, .1); color: var(--green); border: 1px solid rgba(184, 230, 200, .38); }

/* ---- Explorador de archivos ---- */
.files-card { padding: 0; overflow: hidden; }
.files-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap;
  background: var(--surface-2);
}
.breadcrumbs { font-size: 13.5px; font-weight: 500; word-break: break-all; font-family: var(--mono); }
.files-table { width: 100%; border-collapse: collapse; }
.files-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--border);
  font-family: var(--mono);
}
.files-table td { padding: 9px 16px; border-bottom: 1px solid var(--border); }
.files-table tr:last-child td { border-bottom: none; }
.files-table tbody tr:hover { background: var(--surface-2); }
.file-link { color: var(--text); font-weight: 500; word-break: break-all; }
.file-link:hover { color: var(--accent); }
.col-size { width: 90px; white-space: nowrap; font-size: 13px; font-family: var(--mono); }
.col-date { width: 130px; white-space: nowrap; font-size: 13px; }
.col-actions { width: 120px; text-align: right; }
.row-actions { display: flex; justify-content: flex-end; gap: 2px; }

#dropzone.dragover { outline: 2px dashed var(--accent); outline-offset: -8px; background: var(--accent-soft); }
.upload-progress { padding: 10px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.upload-bar { flex: 1; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
#upload-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, rgba(242,230,207,.5), var(--accent)); transition: width .15s ease; box-shadow: 0 0 10px rgba(242, 230, 207, .4); }
.mkdir-form { display: flex; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--border); align-items: center; }
.mkdir-form input { margin: 0; max-width: 260px; }

/* ---- Panel de acceso ---- */
.access-panel summary { cursor: pointer; }
.access-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.access-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.access-row:last-of-type { border-bottom: none; }
.access-name { font-weight: 500; }

/* ---- Usuarios ---- */
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }
.user-card { padding: 14px 18px; }
.user-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.user-tools { margin-top: 10px; }
.user-tools .btn-row { margin-top: 10px; }
.access-edit .btn { margin-top: 2px; }
.sticky { position: sticky; top: 70px; }

/* ---- Prosa (descripción markdown) ---- */
.prose { font-size: 15px; }
.prose :first-child { margin-top: 0; }
.prose :last-child { margin-bottom: 0; }
.prose img { max-width: 100%; border-radius: 8px; }
.prose code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: 13px; font-family: var(--mono); }
.prose pre { background: #0a0a0b; padding: 12px 14px; border-radius: 8px; overflow-x: auto; border: 1px solid var(--border); }
.prose pre code { background: none; padding: 0; }
.prose blockquote { border-left: 3px solid var(--accent); margin-left: 0; padding-left: 14px; color: var(--muted); }

/* ---- Estados vacíos ---- */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state.small-pad { padding: 34px 20px; }
.empty-icon { font-size: 40px; margin: 0 0 10px; }
.danger-zone { border-color: rgba(240, 168, 168, .45); }

@media (max-width: 640px) {
  .col-date { display: none; }
  .card-date { margin-left: 0; }
  .topbar-inner { padding: 10px 14px; gap: 10px; }
  .brand-name { display: none; }
  .container { padding: 20px 14px 40px; }
  .hero { padding: 18px 0 26px; }
  .stats-row { gap: 18px; }
  .hero-cta { margin-left: 0; width: 100%; justify-content: center; }
}
