/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

.orders-page {
  padding: 24px;
  background: #243a52;
  min-height: 100vh;
  font-family: Arial, sans-serif;
}

.orders-card {
  background: #f6f7f8;
  border-radius: 8px;
  border: 1px solid #d7dbe0;
  padding: 14px;
}

.orders-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.orders-label {
  color: #4f5b67;
  font-size: 12px;
}

.orders-input {
  height: 28px;
  border: 1px solid #bfc7cf;
  border-radius: 3px;
  background: #fff;
  padding: 0 8px;
  font-size: 12px;
}

.orders-input--search {
  width: 220px;
}

.orders-input--date {
  width: 120px;
}

.orders-total {
  margin: 0 0 8px;
  color: #444;
  font-size: 12px;
  font-weight: 600;
}

.orders-table-wrap {
  overflow-x: auto;
  border: 1px solid #d3d8de;
  border-radius: 4px;
  background: #fff;
}

.orders-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.orders-table th {
  text-align: left;
  font-size: 12px;
  color: #4f5b67;
  background: #eceff3;
  border-bottom: 1px solid #d3d8de;
  padding: 8px 10px;
}

.orders-table td {
  font-size: 12px;
  color: #2f3944;
  padding: 8px 10px;
  border-bottom: 1px solid #e7eaee;
}

.orders-table tbody tr:hover {
  background: #f8fbff;
}

.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.badge--success {
  color: #2f6f33;
  background: #cdeecf;
  border: 1px solid #9fd8a3;
}

.badge--warning {
  color: #8a5b0c;
  background: #fde2b4;
  border: 1px solid #f3c275;
}

.badge--info {
  color: #2f5c88;
  background: #d9ecff;
  border: 1px solid #a9d2fb;
}

.badge--mint {
  color: #1f6a58;
  background: #d2f4eb;
  border: 1px solid #9fdfcf;
}

.orders-btn {
  border: 1px solid transparent;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  line-height: 1;
}

.orders-btn--small {
  padding: 5px 10px;
  background: #2f8ecf;
  border-color: #2276ae;
}

.orders-btn--primary {
  background: #2f8ecf;
  border-color: #2276ae;
}

.orders-btn--success {
  background: #37a957;
  border-color: #278143;
}

.orders-alert {
  color: #b42318;
  background: #fee4e2;
  border: 1px solid #fbb4ae;
  border-radius: 6px;
  padding: 12px;
  margin: 0;
}

.orders-empty {
  margin: 0;
  color: #4f5b67;
}

.orders-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

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

.orders-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  cursor: pointer;
}

.orders-modal__dialog {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #d3d8de;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  padding: 20px 24px;
  max-width: 860px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
}

.orders-modal__title {
  margin: 0 0 12px;
  font-size: 16px;
  color: #2f3944;
}

.orders-modal__sale-id {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: #1d4ed8;
  word-break: break-all;
}

.orders-modal__reference {
  margin: 0 0 18px;
  font-size: 12px;
  color: #5c6b7a;
  word-break: break-all;
}

.orders-modal__actions {
  display: flex;
  justify-content: flex-end;
}

.orders-modal__summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.orders-modal__summary-item {
  border: 1px solid #dce3ea;
  border-radius: 6px;
  background: #f8fafc;
  padding: 8px 10px;
}

.orders-modal__summary-label {
  display: block;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 4px;
}

.orders-modal__summary-value {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
  word-break: break-word;
}

.orders-modal__subtitle {
  margin: 0 0 8px;
  font-size: 14px;
  color: #2f3944;
}

.orders-modal__products-wrap {
  border: 1px solid #dce3ea;
  border-radius: 6px;
  margin-bottom: 12px;
  overflow: hidden;
}

.orders-modal__products {
  width: 100%;
  border-collapse: collapse;
}

.orders-modal__products th,
.orders-modal__products td {
  text-align: left;
  font-size: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid #e7eaee;
}

.orders-modal__products th {
  background: #f1f5f9;
  color: #475569;
}

.orders-modal__no-products {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  padding: 10px;
  background: #fff;
}

.orders-modal__json {
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid #dce3ea;
  border-radius: 6px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.35;
  overflow-x: auto;
}

.orders-modal__loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 7px;
}

.orders-modal__loading[hidden] {
  display: none;
}

.orders-modal__loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.orders-modal__spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e2e8f0;
  border-top-color: #2f8ecf;
  border-radius: 50%;
  animation: orders-modal-spin 0.65s linear infinite;
}

@keyframes orders-modal-spin {
  to {
    transform: rotate(360deg);
  }
}

.orders-modal__loading-text {
  margin: 0;
  font-size: 13px;
  color: #475569;
  font-weight: 600;
}

.orders-modal__error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #fee4e2;
  border: 1px solid #fbb4ae;
  color: #b42318;
  font-size: 12px;
}

/* Flash (layout aplicación) */
.app-flash {
  margin: 0;
  padding: 10px 16px;
  font-size: 13px;
}

.app-flash--notice {
  background: #ecfdf5;
  color: #065f46;
  border-bottom: 1px solid #a7f3d0;
}

.app-flash--alert {
  background: #fef2f2;
  color: #991b1b;
  border-bottom: 1px solid #fecaca;
}

.app-flash--warning {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  background: #fffbeb;
  color: #92400e;
  border-bottom: 1px solid #fde68a;
}

.app-flash__sphinx-link {
  font-weight: 700;
  color: #5b21b6;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.app-flash__sphinx-link:hover {
  color: #4c1d95;
}

/* Cabecera pedidos */
.orders-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.orders-header__brand {
  font-size: 18px;
  font-weight: 800;
  color: #e8eef6;
  letter-spacing: -0.02em;
}

.orders-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.orders-header__email {
  font-size: 12px;
  color: #c8d4e4;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orders-header__logout {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.orders-header__logout:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* Login Devise */
.auth-body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 20% -10%, #334155 0%, #0f172a 45%, #020617 100%);
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
  border: 1px solid #e2e8f0;
  padding: 28px 28px 24px;
}

.auth-brand {
  text-align: center;
  margin-bottom: 22px;
}

.auth-brand__mark {
  display: inline-block;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  margin-bottom: 10px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.auth-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.03em;
}

.auth-subtitle {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.4;
}

.auth-flash {
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}

.auth-flash--alert {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.auth-flash--notice {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field--inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.auth-label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.auth-input {
  height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  color: #0f172a;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.auth-checkbox {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
}

.auth-checkbox-label {
  font-size: 13px;
  color: #475569;
  cursor: pointer;
}

.auth-submit {
  margin-top: 4px;
  height: 44px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
  transition: transform 0.08s ease, filter 0.15s ease;
}

.auth-submit:hover {
  filter: brightness(1.05);
}

.auth-submit:active {
  transform: scale(0.99);
}

.orders-modal__success {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 12px;
}

.orders-modal--confirm-layer {
  z-index: 1100;
}

.orders-modal__dialog--confirm {
  max-width: 440px;
}

.orders-modal__confirm-text {
  margin: 0 0 8px;
  font-size: 14px;
  color: #334155;
  line-height: 1.45;
}

.orders-modal__confirm-refs {
  margin: 0 0 10px;
  font-size: 14px;
  color: #334155;
  line-height: 1.5;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
}

.orders-modal__confirm-refs-item strong {
  color: #0f172a;
}

.orders-modal__confirm-refs-sep {
  color: #94a3b8;
  font-weight: 700;
}

.orders-modal__confirm-hint {
  margin: 0 0 18px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

.orders-modal__actions--footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.orders-modal__actions--confirm-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.orders-btn--large {
  padding: 8px 14px;
  font-size: 12px;
}

.orders-btn--ghost {
  background: #fff;
  color: #475569;
  border-color: #cbd5e1;
}

.orders-btn--ghost:hover {
  background: #f8fafc;
}

.orders-btn--ghost:disabled,
.orders-btn--success:disabled,
.orders-btn--primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Layout app (sidebar + barra superior) */
.app-shell-body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f1f5f9;
  color: #0f172a;
  display: flex;
  flex-direction: column;
}

.app-shell__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.app-shell__topbar-left {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.app-shell__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  color: #4c1d95;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.app-shell__logo:hover {
  color: #5b21b6;
}

.app-shell__logo-mark {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  box-shadow: 0 2px 8px rgba(91, 33, 182, 0.35);
}

.app-shell__topnav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.app-shell__topnav-link {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  border-radius: 6px;
}

.app-shell__topnav-link:hover {
  color: #334155;
  background: #f1f5f9;
}

.app-shell__topnav-link.is-active {
  color: #4c1d95;
  box-shadow: inset 0 -2px 0 #7c3aed;
  border-radius: 0;
  padding-bottom: 10px;
}

.app-shell__topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-shell__user-email {
  font-size: 13px;
  color: #64748b;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell__logout {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.app-shell__logout:hover {
  background: #f8fafc;
}

.app-shell__body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.app-shell__sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  padding: 20px 0;
}

.app-shell__sidebar-heading {
  margin: 0 16px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

.app-shell__sidebar-heading:not(:first-of-type) {
  margin-top: 20px;
}

.app-shell__nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.app-shell__nav li {
  margin: 0;
}

.app-shell__nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  border-left: 3px solid transparent;
}

.app-shell__nav-link:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.app-shell__nav-link.is-active {
  color: #0f172a;
  background: #fff;
  border-left-color: #7c3aed;
}

.app-shell__nav-icon {
  font-size: 16px;
  line-height: 1;
  opacity: 0.85;
}

.app-shell__nav--sub .app-shell__nav-link--sub {
  position: relative;
  padding-left: 24px;
  font-size: 13px;
  font-weight: 500;
}

.app-shell__nav-active-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #7c3aed;
  border-radius: 0 2px 2px 0;
  opacity: 0;
}

.app-shell__nav-link--sub.is-active .app-shell__nav-active-bar {
  opacity: 1;
}

.app-shell__main {
  flex: 1;
  min-width: 0;
  padding: 24px 28px 40px;
  overflow-x: hidden;
}

.app-page__header {
  margin-bottom: 18px;
}

.app-page__title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.app-page__subtitle {
  margin: 0;
  font-size: 14px;
  color: #64748b;
}

.app-page--shipit .orders-card {
  margin-top: 4px;
}

/* Home dashboard */
.home-dashboard__header {
  margin-bottom: 24px;
}

.home-dashboard__title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.home-dashboard__subtitle {
  margin: 0;
  font-size: 15px;
  color: #64748b;
  line-height: 1.5;
}

.home-dashboard__cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.home-dashboard__card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.home-dashboard__card-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.home-dashboard__card-text {
  margin: 0 0 16px;
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
}

.home-dashboard__card-cta {
  display: inline-block;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(91, 33, 182, 0.25);
}

.home-dashboard__card-cta:hover {
  filter: brightness(1.05);
}

.shipments-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.shipments-filter__label {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.shipments-filter__input {
  height: 36px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  color: #0f172a;
}

.shipments-filter__submit {
  height: 36px;
  padding: 0 18px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(91, 33, 182, 0.25);
}

.shipments-filter__submit:hover {
  filter: brightness(1.05);
}

.profile-sphinx-password-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex: 1 1 220px;
}

.profile-sphinx-password-field .shipments-filter__input {
  flex: 1 1 160px;
  min-width: 120px;
}

.profile-sphinx-verify-btn {
  flex-shrink: 0;
  height: 36px;
  padding: 0 14px;
  border: 1px solid #7c3aed;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #5b21b6;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(91, 33, 182, 0.12);
}

.profile-sphinx-verify-btn:hover:not(:disabled) {
  background: #f5f3ff;
}

.profile-sphinx-verify-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.profile-sphinx-verify-feedback {
  flex: 1 0 100%;
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.profile-sphinx-verify-feedback.is-success {
  color: #15803d;
}

.profile-sphinx-verify-feedback.is-error {
  color: #b91c1c;
}

.shipments-state-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.shipments-state-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.shipments-state-pill:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.shipments-state-pill.is-active {
  color: #5b21b6;
  background: #f3e8ff;
  border-color: #c4b5fd;
  box-shadow: 0 0 0 1px rgba(91, 33, 182, 0.12);
}

.shipments-state-pill__count {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  margin-left: 2px;
}

.shipments-state-pill.is-active .shipments-state-pill__count {
  color: #6d28d9;
}

.orders-total__hint {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  margin-left: 4px;
}

#shipment-detail-modal .orders-modal__summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .app-shell__body {
    flex-direction: column;
  }

  .app-shell__sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 0 16px;
  }

  .app-shell__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0 12px;
  }

  .app-shell__nav li {
    flex: 1 1 auto;
  }

  .app-shell__nav-link {
    border-left: none;
    border-radius: 8px;
  }

  .app-shell__nav-link.is-active {
    border-left: none;
  }

  .app-shell__nav--sub .app-shell__nav-link--sub {
    padding-left: 16px;
  }
}
