/* ============================================================
   public/assets/css/public.css — Estilos vista pública
   ============================================================ */

/* Variables */
:root {
  --azul:        #1a3a6e;
  --azul-claro:  #2a5298;
  --oro:         #c9a84c;
  --oro-claro:   #e8d5a3;
  --bg:          #f4f2ed;
  --bg-card:     #ffffff;
  --texto:       #1c1c1c;
  --texto-2:     #5a5a5a;
  --texto-3:     #999;
  --borde:       #ddd8cc;
  --sidebar-w:   240px;
  --header-h:    80px;
  --radius:      8px;
  --shadow:      0 2px 12px rgba(26,58,110,.07);
}

/* Reset base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--texto);
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── HEADER ─────────────────────────────────────── */
.header {
  height: var(--header-h);
  background: var(--azul);
  border-bottom: 3px solid var(--oro);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  flex-shrink: 0;
}

.header-logo img { height: 50px; width: auto; object-fit: contain; }

.logo-placeholder {
  width: 50px; height: 50px;
  background: rgba(255,255,255,.15);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Lora', serif;
  font-weight: 600; font-size: 16px; color: #fff;
  border: 1px solid rgba(255,255,255,.3);
}

.header-brand {
  border-left: 1px solid rgba(255,255,255,.25);
  padding-left: 14px;
}
.header-brand h1 {
  font-family: 'Lora', serif;
  font-size: 16px; font-weight: 600; color: #fff; line-height: 1.2;
}
.header-brand p { font-size: 11px; color: var(--oro-claro); letter-spacing: .4px; margin-top: 2px; }

.header-search { flex: 1; max-width: 480px; margin-left: auto; }
.header-search form { display: flex; }
.header-search input {
  flex: 1; padding: 9px 16px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px 0 0 6px;
  font-size: 13px; background: rgba(255,255,255,.12);
  color: #fff; outline: none;
}
.header-search input::placeholder { color: rgba(255,255,255,.5); }
.header-search input:focus { background: rgba(255,255,255,.2); }
.header-search button {
  padding: 9px 18px;
  background: var(--oro); border: none;
  border-radius: 0 6px 6px 0;
  font-size: 13px; font-weight: 500;
  color: var(--azul); cursor: pointer; white-space: nowrap;
}
.header-search button:hover { background: var(--oro-claro); }

/* ── LAYOUT ─────────────────────────────────────── */
.layout { display: flex; flex: 1; }

/* ── SIDEBAR ─────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  padding: 24px 14px;
  border-right: 1px solid var(--borde);
  background: var(--bg-card);
}

.sidebar-section { margin-bottom: 28px; }

.sidebar-title {
  font-size: 10px; font-weight: 500;
  letter-spacing: .8px; text-transform: uppercase;
  color: var(--texto-3); padding: 0 8px; margin-bottom: 8px;
}

.sidebar-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; border-radius: 6px;
  font-size: 13px; text-decoration: none;
  color: var(--texto-2); transition: all .15s; margin-bottom: 2px;
}
.sidebar-item:hover  { background: var(--bg); color: var(--texto); }
.sidebar-item.activo { background: var(--azul); color: #fff; font-weight: 500; }
.sidebar-item.activo .badge-n { background: rgba(255,255,255,.2); color: #fff; }

.badge-n {
  font-size: 10px; background: var(--bg);
  padding: 2px 8px; border-radius: 10px; color: var(--texto-3);
}

.sidebar-divider { height: 1px; background: var(--borde); margin: 6px 0; }

/* ── MAIN ─────────────────────────────────────── */
.main { flex: 1; padding: 24px 28px; min-width: 0; }

.main-header {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px; flex-wrap: wrap; gap: 10px;
}

.main-titulo {
  font-family: 'Lora', serif;
  font-size: 20px; font-weight: 600; color: var(--azul);
}
.main-sub { font-size: 13px; color: var(--texto-2); margin-top: 3px; }

/* Chips de filtros activos */
.filtros-activos { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; padding: 4px 10px;
  border-radius: 20px; background: var(--azul);
  color: #fff; text-decoration: none;
}
.chip .x { opacity: .7; font-size: 14px; line-height: 1; }
.chip:hover .x { opacity: 1; }
.chip-clear { font-size: 12px; color: var(--texto-2); padding: 4px 8px; text-decoration: none; }
.chip-clear:hover { color: var(--azul); }

/* ── TABLA DOCUMENTOS ────────────────────────────── */
.doc-table {
  width: 100%; border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--borde);
  box-shadow: var(--shadow);
}

.doc-table thead th {
  background: var(--azul); color: #fff;
  font-size: 11px; font-weight: 500;
  letter-spacing: .5px; text-transform: uppercase;
  padding: 12px 16px; text-align: left;
}

.doc-table tbody tr {
  border-bottom: 1px solid var(--borde);
  transition: background .1s;
}
.doc-table tbody tr:last-child { border-bottom: none; }
.doc-table tbody tr:hover { background: #faf8f4; }
.doc-table td { padding: 14px 16px; vertical-align: middle; }

.tipo-badge {
  display: inline-block; width: 36px; height: 36px;
  border-radius: 6px; font-size: 10px; font-weight: 500;
  text-align: center; line-height: 36px; flex-shrink: 0;
}

.cat-badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 10px; font-size: 10px; font-weight: 500;
}

.doc-titulo { font-size: 14px; font-weight: 500; line-height: 1.3; margin-bottom: 4px; }
.doc-meta {
  display: flex; gap: 8px; align-items: center;
  flex-wrap: wrap; font-size: 11px; color: var(--texto-2);
}

.td-fecha, .td-dep { font-size: 12px; color: var(--texto-2); white-space: nowrap; }
.td-fecha { width: 100px; }
.td-dep   { width: 150px; }

.btn-abrir {
  display: inline-block; padding: 6px 14px;
  background: var(--azul); color: #fff;
  border-radius: 5px; font-size: 12px;
  font-weight: 500; text-decoration: none;
  transition: background .15s; white-space: nowrap;
}
.btn-abrir:hover { background: var(--azul-claro); }

/* ── PAGINACIÓN ──────────────────────────────────── */
.paginacion {
  display: flex; justify-content: center;
  gap: 6px; padding: 24px 0; align-items: center;
}
.pag-btn {
  padding: 7px 13px; border: 1px solid var(--borde);
  border-radius: 6px; font-size: 13px;
  text-decoration: none; color: var(--texto-2);
  background: var(--bg-card); transition: all .15s;
}
.pag-btn:hover { border-color: var(--azul); color: var(--azul); }
.pag-btn.activo { background: var(--azul); color: #fff; border-color: var(--azul); }
.pag-btn.disabled { opacity: .4; pointer-events: none; }
.pag-info { font-size: 13px; color: var(--texto-2); margin: 0 6px; }

/* ── SIN RESULTADOS ──────────────────────────────── */
.sin-resultados { text-align: center; padding: 60px 20px; color: var(--texto-2); }
.sin-resultados svg { opacity: .2; margin-bottom: 16px; }
.sin-resultados p { font-size: 15px; }

/* ── FOOTER ──────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--borde);
  background: var(--azul);
  padding: 16px 32px;
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto;
}
.footer p { font-size: 12px; color: rgba(255,255,255,.6); }
.footer a { color: var(--oro-claro); text-decoration: none; font-size: 12px; }
.footer a:hover { color: var(--oro); }

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .header  { padding: 0 16px; }
  .main    { padding: 16px; }
  .td-dep, .td-fecha { display: none; }
  .header-brand p { display: none; }
}
