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

:root {
  --sidebar-w: 280px;
  --sidebar-w-collapsed: 72px;
  
  /* Maritime Professional Palette */
  --navy-deep: #0a1f3d;
  --navy-primary: #1e3a5f;
  --navy-medium: #2d5a8c;
  --ocean-blue: #3b82f6;
  --ocean-light: #60a5fa;
  --ocean-pale: #dbeafe;
  
  --steel: #64748b;
  --steel-light: #94a3b8;
  --steel-pale: #cbd5e1;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0f2942;
  
  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  background: var(--bg-main);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.sidebar-open {
  overflow: hidden;
}

img, svg, canvas {
  max-width: 100%;
}

button, input, select, textarea {
  font: inherit;
}

.app {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ========== SIDEBAR ========== */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--bg-sidebar) 0%, #0a1e36 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  transition: transform .28s ease, width .28s ease, box-shadow .28s ease;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 60;
  box-shadow: var(--shadow-xl);
  flex-shrink: 0;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(59, 130, 246, 0.3) 50%, 
    transparent 100%
  );
}

.sidebar.collapsed {
  width: var(--sidebar-w-collapsed);
}

.sidebar-top {
  height: 58px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.burger {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(59, 130, 246, 0.1);
  color: var(--ocean-light);
  font-size: 17px;
  cursor: pointer;
  border-radius: 8px;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 300;
}

.burger:hover {
  background: rgba(59, 130, 246, 0.2);
  transform: scale(1.05);
}

.brand {
  font-weight: 700;
  font-size: 15px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar.collapsed .brand {
  display: none;
}

.nav {
  padding: 16px 12px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 13px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  color: var(--steel-pale);
  margin-bottom: 4px;
  transition: var(--transition-smooth);
  position: relative;
  font-size: 13px;
  font-weight: 600;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--ocean-blue);
  border-radius: 0 3px 3px 0;
  transition: var(--transition-smooth);
}

.nav-item:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #ffffff;
  transform: translateX(4px);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.05) 100%);
  color: #ffffff;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

.nav-item.active::before {
  height: 60%;
}

.icon {
  width: 24px;
  height: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  flex-shrink: 0;
}

.label {
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.sidebar.collapsed .label {
  display: none;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s ease;
  z-index: 45;
}

.sidebar.mobile-open + .sidebar-overlay,
.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ========== CONTENT ========== */
.content {
  flex: 1;
  min-width: 0;
  padding: 0;
  background:
    radial-gradient(circle at top right, rgba(96,165,250,0.08), transparent 22%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg-main) 100%);
  overflow-y: auto;
}

.page {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.page.active {
  display: block;
  padding: clamp(10px, 1.6vw, 20px);
}

/* Home: display gestionado por el bloque #page-home.active en sección dashboard */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(226,232,240,0.95);
  border-radius: 14px;
  padding: clamp(10px, 1.3vw, 16px);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(10px);
}

.subtle {
  color: var(--text-muted);
  margin-top: 8px;
  font-size: 14px;
}

/* ========== PDA TITLE ========== */
.pda-titlebar {
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy-medium) 100%);
  color: #ffffff;
  border-radius: 10px;
  padding: 9px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.pda-titlebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    transparent 0%, 
    rgba(59, 130, 246, 0.1) 50%, 
    transparent 100%
  );
  pointer-events: none;
}

.pda-title {
  text-align: center;
  font-weight: 800;
  letter-spacing: 1.5px;
  font-size: 14px;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

/* ========== BOX ========== */
.box {
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(226,232,240,0.92);
  border-radius: 11px;
  padding: clamp(10px, 1.2vw, 14px);
  box-shadow: 0 4px 14px rgba(15,23,42,0.04);
}

.box-title {
  font-weight: 700;
  font-size: 11px;
  color: var(--navy-primary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ocean-pale);
}

/* Remove border from box-title when inside vessel-header-row */
.vessel-header-row .box-title {
  margin: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* ========== VESSEL GRID ========== */
.vessel-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
}

@media (max-width: 1200px) {
  .vessel-grid {
    grid-template-columns: 1fr;
  }
}

.field-row {
  display: grid;
  grid-template-columns: minmax(96px, 120px) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 7px;
}

.field-row .lbl {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(96px, 116px) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 7px;
}

.form-row .field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}

.field-row .row-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 210px);
  gap: 8px;
  align-items: center;
}

.row-inline {
  display: flex;
  gap: 7px;
  align-items: center;
}

.inline-2 {
  display: flex;
  gap: 7px;
  align-items: center;
}

.inline-imo {
  display: flex;
  gap: 7px;
  align-items: center;
}

/* ========== INPUTS ========== */
input,
select {
  width: 100%;
  min-width: 0;
  padding: 5px 9px;
  min-height: 30px;
  border: 1.5px solid var(--border-medium);
  border-radius: 7px;
  font-size: 12.5px;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: var(--transition-smooth);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--ocean-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input[readonly] {
  background: var(--ocean-pale);
  color: var(--navy-medium);
  font-weight: 500;
  cursor: not-allowed;
}

input[type="number"] {
  font-family: 'JetBrains Mono', monospace;
}

/* ========== BUTTONS ========== */
.btn {
  background: linear-gradient(135deg, var(--ocean-blue) 0%, var(--navy-medium) 100%);
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.2px;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn:active {
  transform: translateY(0);
}

.imo-status {
  font-size: 13px;
  color: var(--text-muted);
  padding-left: 8px;
  white-space: nowrap;
  font-weight: 500;
}

.imo-status.ok {
  color: var(--success);
  font-weight: 600;
}

.imo-status.bad {
  color: var(--error);
  font-weight: 600;
}

/* ========== EXPENSES LAYOUT ========== */

/* Wrapper scrollable */
.expenses-wrap {
  overflow-x: auto;
  width: 100%;
}

/* ========== TABLE ========== */
table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-light);
}

th {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 2px solid var(--border-medium);
  padding: 10px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--navy-primary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  text-align: left;
}

td {
  border-bottom: 1px solid var(--border-light);
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text-primary);
}

tbody tr {
  transition: var(--transition-smooth);
}

tbody tr:hover {
  background: rgba(59, 130, 246, 0.02);
}

tbody tr:last-child td {
  border-bottom: none;
}

#tabla tbody td:nth-child(3) {
  text-align: center;
  font-weight: 600;
  color: var(--navy-medium);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

#tabla tbody td:nth-child(4) {
  text-align: right;
  font-weight: 600;
  color: var(--navy-deep);
  padding-right: 16px;
  font-family: 'JetBrains Mono', monospace;
}

#tabla tbody td {
  vertical-align: middle;
}

/* ========== INLINE INPUT COLUMNS (Tarifa / Cantidad) ========== */
#tabla td.td-tarifa,
#tabla td.td-qty {
  padding: 0 6px;
  vertical-align: middle;
  white-space: nowrap;
}

#tabla th.th-tarifa,
#tabla th.th-cantidad {
  white-space: nowrap;
}

#tabla td.td-tarifa input,
#tabla td.td-tarifa select,
#tabla td.td-qty input,
#tabla td.td-qty select {
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 28px;
  padding: 3px 8px;
  font-size: 11.5px;
  box-sizing: border-box;
  margin: 0;
}

#tabla td.td-tarifa input:disabled,
#tabla td.td-tarifa select:disabled,
#tabla td.td-qty input:disabled,
#tabla td.td-qty select:disabled {
  background: #f8fafc;
  color: var(--text-muted);
  border-color: var(--border-light);
  cursor: not-allowed;
}

/* ========== TOTALS ========== */
.totals {
  margin-top: 14px;
  display: grid;
  gap: 7px;
  max-width: 460px;
  margin-left: auto;
}

.tot-row {
  display: grid;
  grid-template-columns: 1fr 80px 170px;
  gap: 12px;
  align-items: center;
}

.tot-label {
  font-weight: 700;
  color: var(--text-secondary);
  text-align: right;
  font-size: 13px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.tot-cur {
  font-weight: 700;
  color: var(--navy-medium);
  text-align: center;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}

.tot-val {
  border: 1.5px solid var(--border-medium);
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  padding: 7px 12px;
  font-weight: 700;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--navy-deep);
  box-shadow: var(--shadow-sm);
}

.tot-total .tot-label {
  color: var(--navy-deep);
  font-size: 14px;
}

.tot-total .tot-val {
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy-medium) 100%);
  color: #ffffff;
  border-color: var(--navy-deep);
  box-shadow: var(--shadow-sm);
  font-size: 14px;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
  background: var(--steel-pale);
  border-radius: 5px;
  border: 2px solid var(--bg-main);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--steel);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .content {
    padding: 12px;
  }

  .vessel-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* field-row y form-row mantienen layout horizontal en móvil —
     reducir columna label y gap para que quepan en pantallas pequeñas */
  .field-row {
    grid-template-columns: minmax(80px, 100px) minmax(0, 1fr);
    gap: 8px;
  }

  .form-row {
    grid-template-columns: minmax(80px, 100px) minmax(0, 1fr);
    gap: 8px;
  }
}


/* ===== PDA titlebar: left + center + right ===== */
.pda-titlebar { position: relative; }
.pda-titlebar-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.pda-titlebar-inner .btn{
  white-space: nowrap;
  padding: 5px 12px;
  font-size: 11.5px;
}
.pda-titlebar-inner .pda-title{
  flex: 1;
  text-align: center;
}

/* Secondary button (same look, different tone) */
.btn.btn-secondary{
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}
.btn.btn-danger{
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* ===== Modals ===== */
.modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
}
.modal{
  width: min(500px, 100%);
  background: #ffffff;
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
  padding: 16px 18px 14px;
}
.modal-title{
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.modal-text{
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  white-space: pre-line;
}
.modal-actions{
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 14px;
}
.modal input{
  margin-top: 6px;
}
.vessel-header-row{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ocean-pale);
  margin-bottom: 10px;
}

.box-title-divider{
  height: 2px;
  background: var(--ocean-pale);
  border-radius: 2px;
  margin: 10px 0 18px;
}


.vessel-header{
  display:flex;
  align-items:center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.vessel-header .box-title{
  margin:0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ocean-pale);
  flex: 1;
}

.pda-inline{
  display:flex;
  align-items:center;
  gap: 7px;
  margin-left: 14px;
}

.pda-inline-label{
  font-weight: 700;
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
}

#pda_number{
  width: 76px;
  height: 26px;
  padding: 3px 8px;
  border-radius: 7px;
  text-align: center;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}
/* ===== Submenu (Sidebar) ===== */

.nav-group { margin-bottom: 6px; }

.nav-parent{
  position: relative;
  display:flex;
  align-items:center;
}

.nav-parent .chev{
  margin-left: auto;
  opacity: 0.9;
  transition: var(--transition-smooth);
}

.nav-group.open .nav-parent .chev{
  transform: rotate(90deg);
}

.nav-sub{
  margin-left: 12px;
  padding-left: 10px;
  border-left: 1px solid rgba(255,255,255,0.12);
  display: none;
}

.nav-group.open .nav-sub{
  display: block;
}

.nav-child{
  padding: 10px 14px;
  border-radius: 10px;
  margin: 4px 0;
  font-size: 13px;
}

.nav-child .icon{
  font-size: 14px;
  opacity: 0.9;
}

/* cuando sidebar está colapsado: ocultar submenú para no romper */
.sidebar.collapsed .nav-sub{
  display: none !important;
  
}
.sidebar.collapsed .nav-parent .chev{
  display: none;
}
/* ═══════════════════════════════════════════════════════
   MULTIPORT — Refined Layout
   ═══════════════════════════════════════════════════════ */

/* No panel lateral en multiport */
.mp-only-onecol {
  grid-template-columns: 1fr !important;
}

.mp-titlebar-onecol {
  grid-template-columns: 1fr !important;
}

/* ── Scroll wrapper ─────────────────────────────────── */
.mp-wrap {
  overflow-x: auto;
  overflow-y: visible;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  box-shadow: 0 1px 4px rgba(15,23,42,0.06);
  margin-top: 4px;
  width: 100%;
}

/* ── Table base ─────────────────────────────────────── */
.mp-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  background: #fff;
  /* Override global table styles */
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.mp-table th,
.mp-table td {
  padding: 4px 6px;
  border-bottom: 1px solid rgba(226,232,240,0.7);
  vertical-align: middle;
  font-size: 12px;
}

/* ── Meta rows (RATE / PORT STAY / PORT / PURPOSE) ─── */
.mp-meta {
  background: #f8fafc;
}

.mp-meta td {
  padding: 4px 8px;
  border-bottom: 1px solid rgba(226,232,240,0.5);
}

.mp-meta-label {
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  background: #f1f5f9 !important;
  white-space: nowrap;
}

/* Strong bottom border after last meta row (PURPOSE) */
.mp-meta-last td {
  border-bottom: 2px solid #93c5fd;
}

/* ── Column separators between port groups ──────────── */
/*
  Estructura de columnas (DOM elements):
  · mp-meta rows     (4 tds):   label(cs2) | P1(cs3) | P2(cs3) | P3(cs3)
      → separar antes de P2=nth(3) y P3=nth(4)
  · mp-headrow       (5 tds):   desc | remarks | P1-head(cs3) | P2-head(cs3) | P3-head(cs3)
      → separar antes de P2-head=nth(4) y P3-head=nth(5)
  · mp-subheadrow    (11 tds):  … | P1-amt | P1-tar | P1-qty | P2-amt | P2-tar | P2-qty | P3-amt | …
      → separar antes de P2-amt=nth(6) y P3-amt=nth(9)
  · mp-row           (11 tds):  desc | remarks | P1-amt | P1-tar | P1-qty | P2-amt | P2-tar | P2-qty | P3-amt | …
      → separar antes de P2-amt=nth(6) y P3-amt=nth(9)
  · tfoot mp-total-row (4 tds): label(cs2) | P1(cs3) | P2(cs3) | P3(cs3)
      → separar antes de P2=nth(3) y P3=nth(4)
*/
.mp-meta td:nth-child(3),
.mp-meta td:nth-child(4) {
  border-left: 2px solid rgba(147, 197, 253, 0.70);
}

.mp-headrow td:nth-child(4),
.mp-headrow td:nth-child(5) {
  border-left: 2px solid rgba(147, 197, 253, 0.70);
}

.mp-subheadrow td:nth-child(6),
.mp-subheadrow td:nth-child(9),
.mp-row td:nth-child(6),
.mp-row td:nth-child(9) {
  border-left: 2px solid rgba(147, 197, 253, 0.70);
}

.mp-total-row td:nth-child(3),
.mp-total-row td:nth-child(4) {
  border-left: 2px solid rgba(147, 197, 253, 0.70);
}

/* ── Port header cells ──────────────────────────────── */
.mp-porthead {
  text-align: center;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--navy-primary);
  background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%) !important;
  border-bottom: 2px solid #93c5fd !important;
  padding: 6px 10px !important;
}

/* ── Column header row (Description / Remarks / Port headers) */
.mp-headrow td,
.mp-headrow th {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 2px solid var(--border-medium);
  padding: 5px 7px;
}

.mp-headcell {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  text-align: center;
  white-space: nowrap;
}

/* ── Subheader row (Amount / Tarifa / Cantidad) ──────── */
.mp-subheadrow td,
.mp-subheadrow th {
  background: #f8fafc;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  text-align: center;
  padding: 4px 7px;
  border-bottom: 1px solid var(--border-medium);
}

/* ── Data rows ──────────────────────────────────────── */
.mp-row {
  transition: background-color 0.12s ease;
}

.mp-row:hover {
  background: rgba(59,130,246,0.03);
}

/* Description col */
.mp-row td:first-child {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 130px;
}

/* Remarks col */
.mp-row td:nth-child(2) {
  font-size: 11px;
  color: var(--text-secondary);
  min-width: 90px;
}

/* ── Inputs inside table ────────────────────────────── */
.mp-input {
  width: 100%;
  min-height: 26px;
  border-radius: 6px;
  padding: 3px 7px;
  border: 1.5px solid var(--border-medium);
  background: var(--bg-card);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.mp-input:focus {
  outline: none;
  border-color: var(--ocean-blue);
  box-shadow: 0 0 0 2.5px rgba(59,130,246,0.12);
}

.mp-input:disabled {
  background: #f8fafc;
  color: #c4cdd8;
  border-color: #e9eef4;
  cursor: not-allowed;
}

/* Remarks textarea */
.mp-remark-input {
  width: 100%;
  min-height: 26px;
  border-radius: 5px;
  padding: 3px 7px;
  border: 1.5px solid var(--border-medium);
  background: var(--bg-card);
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  color: var(--text-secondary);
  resize: none;
  overflow: hidden;
  line-height: 1.3;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.mp-remark-input:focus {
  outline: none;
  border-color: var(--ocean-blue);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.10);
  min-height: 44px;
}

/* Readonly (Port Stay) */
.mp-readonly {
  background: #eff6ff !important;
  color: var(--navy-medium);
  font-weight: 700;
  border-color: #bfdbfe !important;
  font-family: 'JetBrains Mono', monospace;
}

/* ── Amount cells (computed) ────────────────────────── */
.mp-amount-cell {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  text-align: right;
  color: var(--navy-primary);
  background: #f0f9ff;
  font-size: 12.5px;
  white-space: nowrap;
  min-width: 80px;
}

.mp-amount {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  text-align: right;
  color: var(--navy-deep);
  background: #f0f9ff !important;
  border: 1.5px solid #bae6fd !important;
}

/* ── Total rows ─────────────────────────────────────── */
.mp-total-row td {
  background: #f8fafc;
  border-top: 1px solid var(--border-medium);
  border-bottom: 1px solid var(--border-light);
  padding: 6px 8px;
  font-size: 12px;
}

.mp-total-label {
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  text-align: right;
  padding-right: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.mp-total-val {
  font-weight: 700;
  text-align: right;
  padding-right: 14px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--navy-deep);
  font-size: 13px;
  background: #f0f9ff;
  white-space: nowrap;
}

/* Grand total row */
.mp-total-grand td {
  border-top: 2px solid var(--navy-primary);
  background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
  padding: 7px 8px;
}

.mp-total-grand .mp-total-label {
  color: var(--navy-deep);
  font-size: 11px;
}

.mp-total-grand .mp-total-val {
  color: var(--navy-deep);
  font-size: 13px;
  font-weight: 900;
  background: transparent;
}

/* ── Empty state ────────────────────────────────────── */
#mp_empty_row td {
  text-align: center;
  padding: 28px 20px;
  color: var(--text-muted);
  font-style: italic;
  font-size: 12px;
  background: #fafbfc;
}

/* ── Remarks (legacy class, kept for compat) ─────────── */
.mp-remarks {
  resize: none;
  overflow: hidden;
  line-height: 1.25;
  min-height: 34px;
}
.mp-remarks.is-expanded {
  min-height: 64px;
}


/* =======================
   REPOSITORIO (TABLA)
======================= */
.repo-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

.repo-filters-card{
  border:1px solid rgba(0,0,0,.08);
  background:#f8fafc;
  border-radius:12px;
  padding:12px;
  margin-bottom:14px;
}

.repo-filters-grid{
  display:grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr)) auto;
  gap:12px;
  align-items:end;
}

.repo-filter-label{
  font-size:12px;
  color:var(--text-muted, #6b7280);
  margin-bottom:6px;
  letter-spacing:.02em;
}

.repo-filter input,
.repo-filter select{
  width:100%;
  height:38px;
  border-radius:10px;
  border:1px solid rgba(0,0,0,.12);
  padding:0 12px;
  background:#fff;
}

.repo-filter-actions{
  display:flex;
  justify-content:flex-end;
}

.repo-table-wrap{
  border-radius:12px;
  overflow-x:auto;
  border:1px solid rgba(0,0,0,.08);
}

.repo-table{
  width:100%;
  border-collapse:collapse;
}

.repo-table thead th{
  background:#0b2343;
  color:#fff;
  font-size:12px;
  text-transform:uppercase;
  padding:12px 10px;
  text-align:left;
  white-space:nowrap;
}

.repo-table tbody td{
  padding:12px 10px;
  border-top:1px solid rgba(0,0,0,.06);
  font-size:13px;
  vertical-align:middle;
}

.repo-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:26px;
  padding:0 10px;
  border-radius:999px;
  font-size:12px;
  border:1px solid #f6d18b;
  background:#fff7e6;
  color:#1f2937;
}
.pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:22px;
  padding:0 9px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  letter-spacing:.4px;
  white-space:nowrap;
}
.pill-ok{
  background:#dcfce7;
  color:#166534;
  border:1px solid #bbf7d0;
}
.pill-warn{
  background:#fff7e6;
  color:#92400e;
  border:1px solid #f6d18b;
}
.pill-info{
  background:#eff6ff;
  color:#1e40af;
  border:1px solid #bfdbfe;
}
.pill-danger{
  background:#fee2e2;
  color:#991b1b;
  border:1px solid #fecaca;
}

/* Repo: acciones estilo link (más compacto que botones) */
.repo-actions{
  display:flex;
  align-items:center;
  gap:8px;
  white-space:nowrap;
}
.repo-link{
  color:#1f5fd6;
  font-weight:700;
  text-decoration:none;
}
.repo-link:hover{ text-decoration:underline; }
.repo-sep{ color:#7c8aa3; }
.repo-link.is-disabled{
  color:#a8b2c4;
  pointer-events:none;
  text-decoration:none;
  font-weight:600;
}
.repo-link-delete{
  color:#c0392b;
  font-weight:700;
  text-decoration:none;
  white-space:nowrap;
}
.repo-link-delete:hover{ text-decoration:underline; }

@media (max-width: 1200px){
  .repo-filters-grid{ grid-template-columns: repeat(2, minmax(160px, 1fr)); }
}

/* ===== Repositorio: tabla responsive ===== */
.repo-table-wrap{
  width: 100%;
  overflow-x: auto;
  border-radius: 14px;
}

/* evita que se "rompa" el header y quede limpio */
.repo-table{
  width: 100%;
  min-width: unset;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
}

/* Header fijo al scrollear dentro del wrap */
.repo-table thead th{
  position: sticky;
  top: 0;
  z-index: 2;
}

/* Compactar un poco (sin perder look) */
.repo-table th,
.repo-table td{
  white-space: nowrap;
  padding: 8px 5px;
  font-size: 10.5px;
}

/* Botones dentro de tabla: más compactos */
.repo-table .btn,
.repo-table button{
  padding: 10px 14px;
  font-size: 13px;
  border-radius: 12px;
}

/* ===== Ajustes por tamaño de pantalla ===== */
@media (max-width: 1400px){
  .repo-table{ min-width: unset; }
  .repo-table th, .repo-table td{ padding: 10px 10px; font-size: 13px; }
  .repo-table .btn, .repo-table button{ padding: 9px 12px; font-size: 12px; }
}

@media (max-width: 1200px){
  .repo-table{ min-width: unset; }
  .repo-table th, .repo-table td{ padding: 9px 9px; font-size: 12.5px; }
}
.page{
  width: 100%;
  max-width: 100%;
}

.page-content{
  width: 100%;
  max-width: 100%;
}

/* =========================================================
   REPOSITORIO – Densidad “tipo zoom 70%” (solo en esta página)
   ========================================================= */

#page-repositorio .card{
  padding: 18px;              /* antes 24px */
}

/* menos aire en header */
#page-repositorio .repo-header{
  margin-bottom: 10px;
}

/* filtros más compactos */
#page-repositorio .repo-filters-card{
  padding: 14px;
  margin-bottom: 14px;
}

#page-repositorio .repo-filter-label{
  font-size: 11px;
  letter-spacing: .5px;
}

#page-repositorio input,
#page-repositorio select{
  height: 40px;
  font-size: 13px;
  padding: 0 12px;
}

/* tabla con scroll horizontal cuando desborda */
#page-repositorio .repo-table-wrap{
  width: 100%;
  overflow-x: auto;
  border-radius: 14px;
}

#page-repositorio .repo-table{
  width: 100%;
  min-width: unset;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
}

#page-repositorio .repo-table th,
#page-repositorio .repo-table td{
  padding: 8px 5px;
  font-size: 10.5px;
  white-space: nowrap;
}

/* header fijo */
#page-repositorio .repo-table thead th{
  position: sticky;
  top: 0;
  z-index: 2;
}

/* botones compactos */
#page-repositorio .repo-table button,
#page-repositorio .repo-table .btn{
  padding: 5px 8px;
  font-size: 10.5px;
  border-radius: 8px;
  white-space: nowrap;
}

/* reduce un poco el padding del área central (solo repositorio) */
#page-repositorio{
  margin: 0;
}

/* si quieres ganar ancho real del contenido sin tocar el resto */
@media (min-width: 1200px){
  #page-repositorio .card{
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ================= LOGIN SaaS ================= */

.login-page{
  position:fixed;
  inset:0;
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy-primary) 100%);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index: 9999;
}

.login-wrapper{
  width:100%;
  max-width: 420px;
  padding: 20px;
}

.login-card{
  background:#fff;
  border-radius: 14px;
  padding: 28px 28px 24px;
  box-shadow: 0 20px 44px rgba(0,0,0,0.22);
  text-align:center;
}

.login-brand{ margin-bottom: 18px; }
.login-logo{ width: 100px; margin-bottom: 10px; }

.login-brand h1{
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 4px 0;
  color: #0f172a;
  letter-spacing: 0.2px;
}
.login-brand p{
  font-size: 13px;
  margin: 0;
  color: #64748b;
}

.login-form{ text-align:left; }
.login-field{ margin-bottom: 16px; }
.login-field label{
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  display:block;
  margin-bottom: 6px;
}
.login-field input{
  width:100%;
  height: 38px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  padding: 0 12px;
  font-size: 13px;
  transition: all .2s ease;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
.login-field input:focus{
  outline:none;
  border-color:#3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.login-btn{
  width:100%;
  height: 40px;
  border-radius: 8px;
  border:none;
  background: linear-gradient(135deg, var(--navy-primary) 0%, #3b82f6 100%);
  color:#fff;
  font-weight: 700;
  font-size: 13px;
  margin-top: 4px;
  cursor:pointer;
  transition: all .2s ease;
}
.login-btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(59,130,246,0.28);
}

.login-error{
  color:#ef4444;
  font-size: 12px;
  margin-top: 12px;
  text-align:center;
  min-height: 16px;
}

.login-footer{
  margin-top: 26px;
  font-size: 11px;
  color:#94a3b8;
  text-align:center;
}


/* ===== Vessel picker (IMO help) ===== */
.btn-help{
  padding: 10px 12px;
  width: 42px;
  min-width: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  border-radius: 10px;
}
.modal.modal-vessel{
  width: min(720px, 100%);
}
.vessel-pick-head{
  display: grid;
  grid-template-columns: 1fr 140px 54px;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 800;
  color: var(--navy-primary);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.vessel-pick-list{
  margin-top: 10px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  max-height: 360px;
  overflow-y: auto;
}
.vessel-pick-row{
  display: grid;
  grid-template-columns: 1fr 140px 54px;
  gap: 10px;
  align-items: center;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border-light);
  background: #fff;
}
.vessel-pick-row:last-child{
  border-bottom: none;
}
.vessel-pick-row:hover{
  background: rgba(59, 130, 246, 0.03);
}
.vessel-pick-vessel{
  font-weight: 600;
  color: var(--text-primary);
}
.vessel-pick-imo{
  font-family: 'JetBrains Mono', monospace;
  color: var(--navy-deep);
  font-weight: 700;
  text-align: right;
}
.vessel-pick-check{
  display:flex;
  justify-content:center;
}
.vessel-pick-check input{
  width: 18px;
  height: 18px;
}
/* ═══════════════════════════════════════════════════════════════════
   HOME DASHBOARD — Maritime Operations
   ═══════════════════════════════════════════════════════════════════ */

/* ── Page layout ─────────────────────────────────────────────────── */
#page-home.active {
  padding: 18px 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Page header ─────────────────────────────────────────────────── */
.hd-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.hd-page-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  margin: 0 0 2px;
  line-height: 1.2;
}

.hd-period {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.3px;
}

.hd-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hd-last-update {
  font-size: 11px;
  color: var(--text-muted);
}

.hd-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.hd-refresh-btn:hover {
  background: var(--ocean-pale);
  border-color: var(--ocean-blue);
  color: var(--ocean-blue);
}

.hd-status-msg {
  font-size: 13px;
  color: var(--text-muted);
  min-height: 16px;
}

/* ── KPI Row (8 cards) ───────────────────────────────────────────── */
.hd-kpi-row {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
}

.hd-kpi-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 11px;
  padding: 11px 12px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  box-shadow: 0 1px 3px rgba(15,23,42,0.05), 0 3px 8px rgba(15,23,42,0.03);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  animation: hdCardIn 0.5s ease both;
}

.hd-kpi-card:hover {
  box-shadow: 0 4px 20px rgba(15,23,42,0.10);
  transform: translateY(-2px);
}

.hd-kpi-card:nth-child(1) { animation-delay: 0.04s; }
.hd-kpi-card:nth-child(2) { animation-delay: 0.08s; }
.hd-kpi-card:nth-child(3) { animation-delay: 0.12s; }
.hd-kpi-card:nth-child(4) { animation-delay: 0.16s; }
.hd-kpi-card:nth-child(5) { animation-delay: 0.20s; }
.hd-kpi-card:nth-child(6) { animation-delay: 0.24s; }
.hd-kpi-card:nth-child(7) { animation-delay: 0.28s; }
.hd-kpi-card:nth-child(8) { animation-delay: 0.32s; }

@keyframes hdCardIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* Icon blobs */
.hd-kpi-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hd-icon-blue   { background: rgba(59,130,246,0.10);  color: #3b82f6; }
.hd-icon-teal   { background: rgba(13,148,136,0.10);  color: #0d9488; }
.hd-icon-amber  { background: rgba(245,158,11,0.10);  color: #f59e0b; }
.hd-icon-rose   { background: rgba(244,63,94,0.10);   color: #f43f5e; }
.hd-icon-violet { background: rgba(139,92,246,0.10);  color: #8b5cf6; }

.hd-kpi-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.hd-kpi-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.hd-kpi-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.15;
  white-space: nowrap;
}

.hd-kpi-value--sm {
  font-size: 13px;
  line-height: 1.3;
}

.hd-kpi-sub {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Diff card color states */
.hd-kpi-card.kpi-positive .hd-kpi-value { color: #10b981; }
.hd-kpi-card.kpi-negative .hd-kpi-value { color: #f43f5e; }

/* Ring card */
.hd-kpi-card--ring { gap: 10px; }

.hd-ring-wrap {
  position: relative;
  width: 66px;
  height: 66px;
  flex-shrink: 0;
}

.hd-ring-svg { width: 66px; height: 66px; }

.hd-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hd-ring-label b {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.hd-ring-label span {
  font-size: 8px;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}

/* ── Chart cards ─────────────────────────────────────────────────── */
.hd-chart-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 13px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(15,23,42,0.05), 0 3px 8px rgba(15,23,42,0.03);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.hd-chart-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.hd-chart-header h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  white-space: nowrap;
}

.hd-chart-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.hd-chart-body {
  position: relative;
}

.hd-charts-row--2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Tables row ──────────────────────────────────────────────────── */
.hd-tables-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.hd-table-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 13px;
  padding: 14px 12px 10px;
  box-shadow: 0 1px 3px rgba(15,23,42,0.05);
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow: hidden;
}

.hd-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.hd-table thead th {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0 6px 8px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  background: transparent;
}

.hd-table thead th.num { text-align: right; }

.hd-table tbody tr { transition: background 0.15s ease; }
.hd-table tbody tr:hover { background: rgba(59,130,246,0.03); }

.hd-table tbody td {
  padding: 7px 6px;
  border-bottom: 1px solid rgba(226,232,240,0.5);
  color: var(--text-secondary);
  vertical-align: middle;
}

.hd-table tbody tr:last-child td { border-bottom: none; }

.hd-table td.num {
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  white-space: nowrap;
}

.hd-table td.usd {
  color: var(--navy-primary);
  font-weight: 600;
  white-space: nowrap;
}

/* Primera columna (nombre): truncar con ellipsis */
.hd-table tbody td:first-child {
  max-width: 0;
  width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Barra mini — columna fija angosta */
.hd-table td:last-child {
  width: 44px;
  padding-right: 2px;
}

/* Rank badge */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--ocean-pale);
  color: var(--ocean-blue);
  font-size: 9px;
  font-weight: 800;
  margin-right: 5px;
  flex-shrink: 0;
  vertical-align: middle;
}

/* Bar columns hidden — removed per design decision */
.hd-table td:has(.bar-cell),
.hd-table thead th:empty {
  display: none;
}

/* subtle inside hd-table */
.hd-table .subtle {
  color: var(--text-muted);
  font-style: italic;
  padding: 14px 6px;
  font-size: 12px;
}

/* ── Period Filter Bar ──────────────────────────────────────────── */
.hd-filter-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 11px;
  padding: 8px 14px;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.hd-filter-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hd-filter-icon {
  color: var(--steel-light);
  flex-shrink: 0;
}

.hd-filter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.hd-month-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-main);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 3px 4px;
}

.hd-nav-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.hd-nav-btn:hover {
  background: var(--ocean-pale);
  color: var(--ocean-blue);
}

.hd-month-chip {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 120px;
  text-align: center;
  letter-spacing: 0.2px;
  padding: 0 4px;
}

.hd-filter-presets {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.hd-filter-sep {
  width: 1px;
  height: 20px;
  background: var(--border-light);
  margin: 0 3px;
  flex-shrink: 0;
}

.hd-preset-btn {
  padding: 5px 13px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
  line-height: 1.4;
}

.hd-preset-btn:hover {
  background: var(--ocean-pale);
  border-color: var(--ocean-blue);
  color: var(--ocean-blue);
}

.hd-preset-btn.active {
  background: var(--ocean-blue);
  border-color: var(--ocean-blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59,130,246,0.28);
}

/* Botón Histórico — variante especial con icono de reloj */
.hd-preset-btn--history {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  border-color: var(--border-medium);
}
.hd-preset-btn--history.active {
  background: #0d9488;
  border-color: #0d9488;
  color: #fff;
  box-shadow: 0 2px 8px rgba(13,148,136,0.28);
}
.hd-preset-btn--history:hover:not(.active) {
  color: #0d9488;
  border-color: #0d9488;
  background: rgba(13,148,136,0.07);
}

/* Botón Limpiar filtro — siempre visible, acción secundaria */
.hd-filter-reset {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px dashed var(--border-medium);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
  margin-left: 0;
  letter-spacing: 0.1px;
}
.hd-filter-reset:hover {
  color: #f43f5e;
  border-color: #f43f5e;
  border-style: solid;
  background: rgba(244,63,94,0.06);
}

/* ── Drill badge ────────────────────────────────────────────────── */
.hd-drill-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: linear-gradient(135deg, rgba(59,130,246,0.08) 0%, rgba(13,148,136,0.06) 100%);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.hd-drill-type-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  background: var(--ocean-blue);
  color: #fff;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.hd-drill-badge b {
  color: var(--text-primary);
  font-size: 13px;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hd-drill-clear {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 4px;
  padding: 4px 11px;
  background: transparent;
  border: 1px solid var(--border-medium);
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Inter', sans-serif;
}
.hd-drill-clear:hover {
  border-color: var(--ocean-blue);
  color: var(--ocean-blue);
  background: var(--ocean-pale);
}

/* Clickable table rows for drill */
.tr-clickable {
  cursor: pointer;
  transition: background 0.12s;
}
.tr-clickable:hover {
  background: rgba(59,130,246,0.05) !important;
}
.tr-drill-active {
  background: rgba(59,130,246,0.10) !important;
  border-left: 2.5px solid var(--ocean-blue);
}

/* ── Chart empty state ──────────────────────────────────────────── */
.hd-chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-card);
  border-radius: 10px;
}

/* ── Responsive ──────────────────────────────────────────────────── */

/* Pantallas grandes (iMac / monitor externo) */
@media (max-width: 1700px) {
  .hd-kpi-row { grid-template-columns: repeat(4, 1fr); }
}

/* Notebook grande / laptop 15" (1440–1600px) */
@media (max-width: 1500px) {
  :root { --sidebar-w: 240px; }
  #page-home.active { padding: 16px 18px 24px; gap: 12px; }
  .hd-kpi-value { font-size: 16px; }
  .hd-kpi-card  { padding: 10px 11px; gap: 8px; }
  .hd-kpi-icon  { width: 27px; height: 27px; }
  .hd-chart-card  { padding: 12px 14px; gap: 10px; }
  .hd-table-card  { padding: 12px 11px 8px; gap: 8px; }
  .hd-charts-row--2col { gap: 10px; }
  .hd-tables-row       { gap: 10px; }
}

/* Notebook estándar / laptop 13–14" (1280–1440px) */
@media (max-width: 1400px) {
  :root { --sidebar-w: 220px; }
  #page-home.active { padding: 14px 16px 22px; gap: 10px; }
  .hd-kpi-value { font-size: 15px; }
  .hd-kpi-label { font-size: 9.5px; }
  .hd-kpi-sub   { font-size: 9px; }
  .hd-kpi-card  { padding: 9px 10px; gap: 7px; border-radius: 10px; }
  .hd-kpi-icon  { width: 26px; height: 26px; border-radius: 7px; }
  .hd-chart-card  { padding: 11px 13px; gap: 9px; border-radius: 11px; }
  .hd-chart-header h3 { font-size: 12.5px; }
  .hd-table-card  { padding: 11px 10px 7px; gap: 7px; border-radius: 11px; }
  .hd-tables-row  { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hd-charts-row--2col { gap: 10px; }
  .hd-kpi-row { gap: 8px; }
}

@media (max-width: 1200px) {
  .hd-kpi-row          { grid-template-columns: repeat(4, 1fr); }
  .hd-charts-row--2col { grid-template-columns: 1fr; }
  .hd-tables-row       { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  #page-home.active { padding: 12px; gap: 10px; }
  .hd-kpi-row    { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .hd-tables-row { grid-template-columns: 1fr; gap: 8px; }
  .hd-page-title { font-size: 15px; }
  .hd-kpi-value  { font-size: 16px; }
  .hd-kpi-card   { padding: 10px 10px; }
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE — tablet 1024px
   ══════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  :root { --sidebar-w: 220px; }
  .hd-kpi-row { grid-template-columns: repeat(4, 1fr); }
  .hd-charts-row--2col { grid-template-columns: 1fr; }
  .hd-tables-row { grid-template-columns: repeat(2, 1fr); }
  .vessel-grid { grid-template-columns: 1fr; }
  .v-right { border-left: none; border-top: 1px solid var(--border-light); padding-left: 0; padding-top: 14px; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 64px; }
  .brand { display: none; }
  .label { display: none; }
  .nav-sub { display: none !important; }
  .sidebar .sidebarUserInfo { display: none; }
  .hd-kpi-row { grid-template-columns: repeat(2, 1fr); gap: 7px; }
  .hd-tables-row { grid-template-columns: 1fr; }
  .content { padding: 12px; }
  .hd-filter-presets { flex-wrap: wrap; gap: 4px; }
  .hd-chart-card { padding: 11px 12px; }
}

@media (max-width: 600px) {
  .hd-kpi-row { grid-template-columns: repeat(2, 1fr); gap: 7px; }
  .hd-kpi-card { padding: 9px 9px; gap: 7px; }
  .hd-kpi-value { font-size: 15px; }
  .pda-titlebar-inner { flex-direction: column; gap: 7px; align-items: stretch; }
  .pda-titlebar-inner .btn { width: 100%; text-align: center; justify-content: center; }
  .modal { width: 96vw !important; max-width: 96vw !important; }
  .repo-filters { flex-direction: column; }
  .hd-page-header { flex-direction: column; gap: 8px; }

  /* Single Port: tabla cabe en pantalla sin scroll horizontal */
  .expenses-table { overflow-x: auto; }

  #tabla th:nth-child(3),
  #tabla th:nth-child(4) { width: 72px !important; }

  #tabla th, #tabla td { padding: 5px 6px; font-size: 11.5px; }

  .pda-titlebar { padding: 10px 14px; }
  .pda-title { font-size: 12px; letter-spacing: 1px; }
}

/* ══════════════════════════════════════════════════════
   BUTTON LOADING STATE
   ══════════════════════════════════════════════════════ */
.btn .btn-spinner {
  display: none;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

.btn:disabled {
  cursor: not-allowed;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════════════════
   PRINT STYLES — PDF-friendly
   ══════════════════════════════════════════════════════ */
@media print {
  .sidebar, .pda-titlebar, .hd-filter-bar, .hd-refresh-btn,
  .btn, .nav, .modal-backdrop { display: none !important; }
  .content { padding: 0; margin: 0; }
  .app { display: block; }
  body { background: white; }
}


/* ===== Acctual-like responsive upgrade ===== */
.repo-table-wrap,
.table-wrap,
.mp-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.page-content,
.card,
.box,
.repo-card,
.hd-chart-card,
.hd-table-card {
  min-width: 0;
}

@media (max-width: 1199px) {
  .page.active { padding: 14px; }
  .card, .box { border-radius: 12px; }
}

/* ========== MOBILE TOPBAR ========== */
.mobile-topbar {
  display: none;
}

@media (max-width: 1024px) {
  :root { --sidebar-w: 286px; }

  .mobile-topbar {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: linear-gradient(90deg, var(--bg-sidebar) 0%, #0a1e36 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    align-items: center;
    padding: 0 12px;
    gap: 10px;
    z-index: 55;
  }

  .mobile-topbar .brand {
    color: rgba(255, 255, 255, 0.92);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
  }

  .content {
    padding-top: 48px;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(286px, calc(100vw - 44px));
    transform: translateX(-102%);
    box-shadow: 0 24px 60px rgba(2, 8, 23, 0.38);
  }

  .sidebar.collapsed {
    width: min(286px, calc(100vw - 44px));
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar .brand,
  .sidebar .label {
    display: block;
  }

  .sidebar.collapsed .brand,
  .sidebar.collapsed .label {
    display: block;
  }

  .sidebar.collapsed .nav-sub {
    display: block;
  }

  /* Submenú visible en el drawer móvil cuando el grupo está abierto */
  .sidebar.mobile-open .nav-group.open .nav-sub {
    display: block !important;
  }

  .content {
    width: 100%;
    min-height: 100vh;
  }

  .page.active,
  #page-home.active {
    padding-left: 18px;
    padding-right: 18px;
  }

  .hd-page-header,
  .pda-titlebar-inner,
  .vessel-header-row,
  .vessel-header {
    align-items: flex-start;
  }

  .row-inline,
  .inline-2,
  .inline-imo,
  .pda-inline {
    flex-wrap: wrap;
  }
}

@media (max-width: 820px) {
  .page.active,
  #page-home.active {
    padding: 12px;
  }

  /* Mantener layout horizontal en formularios — sólo ajustar label y gap */
  .field-row {
    grid-template-columns: minmax(78px, 96px) minmax(0, 1fr);
    gap: 7px;
  }

  .form-row {
    grid-template-columns: minmax(78px, 96px) minmax(0, 1fr);
    gap: 7px;
  }

  .field-row .lbl,
  .form-row .field-label {
    font-size: 11.5px;
  }

  .pda-titlebar,
  .card,
  .box {
    border-radius: 10px;
  }

  .hd-header-right {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 640px) {
  .sidebar-top {
    height: 54px;
    padding: 0 12px;
  }

  .burger {
    width: 34px;
    height: 34px;
  }

  .brand {
    font-size: 13px;
  }

  .page.active,
  #page-home.active {
    padding: 10px;
  }

  .card,
  .box {
    padding: 12px;
    border-radius: 12px;
  }

  .hd-chart-card,
  .hd-table-card {
    padding: 11px 10px;
    border-radius: 11px;
  }

  .modal {
    padding: 13px;
    border-radius: 12px;
  }

  .hd-page-title {
    font-size: 14px;
  }

  .hd-refresh-btn,
  .btn,
  .login-btn {
    min-height: 36px;
  }

  .repo-table th,
  .repo-table td,
  .hd-table thead th,
  .hd-table tbody td {
    white-space: nowrap;
  }
}

/* ═══════════════════════════════════════════════
   VISUAL REFINEMENTS — proporciones y compactación
   ═══════════════════════════════════════════════ */

/* nav padding reducido + sin nav en estado colapsado */
.nav {
  padding: 12px 10px;
}

/* scrollbar más delgada */
::-webkit-scrollbar { width: 7px; height: 7px; }

/* Sección home: chart bodies proporcionales */
@media (max-width: 1400px) {
  .hd-chart-body canvas { max-height: 200px; }
}
@media (max-width: 900px) {
  .hd-chart-body { height: 180px !important; }
  .hd-chart-body canvas { max-height: 180px; }
}

/* Repo table: columnas con overflow controlado */
#page-repositorio .repo-table-wrap {
  max-width: 100%;
}

/* Tabla single port */
#tabla {
  min-width: 640px;
  /* overflow:visible prevents iOS Safari from clipping inputs in cells
     that lie beyond the viewport inside an overflow-x:auto container */
  overflow: visible;
}

/* Compensate rounded corners (normally handled by overflow:hidden on table) */
#tabla thead tr:first-child th:first-child { border-top-left-radius: 12px; }
#tabla thead tr:first-child th:last-child  { border-top-right-radius: 12px; }
#tabla tbody tr:last-child td:first-child  { border-bottom-left-radius: 12px; }
#tabla tbody tr:last-child td:last-child   { border-bottom-right-radius: 12px; }

/* Vessel-grid: gap responsive extra */
@media (max-width: 820px) {
  .vessel-grid { gap: 10px; }
  .pda-titlebar { padding: 8px 12px; }
  .pda-title { font-size: 12px; }
}

/* Form de usuario en modal: no tan ancho */
@media (max-width: 640px) {
  #modalUserCreate .modal,
  #modalForgot .modal,
  #modalMustChange .modal {
    width: 96vw;
    max-width: 96vw;
  }
}

/* Tabla confirmed: tfoot total más compacto */
#confirmedTable tfoot tr:last-child td {
  font-size: 13px;
  padding: 8px 10px;
}

/* Admin users: h2 del repo-header más compacto */
#page-adminUsers .repo-header h2,
#page-repositorio .repo-header h2 {
  font-size: 15px;
  font-weight: 700;
}

/* repo-filters-card más compacto */
.repo-filters-card {
  padding: 8px 10px;
  margin-bottom: 8px;
}

/* inputs dentro de filtros: consistentes */
.repo-filter input,
.repo-filter select {
  height: 30px;
  font-size: 12.5px;
}

/* Tot label más compacto */
.tot-label {
  font-size: 12px;
}

/* Tot-total label más visible */
.tot-total .tot-label {
  font-size: 12.5px;
}

/* Brand sidebar: tamaño calibrado */
.brand {
  font-size: 13.5px;
}

/* Login wrapper más estrecho en desktop */
.login-wrapper {
  max-width: 380px;
}

/* Login footer compactado */
.login-footer {
  margin-top: 18px;
  font-size: 10.5px;
}

/* hd-refresh-btn más compacto */
.hd-refresh-btn {
  padding: 6px 12px;
  font-size: 11.5px;
}

/* Preset buttons más pequeños */
.hd-preset-btn {
  padding: 4px 11px;
  font-size: 11.5px;
}

/* hd-filter-reset: compacto */
.hd-filter-reset {
  padding: 4px 10px;
  font-size: 11px;
}

/* PDA inline label: ajuste */
.pda-inline-label {
  font-size: 11px;
}

/* input PDA number */
#pda_number, #pda_number_multi, #confirmedPdaNumberInput {
  height: 24px;
  padding: 2px 7px;
  font-size: 11.5px;
  width: 70px;
}

/* tabla global: th más compacto */
th {
  padding: 7px 9px;
  font-size: 10.5px;
}

td {
  padding: 5px 9px;
  font-size: 12.5px;
}

/* Responsive 480px: máxima compactación */
@media (max-width: 480px) {
  .hd-kpi-row { grid-template-columns: 1fr 1fr; gap: 6px; }
  .hd-kpi-card { padding: 8px 8px; gap: 6px; border-radius: 9px; }
  .hd-kpi-value { font-size: 14px; }
  .hd-kpi-icon { width: 24px; height: 24px; border-radius: 6px; }
  .hd-kpi-label { font-size: 9px; }
  #page-home.active { padding: 8px; gap: 8px; }
  .hd-chart-body { height: 160px !important; }
  .pda-titlebar { padding: 7px 10px; }
  .page.active { padding: 8px; }
  /* Formularios en 480px: labels mínimos pero mantener horizontal */
  .field-row, .form-row {
    grid-template-columns: minmax(68px, 84px) minmax(0, 1fr);
    gap: 6px;
    margin-bottom: 5px;
  }
}

/* ── Multiport: densidad específica ──────────────────── */

/* El box de multiport con menos padding vertical */
#page-pdaEstimatedMulti .box {
  padding: clamp(8px, 1vw, 12px);
}

/* Separación entre boxes más pequeña */
#page-pdaEstimatedMulti .box + .box,
#page-pdaEstimated .box + .box,
#page-pdaConfirmed .box + .box {
  margin-top: 8px;
}

/* Expenses box con margen reducido */
.box[style*="margin-top:14px"],
.box[style*="margin-top: 14px"] {
  margin-top: 8px !important;
}

/* mp-wrap: sin margen superior extra */
.mp-wrap {
  margin-top: 2px;
}

/* Multiport: vessel-grid aún más compacto */
#page-pdaEstimatedMulti .vessel-grid {
  gap: 14px;
}

/* Meta-label más pequeño */
.mp-meta-label {
  font-size: 9.5px;
  letter-spacing: 0.6px;
}

/* Amount cell compacto */
.mp-amount-cell {
  font-size: 11.5px;
  min-width: 66px;
}

.mp-total-val {
  font-size: 12px;
  padding-right: 10px;
}

.mp-total-label {
  font-size: 10px;
  padding-right: 10px;
  letter-spacing: 0.6px;
}

/* Nav más compacto */
.nav {
  padding: 10px 8px;
}

.nav-group {
  margin-bottom: 3px;
}

/* box + box spacing en PDA pages */
#page-pdaEstimated .card > .box:not(:first-child),
#page-pdaEstimatedMulti .card > .box:not(:first-child),
#page-pdaConfirmed .card > .box:not(:first-child) {
  margin-top: 8px;
}

/* Totals más compactos */
.totals {
  margin-top: 10px;
  gap: 5px;
}

.tot-row {
  grid-template-columns: 1fr 64px 150px;
  gap: 8px;
}

.tot-val {
  padding: 5px 10px;
  font-size: 12.5px;
}

.tot-total .tot-val {
  font-size: 13px;
}



/* ── Indicadores del día (sidebar) ───────────────────────────────────── */
.sidebar-indicators {
  margin: 0 12px 16px;
  padding: 10px 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  flex-shrink: 0;
}
.sidebar-ind-header {
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(255,255,255,.45);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 9px;
}
.sidebar-ind-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 0;
}
.sidebar-ind-sep {
  height: 1px;
  background: rgba(255,255,255,.08);
  margin: 4px 0;
}
.sidebar-ind-label {
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(255,255,255,.65);
}
.sidebar-ind-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.sidebar-ind-value {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.2px;
}
.sidebar-ind-date-v {
  font-size: 9px;
  color: rgba(255,255,255,.35);
  letter-spacing: .1px;
}
.sidebar.collapsed .sidebar-indicators { display: none; }

/* ===== FORMATO VACÍO ===== */
.btn-fv-toggle {
  background: #5a3e8c;
  color: #fff;
  border: 1.5px solid #7b5bbf;
  font-size: 11px;
  letter-spacing: .5px;
}
.btn-fv-toggle:hover { background: #7b5bbf; }
.btn-fv-toggle.fv-active {
  background: #3d2870;
  box-shadow: 0 0 0 2px #b39ddb inset;
}

.fv-table-wrapper { overflow-x: auto; }

table.fv-tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.fv-tabla thead th {
  background: #003D5C;
  color: #fff;
  padding: 6px 8px;
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}
table.fv-tabla tbody tr td {
  padding: 3px 5px;
  vertical-align: middle;
  border-bottom: 1px solid #f0f0f0;
}
table.fv-tabla tbody tr.fv-row-group td {
  background: #1a3d5c;
  color: #fff;
  padding: 5px 8px;
  font-weight: 700;
  font-size: 13px;
}
table.fv-tabla tbody tr.fv-row-subtotal td {
  background: #f0f4f8;
  font-weight: 700;
  font-size: 12px;
  color: #334;
  padding: 4px 8px;
  border-top: 1.5px solid #c0ccd8;
}
table.fv-tabla input {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 13px;
  background: #fff;
  box-sizing: border-box;
}
table.fv-tabla input:focus { outline: none; border-color: #003D5C; }
table.fv-tabla .fv-type-btn {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 700;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
table.fv-tabla .fv-type-btn.fv-btn-g { background: #1a3d5c; color: #fff; }
table.fv-tabla .fv-type-btn.fv-btn-s { background: #e8edf2; color: #334; }
table.fv-tabla .fv-del-btn {
  background: none;
  border: none;
  color: #c44;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 5px;
  border-radius: 3px;
}
table.fv-tabla .fv-del-btn:hover { background: #ffeaea; }
.fv-neto-cell { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* FDA libre */
table.fda-libre-tabla { width:100%; border-collapse:collapse; font-size:13px; }
table.fda-libre-tabla th {
  background:#003D5C; color:#fff; padding:5px 7px; font-size:11px; white-space:nowrap; text-align:right;
}
table.fda-libre-tabla th.fda-lib-desc { text-align:left; }
table.fda-libre-tabla td { padding:3px 5px; border-bottom:1px solid #f0f0f0; vertical-align:middle; }
table.fda-libre-tabla tr.fda-lib-group td {
  background:#1a3d5c; color:#fff; font-weight:700; padding:5px 8px;
}
table.fda-libre-tabla tr.fda-lib-subtotal td {
  background:#f0f4f8; font-weight:700; font-size:12px; color:#334; border-top:1.5px solid #c0ccd8; padding:4px 8px;
}
table.fda-libre-tabla input {
  width:100%; border:1px solid #ddd; border-radius:4px; padding:3px 5px;
  font-size:13px; box-sizing:border-box; text-align:right;
}
table.fda-libre-tabla input:focus { outline:none; border-color:#003D5C; }
