/* Pronauplio · demo — línea visual del sitio: negro, naranja PRO, verde de los puntos, títulos condensados */
:root {
  --ink: #111111;
  --ink-2: #3a3a36;
  --muted: #5c5c57;
  --line: #e4e2dd;
  --line-strong: #cfcdc7;
  --paper: #ffffff;
  --ground: #f4f3f0;
  --black: #111111;
  --nav-text: #e6e6e2;
  --nav-muted: #a8a8a4;
  --accent: #e8960f;
  --accent-soft: #fff4e0;
  --accent-ink: #8a5a00;
  --green: #7db83a;
  --good: #2f6b12;
  --good-soft: #e9f4df;
  --bad: #a3271b;
  --bad-soft: #fbe7e4;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', 'Segoe UI', sans-serif;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.45; }
a { color: var(--ink); }
code { background: #efeee9; padding: 1px 5px; border-radius: 4px; font-size: 0.92em; }
h1, h2, h3 { font-family: var(--display); letter-spacing: 0.6px; text-transform: uppercase; margin: 0; }
h1 { font-size: 40px; font-weight: 800; line-height: 1; }
h2 { font-size: 20px; font-weight: 800; }
h3 { font-size: 17px; font-weight: 700; }

/* ---------- estructura ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 260px; flex: none; background: var(--black); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; flex-direction: column; gap: 6px; padding: 24px 24px 20px; text-decoration: none; color: #fff; }
.brand-mark { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1; letter-spacing: 0.5px; color: inherit; text-decoration: none; }
.brand-mark .pro { color: var(--accent); }
.brand-dots { display: flex; gap: 4px; }
.brand-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.brand-sub { font-size: 12px; color: var(--nav-muted); }
.nav { flex: 1; padding-bottom: 12px; }
.nav-section { padding: 18px 24px 6px; font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: 1.2px; color: var(--nav-muted); }
.nav-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 24px; color: var(--nav-text); text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 16px; letter-spacing: 0.5px; text-transform: uppercase; border-left: 3px solid transparent; }
.nav-item:hover { background: #1d1d1d; color: #fff; }
.nav-item.active { background: #222; color: #fff; border-left-color: var(--accent); font-weight: 700; }
.nav-item.soon { font-family: var(--body); text-transform: none; font-size: 14px; font-weight: 500; color: #8e8e8a; letter-spacing: 0; padding-top: 7px; padding-bottom: 7px; }
.nav-count { background: var(--accent); color: var(--ink); border-radius: 20px; font-family: var(--body); font-size: 12px; font-weight: 700; padding: 1px 8px; }
.nav-user { display: flex; align-items: center; gap: 10px; padding: 16px 20px 20px 24px; border-top: 1px solid #2e2e2e; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--ink); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.nav-user-txt { display: flex; flex-direction: column; min-width: 0; font-size: 14px; }
.nav-user-txt small { color: #b8b8b4; font-size: 12px; }
.nav-logout { margin-left: auto; color: #d8d8d4; font-size: 13px; }
.main { flex: 1; min-width: 0; padding: 28px 32px 40px; display: flex; flex-direction: column; gap: 20px; }
.foot { margin-top: auto; padding-top: 24px; font-size: 12px; color: var(--muted); }
.nav-toggle, .mobile-bar { display: none; }

@media (max-width: 900px) {
  .app { flex-direction: column; }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; background: var(--black); color: #fff; padding: 12px 16px; position: sticky; top: 0; z-index: 20; }
  .mobile-bar .brand-mark { font-size: 24px; }
  .mobile-menu-btn { font-family: var(--display); font-weight: 700; letter-spacing: 1px; border: 1px solid #555; border-radius: 6px; padding: 8px 14px; cursor: pointer; min-height: 40px; display: flex; align-items: center; }
  .sidebar { display: none; width: 100%; height: auto; position: static; }
  .sidebar .brand { display: none; }
  .nav-toggle:checked ~ .sidebar { display: flex; }
  .main { padding: 20px 16px 32px; }
  h1 { font-size: 32px; }
}

/* ---------- encabezados de página ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-desc { margin: 6px 0 0; color: var(--muted); max-width: 760px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 8px; border: 2px solid var(--ink); background: var(--ink); color: #fff; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: 0.6px; text-transform: uppercase; cursor: pointer; }
.btn:hover { background: #2a2a2a; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.btn-accent:hover { background: #d98a0a; }
.btn-ghost { background: #fff; color: var(--ink); }
.btn-ghost:hover { background: #f1f0ec; }
.btn-small { min-height: 34px; padding: 0 12px; font-size: 15px; }
.btn-danger { background: #fff; color: var(--bad); border-color: var(--bad); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.link-btn { background: none; border: none; padding: 0; color: var(--ink); text-decoration: underline; cursor: pointer; font: inherit; }

/* ---------- tarjetas, paneles ---------- */
.panel { background: var(--paper); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cols-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kpi { background: var(--paper); border-radius: var(--radius); padding: 16px 18px; border-top: 4px solid var(--ink); }
.kpi.good { border-top-color: var(--green); }
.kpi.warn { border-top-color: var(--accent); }
.kpi.bad { border-top-color: var(--bad); }
.kpi-label { font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); }
.kpi-value { font-family: var(--display); font-weight: 700; font-size: 36px; line-height: 1.05; margin-top: 4px; }
.kpi-note { font-size: 13px; color: var(--muted); margin-top: 4px; }

.area-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; background: var(--paper); border-radius: var(--radius); border-top: 4px solid var(--ink); text-decoration: none; color: var(--ink); min-height: 200px; }
.area-card:hover { box-shadow: 0 0 0 2px var(--ink) inset; }
.area-card.highlight { background: var(--accent-soft); border-top-color: var(--accent); }
.area-name { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: 0.8px; }
.area-value { font-family: var(--display); font-weight: 700; font-size: 44px; line-height: 1; }
.area-sub { font-size: 14px; color: var(--muted); }
.area-status { font-size: 14px; font-weight: 600; }
.area-go { margin-top: auto; font-weight: 700; font-size: 14px; }

.hero { position: relative; border-radius: 12px; overflow: hidden; background: #26302e url('img/planta.jpg') center / cover no-repeat; min-height: 170px; display: flex; align-items: flex-end; padding: 28px 32px; color: #fff; }
.hero::before { content: ''; position: absolute; inset: 0; background: rgba(10, 14, 13, 0.55); }
.hero > * { position: relative; }
.hero-title { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1.05; letter-spacing: 0.5px; text-transform: uppercase; }
.hero-sub { font-size: 16px; color: #eef2f0; max-width: 720px; margin-top: 4px; }

/* ---------- tablas ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-family: var(--display); font-size: 14px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table.nowrap td { white-space: nowrap; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr.row-bad td { background: var(--bad-soft); }
.table tr.row-warn td { background: var(--accent-soft); }
.table tr.row-muted td { color: var(--muted); }
.table input, .table select { min-height: 38px; padding: 0 8px; width: 100%; min-width: 64px; }

/* ---------- etiquetas ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 4px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-good { background: var(--good-soft); color: var(--good); }
.badge-warn { background: #ffe2b0; color: #5f3d00; }
.badge-bad { background: var(--ink); color: #fff; }
.badge-info { background: #e7eef8; color: #1f4b8f; }
.badge-grey { background: #ecebe7; color: var(--ink-2); }
.badge-accent { background: var(--accent); color: var(--ink); }

/* ---------- alertas ---------- */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 14.5px; border: 1px solid; }
.alert-good { background: var(--good-soft); border-color: #bcdca4; color: #1f4a0b; }
.alert-warn { background: var(--accent-soft); border-color: #f2cf8f; color: #5f3d00; }
.alert-bad { background: var(--bad-soft); border-color: #efb8b1; color: #7a1c13; }
.alert-info { background: #eef3fb; border-color: #c9d8f0; color: #1f3d6b; }
.alert-list { display: flex; flex-direction: column; }
.alert-row { display: flex; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.alert-row:last-child { border-bottom: none; }
.alert-row:hover .alert-text { text-decoration: underline; }
.alert-area { font-size: 12px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.issues { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }
.issues li.err { color: var(--bad); font-weight: 600; }
.issues li.warn { color: var(--accent-ink); }

/* ---------- formularios ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label, .field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
input, select, textarea { font: inherit; font-size: 16px; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; }
input, select { min-height: 44px; padding: 0 12px; }
textarea { padding: 10px 12px; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
input.dudoso { border: 2px solid var(--accent); background: var(--accent-soft); font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; }
.span-2 { grid-column: span 2; }
.muted { color: var(--muted); font-size: 14px; margin: 0; }
.inline-form { display: inline; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; background: var(--paper); border-radius: var(--radius); padding: 14px 16px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }

/* ---------- foto y revisión ---------- */
.review-grid { display: grid; gap: 16px; align-items: start; grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); }
@media (max-width: 1100px) { .review-grid { grid-template-columns: minmax(0, 1fr); } }
.edit-table { table-layout: fixed; min-width: 560px; }
.edit-table th, .edit-table td { padding-left: 4px; padding-right: 4px; }
.edit-table th { white-space: normal; font-size: 12.5px; line-height: 1.15; vertical-align: bottom; }
.edit-table input, .edit-table select { min-width: 0; padding: 0 6px; }
.upload-box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border: 2px dashed var(--line-strong); border-radius: var(--radius); background: var(--paper); padding: 28px 16px; text-align: center; }
.upload-box input[type=file] { max-width: 100%; border: none; min-height: auto; padding: 0; }
.photo-frame { background: #d9d7d1; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.photo-frame img { max-width: 100%; max-height: 720px; display: block; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; counter-reset: paso; }
.step { background: var(--paper); border-radius: var(--radius); padding: 14px 16px; font-size: 14px; }
.step b { display: block; font-family: var(--display); font-size: 17px; letter-spacing: 0.5px; text-transform: uppercase; }
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.check-list .ok { color: var(--good); font-weight: 600; }
.check-list .warn { color: var(--accent-ink); font-weight: 600; }
.check-list .err { color: var(--bad); font-weight: 600; }
.loading { display: none; align-items: center; gap: 10px; color: var(--muted); }
.loading.on { display: flex; }
.spinner { width: 18px; height: 18px; border: 3px solid #d7d5cf; border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- trazabilidad ---------- */
.chain { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.chain-step { background: var(--paper); border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 14px; min-width: 150px; }
.chain-step small { display: block; font-family: var(--display); font-weight: 700; letter-spacing: 0.6px; color: var(--muted); text-transform: uppercase; }
.chain-step strong { font-size: 16px; }
.chain-arrow { align-self: center; font-weight: 700; color: var(--accent); }

/* ---------- vacíos ---------- */
.empty { background: var(--paper); border-radius: var(--radius); padding: 40px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty p { color: var(--muted); max-width: 520px; margin: 0; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: #1b2422 url('img/planta.jpg') center / cover no-repeat; position: relative; }
.login::before { content: ''; position: absolute; inset: 0; background: rgba(10, 12, 12, 0.6); }
.login-card { position: relative; background: #fff; border-radius: 14px; width: 100%; padding: 32px 28px; display: flex; flex-direction: column; gap: 16px; }
.login-card .brand-mark { font-size: 34px; color: var(--ink); }
.login-sections { display: flex; gap: 18px; position: relative; color: #fff; font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: 1px; margin-top: 18px; flex-wrap: wrap; justify-content: center; }
.login-wrap { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 440px; position: relative; }
.demo-users { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }

/* ---------- instalador ---------- */
.install { background: var(--ground); }
.install-card { max-width: 720px; margin: 40px auto; background: #fff; border-radius: 14px; padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.install-card .brand-mark { color: var(--ink); }
.checklist { margin: 0; padding-left: 18px; }
.checklist .ok { color: var(--good); }
.checklist .no { color: var(--bad); font-weight: 600; }

/* ---------- impresión ---------- */
@media print {
  .sidebar, .mobile-bar, .foot, .page-actions, .no-print { display: none !important; }
  body, .main { background: #fff; padding: 0; }
}
