:root {
  --bg: #08112f;
  --bg-soft: rgba(8, 17, 47, 0.72);
  --card: rgba(255,255,255,0.94);
  --card-strong: #ffffff;
  --text: #1f2937;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --border: rgba(148, 163, 184, 0.24);
  --success-bg: #ecfdf5;
  --success-text: #065f46;
  --error-bg: #fef2f2;
  --error-text: #991b1b;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f3f4f6;
  color: var(--text);
}

h1, h2, h3, p { margin-top: 0; }

.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(180deg, rgba(4, 9, 31, 0.82), rgba(4, 9, 31, 0.94)),
    url('/images/spark-nexus-background.png') center/cover fixed no-repeat;
}

.dashboard-body {
  min-height: 100vh;
  position: relative;
  background:
    linear-gradient(180deg, rgba(4, 9, 31, 0.86), rgba(4, 9, 31, 0.96)),
    url('/images/spark-nexus-background.png') center/cover fixed no-repeat;
}

.dashboard-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.18), transparent 34%);
}

.auth-card, .card {
  background: var(--card);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.18);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
}

.glass-panel {
  background: rgba(7, 15, 40, 0.7);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 22px 32px;
  color: white;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar h1 {
  font-size: 32px;
  margin-bottom: 6px;
}

.topbar p,
.welcome-text {
  color: rgba(255,255,255,0.84);
  margin: 0;
}

.topbar-create {
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.25);
}

.container {
  max-width: 1340px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.dashboard-container {
  position: relative;
  z-index: 1;
}

.card {
  padding: 24px;
}

.create-panel {
  overflow: hidden;
  transition: max-height 0.28s ease, opacity 0.22s ease, transform 0.22s ease, padding 0.22s ease, margin-bottom 0.22s ease;
  max-height: 1000px;
  opacity: 1;
  transform: translateY(0);
  margin-bottom: 24px;
}

.create-panel.collapsed {
  max-height: 0;
  opacity: 0;
  transform: translateY(-10px);
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: 0;
  border-width: 0;
}

.create-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.create-panel-header p {
  color: var(--muted);
  margin-bottom: 0;
}

.create-form-grid {
  display: grid;
  grid-template-columns: 1.3fr 1.5fr 0.8fr;
  gap: 16px;
  align-items: end;
}

.create-submit-wrap {
  display: flex;
  align-items: end;
}

.users-card {
  background: rgba(255,255,255,0.96);
}

.users-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.users-card-header p {
  color: var(--muted);
  margin-bottom: 0;
}

.users-card-header input {
  max-width: 320px;
}

.users-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(240px, 1fr) minmax(360px, 1.3fr);
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.9);
}

.user-main-info h3 {
  margin-bottom: 8px;
}

.user-main-info p {
  margin: 5px 0;
  color: var(--muted);
}

.user-status-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-pill,
.time-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  width: fit-content;
}

.status-active {
  background: #dcfce7;
  color: var(--green);
}

.status-blocked {
  background: #fee2e2;
  color: var(--red);
}

.status-expired {
  background: #fef3c7;
  color: var(--amber);
}

.time-pill {
  background: #eff6ff;
  color: #1d4ed8;
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

.mini-action-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.mini-action-form input {
  width: 100px;
}

label {
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
  display: block;
  margin-bottom: 8px;
}

input,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  font-size: 14px;
  background: rgba(255,255,255,0.96);
}

textarea {
  min-height: 148px;
  resize: vertical;
}

button {
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  background: var(--primary);
  color: white;
  transition: transform .15s ease, background .18s ease, opacity .18s ease;
}

button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

button.secondary,
.ghost-btn {
  background: #111827;
}

button.secondary:hover,
.ghost-btn:hover {
  background: #000000;
}

.success-btn {
  background: var(--green);
}

.success-btn:hover {
  background: #15803d;
}

.danger-btn {
  background: var(--red);
}

.danger-btn:hover {
  background: #b91c1c;
}

.alert {
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 18px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(0,0,0,0.1);
}

.alert.success {
  background: var(--success-bg);
  color: var(--success-text);
}

.alert.error {
  background: var(--error-bg);
  color: var(--error-text);
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inline-row {
  display: flex;
  gap: 10px;
}

.align-end {
  align-items: stretch;
}

.wrap-mobile {
  flex-wrap: wrap;
}

.shrink-button {
  white-space: nowrap;
  flex: 0 0 auto;
}

.share-card {
  margin-top: 20px;
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.98), rgba(220, 252, 231, 0.98));
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: 20px;
  padding: 20px;
}

.share-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.share-card-header h3 {
  color: #166534;
  margin-bottom: 6px;
}

.share-card-header p {
  color: #166534;
  margin-bottom: 0;
}

.share-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary-text {
  font-family: Arial, Helvetica, sans-serif;
  background: rgba(255,255,255,0.92);
}

.empty-state {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(148, 163, 184, 0.4);
  border-radius: 18px;
}

.error-text {
  color: var(--error-text);
  font-weight: 700;
}

@media (max-width: 1180px) {
  .user-row {
    grid-template-columns: 1fr;
  }

  .user-actions {
    justify-content: flex-start;
  }

  .create-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-left,
  .topbar-right,
  .share-card-header,
  .users-card-header,
  .create-panel-header {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }

  .share-summary-grid {
    grid-template-columns: 1fr;
  }

  .users-card-header input {
    max-width: none;
  }

  .mini-action-form {
    flex-wrap: wrap;
  }
}

/* --- Dashboard users redesign --- */
.modern-users-card {
  padding: 28px;
}

.users-overview-header {
  margin-bottom: 18px;
}

.users-overview-header h2 {
  margin-bottom: 8px;
  font-size: 2.05rem;
}

.users-overview-header p {
  color: var(--muted);
  margin-bottom: 0;
}

.users-tab-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.users-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 92px;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245, 247, 255, 0.96));
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.users-tab:hover {
  background: linear-gradient(180deg, rgba(255,255,255,1), rgba(239, 246, 255, 0.98));
}

.users-tab.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.98), rgba(59, 130, 246, 0.92));
  color: white;
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.26);
}

.users-tab.active .users-tab-label {
  color: rgba(255,255,255,0.9);
}

.users-tab strong {
  font-size: 1.55rem;
  line-height: 1;
}

.users-tab-label {
  font-size: 0.97rem;
  color: var(--muted);
  text-align: left;
}

.users-toolbar-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px;
  margin-bottom: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255,255,255,0.98));
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.search-input-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0 14px;
  border-radius: 16px;
  background: white;
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.search-input-wrap input {
  border: 0;
  background: transparent;
  padding-left: 0;
  padding-right: 0;
}

.search-input-wrap input:focus {
  outline: none;
}

.search-icon {
  font-size: 1rem;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.modern-user-row {
  position: relative;
  grid-template-columns: 34px minmax(250px, 1.3fr) minmax(230px, 0.9fr) minmax(420px, 1.3fr);
  gap: 20px;
  padding: 22px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248, 250, 252, 0.96));
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.bulk-select-box {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.bulk-select-box.visible {
  opacity: 1;
  pointer-events: auto;
}

.bulk-select-box input {
  display: none;
}

.bulk-select-box span {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid rgba(37, 99, 235, 0.42);
  background: white;
  display: inline-block;
  position: relative;
}

.bulk-select-box input:checked + span {
  background: var(--primary);
  border-color: var(--primary);
}

.bulk-select-box input:checked + span::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.user-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.user-title-row h3 {
  margin-bottom: 0;
  font-size: 1.1rem;
}

.user-meta-grid {
  display: grid;
  gap: 8px;
}

.user-meta-grid p {
  margin: 0;
  color: var(--muted);
  word-break: break-word;
}

.compact-status-area {
  align-self: stretch;
  justify-content: center;
}

.compact-status-area .time-pill {
  min-height: 54px;
  justify-content: flex-start;
  text-align: left;
  padding-inline: 16px;
}

.modern-actions {
  justify-content: flex-start;
}

.recharge-form {
  background: rgba(239, 246, 255, 0.7);
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 16px;
  padding: 8px;
}

.recharge-form input {
  width: 88px;
  background: white;
}

.recharge-form input::placeholder {
  color: #94a3b8;
}

@media (max-width: 1260px) {
  .users-tab-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modern-user-row {
    grid-template-columns: 34px 1fr;
  }

  .compact-status-area,
  .modern-actions {
    grid-column: 2;
  }
}

@media (max-width: 760px) {
  .modern-users-card {
    padding: 20px;
  }

  .users-tab-grid {
    grid-template-columns: 1fr;
  }

  .users-toolbar-card {
    flex-direction: column;
    align-items: stretch;
  }

  .bulk-actions {
    width: 100%;
  }

  .bulk-actions button {
    flex: 1 1 auto;
  }

  .modern-user-row {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
  }

  .bulk-select-box {
    order: -1;
    justify-content: flex-start;
    padding-top: 0;
  }

  .compact-status-area,
  .modern-actions {
    grid-column: auto;
  }

  .recharge-form {
    width: 100%;
    flex-wrap: wrap;
  }

  .recharge-form input,
  .recharge-form button {
    flex: 1 1 100%;
    width: 100%;
  }
}


/* --- Multi app selector --- */
.app-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  margin-top: 26px;
}

.app-selector-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 28px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.app-selector-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}

.app-selector-card h2 {
  margin: 14px 0 10px;
}

.app-selector-card p {
  margin-bottom: 18px;
  line-height: 1.5;
}

.app-selector-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.app-switch-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Ajustes panel vendedores y recarga fija */
.primary-btn,
button.primary-btn {
  background: var(--primary);
  color: #ffffff;
}

.primary-btn:hover,
button.primary-btn:hover {
  background: var(--primary-dark);
}

.two-main-panels {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.seller-create-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 16px;
  align-items: end;
}

.seller-button-group {
  display: flex;
  gap: 10px;
  align-items: end;
  justify-content: flex-end;
}

.seller-row {
  grid-template-columns: minmax(220px, 1.2fr) minmax(200px, 0.8fr) minmax(380px, 1.4fr);
}

.seller-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.credit-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 800;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid rgba(22, 163, 74, 0.22);
}

.seller-found-user {
  grid-template-columns: minmax(220px, 1.2fr) minmax(220px, 0.9fr) minmax(360px, 1.3fr);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(4px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: min(520px, 100%);
  background: #ffffff;
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.modal-card h2 {
  margin-bottom: 12px;
}

.modal-card p {
  color: var(--text);
  line-height: 1.55;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

button:disabled,
input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 980px) {
  .seller-grid,
  .seller-create-grid {
    grid-template-columns: 1fr;
  }

  .seller-button-group {
    justify-content: flex-start;
  }

  .seller-row,
  .seller-found-user {
    grid-template-columns: 1fr;
  }
}

/* Recarga personalizada + recarga rápida de 7 días */
.recharge-custom-form,
.recharge-seven-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.recharge-seven-form {
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 16px;
  padding: 8px;
}

.recharge-seven-form button {
  white-space: nowrap;
}

@media (max-width: 760px) {
  .recharge-seven-form {
    width: 100%;
    flex-wrap: wrap;
  }

  .recharge-seven-form button {
    flex: 1 1 100%;
    width: 100%;
  }
}


/* --- Visual cleanup patch: organización de formularios y acciones --- */
.create-form-grid,
.seller-create-grid,
.seller-create-form,
.seller-create-user-grid,
.seller-search-form {
  display: grid;
}

.create-user-grid {
  grid-template-columns: minmax(220px, 1fr) minmax(320px, 1.4fr) minmax(140px, 0.75fr) auto;
  gap: 16px;
  align-items: end;
}

.seller-create-form {
  grid-template-columns: minmax(260px, 1fr) minmax(340px, 1.35fr) auto;
  gap: 16px;
  align-items: end;
}

.seller-create-user-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.95fr) minmax(320px, 1.2fr) auto;
  gap: 16px;
  align-items: end;
}

.seller-create-user-grid > button {
  min-width: 220px;
}

.seller-search-form {
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 16px;
  align-items: end;
}

.seller-search-form .inline-row {
  display: contents;
}

.seller-search-form button {
  min-width: 140px;
}

.action-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
}

.action-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
}

.recharge-cluster {
  align-items: stretch;
}

.state-cluster {
  justify-content: flex-start;
}

.action-cluster form {
  margin: 0;
}

.action-cluster button {
  min-height: 48px;
}

.recharge-custom-form {
  display: grid;
  grid-template-columns: minmax(90px, 96px) minmax(90px, 96px) minmax(150px, auto);
  gap: 10px;
  width: 100%;
  max-width: 420px;
}

.recharge-seven-form {
  min-width: 190px;
}

.recharge-seven-form button,
.state-cluster button,
.seller-credit-form button {
  min-width: 145px;
}

.seller-credit-form {
  display: grid;
  grid-template-columns: minmax(110px, 130px) minmax(140px, auto);
  gap: 10px;
}

.seller-credit-form input {
  width: 100%;
}

.seller-row .time-pill,
.seller-found-user .time-pill {
  min-width: 200px;
}

.seller-create-card,
.seller-search-card {
  height: 100%;
}

.seller-grid > .card {
  margin-bottom: 0;
}

.create-panel-header h2 {
  margin-bottom: 8px;
}

.user-main-info,
.user-status-area,
.user-actions {
  min-width: 0;
}

.modern-actions {
  justify-content: flex-start;
}

@media (max-width: 1160px) {
  .create-user-grid,
  .seller-create-form,
  .seller-create-user-grid,
  .seller-search-form {
    grid-template-columns: 1fr;
  }

  .create-submit-wrap,
  .seller-button-group {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .action-cluster {
    width: 100%;
  }

  .recharge-custom-form,
  .seller-credit-form,
  .recharge-seven-form,
  .action-cluster form,
  .action-cluster button {
    width: 100%;
    max-width: none;
  }

  .recharge-custom-form,
  .seller-credit-form {
    grid-template-columns: 1fr;
  }

  .seller-search-form .inline-row {
    display: flex;
    flex-direction: column;
  }
}

.seller-create-actions,
.seller-search-actions {
  display: flex;
  align-items: end;
}

.seller-create-actions button {
  min-width: 220px;
}

.seller-search-actions button {
  min-width: 140px;
}


/* --- Ajustes visuales finos junio 2026 --- */
.field-group {
  min-width: 0;
}

.form-inline-input {
  display: flex;
  gap: 10px;
  align-items: center;
}

.form-inline-input input {
  flex: 1 1 auto;
}

.compact-submit-wrap,
.compact-action-buttons,
.compact-left-action {
  display: flex;
  align-items: end;
}

.compact-submit-wrap button,
.compact-action-buttons button,
.compact-left-action button {
  min-width: 140px;
}

.admin-dashboard-page .create-user-grid {
  grid-template-columns: minmax(220px, 1fr) minmax(320px, 1.45fr) 130px 160px;
  gap: 16px;
  align-items: end;
}

.admin-dashboard-page .compact-number-field input {
  text-align: center;
}

.admin-dashboard-page .create-panel,
.admin-sellers-page .create-panel {
  padding: 24px 28px;
}

.admin-dashboard-page .create-panel-header,
.admin-sellers-page .create-panel-header {
  margin-bottom: 16px;
}

.admin-dashboard-page .modern-user-row,
.admin-sellers-page .seller-row {
  grid-template-columns: minmax(230px, 1.1fr) minmax(220px, 0.85fr) minmax(360px, 1.15fr);
  align-items: center;
}

.admin-dashboard-page .action-layout,
.admin-sellers-page .action-layout {
  gap: 10px;
}

.admin-dashboard-page .recharge-custom-form,
.admin-sellers-page .seller-credit-form {
  width: auto;
  max-width: none;
}

.admin-dashboard-page .recharge-custom-form {
  grid-template-columns: 88px 88px 132px;
}

.admin-dashboard-page .recharge-seven-form button,
.admin-dashboard-page .state-cluster button,
.admin-sellers-page .state-cluster button,
.admin-sellers-page .seller-credit-form button {
  min-width: 130px;
}

.admin-sellers-page .seller-create-form {
  grid-template-columns: minmax(260px, 1fr) minmax(340px, 1.3fr) auto;
  gap: 16px;
  align-items: end;
}

.admin-sellers-page .seller-button-group {
  justify-content: flex-start;
  flex-wrap: nowrap;
}

.admin-sellers-page .seller-credit-form {
  grid-template-columns: 120px 140px;
}

.admin-sellers-page .seller-row .time-pill {
  min-width: 180px;
}

.seller-dashboard-page .seller-grid {
  grid-template-columns: minmax(300px, 0.92fr) minmax(360px, 1.08fr);
  align-items: stretch;
}

.seller-dashboard-page .seller-create-card,
.seller-dashboard-page .seller-search-card {
  padding: 24px 24px 22px;
}

.seller-dashboard-page .seller-create-stack-form,
.seller-dashboard-page .seller-search-stack-form {
  gap: 14px;
}

.seller-dashboard-page .seller-create-inline-actions {
  display: flex;
  justify-content: flex-start;
}

.seller-dashboard-page .seller-primary-submit {
  width: 100%;
}

.seller-dashboard-page .seller-result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.seller-dashboard-page .seller-compact-recharge-form {
  display: grid;
  grid-template-columns: 88px 88px 150px;
  gap: 10px;
  width: auto;
  max-width: 356px;
}

.seller-dashboard-page .seller-result-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.seller-dashboard-page .seller-seven-form {
  padding: 6px;
  min-width: auto;
}

.seller-dashboard-page .seller-seven-form button,
.seller-dashboard-page .seller-result-button-row > form button {
  min-width: 88px;
}

.seller-dashboard-page .seller-seven-form button {
  min-width: 185px;
}

.seller-dashboard-page .seller-found-user {
  grid-template-columns: minmax(220px, 1.1fr) minmax(250px, 0.9fr) minmax(350px, 1fr);
}

.seller-dashboard-page .compact-status-area .time-pill {
  justify-content: center;
}

@media (max-width: 1200px) {
  .admin-dashboard-page .create-user-grid,
  .admin-sellers-page .seller-create-form,
  .seller-dashboard-page .seller-grid,
  .seller-dashboard-page .seller-found-user,
  .admin-dashboard-page .modern-user-row,
  .admin-sellers-page .seller-row {
    grid-template-columns: 1fr;
  }

  .admin-dashboard-page .compact-submit-wrap,
  .admin-sellers-page .seller-button-group {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .form-inline-input {
    flex-direction: column;
    align-items: stretch;
  }

  .seller-dashboard-page .seller-compact-recharge-form,
  .admin-dashboard-page .recharge-custom-form,
  .admin-sellers-page .seller-credit-form {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: none;
  }

  .seller-dashboard-page .seller-result-button-row > form,
  .seller-dashboard-page .seller-seven-form,
  .seller-dashboard-page .seller-result-button-row > form button,
  .seller-dashboard-page .seller-seven-form button,
  .compact-submit-wrap button,
  .compact-left-action button {
    width: 100%;
  }
}

/* --- Ajuste final: panel compacto de administración por usuario --- */
.admin-dashboard-page .modern-user-row,
.seller-dashboard-page .seller-found-user {
  grid-template-columns: minmax(210px, 1.05fr) minmax(270px, 0.95fr) minmax(350px, 0.95fr);
  align-items: center;
}

.time-admin-actions {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.time-admin-box {
  width: min(360px, 100%);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 14px;
  padding: 8px 10px 10px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.time-admin-title {
  text-align: center;
  font-weight: 800;
  font-size: 13px;
  color: #1f2937;
  margin-bottom: 7px;
}

.time-admin-title.device-title {
  margin: 6px 0 6px;
}

.time-admin-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
  align-items: center;
}

.time-custom-form,
.time-seven-form {
  display: contents;
}

.time-custom-form input {
  height: 29px;
  padding: 5px 10px;
  border-radius: 8px;
  text-align: center;
  font-size: 13px;
  background: #ffffff;
}

.time-custom-form button,
.time-seven-form button {
  min-height: 34px;
  height: 34px;
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.time-admin-divider {
  height: 1px;
  background: rgba(148, 163, 184, 0.28);
  margin: 7px 0 4px;
}

.device-action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.seller-device-action-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.device-action-row form,
.device-action-row button {
  width: 100%;
}

.device-action-row button {
  min-height: 34px;
  height: 34px;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.admin-dashboard-page .compact-status-area .time-pill,
.seller-dashboard-page .compact-status-area .time-pill {
  justify-content: center;
  text-align: center;
  min-height: 44px;
}

.seller-dashboard-page .seller-search-stack-form input::placeholder {
  color: #94a3b8;
}

.auth-card > p {
  display: none;
}

@media (max-width: 1100px) {
  .admin-dashboard-page .modern-user-row,
  .seller-dashboard-page .seller-found-user {
    grid-template-columns: 1fr;
  }

  .time-admin-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .time-admin-box {
    width: 100%;
  }

  .time-admin-input-row,
  .device-action-row,
  .seller-device-action-row {
    grid-template-columns: 1fr;
  }
}


/* --- Ajuste puntual: tarjeta de usuario del panel admin igual al panel vendedor --- */
.admin-dashboard-page .modern-user-row {
  grid-template-columns: 34px minmax(240px, 1.05fr) minmax(280px, 0.95fr) 360px;
  align-items: center;
}

.admin-dashboard-page .user-main-info {
  max-width: 100%;
}

.admin-dashboard-page .compact-status-area {
  align-self: center;
}

.admin-dashboard-page .compact-status-area .time-pill {
  min-height: 44px;
  max-width: 100%;
  margin-inline: auto;
}

.admin-dashboard-page .time-admin-actions {
  justify-content: flex-end;
  align-items: center;
}

.admin-dashboard-page .time-admin-box {
  width: 360px;
  max-width: 100%;
  margin-left: auto;
}

.admin-dashboard-page .time-admin-input-row {
  grid-template-columns: 1fr 1fr;
}

.admin-dashboard-page .device-action-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1260px) {
  .admin-dashboard-page .modern-user-row {
    grid-template-columns: 34px minmax(220px, 1fr) minmax(230px, 0.95fr) 340px;
  }

  .admin-dashboard-page .compact-status-area,
  .admin-dashboard-page .modern-actions {
    grid-column: auto;
  }
}

@media (max-width: 1100px) {
  .admin-dashboard-page .modern-user-row {
    grid-template-columns: 1fr;
  }

  .admin-dashboard-page .time-admin-actions {
    justify-content: flex-start;
  }

  .admin-dashboard-page .time-admin-box {
    margin-left: 0;
  }
}

/* --- Notificaciones de movimientos de vendedores --- */
.seller-notification-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.seller-notification-bell {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.seller-notification-bell:hover {
  background: rgba(37, 99, 235, 0.9);
}

.bell-icon {
  font-size: 20px;
  line-height: 1;
}

.seller-notification-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dc2626;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  border: 2px solid rgba(7, 15, 40, 0.95);
}

.seller-notification-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 2000;
  width: min(420px, calc(100vw - 28px));
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255,255,255,0.98);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(14px);
}

.seller-notification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.seller-notification-header strong {
  display: block;
  font-size: 15px;
}

.seller-notification-header span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.small-button {
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 12px;
  white-space: nowrap;
}

.seller-notification-list {
  max-height: 390px;
  overflow-y: auto;
  padding: 8px;
}

.seller-notification-item {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: #ffffff;
}

.seller-notification-item + .seller-notification-item {
  margin-top: 8px;
}

.seller-notification-item.unread {
  border-color: rgba(37, 99, 235, 0.18);
  background: linear-gradient(180deg, rgba(239,246,255,0.98), rgba(255,255,255,0.98));
}

.notification-item-title {
  font-weight: 900;
  margin-bottom: 5px;
  color: #1d4ed8;
}

.seller-notification-item p {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.4;
}

.seller-notification-item small {
  display: block;
  margin-top: 7px;
  color: #94a3b8;
  font-size: 12px;
}

.seller-notification-empty {
  padding: 24px 14px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 760px) {
  .seller-notification-dropdown {
    right: auto;
    left: 0;
  }

  .seller-notification-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
