/* ==========================================================================
   Camioneros RN — sistema de diseño compartido
   Paleta "Ruta / Industrial": verde pino + crema, tipografía condensada
   para títulos, Manrope para texto y Space Mono para datos numéricos.
   Se referencia con <link rel="stylesheet" href="/assets/css/theme.css">
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@600;700;800&family=Manrope:wght@400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap');

:root {
  --pine-950: #0e2419;
  --pine-900: #143323;
  --pine-800: #1c4630;
  --pine-700: #245939;
  --pine-600: #2b6b45;
  --pine-500: #337f4f;
  --cream: #f3f0e6;
  --tint: #dfeee3;
  --paper: #f3f0e6;
  --paper-dim: #e7e1cf;
  --surface: #ffffff;
  --ink: #12201a;
  --ink-soft: #57655c;
  --line: rgba(14, 36, 25, .14);
  --line-on-dark: rgba(243, 240, 230, .20);
  --brick: #b23b30;
  --brick-soft: #f7e0dc;
  --shadow-card: 0 10px 28px rgba(14, 36, 25, .08);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Manrope', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--pine-700); text-decoration: none; }
a:hover { color: var(--pine-900); }

img { max-width: 100%; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 32px; }

/* ---------- typography ---------- */

.display {
  font-family: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .01em;
}

.mono {
  font-family: 'Space Mono', 'Courier New', monospace;
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 700;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.btn-white { background: #ffffff; color: var(--pine-950); }
.btn-white:hover { background: var(--cream); color: var(--pine-950); }
.btn-ghost { background: transparent; border-color: var(--line-on-dark); color: var(--cream); }
.btn-ghost:hover { border-color: var(--cream); color: var(--cream); }
.btn-pine { background: var(--pine-700); color: #fff; }
.btn-pine:hover { background: var(--pine-800); color: #fff; }
.btn-outline { background: transparent; border-color: var(--pine-700); color: var(--pine-700); }
.btn-outline:hover { background: #eef7f0; }
.btn-secondary { background: var(--paper-dim); color: var(--ink); }
.btn-secondary:hover { background: var(--tint); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- tags / badges ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.tag-tint { background: var(--tint); color: var(--pine-800); }
.tag-dark { background: var(--pine-950); color: var(--cream); }
.tag-muted { background: var(--paper-dim); color: var(--ink-soft); }
.tag-danger { background: var(--brick-soft); color: var(--brick); }
.tag-ok { background: #dcefe1; color: var(--pine-700); }

.pill-number {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  background: var(--pine-950);
  color: var(--cream);
  border-radius: 999px;
  padding: 5px 12px;
  display: inline-flex;
  width: fit-content;
}

/* ---------- site header (public + admin shell) ---------- */

.site-header { background: var(--pine-950); width: 100%; }

.site-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.brand-block { display: flex; flex-direction: column; gap: 2px; text-decoration: none; }
.brand-logo {
  display: block;
  width: auto;
  height: 58px;
  max-width: 180px;
  object-fit: contain;
}
.brand-title { font-family: 'Big Shoulders Display', 'Arial Narrow', sans-serif; font-weight: 800; text-transform: uppercase; font-size: 26px; color: var(--cream); line-height: 1; }
.brand-sub { font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--cream); }

.site-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.lane {
  height: 6px;
  background-image: repeating-linear-gradient(90deg, var(--cream) 0 26px, transparent 26px 48px);
  opacity: .5;
}

.menu-toggle {
  display: none;
  min-width: 44px;
  padding: 10px 12px;
  font-size: 22px;
  line-height: 1;
}

/* dropdown menus (Accesos útiles / Herramientas PDF) */
.tools-menu { position: relative; }
.tools-menu summary { list-style: none; cursor: pointer; }
.tools-menu summary::-webkit-details-marker { display: none; }
.tools-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 300px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(14, 36, 25, .16);
  z-index: 20;
}
.tools-menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tools-menu-group { display: grid; gap: 8px; }
.tools-menu-title { margin: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.tools-menu-link { color: var(--ink); background: var(--paper); border: 1px solid var(--line); justify-content: flex-start; }
.tools-menu-link:hover { background: var(--tint); color: var(--pine-900); }
.tools-menu-extra { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- admin topbar ---------- */

.admin-topbar { background: var(--surface); border-bottom: 1px solid var(--line); width: 100%; }
.admin-topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.admin-user { display: flex; align-items: center; gap: 14px; }
.admin-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--pine-950); color: var(--cream);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
}

.site-session {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cream);
}
.site-session-avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  color: var(--pine-950);
  font-size: 12px;
  font-weight: 800;
  flex: 0 0 auto;
}
.site-session-name {
  margin: 0;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.1;
}
.site-session-role {
  margin: 2px 0 0;
  font-size: 12px;
  color: rgba(243, 240, 230, .68);
}

.admin-site-header .site-header-inner {
  max-width: none;
  min-height: 70px;
  padding: 12px 28px;
  gap: 18px;
  flex-wrap: nowrap;
}
.admin-site-header .brand-block {
  flex: 0 0 180px;
  gap: 5px;
}
.admin-site-header .brand-logo {
  height: 42px;
  max-width: 150px;
}
.admin-site-header .brand-title {
  font-size: 21px;
}
.admin-site-header .brand-sub {
  font-size: 9.5px;
  letter-spacing: .16em;
}
.admin-site-header .site-nav {
  margin-left: auto;
  gap: 10px;
  flex-wrap: nowrap;
}
.admin-site-header .btn {
  min-height: 46px;
  padding: 0 22px;
  font-size: 12px;
}
.admin-site-header .site-session {
  max-width: 190px;
  gap: 12px;
}
.admin-site-header .site-session-avatar {
  width: 34px;
  height: 34px;
  font-size: 10px;
}
.admin-site-header .site-session-name {
  font-size: 12.5px;
}
.admin-site-header .site-session-role {
  font-size: 11px;
}
.admin-site-header + .lane {
  height: 4px;
}

/* ---------- birthday + news ---------- */

.birthday-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #ecfdf3 0%, #cdeed9 50%, #a9dfc0 100%);
  border: 1px solid #a9dfc0;
  border-radius: 16px;
  padding: 20px 24px;
}
.birthday-card::before {
  content: "";
  position: absolute;
  inset: -20% -10%;
  background-image: repeating-linear-gradient(120deg, rgba(255,255,255,.35) 0px, rgba(255,255,255,.35) 8px, rgba(255,255,255,0) 8px, rgba(255,255,255,0) 18px);
  pointer-events: none;
}
.birthday-card p { margin: 0; position: relative; z-index: 1; color: var(--pine-900); font-size: 15px; line-height: 1.5; }

.news-panel {
  margin-top: 16px;
  background: #eef7f0;
  border: 1px solid #bfe3cc;
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.news-panel h2 { font-size: 20px; margin: 0; color: var(--pine-900); }
.news-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.news-row .news-title { font-weight: 700; font-size: 14.5px; color: var(--pine-950); }
.news-row .news-date { color: var(--ink-soft); font-size: 13px; }
.news-empty { margin: 0; font-size: 14px; color: var(--ink-soft); }

/* ---------- cards / panels ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  padding: 28px 32px;
}

.module {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s ease, transform .15s ease;
}
.module:hover { box-shadow: 0 14px 34px rgba(14, 36, 25, .14); transform: translateY(-2px); }
.module-title { margin: 0; font-weight: 700; font-size: 15.5px; color: var(--ink); }
.module-desc { margin: 6px 0 0; font-size: 13px; color: var(--ink-soft); line-height: 1.4; }

.icon-tile {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--pine-950); color: var(--cream);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.icon-tile svg { width: 20px; height: 20px; }

.modules-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ---------- forms ---------- */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label {
  font-family: 'Space Mono', monospace;
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
input[type="text"], input[type="password"], input[type="email"], input[type="tel"],
input[type="search"], input[type="number"], input[type="date"], input[type="file"],
select, textarea {
  width: 100%;
  min-height: 48px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
}
textarea { min-height: 100px; padding: 12px 14px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--pine-600);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(43, 107, 69, .12);
}
.search-box {
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid var(--line); border-radius: 12px;
  padding: 0 16px; height: 52px; background: var(--surface);
}
.search-box input { border: none; background: transparent; padding: 0; min-height: unset; }
.search-box svg { flex-shrink: 0; color: var(--ink-soft); }

.error, .notice {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
}
.error { background: var(--brick-soft); color: var(--brick); }
.notice { background: #dcefe1; color: var(--pine-800); }

/* ---------- tables ---------- */

.table-wrap { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-card); overflow: hidden; }
table.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  background: var(--pine-950); color: var(--cream);
  font-family: 'Space Mono', monospace;
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  text-align: left; padding: 14px 16px;
}
.data-table thead th.sortable { cursor: pointer; user-select: none; }
.data-table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 14.5px; vertical-align: middle; }
.data-table tbody tr:nth-child(even) { background: var(--paper); }
.data-table tbody tr:hover { background: var(--tint); }
.data-table tbody tr:last-child td { border-bottom: none; }

@media (max-width: 720px) {
  table.data-table thead { display: none; }
  table.data-table, table.data-table tbody { display: block; width: 100%; }
  table.data-table tr {
    display: grid;
    grid-template-columns: minmax(92px, .65fr) minmax(170px, 1.7fr) minmax(130px, 1fr);
    align-items: start;
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 0 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
  }
  table.data-table tr:nth-child(even) { background: #f8f7f1; }
  table.data-table tr:last-child { border-bottom: none; }
  table.data-table td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    padding: 14px 0;
    border: none;
    font-size: 16px;
    line-height: 1.22;
    overflow-wrap: anywhere;
  }
  table.data-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-soft);
  }
  table.data-table .pill-number {
    min-width: 72px;
    justify-content: center;
    padding: 8px 14px;
    font-size: 16px;
  }
  table.data-table .tag {
    padding: 8px 16px;
    font-size: 15px;
  }
  table.data-table td:nth-child(n + 4) {
    grid-column: 1 / -1;
    padding-top: 0;
    color: var(--ink-soft);
  }
}

/* ---------- footer ---------- */

.site-footer { background: var(--pine-950); width: 100%; padding: 36px 32px; }
.site-footer-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 14px;
}
.site-footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer-links a { font-size: 11.5px; color: rgba(243, 240, 230, .75); }
.site-footer-links a:hover { color: var(--cream); }

/* ---------- responsive nav (shared header) ---------- */

@media (max-width: 760px) {
  .container { padding: 0 18px; }
  .site-header-inner { padding: 16px 18px; }
  .admin-site-header .site-header-inner {
    min-height: 0;
    padding: 14px 16px;
    flex-wrap: wrap;
  }
  .admin-site-header .brand-block {
    flex: 1 1 auto;
  }
  .brand-logo {
    height: 54px;
    max-width: 180px;
  }
  .admin-site-header .brand-logo {
    height: 44px;
    max-width: 170px;
  }
  .menu-toggle { display: inline-flex; }
  .site-nav { display: none; align-items: stretch; flex-direction: column; width: 100%; margin-top: 14px; gap: 8px; }
  .site-nav.open { display: flex; }
  .site-nav .btn, .site-nav .tools-menu { width: 100%; }
  .site-session { width: 100%; }
  .admin-site-header .site-nav {
    margin-left: 0;
    flex-wrap: wrap;
  }
  .admin-site-header .btn {
    min-height: 42px;
    font-size: 13px;
  }
  .admin-site-header .site-session {
    max-width: none;
  }
  .tools-menu-panel { position: static; margin-top: 8px; width: 100%; min-width: 0; }
  .tools-menu-grid { grid-template-columns: 1fr; }
  .modules-grid { grid-template-columns: 1fr; }
  .panel { padding: 20px; }
  .site-footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 900px) {
  .modules-grid { grid-template-columns: repeat(2, 1fr); }
}
