* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
:root {
  --primary: #d4006b;
  --primary-dark: #b3005a;
  --primary-light: #fce4f1;
  --cyan: #00aeef;
  --cyan-dark: #0091c7;
  --yellow: #fc0;
  --green: #8abf1e;
  --green-dark: #6fa015;
  --success: #8abf1e;
  --warning: #e07b00;
  --danger: #dc2626;
  --bg: #f8f4f6;
  --surface: #fff;
  --border: #e8dde5;
  --text: #1a0a12;
  --text-muted: #7a5f6e;
  --sidebar-bg: #1a0a12;
  --sidebar-hover: #2e1020;
  --sidebar-border: #3a1828;
}
body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-family: Inter, system-ui, sans-serif;
}
.layout {
  min-height: 100vh;
  display: flex;
}
.sidebar {
  background: var(--sidebar-bg);
  color: #e2d6dc;
  z-index: 200;
  flex-direction: column;
  width: 240px;
  height: 100vh;
  transition: transform 0.25s;
  display: flex;
  position: fixed;
  overflow-y: auto;
}
.sidebar-logo {
  border-bottom: 1px solid var(--sidebar-border);
  background: linear-gradient(135deg, #2e1020 0%, #1a0a12 100%);
  padding: 22px 20px;
}
.sidebar-logo h1 {
  color: #fff;
  letter-spacing: -0.3px;
  font-size: 18px;
  font-weight: 800;
}
.sidebar-logo h1 span {
  color: var(--primary);
}
.sidebar-logo p {
  color: #9a7a88;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 3px;
  font-size: 10px;
}
.sidebar-nav {
  flex-direction: column;
  flex: 1;
  gap: 2px;
  padding: 12px 10px;
  display: flex;
}
.nav-section {
  color: #5a3848;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 12px 8px 4px;
  font-size: 10px;
  font-weight: 600;
}
.nav-item {
  cursor: pointer;
  color: #9a7a88;
  text-align: left;
  background: 0 0;
  border: none;
  border-radius: 8px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  transition: all 0.15s;
  display: flex;
}
.nav-item:hover {
  background: var(--sidebar-hover);
  color: #f0e0ea;
}
.nav-item.active {
  background: linear-gradient(135deg, var(--primary) 0%, #a0004f 100%);
  color: #fff;
  box-shadow: 0 3px 10px #d4006b66;
}
.nav-item .icon {
  text-align: center;
  width: 18px;
  font-size: 15px;
}
.nav-badge {
  background: var(--sidebar-border);
  color: #6a4858;
  border-radius: 10px;
  margin-left: auto;
  padding: 1px 7px;
  font-size: 11px;
}
.nav-item.active .nav-badge {
  color: #fff;
  background: #fff3;
}
.sidebar-overlay {
  z-index: 190;
  background: #1a0a1299;
  display: none;
  position: fixed;
  inset: 0;
}
.main {
  flex-direction: column;
  flex: 1;
  min-width: 0;
  margin-left: 240px;
  display: flex;
}
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  display: flex;
  position: sticky;
  top: 0;
}
.topbar h2 {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}
.topbar-actions {
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  display: flex;
}
.topbar:after {
  content: "";
  background: linear-gradient(
    90deg,
    var(--primary) 0%,
    var(--cyan) 40%,
    var(--yellow) 70%,
    var(--green) 100%
  );
  height: 2px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}
.menu-btn {
  cursor: pointer;
  color: var(--text);
  background: 0 0;
  border: none;
  flex-shrink: 0;
  padding: 4px;
  font-size: 20px;
  display: none;
}
.page {
  flex: 1;
  padding: 20px 24px;
}
.btn {
  cursor: pointer;
  white-space: nowrap;
  border: none;
  border-radius: 8px;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
  display: inline-flex;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #a0004f 100%);
  color: #fff;
  box-shadow: 0 2px 8px #d4006b4d;
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #8a0044 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px #d4006b66;
}
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg);
}
.btn-danger {
  color: var(--danger);
  background: #fee2e2;
}
.btn-danger:hover {
  background: #fecaca;
}
.btn-cyan {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--cyan-dark) 100%);
  color: #fff;
  box-shadow: 0 2px 8px #00aeef4d;
}
.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}
.btn-icon {
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-muted);
  background: 0 0;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
  transition: all 0.15s;
}
.btn-icon:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}
.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
  display: grid;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  border-radius: 12px;
  padding: 18px;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}
.stat-card:before {
  content: "";
  height: 3px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}
.stat-card:first-child:before {
  background: var(--primary);
}
.stat-card:nth-child(2):before {
  background: var(--cyan);
}
.stat-card:nth-child(3):before {
  background: var(--yellow);
}
.stat-card:nth-child(4):before {
  background: var(--green);
}
.stat-card:nth-child(5):before {
  background: var(--primary);
}
.stat-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px #d4006b1a;
}
.stat-icon {
  margin-bottom: 8px;
  font-size: 20px;
}
.stat-label {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
  font-weight: 600;
}
.stat-value {
  color: var(--text);
  margin-top: 4px;
  font-size: 26px;
  font-weight: 800;
}
.stat-sub {
  color: var(--text-muted);
  margin-top: 3px;
  font-size: 12px;
}
.table-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.table-header {
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  display: flex;
}
.table-header h3 {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}
.table-scroll {
  -webkit-overflow-scrolling: touch;
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 500px;
}
th {
  text-align: left;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--primary-light);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  padding: 9px 16px;
  font-size: 11px;
  font-weight: 700;
}
td {
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  font-size: 13px;
}
tr:last-child td {
  border-bottom: none;
}
tr:hover td {
  background: #fdf6fa;
}
.td-actions {
  gap: 6px;
  display: flex;
}
.badge {
  white-space: nowrap;
  border-radius: 20px;
  align-items: center;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
}
.badge-success {
  color: #567a0e;
  background: #eef7d6;
}
.badge-warning {
  color: #8a5a00;
  background: #fff4cc;
}
.badge-danger {
  color: #b91c1c;
  background: #fee2e2;
}
.badge-info {
  color: #006da0;
  background: #d6f1ff;
}
.badge-gray {
  color: #5a3848;
  background: #f0e8ec;
}
.badge-purple {
  color: #7c3aed;
  background: #f3e8ff;
}
.badge-pink {
  background: var(--primary-light);
  color: var(--primary);
}
.modal-overlay {
  z-index: 300;
  background: #1a0a1280;
  justify-content: center;
  align-items: center;
  padding: 16px;
  display: flex;
  position: fixed;
  inset: 0;
}
.modal {
  background: var(--surface);
  border-top: 3px solid var(--primary);
  border-radius: 14px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  padding: 26px;
  overflow-y: auto;
  box-shadow: 0 24px 64px #d4006b26;
}
.modal h3 {
  color: var(--text);
  margin-bottom: 20px;
  font-size: 17px;
  font-weight: 700;
}
.modal-footer {
  border-top: 1px solid var(--border);
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  display: flex;
}
.form-grid {
  gap: 14px;
  display: grid;
}
.form-group {
  flex-direction: column;
  gap: 5px;
  display: flex;
}
.form-group label {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
  font-weight: 600;
}
.form-group input,
.form-group select,
.form-group textarea {
  border: 1.5px solid var(--border);
  color: var(--text);
  background: var(--surface);
  border-radius: 8px;
  outline: none;
  width: 100%;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px #d4006b1f;
}
.form-row {
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  display: grid;
}
.search-box {
  position: relative;
}
.search-box input {
  border: 1.5px solid var(--border);
  background: var(--bg);
  border-radius: 8px;
  outline: none;
  width: 200px;
  padding: 7px 12px 7px 34px;
  font-size: 13px;
  transition: all 0.15s;
}
.search-box input:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px #d4006b1a;
}
.search-icon {
  color: var(--text-muted);
  font-size: 13px;
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
}
.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 52px 20px;
}
.empty-state .emoji {
  margin-bottom: 10px;
  font-size: 38px;
}
.empty-state p {
  margin-bottom: 14px;
  font-size: 13px;
}
.dashboard-grid {
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
  display: grid;
}
.avatar {
  background: linear-gradient(135deg, var(--primary), #a0004f);
  color: #fff;
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  width: 30px;
  height: 30px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
}
.client-cell {
  align-items: center;
  gap: 10px;
  display: flex;
}
.items-list {
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  display: flex;
}
.item-row {
  grid-template-columns: 1fr 70px 90px 32px;
  align-items: center;
  gap: 8px;
  display: grid;
}
.toast-container {
  z-index: 999;
  flex-direction: column;
  gap: 8px;
  display: flex;
  position: fixed;
  bottom: 22px;
  right: 22px;
}
.toast {
  background: var(--sidebar-bg);
  color: #fff;
  border-radius: 9px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 500;
  animation: 0.2s slide-in;
  box-shadow: 0 8px 24px #1a0a124d;
}
.toast.success {
  border-left: 3px solid var(--green);
}
.toast.error {
  border-left: 3px solid var(--danger);
}
@keyframes slide-in {
  0% {
    opacity: 0;
    transform: translate(110%);
  }
  to {
    opacity: 1;
    transform: translate(0);
  }
}
@media (width<=768px) {
  .sidebar {
    transform: translate(-100%);
  }
  .sidebar.open {
    transform: translate(0);
    box-shadow: 4px 0 24px #d4006b33;
  }
  .sidebar-overlay.open {
    display: block;
  }
  .main {
    margin-left: 0;
  }
  .menu-btn {
    display: block;
  }
  .topbar {
    padding: 12px 16px;
  }
  .topbar h2 {
    font-size: 16px;
  }
  .topbar-date {
    display: none;
  }
  .page {
    padding: 14px 16px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .stat-card {
    padding: 14px;
  }
  .stat-value {
    font-size: 22px;
  }
  .dashboard-grid,
  .form-row {
    grid-template-columns: 1fr;
  }
  .table-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .table-header .topbar-actions,
  .search-box input {
    width: 100%;
  }
  .modal {
    padding: 20px 16px;
  }
  .item-row {
    grid-template-columns: 1fr 55px 75px 28px;
    gap: 6px;
  }
  .toast-container {
    bottom: 14px;
    left: 14px;
    right: 14px;
  }
  .toast {
    font-size: 12px;
  }
}
@media (width<=400px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .btn {
    padding: 7px 12px;
    font-size: 12px;
  }
}
.dash-handle {
  z-index: 10;
  cursor: grab;
  color: var(--text-muted);
  opacity: 0;
  -webkit-user-select: none;
  user-select: none;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 18px;
  line-height: 1;
  transition:
    opacity 0.15s,
    color 0.15s,
    background 0.15s;
  position: absolute;
  top: 10px;
  right: 12px;
}
.dash-widget:hover .dash-handle {
  opacity: 0.5;
}
.dash-handle:hover {
  color: var(--primary);
  background: var(--primary-light);
  opacity: 1 !important;
}
.dash-handle:active {
  cursor: grabbing;
}

/* ════════════════════════════════════════════════════════════════
   GestionDTF v2 — estilos nuevos
   ════════════════════════════════════════════════════════════════ */
a.btn, a.btn-icon { text-decoration: none; display: inline-flex; align-items: center; }
.btn:disabled, .btn-icon:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }
.link { color: var(--text); text-decoration: none; border-bottom: 1px dashed var(--border); cursor: pointer; }
.link:hover { color: var(--primary); border-bottom-color: var(--primary); }
.hint { font-size: 11px; color: var(--text-muted); }
.hint code { background: var(--primary-light); color: var(--primary); padding: 1px 6px; border-radius: 4px; margin: 0 2px; font-size: 11px; }
.mini-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 10px; }
.unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--text-muted); font-weight: 600; pointer-events: none; }
.form-group input[type=number] { padding-right: 42px; }
.alert-error { background: #fee2e2; color: #b91c1c; padding: 8px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.spinner { width: 40px; height: 40px; border: 4px solid var(--border); border-top: 4px solid var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

/* Login */
.login { min-height: 100vh; display: flex; background: linear-gradient(135deg, #1A0A12 0%, #2E1020 50%, #0D1A2E 100%); }
.login-stripe { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 10; background: linear-gradient(90deg, #D4006B 0%, #00AEEF 35%, #FFCC00 65%, #8ABF1E 100%); }
.login-left { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; background: rgba(255,255,255,.03); }
.login-right { width: 100%; max-width: 440px; display: flex; align-items: center; justify-content: center; padding: 40px 32px; background: rgba(255,255,255,.04); border-left: 1px solid rgba(212,0,107,.15); }
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field label { font-size: 12px; font-weight: 600; color: #9A7A88; text-transform: uppercase; letter-spacing: .04em; }
.login-field input { padding: 10px 14px; border-radius: 9px; border: 1.5px solid #3A1828; background: rgba(255,255,255,.06); color: #fff; font-size: 14px; outline: none; font-family: inherit; transition: border-color .2s, box-shadow .2s; }
.login-field input:focus { border-color: #D4006B; box-shadow: 0 0 0 3px rgba(212,0,107,.2); }
.login-field input::placeholder { color: #5A3848; }
.login-field input:-webkit-autofill { -webkit-box-shadow: 0 0 0 30px #2E1020 inset !important; -webkit-text-fill-color: #fff !important; }
.login-eye { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 14px; }
.login-error { background: rgba(220,38,38,.15); color: #FCA5A5; padding: 10px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; border: 1px solid rgba(220,38,38,.3); }
.login-btn { margin-top: 4px; padding: 12px; border-radius: 9px; border: none; cursor: pointer; font-size: 14px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #D4006B 0%, #A0004F 100%); box-shadow: 0 4px 16px rgba(212,0,107,.4); }
.login-btn:disabled { opacity: .7; cursor: not-allowed; }
@media (max-width: 600px) { .login-left { display: none !important; } .login-right { max-width: none; border-left: none; } }

/* Dashboard */
.pill { padding: 5px 14px; border-radius: 20px; font-size: 13px; font-weight: 700; border: 1.5px solid var(--border); background: var(--surface); color: var(--text-muted); cursor: pointer; transition: all .15s; }
.pill.active { border-color: transparent; background: linear-gradient(135deg, var(--primary), #A0004F); color: #fff; box-shadow: 0 2px 8px rgba(212,0,107,.3); }
.dash-widget { position: relative; margin-bottom: 20px; border-radius: 12px; outline: 2px solid transparent; outline-offset: 3px; transition: opacity .15s, outline .1s; }
.dash-widget.dragging { opacity: .4; }
.dash-widget.drag-over { outline: 2px dashed var(--primary); }
.dashboard-grid { margin-top: 0; }
.stat-card:nth-child(6):before { background: var(--cyan); }
.stat-card:nth-child(7):before { background: var(--yellow); }
.stat-card:nth-child(8):before { background: var(--green); }
.stat-card.stat-money:before { background: var(--green); }
.stat-card.stat-cyan:before { background: var(--cyan); }
.stat-card.stat-warn:before { background: var(--warning); }
.stat-card.stat-warn .stat-value { color: var(--warning); }
.stat-value { font-variant-numeric: tabular-nums; }
.mini-avatar { width: 24px; height: 24px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.avisos-box { border-left: 4px solid var(--warning); }
.avisos-list { display: flex; flex-direction: column; }
.aviso-row { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.aviso-row:last-child { border-bottom: none; }
.nav-badge-warn { background: #3a2a10; color: #ffcc00; }
.nav-item.active .nav-badge-warn { background: #fff3; color: #fff; }

/* Tablas y badges */
.bar { background: var(--border); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; transition: width .3s; }
.ref-badge { font-family: monospace; font-weight: 800; font-size: 14px; color: var(--primary); background: var(--primary-light); padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
tr.row-warn td { background: #fff8e6; }
tr.row-warn:hover td { background: #fff1cc; }
.btn-icon-warn { border-color: var(--warning); background: #fff4cc; }
.accion-badge { border-radius: 4px; padding: 2px 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.filter-select { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border); font-size: 13px; background: var(--surface); color: var(--text); font-family: inherit; }
.check-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; cursor: pointer; background: var(--surface); white-space: nowrap; }
.check-pill input { accent-color: var(--primary); }
.btn-whatsapp { background: #25D366; color: #fff; box-shadow: 0 2px 8px rgba(37,211,102,.3); }
.btn-whatsapp:hover:not(:disabled) { background: #1ebe5a; }

/* Modales */
.box-bg { background: var(--bg); border-radius: 10px; padding: 14px; margin-bottom: 18px; }
.info-pink { background: var(--primary-light); border-radius: 8px; padding: 10px 14px; font-size: 13px; }
.form-box { border: 1px solid var(--border); border-radius: 10px; padding: 14px; background: #fdfafc; margin-bottom: 14px; }
.form-grid .form-box { margin-bottom: 0; display: grid; gap: 12px; }
.form-grid .form-box .mini-label { margin-bottom: 0; }
.check-line { display: inline-flex !important; align-items: center; gap: 8px; text-transform: none !important; letter-spacing: 0 !important; font-size: 13px !important; color: var(--text) !important; font-weight: 600; cursor: pointer; padding: 9px 0; white-space: nowrap; }
.check-line input { width: 18px !important; height: 18px; accent-color: var(--primary); }
.form-group input:disabled, .form-group select:disabled { background: var(--bg); color: var(--text-muted); }
.envios-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.envios-kpis > div { background: var(--bg); border-radius: 10px; padding: 12px; text-align: center; }
.envios-kpis span { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.envios-kpis strong { display: block; font-size: 24px; font-weight: 800; margin-top: 2px; }
.envios-kpis .ok { background: #e3f6fd; } .envios-kpis .ok strong { color: var(--cyan-dark); }
.envios-kpis .ko { background: #fee2e2; } .envios-kpis .ko strong { color: var(--danger); }
.envio-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.envio-form input:not([type=checkbox]) { border: 1.5px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; outline: none; }
.envio-form input:focus { border-color: var(--primary); }
.envio-form .check-line { padding: 0; }
.hist-resumen { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--text-muted); margin-top: 10px; }
.msg-preview { white-space: pre-line; background: #dcf8c6; border-radius: 10px 10px 10px 2px; padding: 12px 14px; font-size: 13px; line-height: 1.5; max-width: 460px; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* Ficha de cliente */
.ficha-header { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.ficha-contacto { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Ayuda */
.ayuda-hero { background: linear-gradient(135deg, #1A0A12, #2E1020); border-radius: 14px; padding: 28px 32px; margin-bottom: 28px; color: #fff; }
.ayuda-hero h2 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.ayuda-hero p { font-size: 13px; color: #9A7A88; line-height: 1.6; }
.ayuda-paso { display: flex; gap: 12px; margin-bottom: 10px; align-items: flex-start; }
.ayuda-paso p { font-size: 13px; line-height: 1.6; margin-top: 2px; }
.ayuda-num { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; background: linear-gradient(135deg, var(--primary), #A0004F); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; }
.ayuda-tip { background: var(--primary-light); border-left: 3px solid var(--primary); border-radius: 0 8px 8px 0; padding: 10px 14px; margin-bottom: 10px; font-size: 13px; line-height: 1.6; }

@media (max-width: 768px) {
  .envios-kpis { grid-template-columns: repeat(2, 1fr); }
  .aviso-row { padding: 12px 14px; }
  .ficha-header { padding: 16px; }
  .ayuda-hero { padding: 20px; }
  .table-header .topbar-actions > * { flex: 1 1 auto; }
}
.table-scroll .td-actions { gap: 4px; flex-wrap: nowrap; }
.table-scroll .td-actions .btn-icon { padding: 5px 7px; }
.table-scroll th, .table-scroll td { padding-left: 12px; padding-right: 12px; }
@media (max-width: 1340px) { .table-scroll th, .table-scroll td { padding-left: 9px; padding-right: 9px; } .table-scroll .td-actions .btn-icon { padding: 4px 6px; } }
