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

:root {
  --navy: #04293F;
  --navy-2: #0A3A57;
  --paper: #F6F4EF;
  --card: #FFFFFF;
  --orange: #FEA621;
  --orange-deep: #E68E0C;
  --line: #E1DCCC;
  --sky: #EAF4FB;
  --sky-deep: #2E7AAE;
  --green: #3C8A5A;
  --red: #D64545;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--paper);
  color: var(--navy);
}

.display { font-family: 'Quicksand', sans-serif; font-weight: 700; }
.mono { font-family: 'IBM Plex Mono', monospace; }

a { color: inherit; text-decoration: none; }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--navy);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--orange);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.brand-text { color: #fff; line-height: 1.1; }
.brand-text .b1 { font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: 15px; }
.brand-text .b2 { font-size: 12px; opacity: .75; }

.nav { display: flex; gap: 22px; }
.nav a { color: rgba(246,244,239,0.65); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.nav a.active, .nav a:hover { color: var(--orange); }

.user-badge {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--orange); color: var(--navy);
  font-family: 'IBM Plex Mono', monospace; font-weight: 600; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Campanita de notificaciones ---------- */
.bell-wrap { position: relative; }
.bell-btn {
  background: none; border: none; cursor: pointer; position: relative;
  color: rgba(246,244,239,0.75); font-size: 19px; display: flex; align-items: center; padding: 4px;
}
.bell-btn:hover { color: var(--orange); }
.bell-badge {
  position: absolute; top: -3px; right: -3px;
  background: var(--red); color: #fff;
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.bell-panel {
  display: none; position: absolute; top: 40px; right: 0; z-index: 90;
  width: 360px; max-height: 420px; overflow-y: auto;
  background: #fff; border-radius: 14px; box-shadow: 0 20px 40px -14px rgba(4,41,63,0.4);
}
.bell-panel.open { display: block; }
.bell-panel-head {
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: 13px; color: var(--navy);
}
.bell-item {
  padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--navy);
}
.bell-item:last-child { border-bottom: none; }
.bell-item-close { float: right; border: none; background: none; color: rgba(4,41,63,0.4); cursor: pointer; font-size: 12px; }
.bell-empty { padding: 20px 16px; text-align: center; font-size: 12px; color: rgba(4,41,63,0.5); }

/* ---------- Zona de pegar imágenes (Cotizaciones) ---------- */
.paste-zone {
  border: 2px dashed rgba(4,41,63,0.2); border-radius: 12px; padding: 18px;
  text-align: center; font-size: 12px; color: rgba(4,41,63,0.45); cursor: text;
  background: rgba(4,41,63,0.02); outline: none;
}
.paste-zone:focus { border-color: var(--orange); background: rgba(247,148,29,0.06); }
.paste-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.paste-preview img { width: 90px; height: 68px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.paste-preview .thumb-wrap { position: relative; }
.paste-preview .thumb-remove {
  position: absolute; top: -6px; right: -6px; background: rgba(4,41,63,0.75); color: #fff;
  border: none; border-radius: 50%; width: 18px; height: 18px; font-size: 10px; cursor: pointer; line-height: 1;
}

/* ---------- Layout ---------- */
.container { max-width: 1100px; margin: 0 auto; padding: 28px 20px; }
.page-title { font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: 26px; margin: 0 0 4px; }
.eyebrow {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--orange-deep); display: flex; align-items: center; gap: 6px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 18px;
}
.card h2 { font-family: 'Quicksand', sans-serif; font-size: 18px; font-weight: 700; margin: 2px 0 16px; color: var(--sky-deep); }

/* ---------- Hub con menú lateral (Proveedores / Clientes) ---------- */
.hub-shell { display: flex; gap: 24px; align-items: flex-start; }
.hub-sidebar { width: 220px; flex-shrink: 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 0; }
.hub-sidebar-title { padding: 10px 16px 6px; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: rgba(4,41,63,0.4); font-weight: 700; }
.hub-sidebar-item { display: block; padding: 9px 16px; font-size: 13px; color: var(--navy); text-decoration: none; border-left: 3px solid transparent; }
.hub-sidebar-item:hover { background: rgba(4,41,63,0.04); }
.hub-sidebar-item.active { background: rgba(254,166,33,0.12); border-left-color: var(--orange); font-weight: 700; color: var(--orange-deep); }
.hub-sidebar-item .badge-nuevo { font-size: 9px; color: var(--orange-deep); font-weight: 700; margin-left: 4px; }
.hub-content { flex: 1; min-width: 0; }
@media (max-width: 760px) {
  .hub-shell { flex-direction: column; }
  .hub-sidebar { width: 100%; display: flex; flex-wrap: wrap; padding: 8px; }
  .hub-sidebar-title { width: 100%; }
  .hub-sidebar-item { border-left: none; border-radius: 8px; }
}

/* ---------- Forms ---------- */
label.field-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: rgba(4,41,63,0.55); display: block; margin-bottom: 5px;
}
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], input[type=tel], select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  background: #fff;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(254,166,33,0.18);
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; border-radius: 10px; padding: 10px 18px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.btn-primary { background: var(--orange); color: var(--navy); }
.btn-primary:hover { background: var(--orange-deep); }
.btn-ghost { background: transparent; color: var(--navy); }
.btn-ghost:hover { background: rgba(4,41,63,0.06); }
.btn-danger { background: #fff; color: var(--red); border: 1px solid var(--red); }

/* ---------- Boarding pass card (expedientes) ---------- */
.pass {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: block;
  transition: transform .15s ease, box-shadow .15s ease;
}
.pass:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -16px rgba(4,41,63,0.35); }
.pass-head { padding: 16px 16px 10px; display: flex; justify-content: space-between; align-items: flex-start; }
.pass-id { font-family: 'IBM Plex Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: rgba(4,41,63,0.45); }
.pass-name { font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: 16px; margin-top: 2px; }
.pass-doc { font-size: 11px; color: rgba(4,41,63,0.5); }
.pass-meta { padding: 0 16px 12px; display: flex; gap: 14px; font-size: 12px; color: rgba(4,41,63,0.7); flex-wrap: wrap; }
.pass-meta span { display: flex; align-items: center; gap: 4px; }
.pass-perf { position: relative; border-top: 1.5px dashed var(--line); margin: 0; }
.pass-perf::before, .pass-perf::after {
  content: ''; position: absolute; top: -10px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--paper); border: 1px solid var(--line);
}
.pass-perf::before { left: -10px; }
.pass-perf::after { right: -10px; }
.pass-foot { padding: 14px 16px; background: rgba(246,244,239,0.5); display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.pass-amount-label { font-size: 10px; text-transform: uppercase; color: rgba(4,41,63,0.45); font-family: 'IBM Plex Mono', monospace; }
.pass-amount { font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: 17px; color: var(--navy-2); }

.stamp {
  border: 2px solid currentColor; border-radius: 8px; padding: 2px 8px;
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 600;
  text-transform: uppercase; transform: rotate(-6deg); display: inline-block;
}

.bar-wrap { flex: 1; min-width: 110px; }
.bar-label { display: flex; justify-content: space-between; font-size: 10px; margin-bottom: 4px; font-family: 'IBM Plex Mono', monospace; color: rgba(4,41,63,0.5); }
.bar-track { height: 6px; border-radius: 4px; background: #EDE6D3; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; }

/* ---------- Table-ish list ---------- */
.list-row {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; transition: background .12s ease, border-color .12s ease;
}
a.list-row:hover, .list-row:hover { background: var(--sky); border-color: var(--sky-deep); }
.avatar-circle {
  width: 36px; height: 36px; border-radius: 50%; background: #EDE6D3;
  display: flex; align-items: center; justify-content: center;
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 600; color: var(--navy-2);
}

.empty-box {
  text-align: center; padding: 24px; border-radius: 12px;
  background: var(--paper); color: rgba(4,41,63,0.45); font-size: 12px;
}

.stat {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  display: flex; gap: 12px; align-items: flex-start;
}
.stat-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--navy); display: flex; align-items: center; justify-content: center; color: var(--paper); flex-shrink: 0; }
.stat-value { font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: 24px; line-height: 1; }
.stat-label { font-size: 11px; color: rgba(4,41,63,0.55); margin-top: 4px; }

.alert {
  border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-bottom: 16px;
}
.alert-error { background: #FBEAEA; color: var(--red); border: 1px solid #F3C7C7; }
.alert-warning { background: #FFF6E5; color: var(--orange-deep); border: 1px solid #FFE2A8; }
.alert-success { background: #E9F5EC; color: var(--green); border: 1px solid #C6E6CE; }

/* ---------- Tablas simples ---------- */
.table-clean { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-clean th {
  text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
  color: rgba(4,41,63,0.5); font-weight: 600; padding: 6px 10px; border-bottom: 1px solid var(--line);
  transition: background .12s ease, color .12s ease;
}
.table-clean thead tr:hover th { background: var(--sky); color: var(--sky-deep); }
.table-clean td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.table-clean tbody tr { transition: background .12s ease; }
.table-clean tbody tr:hover { background: var(--sky); }
.table-clean tr:last-child td { border-bottom: none; }
.table-clean .num { text-align: right; font-family: 'IBM Plex Mono', monospace; }

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 100px;
  font-size: 11px; font-weight: 600; font-family: 'IBM Plex Mono', monospace;
}
.chip-orange { background: rgba(254,166,33,0.15); color: var(--orange-deep); }
.chip-navy { background: rgba(4,41,63,0.08); color: var(--navy); }
.chip-green { background: rgba(60,138,90,0.12); color: var(--green); }
.chip-red { background: rgba(214,69,69,0.12); color: var(--red); }

/* ---------- Autocomplete de búsqueda (cliente / responsable / prestador) ---------- */
.search-results {
  position: absolute; z-index: 30; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; width: 100%; margin-top: 4px; overflow: hidden;
  box-shadow: 0 14px 26px -16px rgba(4,41,63,0.35); max-height: 240px; overflow-y: auto;
}
.search-results .res-item { padding: 9px 12px; cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--line); }
.search-results .res-item:last-child { border-bottom: none; }
.search-results .res-item:hover { background: var(--paper); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(4,41,63,0.55);
  display: none; align-items: flex-start; justify-content: center;
  padding: 40px 16px; z-index: 100; overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff; border-radius: 16px; width: 100%; max-width: 560px;
  box-shadow: 0 30px 60px -20px rgba(4,41,63,0.5);
}
.modal-head {
  padding: 18px 22px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-head h2 { margin: 0; font-family: 'Quicksand', sans-serif; font-size: 16px; font-weight: 700; color: var(--red); }
.modal-close { border: none; background: none; font-size: 18px; cursor: pointer; color: rgba(4,41,63,0.4); }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.input-inline-btn { display: flex; gap: 8px; align-items: flex-end; }
.input-inline-btn > div { flex: 1; }

/* ---------- Filas de Medio de Cobro ya cargados ---------- */
.medio-row {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 10px; font-size: 13px;
}
.medio-row-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.medio-row-detail { color: rgba(4,41,63,0.6); font-size: 12px; margin-top: 4px; line-height: 1.5; }
.medio-row-remove { border: none; background: none; color: var(--red); cursor: pointer; font-size: 13px; flex-shrink: 0; }
.medio-row-conv { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 10px; }
.medio-row-conv label { font-size: 10px; text-transform: uppercase; color: rgba(4,41,63,0.45); display:block; margin-bottom:3px; font-family: 'IBM Plex Mono', monospace; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--navy); padding: 20px;
}
.login-card {
  background: #fff; border-radius: 18px; padding: 36px 32px; width: 100%; max-width: 380px;
}

/* ---------- Inputs numéricos sin flechas de incremento/decremento ---------- */
/* Se aplica globalmente a todos los campos type="number" (importes, cotizaciones, cuotas, etc.) */
input[type="number"] {
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
