/* ============================================================
   REC Ingeniería — Sistema de diseño compartido
   Usado por: informes.html, visor.html, admin.html
   ============================================================ */
:root {
  --blue: #163E70;
  --blue-deep: #0E2A4E;
  --orange: #F07B18;
  --ink: #1f2933;
  --muted: #5d6772;
  --line: #d6dde6;
  --paper: #ffffff;
  --soft: #f4f7fb;
  --soft-2: #EEF4FB;
  --radius: 14px;
  --shadow: 0 18px 40px -22px rgba(14, 42, 78, .45);
  --maxw: 1140px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--soft);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* Header */
header.site {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 42px; width: auto; display: block; }
.brand .name { display: flex; flex-direction: column; line-height: 1.1; }
.brand .name b { font-size: 1.05rem; color: var(--blue); letter-spacing: .3px; }
.brand .name span { font-size: .72rem; color: var(--muted); letter-spacing: .6px; text-transform: uppercase; }
nav.menu { display: flex; align-items: center; gap: 26px; }
nav.menu a { font-size: .92rem; font-weight: 500; padding: 6px 2px; border-bottom: 2px solid transparent; transition: .2s; }
nav.menu a:hover, nav.menu a.active { color: var(--blue); border-bottom-color: var(--orange); }
nav.menu a.btn { padding: 10px 20px; color: #fff; border-bottom: none; line-height: 1.1; }
nav.menu a.btn:hover { color: #fff; border-bottom: none; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--orange); color: #fff; font-weight: 600;
  padding: 11px 20px; border-radius: 999px; font-size: .92rem;
  box-shadow: 0 10px 22px -10px rgba(240,123,24,.8);
  transition: transform .15s, background .2s; border: none; cursor: pointer;
}
.btn:hover { transform: translateY(-1px); background: #e06d0c; }
.btn.ghost { background: transparent; color: var(--blue); box-shadow: none; border: 1.5px solid var(--blue); }
.btn.ghost:hover { background: var(--blue); color: #fff; }
.btn.sm { padding: 8px 14px; font-size: .84rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* Page header band */
.page-band {
  background:
    radial-gradient(900px 420px at 80% -20%, rgba(240,123,24,.18), transparent 60%),
    linear-gradient(160deg, var(--blue-deep) 0%, var(--blue) 60%, #1a4a86 100%);
  color: #eaf1fb; padding: 54px 0 60px;
}
.page-band h1 { color: #fff; font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin: 8px 0 10px; letter-spacing: -.4px; }
.page-band p { color: #cfdcef; margin: 0; max-width: 640px; font-size: 1.05rem; }
.page-band .kicker { font-size: .76rem; letter-spacing: 1.6px; text-transform: uppercase; color: #ffd9b0; font-weight: 700; }

/* Toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 28px 0 22px; }
.search {
  flex: 1 1 280px; display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px;
}
.search input { border: 0; outline: 0; flex: 1; font-size: .95rem; background: transparent; color: var(--ink); }
.search svg { width: 18px; height: 18px; color: var(--muted); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  padding: 8px 14px; border-radius: 999px; font-size: .85rem; cursor: pointer; transition: .2s;
}
.chip:hover { border-color: #b7cce7; }
.chip.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* Cards grid */
.grid { display: grid; gap: 22px; grid-template-columns: repeat(3, 1fr); margin: 8px 0 60px; }
.doc-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
  transition: transform .18s, box-shadow .25s, border-color .2s;
}
.doc-card:hover { transform: translateY(-4px); border-color: #b7cce7; box-shadow: 0 26px 50px -24px rgba(14,42,78,.5); }
.doc-thumb {
  height: 120px; background: linear-gradient(140deg, var(--soft-2), #dbe7f6);
  display: grid; place-items: center; color: var(--blue); position: relative;
}
.doc-thumb svg { width: 44px; height: 44px; opacity: .8; }
.doc-thumb .badge {
  position: absolute; top: 12px; left: 12px;
  font-size: .68rem; letter-spacing: .8px; text-transform: uppercase; font-weight: 700;
  background: rgba(22,62,112,.9); color: #fff; padding: 4px 10px; border-radius: 999px;
}
.doc-body { padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.doc-body h3 { margin: 0; font-size: 1.08rem; color: var(--blue); line-height: 1.25; }
.doc-body .meta { font-size: .82rem; color: #8893a0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.doc-body .meta b { color: var(--ink); font-weight: 600; }
.doc-body p { margin: 4px 0 0; font-size: .9rem; color: var(--muted); }
.doc-actions { margin-top: auto; padding-top: 14px; display: flex; gap: 10px; }
.doc-actions .btn { flex: 1; justify-content: center; }

/* States */
.state { text-align: center; padding: 70px 20px; color: var(--muted); }
.state svg { width: 56px; height: 56px; color: #b7cce7; margin-bottom: 14px; }
.state h3 { color: var(--blue); margin: 0 0 6px; }
.spinner {
  width: 34px; height: 34px; border: 3px solid #dbe7f6; border-top-color: var(--orange);
  border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Footer */
footer.site { background: #0b1f3a; color: #aebfd6; padding: 34px 0 26px; margin-top: 20px; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
footer.site .brand img { filter: brightness(0) invert(1); opacity: .92; height: 34px; }
footer.site .brand .name b { color: #fff; }
footer.site .brand .name span { color: #7e93b4; }
footer.site .copyright { width: 100%; border-top: 1px solid rgba(255,255,255,.1); margin-top: 18px; padding-top: 14px; font-size: .8rem; color: #7e93b4; }

/* Forms (admin) */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .85rem; font-weight: 600; color: var(--blue); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px;
  font-size: .95rem; font-family: inherit; color: var(--ink); background: #fff; outline: none; transition: border-color .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); }
.field textarea { resize: vertical; min-height: 80px; }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: 5px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.alert { padding: 12px 16px; border-radius: 10px; font-size: .9rem; margin-bottom: 16px; }
.alert.ok { background: #e9f7ee; color: #1c6b3c; border: 1px solid #bce3cb; }
.alert.err { background: #fdeceb; color: #9a3b32; border: 1px solid #f1c5c0; }
.progress { height: 8px; background: #e5ebf2; border-radius: 999px; overflow: hidden; margin-top: 6px; }
.progress > span { display: block; height: 100%; width: 0; background: var(--orange); transition: width .2s; }

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr 1fr; }
  nav.menu a:not(.btn) { display: none; }
  .row2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
  .brand .name span { display: none; }
}
