/* ==========================================================================
   Components
   ========================================================================== */

/* Buttons */

.button {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 11px 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff;
  color: #111;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform var(--speed) ease,
    box-shadow var(--speed) ease,
    background var(--speed) ease,
    color var(--speed) ease,
    border-color var(--speed) ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button[disabled] {
  opacity: .65;
  cursor: wait;
  transform: none;
}

.button-dark {
  background: var(--dark);
  color: #fff;
  box-shadow: 0 12px 24px rgba(17, 17, 17, .16);
}

.button-dark:hover {
  background: var(--dark-2);
  box-shadow: 0 16px 30px rgba(17, 17, 17, .2);
}

.button-light {
  background: #fff;
  color: #111;
  box-shadow: var(--shadow-soft);
}

.button-soft {
  background: #efebe5;
  color: #111;
}

.button-soft:hover {
  background: #e7e0d7;
}

.button-whatsapp,
.button-whatsapp-inline {
  background: #dcfce7;
  color: #166534;
  box-shadow: 0 12px 24px rgba(22, 101, 52, .12);
}

.button-whatsapp:hover,
.button-whatsapp-inline:hover {
  background: #bbf7d0;
  color: #14532d;
  box-shadow: 0 16px 30px rgba(22, 101, 52, .16);
}

.button-full {
  width: 100%;
}

/* Button icons */

.button-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.button-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.button-back-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: block;
}

.button-back-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Icon button */

.icon-button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  display: inline-grid;
  place-items: center;
  background: #fff;
  color: #111;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition:
    transform var(--speed) ease,
    box-shadow var(--speed) ease,
    background var(--speed) ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  background: #fafafa;
}

/* Panels */

.panel {
  padding: 22px;
  border: 1px solid rgba(229, 223, 215, .78);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, .86);
  box-shadow: var(--shadow-soft);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.panel-head.compact {
  margin-bottom: 14px;
}

.panel-head h3 {
  margin: 0;
  color: #111;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: -.04em;
}

.panel-head a {
  color: #111;
  font-size: 13px;
  font-weight: 800;
}

/* Fields */

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: #52525b;
  font-size: 12px;
  font-weight: 800;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  background: #fff;
  color: #111;
  outline: none;
  transition:
    border-color var(--speed) ease,
    box-shadow var(--speed) ease,
    transform var(--speed) ease;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: #111;
  box-shadow: 0 0 0 4px rgba(17, 17, 17, .08);
}

.field-wide {
  grid-column: 1 / -1;
}

/* Alerts */

.alert {
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
}

.alert-danger {
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid #fecaca;
}

.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
}
/* Status badges */

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.status-warning {
  color: #92400e;
  background: #fef3c7;
}

.status-orange {
  color: #9a3412;
  background: #ffedd5;
}

.status-success {
  color: #166534;
  background: #dcfce7;
}

.status-danger {
  color: #991b1b;
  background: #fee2e2;
}

.status-muted {
  color: #52525b;
  background: #f4f4f5;
}

/* Empty states */

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  padding: 18px;
}

.empty-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  background: var(--surface-2);
  color: #111;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(229, 223, 215, .8);
}

.empty-state h3 {
  margin: 0 0 6px;
  color: #111;
}

.empty-state p {
  margin: 0;
}

/* Toast */

.toast-stack {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 999;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 260px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #111;
  color: #fff;
  box-shadow: 0 20px 44px rgba(17, 17, 17, .22);
  animation: toastIn 240ms ease both;
}

.toast strong {
  display: block;
  margin-bottom: 3px;
}

.toast p {
  margin: 0;
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
  line-height: 1.45;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Mobile */

@media (max-width: 760px) {
  .button {
    min-height: 46px;
    padding: 11px 15px;
    font-size: 13px;
  }

  .panel {
    padding: 16px;
    border-radius: 24px;
    box-shadow: 0 12px 34px rgba(17, 17, 17, .045);
  }

  .panel-head {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
  }

  .panel-head h3 {
    font-size: 19px;
    line-height: 1.08;
  }

  .field {
    gap: 7px;
  }

  .field span {
    font-size: 11.5px;
  }

  .field input,
  .field textarea,
  .field select {
    min-height: 48px;
    padding: 12px 13px;
    border-radius: 15px;
    font-size: 14px;
  }

  .field textarea {
    min-height: 92px;
  }

  .toast-stack {
    left: 12px;
    right: 12px;
    top: 12px;
  }

  .toast {
    min-width: 0;
    max-width: none;
    width: 100%;
  }
}
/* ===== Archive document action ===== */

.archive-action,
.mon-action.archive-action,
.history-action.archive-action,
.warehouse-action.archive-action,
.detail-action.archive-action {
  color: #991b1b;
  background: #fff7f7;
  border-color: #fecaca;
}

.archive-action:hover,
.mon-action.archive-action:hover,
.history-action.archive-action:hover,
.warehouse-action.archive-action:hover,
.detail-action.archive-action:hover {
  color: #7f1d1d;
  background: #fee2e2;
}

.archive-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  padding: 18px;
  display: grid;
  place-items: center;
  background: rgba(17, 17, 17, .42);
  backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.archive-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.archive-modal {
  width: min(100%, 460px);
  padding: 22px;
  border-radius: 28px;
  background: #fff;
  border: 1px solid rgba(229, 223, 215, .95);
  box-shadow: 0 30px 90px rgba(17, 17, 17, .22);
  animation: archiveModalIn .24s cubic-bezier(.22, 1, .36, 1) both;
}

.archive-modal-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.archive-modal-icon {
  width: 44px;
  height: 44px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  color: #991b1b;
  background: #fef2f2;
}

.archive-modal-icon svg {
  width: 21px;
  height: 21px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.archive-modal h3 {
  margin: 0;
  color: #111;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -.055em;
}

.archive-modal p {
  margin: 8px 0 0;
  color: #57534e;
  font-size: 14px;
  line-height: 1.45;
}

.archive-modal-note {
  margin-top: 16px;
  padding: 13px 14px;
  border-radius: 18px;
  color: #57534e;
  background: #faf7f2;
  border: 1px solid #eee5da;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.archive-modal-field {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.archive-modal-field span {
  color: #27272a;
  font-size: 12px;
  font-weight: 900;
}

.archive-modal-field textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 13px 14px;
  color: #111;
  background: #fff;
  outline: none;
  font: inherit;
  line-height: 1.45;
  transition:
    border-color var(--speed) ease,
    box-shadow var(--speed) ease;
}

.archive-modal-field textarea:focus {
  border-color: #111;
  box-shadow: 0 0 0 4px rgba(17, 17, 17, .08);
}

.archive-modal-field small {
  min-height: 16px;
  color: #b42318;
  font-size: 12px;
  font-weight: 700;
}

.archive-modal-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.archive-confirm-button {
  color: #fff;
  background: #991b1b;
  box-shadow: 0 14px 28px rgba(153, 27, 27, .16);
}

.archive-confirm-button:hover {
  color: #fff;
  background: #7f1d1d;
  box-shadow: 0 18px 34px rgba(153, 27, 27, .2);
}

body.has-archive-modal {
  overflow: hidden;
}

@keyframes archiveModalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.98);
    filter: blur(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@media (max-width: 520px) {
  .archive-modal {
    padding: 20px;
    border-radius: 24px;
  }

  .archive-modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .archive-modal-actions .button {
    width: 100%;
  }
}