:root {
  --navy: #0F172A;
  --secondary: #334155;
  --accent: #0369A1;
  --accent-dark: #075985;
  --bg: #F8FAFC;
  --fg: #020617;
  --muted: #E8ECF1;
  --border: #E2E8F0;
  --danger: #DC2626;
  --ok: #047857;
  --warn: #B45309;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 20px rgba(0,0,0,.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

/* ---- Botones ---- */
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 200ms ease;
}
.btn-primary:hover { background: var(--accent-dark); text-decoration: none; }

.btn-ghost {
  display: inline-block;
  color: var(--secondary);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: background 200ms ease;
}
.btn-ghost:hover { background: var(--muted); text-decoration: none; }

/* ---- Alertas ---- */
.alert {
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
}
.alert-err { background: #FEF2F2; color: var(--danger); border: 1px solid #FECACA; }
.alert-ok  { background: #ECFDF5; color: var(--ok); border: 1px solid #A7F3D0; }

/* ---- Login ---- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px;
  background: linear-gradient(160deg, var(--navy) 0%, #1E293B 100%);
}
.login-card {
  background: #fff;
  width: 100%;
  max-width: 400px;
  border-radius: 16px;
  padding: 40px 32px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-logo { height: 52px; width: auto; margin-bottom: 24px; }
.login-card h1 { font-size: 20px; color: var(--navy); }
.login-sub { color: var(--secondary); font-size: 14px; margin: 6px 0 24px; }
.login-form { display: flex; flex-direction: column; gap: 16px; text-align: left; }
.login-form label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--secondary);
}
.login-form input {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 16px;
}
.login-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(3,105,161,.15);
}
.login-form .btn-primary { margin-top: 4px; }
.login-foot { color: #94A3B8; font-size: 13px; }
.login-foot a { color: #CBD5E1; }

/* ---- Topbar ---- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.topbar-in {
  max-width: 940px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand:hover { text-decoration: none; }
.brand img { height: 38px; width: auto; display: block; }
.brand-sep { width: 1px; height: 24px; background: var(--border); }
.brand-tag { font-size: 13px; font-weight: 600; color: var(--secondary); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.client-name { font-weight: 600; font-size: 14px; color: var(--navy); }

/* ---- Contenido ---- */
.content { max-width: 940px; margin: 0 auto; padding: 32px 24px 48px; }

/* ---- Hero ---- */
.hero { margin-bottom: 22px; }
.hero h1 { font-size: 28px; color: var(--navy); letter-spacing: -.01em; }
.hero p { color: var(--secondary); margin-top: 6px; max-width: 620px; }

/* ---- Cómo funciona ---- */
.howto {
  background: linear-gradient(150deg, var(--navy), #1E293B);
  color: #E2E8F0;
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 26px;
}
.howto h2 { font-size: 15px; color: #fff; margin-bottom: 12px; }
.howto ul { list-style: none; display: grid; gap: 8px; }
.howto li { font-size: 14px; padding-left: 18px; position: relative; }
.howto li::before {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}
.howto strong { color: #fff; }

/* ---- Tarjetas de carpeta ---- */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 200ms ease, transform 200ms ease, border-color 200ms ease;
  color: inherit;
}
.card:hover {
  text-decoration: none;
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: #CBD5E1;
}
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-ico { width: 38px; height: 38px; fill: var(--accent); }
.card h3 { font-size: 16px; color: var(--navy); margin-bottom: 4px; }
.card p { font-size: 13px; color: var(--secondary); }

.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-ok { background: #ECFDF5; color: var(--ok); }
.badge-warn { background: #FFFBEB; color: var(--warn); }
.badge-neutral { background: var(--muted); color: var(--secondary); }

/* ---- Migas ---- */
.crumbs { font-size: 14px; margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs .sep { color: #94A3B8; }
.crumbs .current { font-weight: 600; color: var(--navy); }

/* ---- Uploader ---- */
.uploader {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.uploader-text strong { color: var(--navy); font-size: 15px; }
.uploader-text p { color: var(--secondary); font-size: 13px; margin-top: 2px; }
.uploader-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.uploader-actions input[type=file] { font-size: 13px; max-width: 220px; }

/* ---- Lista de archivos ---- */
.filelist { list-style: none; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.file-row:last-child { border-bottom: none; }
.file-row:hover { background: var(--bg); }
.file-main { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--navy); font-weight: 500; }
.file-main:hover { text-decoration: none; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ico { width: 22px; height: 22px; flex-shrink: 0; }
.file-row .ico { fill: var(--accent); }
.file-meta { color: #94A3B8; font-size: 13px; white-space: nowrap; }

.empty {
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  color: #94A3B8;
}

.portal-foot { text-align: center; color: #94A3B8; font-size: 13px; padding: 24px; }

/* ---- Responsive ---- */
@media (max-width: 620px) {
  .hero h1 { font-size: 23px; }
  .cards { grid-template-columns: 1fr; }
  .uploader { flex-direction: column; align-items: stretch; }
  .uploader-actions { justify-content: space-between; }
  .topbar-in, .content { padding-left: 16px; padding-right: 16px; }
  .brand-sep, .brand-tag { display: none; }
}
