/*
 * ATRIC Workflow UI consistency layer — 2026-09-03
 * One type system, spacing rhythm and surface geometry across every module.
 */
:host,
html,
body,
button,
input,
optgroup,
select,
textarea {
  font-family: var(--font-grotesk), var(--font-cairo), var(--font-lexend), "Segoe UI", Arial, sans-serif;
}

body {
  line-height: 1.5;
}

/* Keep the whole Workflow shell on one visual type system. */
body * {
  font-family: inherit !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: inherit;
  letter-spacing: -0.02em;
}

button,
input,
select,
textarea {
  line-height: 1.45;
}

.input {
  min-height: 42px;
  line-height: 1.45;
}

.btn-primary,
.btn-secondary {
  min-height: 42px;
  line-height: 1.35;
}

.elevate-table th {
  padding: 12px 14px;
  font-size: 10px;
  line-height: 1.35;
  letter-spacing: 0.08em;
}

.elevate-table td {
  padding: 11px 14px;
  font-size: 12px;
  line-height: 1.45;
  vertical-align: middle;
}

table.w-full th,
body table th {
  padding: 12px 14px;
  line-height: 1.35;
}

table.w-full td,
body table td {
  padding: 11px 14px;
  line-height: 1.45;
  vertical-align: middle;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6 {
  letter-spacing: 0;
}

/* The current queue and history use the same 20px vertical rhythm and radius. */
.workflow-current-task-list {
  margin-bottom: 1.25rem;
}

.workflow-current-task-list > p,
.workflow-task-table,
.workflow-task-history {
  border-radius: 1rem !important;
}

.workflow-task-table,
.workflow-task-history {
  box-shadow: 0 10px 26px -24px rgba(16, 16, 49, 0.52);
}

.workflow-task-table tbody tr {
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.workflow-task-table tbody tr:hover {
  box-shadow: inset 3px 0 0 #a14d34;
}

/* Multi-company mode keeps both brands visible without squeezing the task tabs. */
.workflow-brand-link {
  color: inherit;
  text-decoration: none;
}

.workflow-group-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  white-space: nowrap;
}

.workflow-group-brand-atric {
  width: 104px;
  height: auto;
}

.workflow-group-brand-elevate {
  width: 130px;
  height: auto;
}

.workflow-group-brand-divider {
  width: 1px;
  height: 25px;
  background: rgba(255, 255, 255, .42);
}

.workflow-group-brand-badge {
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  padding: 4px 7px;
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Approval and rejection are completed from the row and still use the audited update action. */
.workflow-quick-decision-form,
.workflow-quick-decision {
  display: inline-flex;
  min-width: 0;
  margin-inline-end: 4px;
  vertical-align: middle;
}

.workflow-quick-decision {
  position: relative;
  display: inline-block;
}

.workflow-inline-status.workflow-quick-decision {
  min-width: 0;
}

.workflow-quick-decision-button,
.workflow-quick-decision-confirm {
  border: 0;
  border-radius: 7px;
  padding: 6px 9px;
  color: #fff;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  list-style: none;
  transition: opacity 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.workflow-quick-decision-button::-webkit-details-marker {
  display: none;
}

.workflow-quick-decision-button.is-approve,
.workflow-quick-decision-confirm.is-approve {
  background: #28733c;
}

.workflow-quick-decision-button.is-reject,
.workflow-quick-decision-confirm.is-reject {
  background: #a13f2b;
}

.workflow-quick-decision-button:hover,
.workflow-quick-decision[open] > .workflow-quick-decision-button,
.workflow-quick-decision-confirm:hover {
  opacity: .9;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -8px rgba(16, 16, 49, .8);
}

.workflow-quick-decision-form.is-busy,
.workflow-quick-decision form.is-busy {
  opacity: .65;
  pointer-events: none;
}

.workflow-quick-decision-button:disabled,
.workflow-quick-decision-confirm:disabled {
  cursor: wait;
}

.workflow-quick-decision-menu {
  position: static;
  z-index: 70;
  display: none;
  width: 270px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid #e1d9d2;
  border-radius: 13px;
  background: #fff;
  color: #18183d;
  white-space: normal;
  box-shadow: 0 20px 45px -20px rgba(16, 16, 49, .7);
}

.workflow-quick-decision[open] > .workflow-quick-decision-menu {
  display: block;
  animation: workflowStatusIn 180ms cubic-bezier(.22, 1, .36, 1);
}

.workflow-quick-decision-menu form {
  display: grid;
  gap: 9px;
}

.workflow-quick-decision-menu strong {
  font-size: 11px;
}

.workflow-quick-decision-menu textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #ddd5ce;
  border-radius: 9px;
  background: #fff;
  padding: 9px 10px;
  color: #18183d;
  font: inherit;
  font-size: 11px;
  line-height: 1.45;
  outline: none;
}

.workflow-quick-decision-menu textarea:focus {
  border-color: #a14d34;
  box-shadow: 0 0 0 3px rgba(161, 77, 52, .12);
}

.workflow-quick-decision-confirm {
  justify-self: start;
}

@media (max-width: 1180px) {
  .workflow-group-brand-badge {
    display: none;
  }

  .workflow-group-brand-atric {
    width: 88px;
  }

  .workflow-group-brand-elevate {
    width: 108px;
  }
}

@media (max-width: 640px) {
  .workflow-group-brand {
    gap: 6px;
  }

  .workflow-group-brand-atric {
    width: 66px;
  }

  .workflow-group-brand-elevate {
    width: 78px;
  }

  .workflow-group-brand-divider {
    height: 20px;
  }
}

/* Status changes stay inside My Tasks and expand safely inside the scroll table. */
.workflow-inline-status {
  min-width: 150px;
}

.workflow-inline-status > summary {
  display: inline-flex;
  cursor: pointer;
  list-style: none;
  border-radius: 8px;
  outline: none;
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.workflow-inline-status > summary::-webkit-details-marker {
  display: none;
}

.workflow-inline-status > summary:hover,
.workflow-inline-status[open] > summary {
  box-shadow: 0 0 0 3px rgba(161, 77, 52, 0.12);
  transform: translateY(-1px);
}

.workflow-inline-status-menu {
  display: none;
  min-width: 190px;
  margin-top: 7px;
  padding: 8px;
  border: 1px solid #e4ddd7;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 38px -22px rgba(16, 16, 49, 0.62);
}

.workflow-inline-status[open] > .workflow-inline-status-menu {
  display: grid;
  gap: 5px;
  animation: workflowStatusIn 180ms cubic-bezier(.22, 1, .36, 1);
}

.workflow-inline-status-menu > strong {
  padding: 3px 6px 6px;
  color: #817a73;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.workflow-inline-status-action,
.workflow-inline-status-more {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 8px 9px;
  background: transparent;
  color: #18183d;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.workflow-inline-status-action:hover,
.workflow-inline-status-more:hover {
  background: #f5efeb;
  color: #87422f;
}

.workflow-inline-status form.is-busy {
  opacity: .72;
  pointer-events: none;
}

.workflow-inline-status-action:disabled {
  cursor: wait;
}

.workflow-inline-status-feedback:not(:empty) {
  display: block;
  max-width: 220px;
  padding: 6px 7px 2px;
  color: #a13f2b;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
}

/* Account actions stay visible and open focused dialogs instead of leaving the page. */
.account-phone-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  padding: 10px;
  border-top: 1px solid #eee8e3;
  border-bottom: 1px solid #eee8e3;
}

.account-phone-row small,
.account-phone-row strong {
  display: block;
}

.account-phone-row small {
  margin-bottom: 2px;
  color: #817a73;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.account-phone-row strong {
  color: #18183d;
  font-size: 12px;
}

.account-phone-row > button,
.account-menu-action {
  border: 1px solid #ded8d2;
  border-radius: 8px;
  background: #fff;
  color: #18183d;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.account-phone-row > button {
  flex: 0 0 auto;
  padding: 6px 10px;
}

.account-menu-action {
  width: 100%;
  margin-top: 4px;
  padding: 9px 10px;
  text-align: start;
}

.account-phone-row > button:hover,
.account-menu-action:hover {
  border-color: #c9a99e;
  background: #f5efeb;
  color: #87422f;
}

.account-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 170;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(13, 13, 39, .66);
  backdrop-filter: blur(6px);
  animation: accountOverlayIn 180ms ease-out;
}

.account-modal-card {
  width: min(440px, 100%);
  overflow: hidden;
  border: 1px solid #e4ddd6;
  border-radius: 18px;
  background: #fff;
  color: #18183d;
  box-shadow: 0 30px 80px -28px rgba(10, 10, 36, .82);
  animation: accountDialogIn 220ms cubic-bezier(.22, 1, .36, 1);
}

.account-modal-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #eee8e3;
}

.account-modal-card h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.account-modal-card header p,
.account-modal-copy {
  margin: 5px 0 0;
  color: #817a73;
  font-size: 12px;
  line-height: 1.5;
}

.account-modal-copy,
.account-password-fields,
.account-modal-card > .account-modal-input,
.account-modal-message {
  margin: 16px 20px 0;
}

.account-password-fields {
  display: grid;
  gap: 10px;
}

.account-modal-input {
  width: calc(100% - 40px);
  border: 1px solid #ddd5ce;
  border-radius: 10px;
  background: #fff;
  padding: 11px 12px;
  color: #18183d;
  font-size: 13px;
  outline: none;
}

.account-password-fields .account-modal-input {
  width: 100%;
}

.account-modal-input:focus {
  border-color: #a14d34;
  box-shadow: 0 0 0 3px rgba(161, 77, 52, .12);
}

.account-code-input {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .35em;
}

.account-modal-message {
  border-radius: 9px;
  background: #f5efeb;
  padding: 9px 10px;
  color: #87422f;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

.account-modal-card > footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 18px 20px 20px;
}

.account-modal-card button {
  font: inherit;
}

.account-modal-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #ded8d2;
  border-radius: 9px;
  background: #fff;
  color: #18183d;
  font-size: 20px;
  cursor: pointer;
}

.account-modal-primary,
.account-modal-secondary {
  border-radius: 9px;
  padding: 9px 13px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.account-modal-primary {
  border: 1px solid #18183d;
  background: #18183d;
  color: #fff;
}

.account-modal-secondary {
  border: 1px solid #ded8d2;
  background: #fff;
  color: #18183d;
}

.account-modal-primary:disabled,
.account-modal-secondary:disabled,
.account-modal-close:disabled {
  opacity: .55;
  cursor: wait;
}

@keyframes accountOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes accountDialogIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes workflowStatusIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  .elevate-table th,
  .elevate-table td {
    padding: 10px 12px;
  }

  table.w-full th,
  table.w-full td,
  body table th,
  body table td {
    padding: 9px 10px;
  }
}
