/* MUNDOMÓVIL · Control de Descuentos v5 · Paleta SeguimientoSim v2.1 */

:root {
  --bg: #1a1730;
  --bg-2: #221e3e;
  --bg-card: #2a2548;
  --bg-card-end: #221e3e;
  --bg-input: #1f1b3a;
  --bg-input-focus: rgba(148, 132, 215, 0.1);
  --purple: #7a65cd;
  --purple-2: #9484d7;
  --network: #402d8b;
  --home: #9484d7;
  --text: #f0edf8;
  --text-dim: #bfb8dc;
  --border: #3a3458;
  --border-2: #524a7a;
  --error: #e07090;
  --success: #4fbf8e;
  --warning: #e0b560;
  --info: #5fa5e8;
  --fs-h2: clamp(15px, 3vw, 18px);
  --fs-body: clamp(13px, 2.3vw, 14px);
  --fs-small: clamp(10px, 1.8vw, 12px);
  --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.35);
}
[data-theme="light"] {
  --bg: #f5f3fa;
  --bg-2: #ffffff;
  --bg-card: #ffffff;
  --bg-card-end: #f8f6fc;
  --bg-input: #f0edf8;
  --bg-input-focus: rgba(64, 45, 139, 0.06);
  --purple: #5a47b3;
  --purple-2: #402d8b;
  --network: #402d8b;
  --home: #402d8b;
  --text: #1a1530;
  --text-dim: #6b6488;
  --border: #dad3ec;
  --border-2: #b8aee0;
  --error: #d6446a;
  --success: #2f9d6f;
  --warning: #c98a2a;
  --info: #3d7fb8;
  --shadow-card: 0 8px 28px rgba(64, 45, 139, 0.1);
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
html,
body {
  min-height: 100dvh;
}
body {
  font-family: "MADE TOMMY", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  transition:
    background 0.3s,
    color 0.3s;
}
body.is-login::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(95, 75, 139, 0.18),
      transparent 50%
    ),
    radial-gradient(circle at 80% 80%, rgba(64, 45, 139, 0.15), transparent 50%);
}
[data-theme="light"] body.is-login::before {
  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(95, 75, 139, 0.08),
      transparent 50%
    ),
    radial-gradient(circle at 80% 80%, rgba(64, 45, 139, 0.06), transparent 50%);
}
.view {
  display: none;
  flex: 1;
  flex-direction: column;
}
.view.active {
  display: flex;
}

/* TOPBAR */
.topbar {
  background: var(--purple);
  padding: 10px 16px;
  text-align: center;
  font-size: var(--fs-small);
  color: #fff;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* LOGIN HEADER */
.login-header {
  background: linear-gradient(
    135deg,
    var(--bg-2) 0%,
    rgba(95, 75, 139, 0.12) 50%,
    var(--bg-2) 100%
  );
  border-bottom: 1px solid var(--border-2);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
}
.login-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(95, 75, 139, 0.07),
    transparent
  );
  pointer-events: none;
}
.login-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--purple),
    var(--home),
    var(--purple),
    transparent
  );
}
.login-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  gap: 20px;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
}
.login-header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.login-header-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(95, 75, 139, 0.12);
  border: 1px solid var(--border-2);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: var(--fs-small);
  color: var(--text-dim);
  font-weight: 600;
}
.lock-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 8px var(--warning);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

/* NAVBAR */
.navbar {
  background: linear-gradient(180deg, var(--bg), transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 12px;
  flex-wrap: wrap;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: 1;
}
.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--purple), var(--network));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(95, 75, 139, 0.4);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.brand-logo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 30% 20%,
    rgba(255, 255, 255, 0.25),
    transparent 60%
  );
  pointer-events: none;
}
.brand-logo svg {
  width: 28px;
  height: 28px;
  fill: #fff;
  position: relative;
  z-index: 1;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-text .brand-main {
  font-size: clamp(16px, 3.5vw, 20px);
  font-weight: 700;
  letter-spacing: -0.3px;
  white-space: nowrap;
}
.brand-text .brand-main span {
  background: linear-gradient(90deg, var(--home), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-text .brand-sub {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  margin-top: 3px;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.last-update {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 4px 8px;
  background: rgba(95, 75, 139, 0.08);
  border-radius: 6px;
  white-space: nowrap;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 12px;
  border-right: 1px solid var(--border);
}
.user-avatar {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--purple), var(--network));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(95, 75, 139, 0.3);
}
.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.user-name {
  font-size: 15px;
  font-weight: 600;
}
.user-role {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.btn-logout {
  min-height: 40px;
  padding: 9px 14px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  font-family: "MADE TOMMY", sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.25s;
  white-space: nowrap;
}
.btn-logout:hover {
  border-color: var(--error);
  color: var(--error);
}
.btn-export,
.btn-reload {
  min-height: 40px;
  padding: 9px 12px;
  background: rgba(95, 75, 139, 0.15);
  border: 1px solid var(--border-2);
  color: var(--home);
  border-radius: 8px;
  font-family: "MADE TOMMY", sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  white-space: nowrap;
}
.btn-export:hover,
.btn-reload:hover {
  background: rgba(95, 75, 139, 0.25);
  transform: translateY(-1px);
}
.btn-reload {
  font-size: 16px;
  padding: 9px 10px;
}
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s;
  font-size: 18px;
  color: var(--text-dim);
}
.theme-toggle:hover {
  border-color: var(--home);
  color: var(--home);
}

/* LOGIN */
.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 6vw, 60px) clamp(16px, 4vw, 24px);
  position: relative;
  z-index: 1;
  width: 100%;
}
.login-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, var(--bg-card), var(--bg-card-end));
  border: 1px solid var(--border-2);
  border-radius: 24px;
  padding: clamp(32px, 7vw, 52px) clamp(24px, 5vw, 44px);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--purple),
    var(--home),
    transparent
  );
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(95, 75, 139, 0.18);
  border: 1px solid var(--border-2);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: var(--fs-small);
  color: var(--home);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
  margin-bottom: 20px;
}
.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
h1 {
  font-size: clamp(24px, 5vw, 34px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
h1 span {
  background: linear-gradient(90deg, var(--home), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitle {
  color: var(--text-dim);
  font-size: var(--fs-body);
  margin-bottom: 28px;
  line-height: 1.5;
}
.footer-note {
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}
.footer-note a {
  color: var(--home);
  text-decoration: none;
}

/* FIELDS */
.field {
  margin-bottom: 18px;
}
.field label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}
.field label .req {
  color: var(--error);
  margin-left: 2px;
}
.field label .opt {
  color: var(--text-dim);
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: "MADE TOMMY", sans-serif;
  font-size: 16px;
  transition: all 0.25s;
  -webkit-appearance: none;
  appearance: none;
}
.field textarea {
  resize: vertical;
  min-height: 60px;
  line-height: 1.5;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--purple);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(95, 75, 139, 0.15);
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-dim);
  opacity: 0.5;
}
.field select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239484D7' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.field select option {
  background: var(--bg-2);
  color: var(--text);
}
.field-hint {
  font-size: 11px;
  margin-top: 4px;
  font-weight: 600;
  min-height: 16px;
}
.field-hint.valid {
  color: var(--success);
}
.field-hint.invalid {
  color: var(--error);
}
.field-hint.neutral {
  color: var(--text-dim);
}
.pw-wrap {
  position: relative;
}
.pw-wrap input {
  padding-right: 48px;
}
.pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}
.field.field-error input,
.field.field-error select,
.field.field-error textarea {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 3px rgba(255, 92, 92, 0.2) !important;
  animation: fieldShake 0.4s ease;
}
.field.field-error label {
  color: var(--error);
}
.field-error-msg {
  display: none;
  font-size: 11px;
  color: var(--error);
  margin-top: 4px;
  font-weight: 600;
}
.field.field-error .field-error-msg {
  display: block;
}
@keyframes fieldShake {
  0%,
  100% {
    transform: translateX(0);
  }
  15% {
    transform: translateX(-6px);
  }
  30% {
    transform: translateX(6px);
  }
  45% {
    transform: translateX(-4px);
  }
  60% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-2px);
  }
  90% {
    transform: translateX(2px);
  }
}

/* BUTTONS */
.btn-primary {
  width: 100%;
  min-height: 52px;
  padding: 15px;
  background: linear-gradient(135deg, var(--purple), var(--network));
  border: none;
  border-radius: 12px;
  color: white;
  font-family: "MADE TOMMY", sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 8px;
  box-shadow: 0 4px 20px rgba(95, 75, 139, 0.3);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(95, 75, 139, 0.5);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-finish {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-family: "MADE TOMMY", sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  text-transform: uppercase;
  min-height: 40px;
}
.btn-finish.danger {
  background: rgba(255, 92, 92, 0.15);
  color: var(--error);
  border: 1px solid rgba(255, 92, 92, 0.3);
}
.btn-finish.danger:hover {
  background: rgba(255, 92, 92, 0.25);
}
.btn-finish.secondary {
  background: rgba(95, 75, 139, 0.12);
  color: var(--home);
  border: 1px solid var(--border-2);
}
.btn-finish.secondary:hover {
  background: rgba(95, 75, 139, 0.22);
}
.btn-edit {
  padding: 6px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-family: "MADE TOMMY", sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-edit:hover {
  border-color: var(--home);
  color: var(--home);
  background: rgba(95, 75, 139, 0.1);
}
.btn-clear-filters {
  height: 42px;
  padding: 0 16px;
  background: rgba(255, 92, 92, 0.1);
  border: 1px solid rgba(255, 92, 92, 0.25);
  border-radius: 9px;
  color: var(--error);
  font-family: "MADE TOMMY", sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-clear-filters:hover {
  background: rgba(255, 92, 92, 0.2);
}
.filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--error);
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
}
.btn-fullscreen {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-fullscreen:hover {
  border-color: var(--home);
  color: var(--home);
}
.card-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* LOADING */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.loading-overlay.visible {
  display: flex;
}
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--home);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.loading-text {
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 600;
}

/* TOAST */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: "MADE TOMMY", sans-serif;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 420px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: toastIn 0.35s ease;
  position: relative;
  overflow: hidden;
}
.toast::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  animation: toastTimer 4s linear forwards;
}
.toast.success {
  background: linear-gradient(135deg, #059669, #10b981);
}
.toast.error {
  background: linear-gradient(135deg, #dc2626, #ef4444);
}
.toast.warning {
  background: linear-gradient(135deg, #d97706, #f59e0b);
}
.toast.info {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
}
.toast.out {
  animation: toastOut 0.3s ease forwards;
}
@keyframes toastIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes toastOut {
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}
@keyframes toastTimer {
  from {
    width: 100%;
  }
  to {
    width: 0;
  }
}
.msg {
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 13px;
  display: none;
  line-height: 1.5;
}
.msg.error {
  display: block;
  background: rgba(255, 92, 92, 0.12);
  border: 1px solid rgba(255, 92, 92, 0.3);
  color: var(--error);
}
.msg.success {
  display: block;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: var(--success);
}
.msg.warning {
  display: block;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--warning);
}

main.dashboard-main {
  flex: 1;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 32px) clamp(40px, 6vw, 60px);
  position: relative;
}

/* STATS */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: clamp(14px, 3vw, 20px);
  background: linear-gradient(180deg, var(--bg-card), var(--bg-card-end));
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: all 0.3s;
}
.stat:hover {
  border-color: var(--border-2);
  transform: translateY(-2px);
}
.stat-icon {
  font-size: 22px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(95, 75, 139, 0.1);
  border-radius: 10px;
  flex-shrink: 0;
}
.stat-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.stat-label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
}
.stat-value {
  font-size: clamp(22px, 4.5vw, 30px);
  font-weight: 700;
  line-height: 1;
}
.stat-value.installed {
  color: var(--success);
}
.stat-value.not-installed-val {
  color: var(--error);
}
.stat-value.active-val {
  color: var(--warning);
}
.stat-value.importe-val {
  color: var(--info);
  font-size: clamp(16px, 3vw, 22px);
}
.pulse-icon {
  animation: pulse-icon 1.5s infinite;
}
@keyframes pulse-icon {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* STAT PROGRESS BARS */
.stat-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-input);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.stat-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  width: 0;
}
.stat-bar-fill.success-bar {
  background: var(--success);
}
.stat-bar-fill.warning-bar {
  background: var(--warning);
}
.stat-bar-fill.error-bar {
  background: var(--error);
}

/* STAGGERED ANIMATION */
.stat.anim-in {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeSlideIn 0.4s ease forwards;
}
.stat.anim-in:nth-child(1) {
  animation-delay: 0s;
}
.stat.anim-in:nth-child(2) {
  animation-delay: 0.05s;
}
.stat.anim-in:nth-child(3) {
  animation-delay: 0.1s;
}
.stat.anim-in:nth-child(4) {
  animation-delay: 0.15s;
}
.stat.anim-in:nth-child(5) {
  animation-delay: 0.2s;
}
.stat.anim-in:nth-child(6) {
  animation-delay: 0.25s;
}
@keyframes fadeSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ORIGIN SUMMARY */
.origin-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 24px;
}
.origin-summary:empty {
  display: none;
}
.origin-summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.origin-summary-label {
  display: flex;
  align-items: center;
  gap: 6px;
}
.origin-summary-values {
  display: flex;
  gap: 10px;
}
.origin-summary-count {
  color: var(--text-dim);
}
.origin-summary-amount {
  color: var(--info);
}

/* SHORTCUTS HELP */
.shortcuts-help {
  font-size: 11px;
  color: var(--text-dim);
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  letter-spacing: 0.3px;
}
.shortcuts-help strong {
  color: var(--home);
}

/* QUICK STATS CARD */
.quick-stats-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.qs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.qs-row:last-child {
  border-bottom: none;
}
.qs-label {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
}
.qs-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.qs-value.qs-highlight {
  color: var(--success);
}

/* LAYOUT */
.layout-two {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: clamp(16px, 2.5vw, 24px);
}
.col-left,
.col-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.card {
  background: linear-gradient(180deg, var(--bg-card), var(--bg-card-end));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: clamp(20px, 4vw, 28px);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--purple),
    var(--home),
    transparent
  );
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.card h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
}
.card-badge {
  font-size: 11px;
  color: var(--home);
  background: rgba(95, 75, 139, 0.15);
  padding: 4px 10px;
  border-radius: 100px;
  font-weight: 600;
}

/* FULLSCREEN TABLE */
.card.fullscreen {
  position: fixed;
  inset: 0;
  z-index: 200;
  border-radius: 0;
  max-width: none;
  overflow-y: auto;
  padding: 20px 28px;
}
.card.fullscreen .table-wrap {
  margin: 0;
  padding: 0;
}

/* BULK ACTIONS */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(95, 75, 139, 0.1);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  animation: fadeSlideIn 0.3s ease;
}
.bulk-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--home);
  margin-right: 4px;
}
.bulk-btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-family: "MADE TOMMY", sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}
.bulk-btn.success {
  background: rgba(74, 222, 128, 0.15);
  color: var(--success);
  border-color: rgba(74, 222, 128, 0.3);
}
.bulk-btn.warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.3);
}
.bulk-btn.danger {
  background: rgba(255, 92, 92, 0.15);
  color: var(--error);
  border-color: rgba(255, 92, 92, 0.3);
}
.bulk-btn.outline {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--border);
}
.bulk-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.15);
}

/* DATE PRESETS */
.date-presets {
  display: flex;
  gap: 4px;
}
.date-preset-btn {
  padding: 6px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-family: "MADE TOMMY", sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.date-preset-btn:hover {
  border-color: var(--home);
  color: var(--home);
}

/* FILTERS */
.filters-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.date-filters {
  margin-bottom: 16px;
}
.date-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.date-filter-group label {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.date-filter-group input[type="date"] {
  height: 42px;
  padding: 0 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-family: "MADE TOMMY", sans-serif;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.25s;
}
.date-filter-group input[type="date"]:focus {
  border-color: var(--purple);
  outline: none;
  box-shadow: 0 0 0 3px rgba(95, 75, 139, 0.15);
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0 14px;
  height: 42px;
  flex: 1;
  min-width: 180px;
  transition: border-color 0.25s;
}
.search-box:focus-within {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(95, 75, 139, 0.15);
}
.search-icon {
  font-size: 14px;
  opacity: 0.5;
}
.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: "MADE TOMMY", sans-serif;
  font-size: 14px;
  flex: 1;
  min-width: 0;
}
.search-box input::placeholder {
  color: var(--text-dim);
  opacity: 0.5;
}
.filter-select {
  height: 42px;
  padding: 0 36px 0 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-family: "MADE TOMMY", sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239484D7' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.filter-select:focus {
  border-color: var(--purple);
  outline: none;
  box-shadow: 0 0 0 3px rgba(95, 75, 139, 0.15);
}
.filter-select option {
  background: var(--bg-2);
  color: var(--text);
}

/* TABLE */
.table-wrap {
  margin: 0 calc(-1 * clamp(20px, 4vw, 28px)) 0;
  padding: 0 clamp(20px, 4vw, 28px);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: auto;
  min-width: 720px;
}
thead th {
  text-align: left;
  padding: 10px 10px;
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
thead th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}
thead th.sortable:hover {
  color: var(--home);
}
thead th.sortable.active {
  color: var(--home);
}
.sort-arrow {
  font-size: 10px;
  margin-left: 2px;
  opacity: 0.4;
}
thead th.sortable.active .sort-arrow {
  opacity: 1;
}
.th-check {
  width: 36px;
  text-align: center;
}
.th-check input[type="checkbox"],
.td-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--purple);
  cursor: pointer;
}
.td-check {
  width: 36px;
  text-align: center;
}
tbody td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td {
  border-bottom: none;
}
tbody tr {
  transition: background 0.2s;
}
tbody tr:hover {
  background: rgba(95, 75, 139, 0.05);
}
tbody tr.selected {
  background: rgba(95, 75, 139, 0.12);
}
tbody td code {
  font-size: 12px;
  background: rgba(95, 75, 139, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--home);
}
td code.copyable {
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
td code.copyable:hover {
  background: rgba(95, 75, 139, 0.25);
}
td code.copyable::after {
  content: "📋";
  position: absolute;
  right: -18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  opacity: 0;
  transition: opacity 0.2s;
}
td code.copyable:hover::after {
  opacity: 0.6;
}
.date-cell {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  white-space: nowrap;
}
.date-relative {
  font-size: 9px;
  color: var(--text-dim);
  opacity: 0.7;
  display: block;
  margin-top: 1px;
}
.obs-cell {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
  font-size: 11px;
  cursor: help;
}
.registrado-cell {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  white-space: nowrap;
}
.pct-cell {
  font-size: 11px;
  color: var(--home);
  font-weight: 600;
  white-space: nowrap;
}
.calc-cell {
  font-size: 12px;
  color: var(--info);
  font-weight: 700;
  white-space: nowrap;
}
.calc-cell.empty {
  color: var(--text-dim);
  font-weight: 600;
  opacity: 0.6;
}
.card-pct {
  font-size: 13px;
  color: var(--home);
  font-weight: 600;
}
.card-calc {
  font-size: 13px;
  color: var(--info);
  font-weight: 700;
  margin-left: 4px;
}
/* Campo calculado de solo-lectura en formulario/modal */
.field-calc {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 13px 14px;
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 9px;
  min-height: 49px;
}
.field-calc .field-calc-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--info);
  line-height: 1;
}
.field-calc .field-calc-formula {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
}
.field-calc.empty .field-calc-value {
  color: var(--text-dim);
  opacity: 0.5;
}
tbody tr.row-highlight {
  animation: rowGlow 2s ease;
}
@keyframes rowGlow {
  0% {
    background: rgba(95, 75, 139, 0.3);
  }
  100% {
    background: transparent;
  }
}

/* INLINE STATE PILL (clickable) */
.pill-clickable {
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.pill-clickable:hover {
  filter: brightness(1.3);
  transform: scale(1.05);
}
.pill-clickable::after {
  content: "⟳";
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  opacity: 0;
  transition: opacity 0.2s;
}
.pill-clickable:hover::after {
  opacity: 0.6;
}

/* TOOLTIP POPUP */
.tooltip-popup {
  position: fixed;
  z-index: 8000;
  max-width: 320px;
  padding: 12px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  white-space: pre-wrap;
  word-break: break-word;
}
.tooltip-popup.visible {
  opacity: 1;
}

/* PAGINATION */
.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0 clamp(20px, 4vw, 28px);
  flex-wrap: wrap;
}
.pagination-info {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
}
.pagination-size {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pagination-size label {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pagination-size select {
  height: 32px;
  padding: 0 28px 0 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: "MADE TOMMY", sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%239484D7' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.pagination-size select option {
  background: var(--bg-2);
  color: var(--text);
}
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pagination:empty {
  display: none;
}
.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-family: "MADE TOMMY", sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-btn:hover {
  border-color: var(--home);
  color: var(--home);
}
.page-btn.active {
  background: rgba(95, 75, 139, 0.2);
  border-color: var(--home);
  color: var(--home);
}
.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.page-info {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
  padding: 0 4px;
}

/* PILLS */
.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.pill.aplicado {
  background: rgba(74, 222, 128, 0.15);
  color: var(--success);
}
.pill.pendiente {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}
.pill.rechazado {
  background: rgba(255, 92, 92, 0.15);
  color: var(--error);
}
.origen-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.origen-tag.avatel {
  background: rgba(56, 189, 248, 0.12);
  color: var(--info);
}
.origen-tag.instalacion {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
}
.origen-tag.compensacion {
  background: rgba(148, 132, 215, 0.15);
  color: var(--home);
}
.origen-tag.comercial {
  background: rgba(236, 72, 153, 0.12);
  color: #ec4899;
}

/* MOBILE CARDS */
.descuento-cards {
  display: none;
  flex-direction: column;
  gap: 10px;
}
.descuento-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  transition: border-color 0.2s;
}
.descuento-card:active {
  border-color: var(--border-2);
}
.descuento-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 4px;
}
.descuento-card-client {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
}
.descuento-card-date {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 8px;
}
.descuento-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.descuento-card-code {
  font-size: 11px;
  font-family: monospace;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
  background: rgba(95, 75, 139, 0.12);
  color: var(--home);
}
.descuento-card-importe {
  font-size: 18px;
  font-weight: 700;
  color: var(--info);
  margin-bottom: 8px;
}
.descuento-card-obs {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
  margin-bottom: 8px;
}
.descuento-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.descuento-card-by {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* MODAL */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open {
  display: flex;
}
.modal-card {
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--bg-card), var(--bg-card-end));
  border: 1px solid var(--border-2);
  border-radius: 20px;
  padding: clamp(24px, 5vw, 36px);
  position: relative;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.modal-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--home), transparent);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
}
.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}
.modal-close:hover {
  border-color: var(--error);
  color: var(--error);
}
.modal-meta {
  background: rgba(95, 75, 139, 0.08);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.modal-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}
.modal-meta-item span {
  color: var(--text);
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.modal-actions .btn-primary {
  flex: 1;
}
.modal-delete {
  flex: 0 0 auto !important;
  width: auto !important;
  min-height: 52px;
  padding: 15px 16px;
}

/* CONFIRM */
.confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.confirm-overlay.open {
  display: flex;
}
.confirm-card {
  background: linear-gradient(180deg, var(--bg-card), var(--bg-card-end));
  border: 1px solid var(--border-2);
  border-radius: 20px;
  padding: 32px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.confirm-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.confirm-text {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}
.confirm-sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 24px;
  line-height: 1.5;
}
.confirm-btns {
  display: flex;
  gap: 10px;
}
.confirm-btns button {
  flex: 1;
  padding: 14px;
  border-radius: 10px;
  font-family: "MADE TOMMY", sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
.confirm-cancel {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border) !important;
}
.confirm-cancel:hover {
  border-color: var(--text-dim) !important;
}
.confirm-ok {
  background: linear-gradient(135deg, var(--error), #dc2626);
  color: white;
}
.confirm-ok:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}
.empty-state,
.no-results-state {
  text-align: center;
  padding: 50px 16px;
  color: var(--text-dim);
}
.empty-state .icon,
.no-results-state .icon {
  font-size: 42px;
  margin-bottom: 10px;
  opacity: 0.4;
}
.empty-state p,
.no-results-state p {
  font-size: 14px;
  line-height: 1.5;
}
.empty-hint {
  font-size: 12px;
  color: var(--text-dim);
  opacity: 0.6;
  margin-top: 4px;
}

/* PRINT STYLES */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .topbar,
  .navbar,
  .col-left,
  .toast-container,
  .confirm-overlay,
  .modal-overlay,
  .loading-overlay,
  .tooltip-popup,
  .filters-bar,
  .date-filters,
  .pagination-wrap,
  .btn-edit,
  .th-check,
  .td-check,
  .bulk-bar,
  .origin-summary,
  .shortcuts-help,
  .empty-state,
  .no-results-state,
  .card-header-actions {
    display: none !important;
  }
  .layout-two {
    grid-template-columns: 1fr !important;
  }
  .card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    padding: 10px !important;
  }
  .card::before {
    display: none !important;
  }
  .stats {
    gap: 8px !important;
  }
  .stat {
    border: 1px solid #ccc !important;
  }
  table {
    display: table !important;
  }
  .descuento-cards {
    display: none !important;
  }
  .table-wrap {
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  tbody td,
  thead th {
    padding: 6px 8px !important;
    font-size: 11px !important;
  }
  .pill,
  .origen-tag {
    border: 1px solid #999 !important;
  }
  .calc-cell {
    color: #000 !important;
  }
}

/* RESPONSIVE */
@media (max-width: 1100px) {
  .layout-two {
    grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  }
}
@media (max-width: 960px) {
  .layout-two {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 768px) {
  .navbar {
    padding: 16px 20px;
  }
  .user-info {
    border-right: none;
    padding-right: 0;
  }
  .user-meta {
    display: none;
  }
  .last-update {
    display: none;
  }
  table {
    display: none;
  }
  .descuento-cards {
    display: flex;
  }
  .table-wrap {
    margin: 0;
    padding: 0;
  }
  .toast {
    min-width: auto;
    max-width: calc(100vw - 40px);
  }
  .btn-export {
    font-size: 11px;
    padding: 8px 10px;
  }
  .pagination-wrap {
    display: none;
  }
  .shortcuts-help {
    display: none;
  }
  .bulk-bar {
    display: none !important;
  }
  .th-check,
  .td-check {
    display: none;
  }
  .quick-stats-card {
    order: -1;
  }
  /* Modal en pantallas medianas/pequeñas */
  .modal-overlay {
    padding: 12px;
    align-items: flex-end;
  }
  .modal-card {
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
  }
  .modal-actions {
    flex-direction: column;
  }
  .modal-actions .btn-primary,
  .modal-delete {
    width: 100% !important;
    flex: 1 1 100% !important;
  }
  .modal-delete {
    min-height: 48px;
  }
}
@media (max-width: 640px) {
  .login-header-inner {
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
    text-align: center;
  }
  .login-header-brand {
    justify-content: center;
  }
  .login-header-badge {
    font-size: 11px;
    padding: 7px 14px;
  }
  .filters-bar {
    flex-direction: column;
  }
  .search-box,
  .filter-select,
  .btn-clear-filters {
    width: 100%;
  }
  .date-filters {
    flex-direction: column;
    align-items: stretch;
  }
  .date-filter-group {
    width: 100%;
  }
  .date-filter-group input[type="date"] {
    flex: 1;
  }
  .date-presets {
    width: 100%;
  }
  .date-preset-btn {
    flex: 1;
  }
  .card-header {
    align-items: flex-start;
  }
}
@media (max-width: 480px) {
  .topbar {
    font-size: 11px;
    padding: 9px 14px;
  }
  .navbar {
    padding: 12px 14px;
    gap: 10px;
    flex-direction: column;
    align-items: stretch;
  }
  .nav-left {
    flex: none;
    width: 100%;
  }
  .nav-right {
    gap: 6px;
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .user-info {
    margin-left: auto;
  }
  .brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }
  .brand-logo svg {
    width: 22px;
    height: 22px;
  }
  .brand-text .brand-main {
    font-size: 15px;
  }
  .brand-text .brand-sub {
    display: none;
  }
  .btn-logout {
    padding: 8px 12px;
    font-size: 12px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat {
    padding: 14px;
    gap: 10px;
  }
  .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
  .origin-summary {
    grid-template-columns: 1fr;
  }
  .descuento-card-importe {
    font-size: 16px;
  }
  .modal-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}
@media (max-width: 380px) {
  .navbar {
    padding: 10px 12px;
  }
  .brand-text .brand-main {
    font-size: 13px;
  }
  main.dashboard-main {
    padding: 18px 12px 30px;
  }
  .card {
    padding: 16px;
  }
  .stats {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .user-avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
}