#order-recovery-root {
  --or-blue: #2563eb;
  --or-blue-dark: #123e91;
  --or-navy: #0b1f45;
  --or-ink: #14213a;
  --or-muted: #64748b;
  --or-line: #dbe5f2;
  --or-soft: #f4f8fd;
  --or-red: #dc2626;
  --or-orange: #ea580c;
  --or-green: #059669;
  color: var(--or-ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#order-recovery-root * { box-sizing: border-box; }

.or-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 26px 28px;
  color: #fff;
  border-radius: 22px;
  background:
    radial-gradient(circle at 85% 10%, rgba(56, 189, 248, .28), transparent 34%),
    linear-gradient(125deg, #081b3e 0%, #123e91 58%, #1764cf 100%);
  box-shadow: 0 20px 44px rgba(15, 54, 118, .18);
}

.or-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.or-hero h2 { margin: 0; font-size: clamp(25px, 3vw, 38px); line-height: 1.08; font-weight: 900; }
.or-hero p { max-width: 780px; margin: 10px 0 0; color: #dbeafe; font-size: 14px; line-height: 1.65; }
.or-hero-actions { display: flex; flex-wrap: wrap; gap: 9px; justify-content: flex-end; }

.or-btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--or-line);
  border-radius: 11px;
  padding: 9px 14px;
  background: #fff;
  color: var(--or-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}

.or-btn:hover { transform: translateY(-1px); border-color: #9db9e8; box-shadow: 0 8px 20px rgba(15, 54, 118, .12); }
.or-btn:focus-visible { outline: 3px solid rgba(37, 99, 235, .24); outline-offset: 2px; }
.or-btn--hero { color: #fff; border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.12); }
.or-btn--hero:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.46); }
.or-btn--primary { color: #fff; border-color: var(--or-blue); background: var(--or-blue); }
.or-btn--primary:hover { border-color: #1d4ed8; background: #1d4ed8; }
.or-btn--green { color: #fff; border-color: var(--or-green); background: var(--or-green); }
.or-btn--danger { color: #b91c1c; border-color: #fecaca; background: #fff7f7; }
.or-btn--soft { color: #174a9b; border-color: #bfd3f5; background: #eff6ff; }
.or-btn[disabled] { opacity: .48; cursor: not-allowed; transform: none; box-shadow: none; }

.or-demo-note {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid #f6d38b;
  border-radius: 14px;
  background: #fffbeb;
  color: #854d0e;
  font-size: 13px;
  line-height: 1.5;
}

.or-demo-note i { margin-top: 2px; color: #f59e0b; }

.or-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.or-kpi {
  min-height: 116px;
  padding: 17px 18px;
  border: 1px solid var(--or-line);
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 54, 118, .055);
}

.or-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--or-muted); font-size: 12px; font-weight: 800; }
.or-kpi-icon { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; color: var(--or-blue); background: #eaf2ff; }
.or-kpi strong { display: block; margin-top: 8px; color: var(--or-navy); font-size: 27px; line-height: 1; font-weight: 950; }
.or-kpi small { display: block; margin-top: 7px; color: #8493aa; font-size: 11px; }
.or-kpi.is-danger { border-color: #fecaca; background: linear-gradient(145deg, #fff 30%, #fff3f3); }
.or-kpi.is-danger .or-kpi-icon { color: #b91c1c; background: #fee2e2; }
.or-kpi.is-warning .or-kpi-icon { color: #c2410c; background: #ffedd5; }
.or-kpi.is-money .or-kpi-icon { color: #047857; background: #d1fae5; }

.or-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1.7fr) repeat(3, minmax(145px, .72fr)) auto;
  gap: 9px;
  align-items: center;
  padding: 13px;
  margin-bottom: 14px;
  border: 1px solid var(--or-line);
  border-radius: 16px;
  background: #fff;
}

.or-field { position: relative; }
.or-field > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #7890b0; pointer-events: none; }
#order-recovery-root .or-field input,
#order-recovery-root .or-toolbar select,
#order-recovery-root .or-control {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cdd9e8;
  border-radius: 10px;
  padding: 9px 11px;
  color: var(--or-ink);
  background: #fff;
  font: inherit;
  font-size: 13px;
}

#order-recovery-root .or-field input { padding-left: 38px; }
#order-recovery-root input:focus,
#order-recovery-root select:focus,
#order-recovery-root textarea:focus { outline: 3px solid rgba(37,99,235,.13); border-color: #5d8ee3; }

.or-workspace { display: grid; grid-template-columns: minmax(310px, 390px) minmax(0, 1fr); gap: 15px; align-items: start; }
.or-list,
.or-detail { border: 1px solid var(--or-line); border-radius: 18px; background: #fff; box-shadow: 0 12px 28px rgba(15,54,118,.055); }
.or-list { overflow: hidden; }
.or-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--or-line); background: #f8fbff; }
.or-list-head strong { font-size: 14px; }
.or-list-head span { color: var(--or-muted); font-size: 12px; font-weight: 700; }
.or-list-body { max-height: 720px; overflow: auto; padding: 8px; }

.or-row {
  width: 100%;
  display: block;
  margin: 0 0 7px;
  padding: 13px;
  border: 1px solid #e6edf6;
  border-left: 4px solid #f59e0b;
  border-radius: 13px;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.or-row[data-severity="critical"] { border-left-color: var(--or-red); }
.or-row[data-severity="info"] { border-left-color: var(--or-blue); }
.or-row:hover { background: #f8fbff; border-color: #b9cdee; }
.or-row.is-selected { border-color: #6e9be8; background: #eff6ff; box-shadow: 0 0 0 2px rgba(37,99,235,.11); }
.or-row-top,
.or-row-bottom { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.or-row-top strong { font-size: 13px; }
.or-row-time { color: #8493aa; font-size: 10px; white-space: nowrap; }
.or-row-reason { margin: 7px 0 3px; color: #9a3412; font-size: 12px; font-weight: 850; }
.or-row-person { overflow: hidden; color: #53657d; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.or-row-bottom { margin-top: 9px; }
.or-row-bottom strong { color: var(--or-navy); font-size: 14px; }

.or-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 900; }
.or-badge--open { color: #b91c1c; background: #fee2e2; }
.or-badge--contacted { color: #9a3412; background: #ffedd5; }
.or-badge--retrying { color: #1d4ed8; background: #dbeafe; }
.or-badge--resolved, .or-badge--recovered { color: #047857; background: #d1fae5; }
.or-badge--cancelled { color: #475569; background: #e2e8f0; }
.or-badge--demo { color: #6d28d9; background: #ede9fe; }

.or-detail { min-height: 520px; padding: 18px; }
.or-empty { display: grid; place-items: center; min-height: 430px; color: #7c8da5; text-align: center; }
.or-empty i { display: block; margin-bottom: 13px; color: #b3c4db; font-size: 36px; }
.or-empty strong { display: block; color: var(--or-ink); font-size: 17px; }
.or-empty span { display: block; max-width: 370px; margin-top: 6px; font-size: 13px; line-height: 1.5; }

.or-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 15px; border-bottom: 1px solid var(--or-line); }
.or-detail-head h3 { margin: 4px 0 0; color: var(--or-navy); font-size: 22px; font-weight: 950; }
.or-detail-head p { margin: 6px 0 0; color: var(--or-muted); font-size: 12px; }
.or-detail-total { text-align: right; white-space: nowrap; }
.or-detail-total span { display: block; color: var(--or-muted); font-size: 11px; font-weight: 800; }
.or-detail-total strong { display: block; margin-top: 3px; color: var(--or-navy); font-size: 23px; font-weight: 950; }
.or-reason-box { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; margin: 15px 0; padding: 14px; border: 1px solid #fed7aa; border-radius: 14px; background: #fff7ed; }
.or-reason-box.is-critical { border-color: #fecaca; background: #fff4f4; }
.or-reason-icon { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; border-radius: 12px; color: #b45309; background: #ffedd5; }
.or-reason-box.is-critical .or-reason-icon { color: #b91c1c; background: #fee2e2; }
.or-reason-box strong { display: block; color: #7c2d12; font-size: 13px; }
.or-reason-box p { margin: 5px 0 0; color: #9a3412; font-size: 12px; line-height: 1.5; }

.or-info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.or-card { padding: 13px; border: 1px solid #e3ebf5; border-radius: 13px; background: #fbfdff; }
.or-card h4 { display: flex; align-items: center; gap: 7px; margin: 0 0 9px; color: #355176; font-size: 11px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.or-card-line { margin-top: 5px; color: #52647b; font-size: 12px; line-height: 1.42; overflow-wrap: anywhere; }
.or-card-line strong { color: var(--or-ink); }
.or-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.or-card-actions .or-btn { min-height: 34px; padding: 6px 9px; font-size: 11px; }

.or-section { margin-top: 14px; border: 1px solid #e3ebf5; border-radius: 14px; overflow: hidden; }
.or-section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 13px; border-bottom: 1px solid #e3ebf5; background: #f8fbff; font-size: 12px; font-weight: 900; }
.or-items-wrap { overflow-x: auto; }
.or-items { width: 100%; border-collapse: collapse; font-size: 12px; }
.or-items th { padding: 9px 11px; color: #60718a; background: #fff; text-align: left; font-size: 10px; text-transform: uppercase; }
.or-items td { padding: 10px 11px; border-top: 1px solid #edf2f7; vertical-align: top; }
.or-items th:last-child, .or-items td:last-child { text-align: right; }
.or-item-name { color: var(--or-ink); font-weight: 800; }
.or-item-code { display: block; margin-top: 3px; color: #8796aa; font-size: 10px; }

.or-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding: 13px; border: 1px solid #bfd3f5; border-radius: 14px; background: #eff6ff; }
.or-actions-note { width: 100%; margin: 0 0 2px; color: #45658f; font-size: 11px; }

.or-timeline { padding: 12px 13px; }
.or-event { position: relative; padding: 0 0 14px 22px; color: #52647b; font-size: 12px; line-height: 1.45; }
.or-event:last-child { padding-bottom: 0; }
.or-event::before { content: ""; position: absolute; left: 4px; top: 4px; width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; background: var(--or-blue); box-shadow: 0 0 0 2px #bfdbfe; }
.or-event:not(:last-child)::after { content: ""; position: absolute; left: 8px; top: 15px; bottom: 1px; width: 1px; background: #cbd9ed; }
.or-event strong { color: var(--or-ink); }
.or-event time { display: block; margin-top: 2px; color: #8a99ad; font-size: 10px; }

.or-pagebar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; color: var(--or-muted); font-size: 12px; }
.or-page-buttons { display: flex; gap: 6px; }
.or-page-buttons .or-btn { min-height: 34px; padding: 6px 10px; }

@media (max-width: 1150px) {
  .or-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .or-toolbar { grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(140px, .65fr)); }
  .or-toolbar .or-refresh { grid-column: auto; }
  .or-workspace { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); }
  .or-info-grid { grid-template-columns: 1fr 1fr; }
  .or-info-grid .or-card:last-child { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .or-hero { grid-template-columns: 1fr; padding: 22px; }
  .or-hero-actions { justify-content: flex-start; }
  .or-toolbar { grid-template-columns: 1fr 1fr; }
  .or-toolbar .or-field { grid-column: 1 / -1; }
  .or-workspace { grid-template-columns: 1fr; }
  .or-list-body { max-height: 410px; }
}

@media (max-width: 600px) {
  .or-hero { border-radius: 16px; padding: 18px; }
  .or-hero-actions, .or-hero-actions .or-btn { width: 100%; }
  .or-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .or-kpi { min-height: 104px; padding: 13px; }
  .or-kpi strong { font-size: 22px; }
  .or-toolbar { grid-template-columns: 1fr; }
  .or-toolbar .or-field { grid-column: auto; }
  .or-info-grid { grid-template-columns: 1fr; }
  .or-info-grid .or-card:last-child { grid-column: auto; }
  .or-detail-head { display: block; }
  .or-detail-total { margin-top: 12px; text-align: left; }
  .or-actions .or-btn { width: 100%; }
  .or-detail { padding: 13px; }
}
