:root {
  --bg: #f4f6f8;
  --bg-2: #e8ece9;
  --surface: #eef1f0;
  --card: #ffffff;
  --panel: #ffffff;
  --stripe-a: #f1f3f5;
  --stripe-b: #e8ece9;
  --input-bg: #ffffff;
  --accent: #1B3626;
  --accent-light: #217A43;
  --accent-gold: #D6A84B;
  --text: #203029;
  --muted: #6E756F;
  --border: #D9DDD8;
  --sidebar-w: 250px;
  --topbar-h: 56px;
  --sidebar-bg: #0f1720;
  --transition: 0.2s ease;
  --radius: 8px;
  --portal-font: "Segoe UI", "Aptos", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
html:has(body.portal-cliente),
body.portal-cliente { background: #F3F1EC; }
html:has(body.login-host),
body.login-host { background: #1B3626; }

/* ── SIDEBAR (staff) ──────────────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #0f1720 0%, #1a2733 100%);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width var(--transition), transform var(--transition);
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,.08);
}
.sidebar.collapsed { width: 0; }
.sidebar-header {
  padding: 1rem .85rem;
  display: flex;
  align-items: center;
  gap: .65rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  min-height: 72px;
}
.sidebar-logo-eco {
  height: 36px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
  flex-shrink: 0;
  background: transparent;
  padding: 0;
}
.sidebar-icon-wrap {
  width: 34px; height: 34px;
  border-radius: 8px;
  flex-shrink: 0;
  object-fit: contain;
  background: #fff;
  padding: 3px;
}
.sidebar-logo {
  height: 28px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  flex-shrink: 0;
}
.sidebar-title-main {
  display: block;
  color: #f8fafc;
  font-weight: 700;
  font-size: .85rem;
  white-space: nowrap;
}
.sidebar-title-sub {
  display: block;
  color: #94a3b8;
  font-size: .65rem;
  white-space: nowrap;
}
.sidebar-user {
  padding: .75rem .85rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .82rem;
  flex-shrink: 0;
}
.sidebar-user-meta { min-width: 0; }
.user-name {
  display: block;
  color: #f1f5f9;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}
.badge-role {
  display: inline-block;
  margin-top: 2px;
  font-size: .62rem;
  text-transform: uppercase;
  color: #cbd5e1;
  background: rgba(255,255,255,.08);
  padding: 1px 6px;
  border-radius: 8px;
}
.sidebar-nav { list-style: none; flex: 1; overflow-y: auto; padding: .3rem 0; margin: 0; }
.nav-section {
  padding: .55rem .85rem .2rem;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(226,232,240,.65);
}
.sidebar-nav li a {
  display: flex; align-items: center; gap: .6rem;
  padding: .48rem .85rem;
  color: #cbd5e1;
  text-decoration: none;
  font-size: .84rem;
  white-space: nowrap;
}
.sidebar-nav li a i { width: 18px; text-align: center; }
.sidebar-nav li a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav li a.active { background: rgba(255,255,255,.12); color: #fff; border-right: 3px solid var(--accent-light); }
.sidebar-footer { padding: .55rem .65rem; border-top: 1px solid rgba(255,255,255,.08); }
.btn-logout {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem .6rem; border-radius: var(--radius);
  background: rgba(239,68,68,.12); color: #fca5a5; text-decoration: none; font-size: .78rem;
}
.btn-logout:hover { background: rgba(239,68,68,.22); }

/* ── MAIN / TOPBAR (staff) ────────────────────────────────────── */
.main-wrapper { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left var(--transition); }
.main-wrapper.expanded, .main-wrapper.no-sidebar { margin-left: 0; }
.topbar {
  height: var(--topbar-h); background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem; padding: 0 1.25rem;
  position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 4px rgba(15,23,32,.04);
}
.sidebar-toggle { border: 1px solid var(--border); background: #fff; border-radius: 6px; width: 36px; height: 36px; cursor: pointer; color: var(--text); }
.sidebar-toggle:hover { background: #f1f3f5; }
.page-title { margin: 0; font-size: 1.1rem; color: var(--accent); flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.main-content { padding: 1.25rem 1.5rem 2rem; max-width: 1400px; width: 100%; margin: 0 auto; }

h1 { margin-top: 0; color: var(--accent); }
h2 { margin: 0 0 .75rem; font-size: 1rem; color: var(--text); }
.muted { color: var(--muted); font-size: 13px; }

.flash-stack { margin-bottom: 12px; }
.flash { padding: 8px 12px; border-radius: 6px; margin-bottom: 6px; font-size: 14px; overflow-wrap: anywhere; max-height: 8rem; overflow: auto; }
.flash-danger { background: #fde2e1; color: #8a1c1c; }
.flash-warning { background: #fff3cd; color: #7a5b00; }
.flash-info { background: #e2eefc; color: #124a8a; }
.flash-success { background: #e1f6e6; color: #14602b; }

.banner { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 13px; }
.banner-info { background: #e2eefc; color: #124a8a; }
.banner-warning { background: #fff3cd; color: #7a5b00; }

.btn, button, .btn-primary, .btn-secondary-bar {
  border: 1px solid var(--border); background: #fff; border-radius: 6px;
  padding: 7px 12px; cursor: pointer; font-size: 13px;
}
.btn-primary {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--accent); color: #fff; border-color: var(--accent);
  text-decoration: none; font-weight: 600;
}
.btn-primary:hover { background: var(--accent-light); }
.btn-secondary-bar:hover { background: #f1f3f5; }
.inline-form { display: inline; }

/* ── DASHBOARD ─────────────────────────────────────────────────── */
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 1rem; }
.dash-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 1.25rem; }
.stat-card {
  background: var(--panel); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: inherit; display: block;
  transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover { box-shadow: 0 4px 14px rgba(15,23,32,.08); transform: translateY(-1px); }
.stat-label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { display: block; font-size: 1.55rem; font-weight: 700; color: var(--text); }
.panel-hint { margin-top: 1.25rem; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; font-size: 13px; }
.panel-hint ul { margin: 0; padding-left: 1.2rem; }
.panel-hint li { margin-bottom: .35rem; }

/* ── FILTROS / GRILLA (admin) ─────────────────────────────────── */
.filtros-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; background: var(--panel); padding: 12px; border-radius: 8px; border: 1px solid var(--border); }
.filtros-bar input, .filtros-bar select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; }
.table-wrap, .table-scroll { overflow: auto; background: var(--panel); border-radius: 8px; border: 1px solid var(--border); max-height: min(62vh, 640px); scrollbar-gutter: stable; }
.table-scroll-sm { max-height: min(40vh, 360px); }
table.grid { width: max-content; min-width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.grid th, table.grid td { padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: left; }
table.grid thead th { background: #f1f3f5; position: sticky; top: 0; z-index: 2; color: var(--text); }
table.grid.grid-zebra tbody tr:nth-child(even) { background: #f7f9fb; }
table.grid tbody tr:hover { background: #eef5fc; }
.card-pedido { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; margin-bottom: 12px; }
.card-pedido h3 { margin: 0 0 6px; color: var(--accent); }

/* ── LOGIN (corporativo; listo para foto de fondo) ─────────────── */
.login-wrap {
  display: flex; justify-content: center; align-items: center; min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(24,57,43,.88) 0%, rgba(32,48,41,.72) 45%, rgba(24,57,43,.55) 100%),
    url("../assets/login-bg.jpg") center/cover no-repeat,
    #18392B;
}
.login-card {
  background: rgba(255,255,255,.96); padding: 36px 32px; border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,.28); width: min(400px, 92vw);
  display: flex; flex-direction: column; gap: 10px; backdrop-filter: blur(4px);
}
.login-card .login-logo {
  height: auto;
  width: 100%;
  max-width: 280px;
  object-fit: contain;
  align-self: flex-start;
  margin-bottom: 8px;
  background: #000;
  border-radius: 6px;
  padding: 10px 12px;
}
.login-card h1 { font-size: 22px; margin: 0; color: #1B3626; }
.login-card label { font-size: 12px; color: #6E756F; text-transform: uppercase; letter-spacing: .04em; }
.login-card input { padding: 10px 12px; border: 1px solid #D9DDD8; border-radius: 8px; font-size: 14px; }
.login-card button {
  margin-top: 10px; background: #18392B; color: #fff; border: none;
  padding: 12px; border-radius: 8px; cursor: pointer; font-weight: 700; letter-spacing: .02em;
}
.login-card button:hover { background: #217A43; }

.error-page { text-align: center; padding: 60px 0; }
.error-page h1 { font-size: 64px; margin: 0; }

/* ── TOAST / MODAL ─────────────────────────────────────────────── */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #1e293b; color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 13px; min-width: 220px; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.toast.toast-success { background: #14602b; }
.toast.toast-danger, .toast.toast-error { background: #8a1c1c; }
.toast.toast-warning { background: #7a5b00; }
.toast.toast-info { background: #124a8a; }
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,32,.45); display: flex; align-items: center; justify-content: center; z-index: 10000; }
.modal-dialog { background: #fff; border-radius: 10px; width: min(420px, 92vw); box-shadow: 0 12px 40px rgba(0,0,0,.2); }
.modal-dialog-header { display: flex; align-items: center; gap: .5rem; padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 600; }
.modal-dialog-body { padding: 16px; font-size: 14px; }
.modal-dialog-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }

.activar-acceso { display: inline-block; position: relative; }
.activar-acceso[open] .activar-form {
  display: flex; flex-direction: column; gap: 6px; position: absolute; right: 0; top: 110%;
  z-index: 20; background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px; min-width: 220px; box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.activar-form { display: none; }
.activar-form input { padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; }

@media (max-width: 900px) {
  .main-wrapper { margin-left: 0; }
  .sidebar { transform: translateX(-100%); width: var(--sidebar-w); }
  .sidebar.open { transform: translateX(0); }
}

/* ── PORTAL CLIENTE (maqueta: verde #1B3626 / fondo #F3F1EC) ─ */
body.portal-cliente {
  background: #F3F1EC;
  font-family: var(--portal-font);
}
body.portal-cliente .main-wrapper { margin-left: 0; min-height: 100vh; background: #F3F1EC; }
body.portal-cliente .main-content { padding: 0; max-width: none; margin: 0; background: #F3F1EC; }
.portal-shell {
  font-family: var(--portal-font);
  color: #1a2420;
  background: #F3F1EC;
  min-height: calc(100vh - 56px);
  margin: 0;
  padding: 0 0 2.5rem;
}

.portal-topbar {
  height: 56px;
  background: #1B3626;
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 rgba(0,0,0,.12);
}
.portal-topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.portal-logo-eco {
  height: 42px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  display: block;
  background: transparent;
  padding: 0;
}
.portal-brand-mark {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: .08em;
  color: #fff;
  text-transform: uppercase;
  line-height: 1;
}
.portal-brand-divider {
  width: 1px;
  height: 18px;
  background: rgba(255,255,255,.35);
  flex-shrink: 0;
}
.portal-brand-name {
  font-weight: 400;
  font-size: 0.95rem;
  color: rgba(255,255,255,.92);
  letter-spacing: .01em;
  white-space: nowrap;
}
.portal-topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: rgba(255,255,255,.85);
  min-width: 0;
}
.portal-host-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: rgba(193,154,78,.95);
  color: #1B3626;
  white-space: nowrap;
}
.portal-host-badge-live {
  background: rgba(255,255,255,.14);
  color: #fff;
  font-weight: 600;
  text-transform: none;
  letter-spacing: .02em;
}
.portal-user-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-logout { color: rgba(255,255,255,.85); text-decoration: none; font-size: 15px; }
.portal-logout:hover { color: #fff; }
.portal-back-admin {
  color: rgba(255,255,255,.9);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 6px;
  white-space: nowrap;
}
.portal-back-admin:hover { background: rgba(255,255,255,.1); }

.portal-preview-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 1.75rem;
  background: #E8F0EA;
  border-bottom: 1px solid #C5D6C9;
  color: #1B3626;
  font-size: 13px;
  line-height: 1.4;
}
.portal-preview-banner i { color: #1B3626; opacity: .75; }
.portal-preview-banner span { flex: 1; min-width: 220px; }
.portal-preview-banner a {
  color: #1B3626;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.portal-page { max-width: 1120px; margin: 0 auto; padding: 1.75rem 1.5rem 2.5rem; }
.portal-title { font-size: 1.85rem; margin: 0 0 8px; color: #14201a; font-weight: 700; letter-spacing: -.01em; }
.portal-subtitle { color: #5c6560; margin: 0 0 1.35rem; font-size: 14.5px; line-height: 1.45; max-width: 42rem; }
.portal-kicker { color: #5c6560; margin: .2rem 0 0; font-size: 14px; }
.portal-breadcrumb {
  font-size: 13px;
  color: #7a827c;
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.portal-breadcrumb a {
  color: #7a827c;
  text-decoration: none;
}
.portal-breadcrumb a:hover {
  color: #1B3626;
  text-decoration: underline;
}
.portal-breadcrumb span:last-child { color: #3d4a43; }

.portal-toolbar {
  display: grid;
  grid-template-columns: minmax(200px, 240px) 1fr auto;
  gap: 20px;
  align-items: end;
  margin: 0 0 1.5rem;
}
.customer-card {
  background: #fff;
  border: 1px solid #E0E4DF;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 74px;
  box-shadow: 0 1px 2px rgba(27,54,38,.04);
}
.customer-card select {
  border: 0; background: transparent; font-size: 14px; font-weight: 700; color: #14201a; padding: 0;
  width: 100%; cursor: pointer;
}
.customer-card select:focus { outline: none; }
.portal-label {
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #7a827c;
  font-weight: 700;
}
.portal-customer-name { font-size: 14px; font-weight: 700; color: #14201a; }
.portal-customer-country { color: #5c6560; font-size: 12.5px; }
.filter-block { display: flex; flex-direction: column; gap: 8px; }
.search-block { justify-self: end; }
.segmented { display: inline-flex; gap: 8px; }
.segmented a {
  padding: 8px 18px;
  font-size: 13px;
  color: #5c6560;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 600;
  background: #fff;
  border: 1px solid #E0E4DF;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.segmented a:hover { border-color: #1B3626; color: #1B3626; }
.segmented a.active {
  background: #1B3626;
  color: #fff;
  border-color: #1B3626;
}
.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-input-wrap > i {
  position: absolute;
  left: 12px;
  color: #9aa19c;
  font-size: 12px;
  pointer-events: none;
}
.search-form input {
  padding: 9px 14px 9px 34px;
  border: 1px solid #E0E4DF;
  border-radius: 10px;
  font-size: 13px;
  width: 240px;
  color: #14201a;
  background: #fff;
}
.search-form input::placeholder { color: #9aa19c; }
.search-form input:focus {
  color: #14201a;
  outline: none;
  border-color: #1B3626;
  box-shadow: 0 0 0 2px rgba(27,54,38,.12);
}

.po-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.portal-section-title {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #7a827c;
  font-weight: 700;
}
.portal-empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: #5c6560;
  background: #fff;
  border: 1px solid #E0E4DF;
  border-radius: 12px;
}

.po-list { display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.po-list-head {
  display: grid;
  grid-template-columns: 110px minmax(160px, 1.4fr) minmax(160px, 1.3fr) minmax(140px, 1.1fr) 100px 28px;
  gap: 8px;
  align-items: center;
  padding: 11px 18px;
  background: #DCE6E1;
  border-radius: 10px;
  color: #3d4a43;
  font-size: 12.5px;
  font-weight: 600;
}
.po-row {
  display: grid;
  grid-template-columns: 110px minmax(160px, 1.4fr) minmax(160px, 1.3fr) minmax(140px, 1.1fr) 100px 28px;
  gap: 8px;
  align-items: center;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid #E0E4DF;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgba(27,54,38,.03);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.po-row:hover {
  border-color: #b8c8be;
  background: #FBFCFB;
  box-shadow: 0 2px 8px rgba(27,54,38,.06);
}
.po-cell, .po-link {
  font-weight: 700;
  color: #1B3626;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.po-summary { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.po-summary-main { color: #14201a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.po-shipping, .po-dates { color: #3d4a43; }
.cell-sub { color: #5c6560; font-size: 12.5px; margin-top: 2px; }
.chevron {
  color: #A1A6A2;
  text-align: right;
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.badge-status {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}
.badge-open { background: #E5F0E8; color: #1B3626; }
.badge-closed { background: #E8E8E8; color: #555; }
.badge-cancelled { background: #fde2e1; color: #8a1c1c; }

/* tabla legacy (detalle / otras vistas) */
.po-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.po-table th {
  text-align: left; padding: 12px 14px; color: #3d4a43; font-size: 12.5px;
  background: #DCE6E1; font-weight: 600;
}
.po-table td { padding: 16px 14px; background: #fff; border-bottom: 10px solid #F3F1EC; vertical-align: middle; }
.po-table tbody tr { cursor: pointer; }
.po-table tbody tr:hover td { background: #FBFCFB; }

.portal-order-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  margin: 0 0 1.15rem;
}
.portal-order-header .portal-title {
  font-size: 1.7rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.portal-order-header .badge-status { font-size: 11px; vertical-align: middle; }
.portal-kicker { margin-top: 6px; }
.portal-stats {
  display: flex;
  gap: 36px;
  text-align: right;
  padding-top: 4px;
}
.stat-plain .stat-label {
  display: block;
  font-size: 10px;
  color: #7a827c;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 700;
}
.stat-plain .stat-value {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: #14201a;
  margin-top: 6px;
}
.stat-label {
  font-size: 10px;
  color: #7a827c;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 700;
}
.stat-value { font-size: 1.05rem; font-weight: 700; color: #14201a; }

.portal-tabs {
  display: flex;
  gap: 28px;
  border-bottom: 1px solid #D9DDD8;
  margin: 0 0 1.35rem;
}
.portal-tabs a {
  padding: 10px 0 12px;
  font-size: 14.5px;
  text-decoration: none;
  color: #7a827c;
  border-bottom: 3px solid transparent;
  font-weight: 500;
  margin-bottom: -1px;
}
.portal-tabs a:hover { color: #1B3626; }
.portal-tabs a.active {
  color: #1B3626;
  border-bottom-color: #1B3626;
  font-weight: 700;
}

.products-panel { max-width: 920px; }
.tab-title {
  margin: 0 0 6px;
  font-size: 1.25rem;
  color: #14201a;
  font-weight: 700;
}
.tab-lead {
  margin: 0 0 1.25rem;
  color: #5c6560;
  font-size: 14px;
  line-height: 1.45;
}

.prod-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
.prod-table th {
  text-align: left;
  padding: 10px 14px;
  color: #7a827c;
  font-size: 12.5px;
  font-weight: 600;
  border-bottom: 1px solid #D9DDD8;
  background: transparent;
}
.prod-table td {
  padding: 16px 14px;
  border-bottom: 1px solid #E8EBE7;
  color: #3d4a43;
  vertical-align: middle;
}
.prod-table tbody tr:nth-child(odd) { background: #F7F6F2; }
.prod-table tbody tr:nth-child(even) { background: #fff; }
.prod-name { font-weight: 700; color: #14201a; }
.prod-sku { color: #7a827c; font-size: 13.5px; }
.prod-format { color: #3d4a43; }
.prod-table .col-cases { text-align: right; font-variant-numeric: tabular-nums; width: 90px; }
.prod-table th.col-cases { text-align: right; }

.cert-panel { max-width: 860px; }
.cert-block {
  margin-bottom: 6px;
  border-bottom: 1px solid #E8EBE7;
}
.cert-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 4px 8px 0;
  cursor: pointer;
  list-style: none;
}
.cert-head::-webkit-details-marker { display: none; }
.cert-head::before {
  content: "▸";
  flex: 0 0 14px;
  color: #7a827c;
  font-size: 11px;
  line-height: 1;
}
.cert-block[open] > .cert-head::before { content: "▾"; }
.cert-head-main { min-width: 0; flex: 1; }
.cert-head-name {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: #14201a;
  line-height: 1.3;
}
.cert-head-meta {
  display: block;
  margin-top: 1px;
  font-size: 11.5px;
  color: #7a827c;
}
.cert-head-count {
  flex-shrink: 0;
  font-size: 11px;
  color: #8a918b;
  white-space: nowrap;
}
.cert-empty {
  margin: 0;
  padding: 10px 2px;
  color: #5c6560;
  font-size: 13px;
}
.cert-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin: 0 0 8px 18px;
  max-width: calc(100% - 18px);
}
.cert-table th {
  text-align: left;
  padding: 7px 8px;
  color: #7a827c;
  font-size: 11px;
  font-weight: 600;
  border-bottom: 1px solid #E8EBE7;
}
.cert-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #F0F1EE;
  color: #3d4a43;
  vertical-align: middle;
  line-height: 1.35;
}
.cert-table tbody tr:last-child td { border-bottom: none; }
.cert-type-cell {
  color: #5c6560;
  font-size: 11.5px;
  white-space: nowrap;
  width: 92px;
}
.cert-sku {
  color: #8a918b;
  font-size: 11.5px;
  white-space: nowrap;
}
.cert-table th.col-cert,
.cert-table td.col-cert { text-align: right; width: 88px; }
.cert-pending {
  color: #9aa19b;
  font-size: 11.5px;
  font-weight: 500;
}
.cert-dl {
  color: #1B3626;
  font-weight: 650;
  font-size: 12px;
  text-decoration: none;
}
.cert-dl:hover { color: #217A43; }
.cert-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
  margin-bottom: 1rem;
}
.cert-panel-head .tab-title { margin-bottom: 0.25rem; }
.cert-panel-head .tab-lead { margin: 0; }
.btn-cert-all {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  border-radius: 8px;
  background: #18392B;
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 650;
  font-size: 0.9rem;
  white-space: nowrap;
}
.btn-cert-all:hover { filter: brightness(1.08); color: #fff !important; }
.cert-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}
.cert-dl-all {
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.total-bar {
  margin-top: 14px;
  background: #DCE6E1;
  border-radius: 10px;
  padding: 14px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #14201a;
}
.total-bar-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #3d4a43;
}
.total-bar-value { font-size: 15px; font-weight: 700; color: #14201a; }
.total-chip {
  margin: 18px auto 0;
  width: fit-content;
  background: #DCE6E1;
  border-radius: 8px;
  padding: 12px 28px;
  display: flex;
  gap: 18px;
  align-items: center;
  color: #14201a;
}

.info-panel { max-width: 820px; }
.info-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 64px;
  max-width: 820px;
  margin-top: .25rem;
}
.info-col { min-width: 0; }
.info-row {
  padding: 14px 0 16px;
  border-bottom: 1px solid #D9DDD8;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.info-label {
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #7a827c;
  font-weight: 700;
}
.info-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #14201a;
  line-height: 1.3;
}
.shipping-panel { max-width: 980px; }
.ship-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 1.35rem;
}
.ship-row {
  display: grid;
  gap: 12px 28px;
}
.ship-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ship-row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ship-field {
  padding: 12px 0 14px;
  border-bottom: 1px solid #D9DDD8;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.route-card {
  background: #fff;
  border: 1px solid #E0E4DF;
  border-radius: 12px;
  padding: 28px 32px;
  margin: 1.1rem 0 0;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(180px, 1.6fr) minmax(120px, 1fr);
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 2px rgba(27,54,38,.04);
}
.port-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.port-box-right { text-align: right; align-items: flex-end; }
.port-name {
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #14201a;
}
.port-country {
  font-size: 13.5px;
  color: #5c6560;
}
.route-mid {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  min-width: 0;
}
.route-mid .vessel-name {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: #14201a;
  text-transform: uppercase;
  letter-spacing: .03em;
  background: transparent;
  margin: 0;
  padding: 0;
}
.route-line {
  width: 100%;
  height: 2px;
  background: #C19A4E;
  position: relative;
  border-radius: 1px;
}
.route-line::after {
  content: '';
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left: 8px solid #C19A4E;
}
.voyage-label {
  font-size: 13px;
  color: #5c6560;
  min-height: 1.2em;
}

.dates-panel { max-width: 980px; }
.timeline {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  top: 34px;
  height: 2px;
  background: #D9DDD8;
  z-index: 0;
}
.timeline li {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}
.tl-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #C5CBC6;
  flex-shrink: 0;
  box-sizing: border-box;
}
.timeline li.done .tl-dot {
  background: #1B3626;
  border-color: #1B3626;
}
.timeline li.next .tl-dot {
  background: #C19A4E;
  border-color: #C19A4E;
}
.tl-label {
  font-weight: 700;
  font-size: 13.5px;
  color: #14201a;
  min-height: 1.2em;
}
.tl-date {
  font-size: 14px;
  font-weight: 700;
  color: #14201a;
  margin-top: 2px;
}
.tl-status {
  font-size: 13px;
  color: #7a827c;
}
.timeline li.next .tl-date { color: #C19A4E; }
.timeline li.next .tl-status { color: #5c6560; }
.timeline li.pending .tl-date { color: #14201a; }
.timeline li.done .tl-status { color: #5c6560; }

@media (max-width: 900px) {
  .portal-toolbar, .info-two-col { grid-template-columns: 1fr; }
  .ship-row-3, .ship-row-4 { grid-template-columns: 1fr 1fr; }
  .search-block { justify-self: stretch; }
  .search-form input { width: 100%; }
  .portal-stats { text-align: left; gap: 20px; width: 100%; }
  .po-list-head { display: none; }
  .po-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "po chev"
      "sum sum"
      "ship ship"
      "dates dates"
      "status status";
    gap: 6px 10px;
  }
  .po-cell { grid-area: po; }
  .po-summary { grid-area: sum; }
  .po-shipping { grid-area: ship; }
  .po-dates { grid-area: dates; }
  .po-row > span:nth-child(5) { grid-area: status; }
  .chevron { grid-area: chev; }
  .prod-table { font-size: 13px; }
  .prod-table th, .prod-table td { padding: 12px 8px; }
  .timeline { grid-template-columns: 1fr; }
  .timeline::before { display: none; }
  .route-card {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 18px;
  }
  .port-box-right { align-items: center; text-align: center; }
  .route-mid { order: 0; }
}

/* ── PANEL ADMIN (sidebar ecosistema + contenido estilo portal) ─── */
body.panel-staff {
  font-family: var(--portal-font);
}
.sync-banner {
  display: none;
  align-items: center;
  gap: 12px;
  margin: 10px 1.5rem 0;
  padding: 8px 12px;
  background: rgba(27,54,38,.92);
  color: #fff;
  border-radius: 10px;
  font-size: 13px;
}
.sync-banner.visible { display: flex; }
.sync-banner-bar {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,.18);
  border-radius: 99px;
  overflow: hidden;
  min-width: 120px;
}
.sync-banner-bar > span {
  display: block;
  height: 100%;
  width: 0%;
  background: #D6A84B;
  transition: width .35s ease;
}
.sync-banner-pct { font-weight: 700; min-width: 3.2rem; text-align: right; }
.sync-banner-fase { opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.sync-banner.ok { background: rgba(20,96,43,.92); }
.sync-banner.ok .sync-banner-bar > span { background: #b7e4c0; }
.sync-banner.err { background: rgba(138,28,28,.92); }
.btn-sync.busy { opacity: .65; pointer-events: none; }
body.panel-admin {
  background: #F3F1EC;
  font-family: var(--portal-font);
}
body.panel-admin .main-wrapper { margin-left: 0; min-height: 100vh; background: #F3F1EC; }
body.panel-admin .main-content,
body.panel-admin .admin-main {
  padding: 0;
  max-width: none;
  margin: 0;
  background: #F3F1EC;
}

.admin-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2.5rem;
}
.admin-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.admin-title {
  font-size: 1.7rem;
  margin: 0 0 6px;
  color: #14201a;
  font-weight: 700;
}
.admin-subtitle {
  margin: 0;
  color: #5c6560;
  font-size: 14px;
  max-width: 44rem;
  line-height: 1.45;
}
.admin-crumb {
  margin: 0 0 6px;
  font-size: 13px;
  color: #7a827c;
}
.admin-crumb a { color: #7a827c; text-decoration: none; }
.admin-crumb a:hover { color: #1B3626; text-decoration: underline; }
.admin-page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 1.25rem;
}
.admin-stat {
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(224,228,223,.95);
  border-radius: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  display: block;
  box-shadow: 0 8px 20px rgba(27,54,38,.06);
  backdrop-filter: blur(6px);
}
.admin-stat:hover { border-color: #b8c8be; }
.admin-stat-value {
  display: block;
  font-size: 1.55rem;
  font-weight: 700;
  color: #14201a;
  margin-top: 8px;
}
.admin-stat-sm { font-size: 1.05rem !important; }

.admin-card {
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(224,228,223,.95);
  border-radius: 12px;
  padding: 18px 20px 20px;
  margin-bottom: 1.15rem;
  box-shadow: 0 8px 24px rgba(27,54,38,.06);
  backdrop-filter: blur(6px);
}
.admin-card-title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  color: #14201a;
  font-weight: 700;
}
.admin-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.admin-card-head .admin-card-title { margin: 0; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.admin-table th {
  text-align: left;
  padding: 10px 12px;
  background: #DCE6E1;
  color: #3d4a43;
  font-size: 12px;
  font-weight: 600;
}
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid #E8EBE7;
  vertical-align: middle;
  color: #14201a;
}
.admin-table tbody tr:hover td { background: #FBFCFB; }
.admin-table code {
  font-size: 12.5px;
  background: #F3F1EC;
  padding: 2px 6px;
  border-radius: 4px;
}

.admin-filters, .admin-search, .admin-form-row, .admin-form-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: end;
}
.admin-search-wide { width: 100%; }
.admin-search input, .admin-filters input, .admin-filters select,
.admin-form-row input, .admin-form-grid input, .admin-form-grid select,
.inline-form input, .inline-form select, .activar-form input {
  padding: 8px 12px;
  border: 1px solid #E0E4DF;
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  color: #14201a;
}
.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}
.admin-form-grid label { display: flex; flex-direction: column; gap: 6px; }
.admin-form-actions { display: flex; align-items: end; }
.admin-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  white-space: nowrap;
}
.inline-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.input-sm { width: 120px !important; }
.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: #5c6560;
  white-space: nowrap;
}
body.panel-admin .btn-primary {
  background: #1B3626;
  border-color: #1B3626;
  color: #fff;
}
body.panel-admin .btn-primary:hover { background: #254a34; }
body.panel-admin .btn {
  background: #fff;
  border: 1px solid #E0E4DF;
  border-radius: 8px;
  color: #1B3626;
  text-decoration: none;
  font-weight: 600;
}
body.panel-admin .btn:hover { border-color: #1B3626; }

.activar-acceso { position: relative; display: inline-block; }
.activar-acceso summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.activar-acceso summary::-webkit-details-marker { display: none; }
.activar-form {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  background: #fff;
  border: 1px solid #E0E4DF;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(27,54,38,.12);
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: #1B3626;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 2rem 1.75rem;
  color: #fff;
}
.login-logo {
  display: block;
  height: 52px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  margin: 0 auto 1.25rem;
  background: transparent;
}
.login-card h1 {
  margin: 0 0 .4rem;
  font-size: 1.35rem;
  font-weight: 600;
  text-align: center;
  color: #fff;
}
.login-card .muted {
  color: rgba(255,255,255,.72);
  font-size: 13.5px;
  text-align: center;
  margin: 0 0 1.25rem;
}
.login-card label {
  display: block;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(255,255,255,.7);
  margin: .65rem 0 .3rem;
}
.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(0,0,0,.22);
  color: #fff;
  font-size: 15px;
}
.login-card button {
  width: 100%;
  margin-top: 1.15rem;
  padding: 11px 14px;
  border: 0;
  border-radius: 8px;
  background: #D6A84B;
  color: #1B3626;
  font-weight: 700;
  cursor: pointer;
}
.login-card button:hover { filter: brightness(1.05); }
.login-staff-link {
  display: block;
  margin-top: 1rem;
  text-align: center;
  color: rgba(255,255,255,.55);
  font-size: 12px;
  text-decoration: none;
}
.login-staff-link:hover { color: #fff; }
body.login-host .flash-stack { max-width: 400px; margin: 0 auto 1rem; }

.login-lang,
.portal-lang {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
}
.login-lang {
  justify-content: flex-end;
  margin: 0 0 1rem;
}
.login-lang a,
.portal-lang a {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,.28);
  color: rgba(255,255,255,.75);
}
.login-lang a.active,
.portal-lang a.active {
  background: #fff;
  color: #18392B;
  border-color: #fff;
}
body.portal-cliente .portal-lang a {
  border-color: rgba(27,54,38,.2);
  color: #6E756F;
}
body.portal-cliente .portal-lang a.active {
  background: #18392B;
  color: #fff;
  border-color: #18392B;
}
.admin-check {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  font-size: 0.92rem;
  color: var(--text);
}

.audit-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #5c6560;
}
.audit-table-wrap { max-height: min(70vh, 720px); }
.audit-fecha { white-space: nowrap; font-variant-numeric: tabular-nums; }
.audit-ip {
  font-family: Consolas, "Segoe UI Mono", monospace;
  font-size: 12px;
  white-space: nowrap;
}
.audit-accion {
  display: inline-block;
  background: #E8F0EB;
  color: #1B3626;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.audit-detalle {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audit-motivo {
  display: inline-block;
  margin-left: 6px;
  color: #7a5b00;
  font-size: 11px;
}
.audit-ok { color: #14602b; font-weight: 700; }
.audit-fail { color: #8a1c1c; font-weight: 700; }
.audit-more {
  min-width: 28px;
  padding: 2px 8px;
  font-weight: 700;
}
.audit-extra td {
  background: #eef4f0;
  font-size: 12px;
}
.audit-ctx {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 4px 12px;
  margin: 0;
}
.audit-ctx dt { color: #5c6560; font-weight: 600; }
.audit-ctx dd { margin: 0; word-break: break-word; }
.audit-pager {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

@media (max-width: 900px) {
  .admin-nav { top: 56px; }
  .admin-nav-preview { margin-left: 0 !important; width: 100%; }
  .admin-page { padding: 1.1rem 1rem 2rem; }
}

/* ── CAPAS PANEL STAFF (Emiliana). No aplica a portal-cliente ni login-host. ── */
html:has(body.panel-staff) {
  min-height: 100%;
  background: #b7c9bb;
}
body.panel-staff {
  --bg: #b7c9bb;
  --bg-2: #a8bdb0;
  --surface: #c5d4c8;
  --card: #e2ebe5;
  --panel: #e2ebe5;
  --stripe-a: #d6e3db;
  --stripe-b: #c8d6cc;
  --input-bg: #eaf1ec;
  --border: #b3c4b8;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 0% 0%, rgba(27,54,38,.22), transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 10%, rgba(214,168,75,.18), transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(33,122,67,.16), transparent 50%),
    linear-gradient(180deg, #c5d4c8 0%, #b7c9bb 48%, #aebfaf 100%);
  background-attachment: fixed;
}
body.panel-staff .main-wrapper,
body.panel-staff .main-content,
body.panel-staff .main-content.admin-main {
  background: transparent;
  color: var(--text);
}
body.panel-staff .main-content.admin-main {
  max-width: none;
  padding: 0;
}
body.panel-staff .topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(27,54,38,.08);
  backdrop-filter: none;
}
body.panel-staff .sidebar-toggle {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}
body.panel-staff .sidebar-toggle:hover { background: var(--stripe-a); }
body.panel-staff .page-title { color: var(--accent); }

body.panel-staff .stat-card,
body.panel-staff .panel-hint,
body.panel-staff .filtros-bar,
body.panel-staff .table-wrap,
body.panel-staff .table-scroll,
body.panel-staff .card-pedido,
body.panel-staff .admin-stat,
body.panel-staff .admin-card,
body.panel-staff .container,
body.panel-staff .card {
  background: var(--card);
  border-color: var(--border);
  box-shadow: 0 6px 18px rgba(27,54,38,.08);
  backdrop-filter: none;
}
body.panel-staff .admin-stat:hover,
body.panel-staff .stat-card:hover { border-color: #8eaa96; }

body.panel-staff table.grid thead th,
body.panel-staff .admin-table th {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
body.panel-staff table.grid tbody tr:nth-child(odd),
body.panel-staff .admin-table tbody tr:nth-child(odd) td {
  background: var(--stripe-a);
}
body.panel-staff table.grid tbody tr:nth-child(even),
body.panel-staff table.grid.grid-zebra tbody tr:nth-child(even),
body.panel-staff .admin-table tbody tr:nth-child(even) td {
  background: var(--stripe-b);
}
body.panel-staff table.grid tbody tr:hover,
body.panel-staff .admin-table tbody tr:hover td {
  background: #c5d9c8;
}
body.panel-staff .admin-table td { border-bottom-color: var(--border); color: var(--text); }
body.panel-staff .admin-table code { background: var(--surface); color: var(--text); }
body.panel-staff .audit-extra td { background: var(--surface); }
body.panel-staff .table { background: var(--card); color: var(--text); }

body.panel-staff input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="hidden"]),
body.panel-staff select,
body.panel-staff textarea,
body.panel-staff .form-control,
body.panel-staff .admin-search input,
body.panel-staff .admin-filters input,
body.panel-staff .admin-filters select,
body.panel-staff .admin-form-row input,
body.panel-staff .admin-form-grid input,
body.panel-staff .admin-form-grid select,
body.panel-staff .admin-form-grid textarea,
body.panel-staff .inline-form input,
body.panel-staff .inline-form select,
body.panel-staff .activar-form input,
body.panel-staff .filtros-bar input,
body.panel-staff .filtros-bar select {
  background: var(--input-bg);
  color: var(--text);
  border-color: var(--border);
}
body.panel-staff input::placeholder,
body.panel-staff textarea::placeholder { color: var(--muted); }

body.panel-staff .modal-overlay { background: rgba(27,54,38,.42); }
body.panel-staff .modal-dialog,
body.panel-staff .modal-content,
body.panel-staff .activar-form,
body.panel-staff .activar-acceso[open] .activar-form {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}
body.panel-staff .modal-dialog-header,
body.panel-staff .modal-dialog-footer {
  border-color: var(--border);
  color: var(--text);
}

body.panel-staff .login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(27,54,38,.22), transparent 55%),
    linear-gradient(180deg, #c5d4c8 0%, #b7c9bb 100%);
}
body.panel-staff .login-card {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(27,54,38,.14);
}
body.panel-staff .login-card h1 { color: var(--accent); }
body.panel-staff .login-card .muted,
body.panel-staff .login-card label { color: var(--muted); }
body.panel-staff .login-logo {
  background: var(--accent);
  border-radius: 6px;
  padding: 10px 12px;
}
body.panel-staff .login-card input[type="text"],
body.panel-staff .login-card input[type="password"] {
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
}
body.panel-staff .login-card button {
  background: var(--accent);
  color: #fff;
}
body.panel-staff .login-card button:hover { background: var(--accent-light); }

body.panel-staff {
  font-size: 13px;
}
body.panel-staff .admin-page {
  max-width: none;
  padding: 1rem 1.15rem 2rem;
}
body.panel-staff .admin-title { font-size: 1.28rem; }
body.panel-staff .admin-subtitle { font-size: 12.5px; line-height: 1.35; }
body.panel-staff .admin-crumb { font-size: 12px; }
body.panel-staff .admin-card { padding: 12px 14px 14px; }
body.panel-staff .admin-card-title { font-size: .92rem; margin-bottom: 8px; }
body.panel-staff .admin-stat { padding: 10px 12px; }
body.panel-staff .admin-stat-value { font-size: 1.25rem; margin-top: 4px; }
body.panel-staff .admin-stat-sm { font-size: .88rem !important; }
body.panel-staff .page-title { font-size: .98rem; }
body.panel-staff .portal-label { font-size: 9px; }
body.panel-staff .btn,
body.panel-staff button,
body.panel-staff .btn-primary,
body.panel-staff .btn-secondary-bar {
  font-size: 12px;
  padding: 5px 9px;
}
body.panel-staff .admin-search input,
body.panel-staff .admin-filters input,
body.panel-staff .admin-filters select,
body.panel-staff .admin-form-row input,
body.panel-staff .admin-form-grid input,
body.panel-staff .admin-form-grid select,
body.panel-staff .admin-form-grid textarea {
  font-size: 12px;
  padding: 6px 8px;
}
body.panel-staff .admin-filters input[type="date"] {
  width: 10.4rem;
  min-width: 10.4rem;
}

body.panel-staff .table-wrap,
body.panel-staff .table-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  max-height: none;
  scrollbar-gutter: auto;
}
body.panel-staff .audit-table-wrap {
  max-height: min(70vh, 720px);
  overflow: auto;
}
body.panel-staff .admin-table.table-clientes {
  width: 100%;
  table-layout: fixed;
}
body.panel-staff .table-clientes th:nth-child(1) { width: 7.2rem; }
body.panel-staff .table-clientes th:nth-child(2) { width: 18%; }
body.panel-staff .table-clientes th:nth-child(3) { width: 5.5rem; }
body.panel-staff .table-clientes th:nth-child(4),
body.panel-staff .table-clientes th:nth-child(5) { width: 4.8rem; }
body.panel-staff .table-clientes th:nth-child(6) { width: 7.2rem; }
body.panel-staff .table-clientes th:nth-child(7) { width: 8.5rem; }
body.panel-staff .table-clientes td {
  overflow: hidden;
  text-overflow: ellipsis;
}
body.panel-staff .table-clientes td.col-nombre {
  max-width: 0;
}
body.panel-staff .table-clientes td.admin-row-actions {
  overflow: visible;
}
body.panel-staff .admin-table th {
  position: relative;
}
body.panel-staff .col-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 4;
}
body.panel-staff .col-resizer:hover,
body.col-resizing .col-resizer {
  background: rgba(27, 54, 38, .28);
}
body.col-resizing { cursor: col-resize; user-select: none; }
body.panel-staff .admin-table {
  width: max-content;
  min-width: 100%;
  font-size: 12px;
}
body.panel-staff .admin-table th,
body.panel-staff .admin-table td {
  padding: 5px 8px;
  white-space: nowrap;
  line-height: 1.25;
  vertical-align: middle;
}
body.panel-staff .admin-table th { font-size: 11px; }
body.panel-staff .admin-table code { font-size: 11px; }
body.panel-staff .audit-fecha,
body.panel-staff .audit-ip {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
body.panel-staff .admin-row-actions,
body.panel-staff .inline-form {
  flex-wrap: nowrap;
}
body.panel-staff .login-card h1 { font-size: 1.15rem; }
body.panel-staff .login-card .muted { font-size: 12.5px; }
body.panel-staff .login-card input[type="text"],
body.panel-staff .login-card input[type="password"] { font-size: 13.5px; }

@media print {
  html:has(body.panel-staff),
  body.panel-staff,
  body.panel-staff .main-wrapper,
  body.panel-staff .main-content,
  body.panel-staff .topbar,
  body.panel-staff .admin-card,
  body.panel-staff .admin-stat,
  body.panel-staff .table-wrap,
  body.panel-staff .login-wrap,
  body.panel-staff .login-card {
    background: #fff !important;
    background-image: none !important;
    box-shadow: none !important;
    color: #000 !important;
  }
}

.clave-visible { font-size: 13px; letter-spacing: .02em; user-select: all; background: #f4f6f8; padding: 2px 6px; border-radius: 4px; }
